diff --git a/openmetadata-ui/src/main/resources/ui/cypress/constants/constants.js b/openmetadata-ui/src/main/resources/ui/cypress/constants/constants.js index 6df167c9b31..4ab7b226ce9 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/constants/constants.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/constants/constants.js @@ -137,7 +137,7 @@ export const SEARCH_ENTITY_MLMODEL = { export const DELETE_ENTITY = { table: { - term: 'fact_sale', + term: 'dim.shop', entity: MYDATA_SUMMARY_OPTIONS.tables, serviceName: 'sample_data', }, diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Flow/AddAndRemoveTierAndOwner.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Flow/AddAndRemoveTierAndOwner.js new file mode 100644 index 00000000000..97b32e9f36f --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Flow/AddAndRemoveTierAndOwner.js @@ -0,0 +1,405 @@ +/* + * Copyright 2023 Collate. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// / + +import { + descriptionBox, + interceptURL, + verifyResponseStatusCode, + visitEntityDetailsPage, +} from '../../common/common'; +import { + DELETE_TERM, + SEARCH_ENTITY_DASHBOARD, + SEARCH_ENTITY_MLMODEL, + SEARCH_ENTITY_PIPELINE, + SEARCH_ENTITY_TABLE, + SEARCH_ENTITY_TOPIC, +} from '../../constants/constants'; + +const ENTITIES = { + table: { + ...SEARCH_ENTITY_TABLE.table_4, + schema: 'shopify', + database: 'ecommerce_db', + }, + topic: SEARCH_ENTITY_TOPIC.topic_2, + dashboard: SEARCH_ENTITY_DASHBOARD.dashboard_2, + pipeline: SEARCH_ENTITY_PIPELINE.pipeline_2, + mlmodel: SEARCH_ENTITY_MLMODEL.mlmodel_2, +}; +const glossary = 'GlossaryOwnerTest'; +const glossaryTerm = 'GlossaryTermOwnerTest'; + +const OWNER = 'Aaron Johnson'; +const TIER = 'Tier1'; + +const addRemoveOwner = () => { + cy.get('[data-testid="edit-owner"]').should('be.visible').click(); + verifyResponseStatusCode('@getTeams', 200); + cy.get('.ant-tabs [id*=tab-users]').should('be.visible').click(); + verifyResponseStatusCode('@getUsers', 200); + cy.get(`.ant-tabs [title="${OWNER}"]`).should('be.visible').click(); + verifyResponseStatusCode('@patchOwner', 200); + cy.get('[data-testid="Owner"]').should('be.visible').should('contain', OWNER); + cy.get('[data-testid="edit-owner"]').should('be.visible').click(); + verifyResponseStatusCode('@getUsers', 200); + cy.get('[data-testid="remove-owner"]').should('be.visible').click(); + verifyResponseStatusCode('@patchOwner', 200); + cy.get('[data-testid="Owner"]') + .should('be.visible') + .should('contain', 'No Owner'); +}; +const addRemoveTier = () => { + cy.get('[data-testid="edit-Tier-icon"]').should('be.visible').click(); + cy.get('[data-testid="card-list"]').first().should('be.visible').as('tier1'); + cy.get('@tier1') + .find('[data-testid="icon"] > [data-testid="select-tier-button"]') + .should('be.visible') + .click(); + verifyResponseStatusCode('@patchOwner', 200); + cy.get('[data-testid="Tier"]').should('be.visible').should('contain', TIER); + + cy.get('[data-testid="edit-Tier-icon"]').should('be.visible').click(); + cy.get('[data-testid="card-list"]').first().should('be.visible').as('tier1'); + cy.get('@tier1') + .find('[data-testid="icon"] > [data-testid="remove-tier"]') + .should('be.visible') + .click(); + verifyResponseStatusCode('@patchOwner', 200); + cy.get('[data-testid="Tier"]') + .should('be.visible') + .should('contain', 'No Tier'); +}; + +describe('Add and Remove Owner and Tier', () => { + beforeEach(() => { + interceptURL('GET', '/api/v1/permissions/*/name/*', 'entityPermission'); + interceptURL('GET', '/api/v1/feed/count?entityLink=*', 'activityFeed'); + interceptURL( + 'GET', + '/api/v1/search/query?q=**teamType:Group&from=0&size=15&index=team_search_index', + 'getTeams' + ); + interceptURL('GET', '/api/v1/users?&isBot=false&limit=15', 'getUsers'); + cy.login(); + }); + + Object.entries(ENTITIES).map(([key, value]) => { + it(`${key} details page`, () => { + interceptURL('PATCH', `/api/v1/${value.entity}/*`, 'patchOwner'); + + visitEntityDetailsPage(value.term, value.serviceName, value.entity); + verifyResponseStatusCode('@entityPermission', 200); + verifyResponseStatusCode('@activityFeed', 200); + + addRemoveOwner(); + }); + }); + + it('databaseSchema details page', () => { + interceptURL('PATCH', '/api/v1/databaseSchemas/*', 'patchOwner'); + interceptURL('GET', '/api/v1/*/name/*', 'schemaDetails'); + const value = ENTITIES.table; + visitEntityDetailsPage(value.term, value.serviceName, value.entity); + verifyResponseStatusCode('@entityPermission', 200); + verifyResponseStatusCode('@activityFeed', 200); + + cy.get('[data-testid="breadcrumb"]') + .should('be.visible') + .contains(value.schema) + .click(); + verifyResponseStatusCode('@entityPermission', 200); + verifyResponseStatusCode('@schemaDetails', 200); + verifyResponseStatusCode('@activityFeed', 200); + addRemoveOwner(); + }); + + it('database details page', () => { + interceptURL('PATCH', '/api/v1/databases/*', 'patchOwner'); + interceptURL('GET', '/api/v1/databases/name/*', 'databaseDetails'); + const value = ENTITIES.table; + visitEntityDetailsPage(value.term, value.serviceName, value.entity); + verifyResponseStatusCode('@entityPermission', 200); + verifyResponseStatusCode('@activityFeed', 200); + + cy.get('[data-testid="breadcrumb"]') + .should('be.visible') + .contains(value.database) + .click(); + verifyResponseStatusCode('@entityPermission', 200); + verifyResponseStatusCode('@databaseDetails', 200); + verifyResponseStatusCode('@activityFeed', 200); + addRemoveOwner(); + }); + + it('service details page', () => { + interceptURL('PATCH', '/api/v1/services/databaseServices/*', 'patchOwner'); + interceptURL( + 'GET', + '/api/v1/services/databaseServices/name/*', + 'serviceDetails' + ); + interceptURL( + 'GET', + '/api/v1/services/ingestionPipelines/status', + 'ingestionPipelines' + ); + interceptURL('GET', '/api/v1/databases?service=*', 'databases'); + const value = ENTITIES.table; + visitEntityDetailsPage(value.term, value.serviceName, value.entity); + verifyResponseStatusCode('@entityPermission', 200); + verifyResponseStatusCode('@activityFeed', 200); + + cy.get('[data-testid="breadcrumb"]') + .should('be.visible') + .contains(value.serviceName) + .click(); + verifyResponseStatusCode('@entityPermission', 200); + verifyResponseStatusCode('@ingestionPipelines', 200); + verifyResponseStatusCode('@serviceDetails', 200); + verifyResponseStatusCode('@databases', 200); + + addRemoveOwner(); + }); + + it('Test suite details page', () => { + interceptURL('PATCH', '/api/v1/dataQuality/testSuites/*', 'patchOwner'); + interceptURL('GET', '/api/v1/dataQuality/testSuites?*', 'testSuites'); + interceptURL( + 'GET', + '/api/v1/dataQuality/testSuites/name/critical_metrics_suite?fields=*', + 'testSuiteDetails' + ); + interceptURL('GET', '/api/v1/dataQuality/testCases?*', 'testCases'); + cy.get('[data-testid="appbar-item-data-quality"]') + .should('be.visible') + .click(); + verifyResponseStatusCode('@testSuites', 200); + cy.get('[data-testid="test-suite-critical_metrics_suite"]') + .should('be.visible') + .click(); + verifyResponseStatusCode('@entityPermission', 200); + verifyResponseStatusCode('@testSuiteDetails', 200); + verifyResponseStatusCode('@testCases', 200); + addRemoveOwner(); + }); + + it('Teams details page', () => { + interceptURL('PATCH', '/api/v1/teams/*', 'patchOwner'); + interceptURL('GET', '/api/v1/permissions/team/*', 'teamPermission'); + interceptURL( + 'GET', + '/api/v1/teams/name/Organization?fields=*', + 'getOrganization' + ); + cy.get('[data-testid="appbar-item-settings"]').should('be.visible').click(); + verifyResponseStatusCode('@entityPermission', 200); + verifyResponseStatusCode('@getOrganization', 200); + verifyResponseStatusCode('@teamPermission', 200); + + cy.get('[data-testid="add-user"]').should('be.visible').click(); + verifyResponseStatusCode('@getUsers', 200); + cy.get(`.ant-popover [title="${OWNER}"]`).should('be.visible').click(); + verifyResponseStatusCode('@patchOwner', 200); + cy.get('[data-testid="entity-summary-details"]') + .should('be.visible') + .should('contain', OWNER); + cy.get('[data-testid="add-user"]').should('be.visible').click(); + verifyResponseStatusCode('@getUsers', 200); + cy.get('[data-testid="remove-owner"]').should('be.visible').click(); + verifyResponseStatusCode('@patchOwner', 200); + cy.get('[data-testid="entity-summary-details"]') + .should('be.visible') + .should('contain', 'No Owner'); + }); + + it('Glossary details page', () => { + interceptURL('PATCH', '/api/v1/glossaries/*', 'patchOwner'); + interceptURL('POST', '/api/v1/glossaries', 'createGlossary'); + interceptURL('GET', '/api/v1/permissions/glossary/*', 'glossaryPermission'); + interceptURL('GET', '/api/v1/glossaries?*', 'getGlossaries'); + cy.get('[data-testid="governance"]').should('be.visible').click(); + cy.get('[data-testid="appbar-item-glossary"]') + .should('be.visible') + .click({ waitForAnimations: true }); + cy.get('[data-testid="add-placeholder-button"]') + .should('be.visible') + .click(); + cy.get('[data-testid="name"]').should('be.visible').type(glossary); + cy.get(descriptionBox).scrollIntoView().should('be.visible').type(glossary); + cy.get('[data-testid="save-glossary"]') + .scrollIntoView() + .should('be.visible') + .click(); + verifyResponseStatusCode('@createGlossary', 201); + verifyResponseStatusCode('@getGlossaries', 200); + verifyResponseStatusCode('@glossaryPermission', 200); + + cy.get('[data-testid="edit-owner-button"]').should('be.visible').click(); + verifyResponseStatusCode('@getUsers', 200); + cy.get(`[title="${OWNER}"]`).should('be.visible').click(); + verifyResponseStatusCode('@patchOwner', 200); + cy.get('[data-testid="glossary-owner-name"]') + .should('be.visible') + .should('contain', OWNER); + // Todo: uncomment once remove owner functionality will be added in glossary + // cy.get('[data-testid="edit-owner-button"]').should('be.visible').click(); + // verifyResponseStatusCode('@getUsers', 200); + // cy.get('[data-testid="remove-owner"]').should('be.visible').click(); + // verifyResponseStatusCode('@patchOwner', 200); + // cy.get('[data-testid="glossary-owner-name"]') + // .should('be.visible') + // .should('contain', 'No Owner'); + }); + + it('GlossaryTerm details page', () => { + interceptURL('PATCH', '/api/v1/glossaryTerms/*', 'patchOwner'); + interceptURL('POST', '/api/v1/glossaryTerms', 'createGlossaryTerm'); + interceptURL('GET', '/api/v1/permissions/glossary/*', 'glossaryPermission'); + interceptURL( + 'GET', + '/api/v1/permissions/glossaryTerm/*', + 'glossaryTermPermission' + ); + interceptURL('GET', '/api/v1/glossaries?*', 'getGlossaries'); + interceptURL('GET', '/api/v1/glossaryTerms?*', 'getGlossaryTerms'); + interceptURL( + 'GET', + '/api/v1/glossaryTerms/name/*', + 'getGlossaryTermDetails' + ); + cy.get('[data-testid="governance"]').should('be.visible').click(); + cy.get('[data-testid="appbar-item-glossary"]') + .should('be.visible') + .click({ waitForAnimations: true }); + verifyResponseStatusCode('@getGlossaries', 200); + verifyResponseStatusCode('@glossaryPermission', 200); + cy.get('[data-testid="add-new-tag-button-header"]') + .should('be.visible') + .click(); + cy.get('[data-testid="name"]').should('be.visible').type(glossaryTerm); + cy.get(descriptionBox) + .scrollIntoView() + .should('be.visible') + .type(glossaryTerm); + cy.get('[data-testid="save-glossary-term"]') + .scrollIntoView() + .should('be.visible') + .click(); + verifyResponseStatusCode('@createGlossaryTerm', 201); + verifyResponseStatusCode('@getGlossaryTerms', 200); + + cy.get(`[data-testid="${glossaryTerm}"]`).should('be.visible').click(); + verifyResponseStatusCode('@getGlossaryTermDetails', 200); + verifyResponseStatusCode('@glossaryTermPermission', 200); + verifyResponseStatusCode('@getGlossaryTerms', 200); + + cy.get('[data-testid="edit-owner-button"]').should('be.visible').click(); + verifyResponseStatusCode('@getUsers', 200); + cy.get(`[title="${OWNER}"]`).should('be.visible').click(); + verifyResponseStatusCode('@patchOwner', 200); + cy.get('[data-testid="glossary-owner-name"]') + .should('be.visible') + .should('contain', OWNER); + // Todo: uncomment once remove owner functionality will be added in glossaryTerm + // cy.get('[data-testid="edit-owner-button"]').should('be.visible').click(); + // verifyResponseStatusCode('@getUsers', 200); + // cy.get('[data-testid="remove-owner"]').should('be.visible').click(); + // verifyResponseStatusCode('@patchOwner', 200); + // cy.get('[data-testid="glossary-owner-name"]') + // .should('be.visible') + // .should('contain', 'No Owner'); + }); + + it('Delete glossary and glossaryTerm', () => { + interceptURL('GET', '/api/v1/permissions/glossary/*', 'glossaryPermission'); + interceptURL('GET', '/api/v1/glossaries?*', 'getGlossaries'); + + cy.get('[data-testid="governance"]').should('be.visible').click(); + cy.get('[data-testid="appbar-item-glossary"]') + .should('be.visible') + .click({ waitForAnimations: true }); + verifyResponseStatusCode('@getGlossaries', 200); + verifyResponseStatusCode('@glossaryPermission', 200); + cy.get('[data-testid="manage-button"]').should('be.visible').click(); + cy.get('[data-testid="delete-button"]') + .scrollIntoView() + .should('be.visible') + .click(); + + cy.get('[data-testid="delete-confirmation-modal"]') + .should('exist') + .then(() => { + cy.get('[role="dialog"]').should('be.visible'); + cy.get('[data-testid="modal-header"]').should('be.visible'); + }); + cy.get('[data-testid="modal-header"]') + .should('be.visible') + .should('contain', `Delete ${glossary}`); + cy.get('[data-testid="confirmation-text-input"]') + .should('be.visible') + .type(DELETE_TERM); + interceptURL('DELETE', '/api/v1/glossaries/*', 'getGlossary'); + cy.get('[data-testid="confirm-button"]') + .should('be.visible') + .should('not.disabled') + .click(); + verifyResponseStatusCode('@getGlossary', 200); + }); +}); + +describe('Add and Remove Tier', () => { + beforeEach(() => { + interceptURL('GET', '/api/v1/permissions/*/name/*', 'entityPermission'); + interceptURL('GET', '/api/v1/feed/count?entityLink=*', 'activityFeed'); + interceptURL( + 'GET', + '/api/v1/search/query?q=**teamType:Group&from=0&size=15&index=team_search_index', + 'getTeams' + ); + interceptURL('GET', '/api/v1/users?&isBot=false&limit=15', 'getUsers'); + cy.login(); + }); + + Object.entries(ENTITIES).map(([key, value]) => { + it(`${key} details page`, () => { + interceptURL('PATCH', `/api/v1/${value.entity}/*`, 'patchOwner'); + + visitEntityDetailsPage(value.term, value.serviceName, value.entity); + verifyResponseStatusCode('@entityPermission', 200); + verifyResponseStatusCode('@activityFeed', 200); + + addRemoveTier(); + }); + }); + + it('database details page', () => { + interceptURL('PATCH', '/api/v1/databases/*', 'patchOwner'); + interceptURL('GET', '/api/v1/databases/name/*', 'databaseDetails'); + const value = ENTITIES.table; + visitEntityDetailsPage(value.term, value.serviceName, value.entity); + verifyResponseStatusCode('@entityPermission', 200); + verifyResponseStatusCode('@activityFeed', 200); + + cy.get('[data-testid="breadcrumb"]') + .should('be.visible') + .contains(value.database) + .click(); + verifyResponseStatusCode('@entityPermission', 200); + verifyResponseStatusCode('@databaseDetails', 200); + verifyResponseStatusCode('@activityFeed', 200); + + addRemoveTier(); + }); +}); diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/EntityDetails.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/EntityDetails.spec.js index 31bf72c1ee4..24af6a1bcad 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/EntityDetails.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/EntityDetails.spec.js @@ -81,19 +81,16 @@ describe('Entity Details Page', () => { .should('be.visible') .click(); - cy.get('[data-testid="message-container"]') - .first() - .scrollIntoView() - .contains(`Deleted ${singular}`) - .should('be.visible'); - // data not found should be visible while redirecting to the deleted entity details page cy.get(`[title="${value.term}"]`).should('be.visible').click(); cy.location('pathname').then((loc) => { const fqn = loc.split('/').pop(); cy.get('.Toastify__toast-body > :nth-child(2)') .should('be.visible') - .should('contain', `${singular} instance for ${fqn} not found`); + .should( + 'contain', + `${singular} instance for ${decodeURI(fqn)} not found` + ); cy.get('.Toastify__close-button > svg') .first() @@ -101,7 +98,9 @@ describe('Entity Details Page', () => { .click(); cy.get('[data-testid="no-data-image"]').should('be.visible'); cy.contains( - `${Cypress._.startCase(singular)} instance for ${fqn} not found` + `${Cypress._.startCase(singular)} instance for ${decodeURI( + fqn + )} not found` ).should('be.visible'); }); cy.clickOnLogo(); diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Service.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Service.spec.js index 34f29f61235..14438886eca 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Service.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Service.spec.js @@ -91,7 +91,11 @@ describe('Services page should work properly', () => { .should('be.visible') .click(); - interceptURL('PUT', '/api/v1/services/databaseServices', 'updateService'); + interceptURL( + 'PATCH', + '/api/v1/services/databaseServices/*', + 'updateService' + ); cy.get('[data-testid="selectable-list"]') .contains(service.Owner) diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryTermTab/GlossaryTermTab.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryTermTab/GlossaryTermTab.component.tsx index 3c72bf64384..89042483c74 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryTermTab/GlossaryTermTab.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryTermTab/GlossaryTermTab.component.tsx @@ -84,13 +84,18 @@ const GlossaryTermTab = ({ dataIndex: 'name', key: 'name', className: 'glossary-name-column', - render: (_, record) => ( - - {getEntityName(record)} - - ), + render: (_, record) => { + const name = getEntityName(record); + + return ( + + {name} + + ); + }, }, { title: t('label.description'), diff --git a/openmetadata-ui/src/main/resources/ui/src/components/GlossaryDetailsRightPanel/GlossaryDetailsRightPanel.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/GlossaryDetailsRightPanel/GlossaryDetailsRightPanel.component.tsx index 65da9185552..ef796b659d0 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/GlossaryDetailsRightPanel/GlossaryDetailsRightPanel.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/GlossaryDetailsRightPanel/GlossaryDetailsRightPanel.component.tsx @@ -95,11 +95,9 @@ const GlossaryDetailsRightPanel = ({ return ( - +
- + {t('label.owner')} {(permissions.EditOwner || permissions.EditAll) && ( diff --git a/openmetadata-ui/src/main/resources/ui/src/components/TestSuiteDetails/TestSuiteDetails.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/TestSuiteDetails/TestSuiteDetails.component.tsx index ae40653b89a..6989b504667 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/TestSuiteDetails/TestSuiteDetails.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/TestSuiteDetails/TestSuiteDetails.component.tsx @@ -80,8 +80,8 @@ const TestSuiteDetails = ({
- {extraInfo.map((info, index) => ( - + {extraInfo.map((info) => ( + { const extraInfo: Array = useMemo( () => [ { - key: 'owner', + key: EntityInfo.OWNER, value: testOwner?.type === 'team' ? getTeamAndUserDetailsPath(testOwner?.name || '') diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/service/index.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/service/index.tsx index 07cae596ee3..f12e9588be1 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/service/index.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/service/index.tsx @@ -62,11 +62,7 @@ import { import { fetchAirflowConfig } from 'rest/miscAPI'; import { getMlModels } from 'rest/mlModelAPI'; import { getPipelines } from 'rest/pipelineAPI'; -import { - getServiceByFQN, - updateOwnerService, - updateService, -} from 'rest/serviceAPI'; +import { getServiceByFQN, updateOwnerService } from 'rest/serviceAPI'; import { getContainers } from 'rest/storageAPI'; import { getTopics } from 'rest/topicsAPI'; import { getEntityName } from 'utils/EntityUtils'; @@ -775,10 +771,10 @@ const ServicePage: FunctionComponent = () => { } }; - const handleRemoveOwner = async () => { + const handleUpdateOwner = async (owner: ServicesType['owner']) => { const updatedData = { ...serviceDetails, - owner: undefined, + owner, } as ServicesUpdateRequest; const jsonPatch = compare(serviceDetails || {}, updatedData); @@ -799,50 +795,6 @@ const ServicePage: FunctionComponent = () => { } }; - const handleUpdateOwner = (owner: ServicesType['owner']) => { - if (isUndefined(owner)) { - handleRemoveOwner(); - - return; - } - const updatedData = { - connection: serviceDetails?.connection, - name: serviceDetails?.name, - serviceType: serviceDetails?.serviceType, - owner, - description: serviceDetails?.description, - } as ServicesUpdateRequest; - - return new Promise((resolve, reject) => { - updateService(serviceName, serviceDetails?.id ?? '', updatedData) - .then((res) => { - if (res) { - setServiceDetails(res); - - return resolve(); - } else { - showErrorToast( - t('server.entity-updating-error', { - entity: t('label.owner-lowercase'), - }) - ); - } - - return reject(); - }) - .catch((error: AxiosError) => { - showErrorToast( - error, - t('server.entity-updating-error', { - entity: t('label.owner-lowercase'), - }) - ); - - return reject(); - }); - }); - }; - const onDescriptionEdit = (): void => { setIsEdit(true); }; @@ -1158,7 +1110,7 @@ const ServicePage: FunctionComponent = () => { {extraInfo.map((info) => ( - +