UI : Added show deleted table in Database schema level (#10672)

* Added show deleted table in Database scheam level

* Changes as per comments

* fix cypress issue

* make switch label static

* other language

* fix cypress issue
This commit is contained in:
Ashish Gupta 2023-03-22 16:16:08 +05:30 committed by GitHub
parent ebbd611825
commit f15a752706
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 321 additions and 69 deletions

View File

@ -68,6 +68,7 @@ export const SEARCH_ENTITY_TABLE = {
displayName: 'raw_product_catalog',
entity: MYDATA_SUMMARY_OPTIONS.tables,
serviceName: 'sample_data',
schemaName: 'shopify',
},
table_4: {
term: 'dim_address',

View File

@ -0,0 +1,181 @@
/*
* 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 {
interceptURL,
toastNotification,
verifyResponseStatusCode,
visitEntityDetailsPage,
} from '../../common/common';
import { DELETE_TERM, SEARCH_ENTITY_TABLE } from '../../constants/constants';
const ENTITY_TABLE = SEARCH_ENTITY_TABLE.table_3;
describe('Restore entity functionality should work properly', () => {
beforeEach(() => {
cy.login();
});
it('Soft Delete entity table', () => {
visitEntityDetailsPage(
ENTITY_TABLE.term,
ENTITY_TABLE.serviceName,
ENTITY_TABLE.entity
);
cy.get('[data-testid="manage-button"]').should('exist').click();
cy.get('[data-testid="delete-button-title"]').should('exist').click();
cy.get('.ant-modal-header')
.should('be.visible')
.contains(`Delete ${ENTITY_TABLE.displayName}`);
cy.get('[data-testid="soft-delete-option"]').should('exist').click();
cy.get('[data-testid="confirm-button"]').should('be.disabled');
cy.get('[data-testid="confirmation-text-input"]')
.should('exist')
.type(DELETE_TERM);
interceptURL(
'DELETE',
'api/v1/tables/*?hardDelete=false&recursive=false',
'softDeleteTable'
);
cy.get('[data-testid="confirm-button"]')
.should('be.visible')
.should('not.be.disabled')
.click();
verifyResponseStatusCode('@softDeleteTable', 200);
toastNotification('Table deleted successfully!');
});
it('Check Soft Deleted entity table', () => {
cy.get('[data-testid="appbar-item-explore"]').should('exist').click();
interceptURL(
'GET',
'api/v1/search/query?q=&index=table_search_index&from=0&size=10&deleted=true&query_filter=%7B%22query%22%3A%7B%22bool%22%3A%7B%7D%7D%7D&sort_field=_score&sort_order=desc',
'showDeletedTables'
);
cy.get('[data-testid="show-deleted"]').should('exist').click();
verifyResponseStatusCode('@showDeletedTables', 200);
cy.get('[data-testid="sample_data-raw_product_catalog"]')
.should('exist')
.click();
cy.get('[data-testid="inactive-link"]')
.should('be.visible')
.contains(ENTITY_TABLE.displayName);
cy.get('[data-testid="deleted-badge"]').should('exist');
});
it("Check Soft Deleted table in it's Schema", () => {
cy.get('[data-testid="appbar-item-explore"]').should('exist').click();
interceptURL(
'GET',
'api/v1/search/query?q=&index=table_search_index&from=0&size=10&deleted=true&query_filter=%7B%22query%22%3A%7B%22bool%22%3A%7B%7D%7D%7D&sort_field=_score&sort_order=desc',
'showDeletedTables'
);
cy.get('[data-testid="show-deleted"]').should('exist').click();
verifyResponseStatusCode('@showDeletedTables', 200);
cy.get('[data-testid="sample_data-raw_product_catalog"]')
.should('exist')
.click();
cy.get('[data-testid="inactive-link"]')
.should('be.visible')
.contains(ENTITY_TABLE.displayName);
cy.get('[data-testid="breadcrumb-link"]')
.should('be.visible')
.within(() => {
cy.contains(ENTITY_TABLE.displayName);
});
cy.get('[data-testid="deleted-badge"]').should('exist');
cy.get('[data-testid="breadcrumb-link"]')
.should('be.visible')
.within(() => {
cy.contains(ENTITY_TABLE.schemaName).click();
});
cy.get('[data-testid="manage-button"]').should('exist').click();
cy.get('[data-testid="deleted-table-menu-item-label"]')
.should('exist')
.contains('Show Deleted Table');
cy.get('[data-testid="deleted-table-menu-item-switch')
.should('exist')
.click();
cy.get('[data-testid="Tables"] [data-testid="filter-count"]')
.should('exist')
.contains('1');
cy.get('.ant-table-row > :nth-child(1)')
.should('exist')
.contains(ENTITY_TABLE.displayName);
});
it('Restore Soft Deleted table', () => {
cy.get('[data-testid="appbar-item-explore"]').should('exist').click();
interceptURL(
'GET',
'api/v1/search/query?q=&index=table_search_index&from=0&size=10&deleted=true&query_filter=%7B%22query%22%3A%7B%22bool%22%3A%7B%7D%7D%7D&sort_field=_score&sort_order=desc',
'showDeletedTables'
);
cy.get('[data-testid="show-deleted"]').should('exist').click();
verifyResponseStatusCode('@showDeletedTables', 200);
cy.get('[data-testid="sample_data-raw_product_catalog"]')
.should('exist')
.click();
cy.get('[data-testid="inactive-link"]')
.should('be.visible')
.contains(ENTITY_TABLE.displayName);
cy.get('[data-testid="breadcrumb-link"]')
.should('be.visible')
.within(() => {
cy.contains(ENTITY_TABLE.displayName);
});
cy.get('[data-testid="deleted-badge"]').should('exist');
cy.get('[data-testid="manage-button"]').should('exist').click();
cy.get('[data-testid="restore-button"]').should('be.visible').click();
cy.get('.ant-modal-header').should('be.visible').contains('Restore table');
cy.get('[data-testid="restore-modal-body"]')
.should('be.visible')
.contains(
`Are you sure you want to restore ${ENTITY_TABLE.displayName}?`
);
cy.get('.ant-btn-primary').should('be.visible').contains('Restore').click();
cy.wait(500);
cy.get('[data-testid="deleted-badge"]').should('not.exist');
});
});

View File

@ -68,7 +68,7 @@ describe('Check if tags addition and removal flow working properly from tables',
);
cy.get(
'[data-testid="entity-tags"] [data-testid="tags-wrapper"] > [data-testid="tag-container"] [data-testid="tags"] > [data-testid="add-tag"] > span'
'[data-testid="entity-tags"] [data-testid="tags-wrapper"] [data-testid="tag-container"] [data-testid="tags"] [data-testid="add-tag"] span'
)
.should('be.visible')
.click();
@ -87,13 +87,13 @@ describe('Check if tags addition and removal flow working properly from tables',
if (entityDetails.entity === 'mlmodels') {
cy.get(
`[data-testid="feature-card-${entityDetails.fieldName}"] [data-testid="tag-container"] [data-testid="tags"] > [data-testid="add-tag"] > span`
`[data-testid="feature-card-${entityDetails.fieldName}"] [data-testid="tag-container"] [data-testid="tags"] > [data-testid="add-tag"] span`
)
.should('be.visible')
.click();
} else {
cy.get(
`.ant-table-tbody [data-testid="tag-container"] [data-testid="add-tag"]>span`
`.ant-table-tbody [data-testid="tag-container"] [data-testid="add-tag"] span`
)
.eq(0)
.should('be.visible')

View File

@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none"><path fill="#37352F" d="M18.071 8.571v-2.82A5.76 5.76 0 0 0 12.32 0h-.497A5.76 5.76 0 0 0 6.07 5.751v2.82A2.571 2.571 0 0 0 3.5 11.143v7.971A4.894 4.894 0 0 0 8.386 24h7.371a4.894 4.894 0 0 0 4.886-4.886v-7.971A2.572 2.572 0 0 0 18.07 8.57ZM7.786 5.751a4.037 4.037 0 0 1 4.037-4.037h.497a4.037 4.037 0 0 1 4.037 4.037v2.82H7.786v-2.82Zm11.143 13.363a3.172 3.172 0 0 1-3.172 3.172H8.386a3.171 3.171 0 0 1-3.172-3.172v-7.971a.857.857 0 0 1 .857-.857h12a.857.857 0 0 1 .858.857v7.971Z"/><path fill="#37352F" d="M12.929 16.045v2.811a.857.857 0 0 1-1.714 0v-2.811a1.714 1.714 0 1 1 1.714 0Z"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"><path fill="#37352F" d="M18.071 8.571v-2.82A5.76 5.76 0 0 0 12.32 0h-.497A5.76 5.76 0 0 0 6.07 5.751v2.82A2.571 2.571 0 0 0 3.5 11.143v7.971A4.894 4.894 0 0 0 8.386 24h7.371a4.894 4.894 0 0 0 4.886-4.886v-7.971A2.572 2.572 0 0 0 18.07 8.57ZM7.786 5.751a4.037 4.037 0 0 1 4.037-4.037h.497a4.037 4.037 0 0 1 4.037 4.037v2.82H7.786v-2.82Zm11.143 13.363a3.172 3.172 0 0 1-3.172 3.172H8.386a3.171 3.171 0 0 1-3.172-3.172v-7.971a.857.857 0 0 1 .857-.857h12a.857.857 0 0 1 .858.857v7.971Z"/><path fill="#37352F" d="M12.929 16.045v2.811a.857.857 0 0 1-1.714 0v-2.811a1.714 1.714 0 1 1 1.714 0Z"/></svg>

Before

Width:  |  Height:  |  Size: 669 B

After

Width:  |  Height:  |  Size: 666 B

View File

@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="18" fill="none"><path fill="#37352F" d="m14.98 9.202 1.363-1.363c.099.371.157.76.157 1.161 0 2.481-2.019 4.5-4.5 4.5-.402 0-.79-.058-1.161-.157l1.363-1.363a2.987 2.987 0 0 0 2.778-2.778Zm8.925-.566c-.092-.166-1.4-2.459-3.958-4.402l-1.091 1.092A15.01 15.01 0 0 1 22.368 9C21.478 10.355 17.992 15 12 15a11.02 11.02 0 0 1-2.52-.298l-1.233 1.232c1.133.348 2.379.566 3.753.566 7.851 0 11.744-6.844 11.905-7.136a.75.75 0 0 0 0-.728ZM20.78 1.28l-16.5 16.5a.748.748 0 0 1-1.06 0 .75.75 0 0 1 0-1.06l2.099-2.1C1.925 12.572.201 9.556.095 9.364a.75.75 0 0 1 0-.728C.256 8.345 4.149 1.5 12 1.5c2.03 0 3.788.463 5.292 1.148L19.72.22a.75.75 0 1 1 1.06 1.06ZM6.437 13.502l1.9-1.899A4.47 4.47 0 0 1 7.5 9c0-2.481 2.019-4.5 4.5-4.5.97 0 1.867.312 2.603.836l1.536-1.535A11.043 11.043 0 0 0 12 3C6.008 3 2.521 7.645 1.633 9c.564.855 2.186 3.02 4.804 4.503Zm2.988-2.988 4.09-4.089A2.966 2.966 0 0 0 12 6c-1.654 0-3 1.346-3 3 0 .555.162 1.068.425 1.514Z"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 18" fill="none"><path fill="#37352F" d="m14.98 9.202 1.363-1.363c.099.371.157.76.157 1.161 0 2.481-2.019 4.5-4.5 4.5-.402 0-.79-.058-1.161-.157l1.363-1.363a2.987 2.987 0 0 0 2.778-2.778Zm8.925-.566c-.092-.166-1.4-2.459-3.958-4.402l-1.091 1.092A15.01 15.01 0 0 1 22.368 9C21.478 10.355 17.992 15 12 15a11.02 11.02 0 0 1-2.52-.298l-1.233 1.232c1.133.348 2.379.566 3.753.566 7.851 0 11.744-6.844 11.905-7.136a.75.75 0 0 0 0-.728ZM20.78 1.28l-16.5 16.5a.748.748 0 0 1-1.06 0 .75.75 0 0 1 0-1.06l2.099-2.1C1.925 12.572.201 9.556.095 9.364a.75.75 0 0 1 0-.728C.256 8.345 4.149 1.5 12 1.5c2.03 0 3.788.463 5.292 1.148L19.72.22a.75.75 0 1 1 1.06 1.06ZM6.437 13.502l1.9-1.899A4.47 4.47 0 0 1 7.5 9c0-2.481 2.019-4.5 4.5-4.5.97 0 1.867.312 2.603.836l1.536-1.535A11.043 11.043 0 0 0 12 3C6.008 3 2.521 7.645 1.633 9c.564.855 2.186 3.02 4.804 4.503Zm2.988-2.988 4.09-4.089A2.966 2.966 0 0 0 12 6c-1.654 0-3 1.346-3 3 0 .555.162 1.068.425 1.514Z"/></svg>

Before

Width:  |  Height:  |  Size: 1000 B

After

Width:  |  Height:  |  Size: 997 B

View File

@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" fill="none"><g clip-path="url(#a)"><path fill="#37352F" d="M11.812 2.382A6.762 6.762 0 0 0 7 .39c-.992 0-1.963.214-2.852.625l.141-.36a.479.479 0 0 0-.891-.35l-.59 1.51a.657.657 0 0 0 .413.864l1.547.485a.475.475 0 0 0 .6-.313.479.479 0 0 0-.313-.6l-.764-.24A5.831 5.831 0 0 1 7 1.347a5.81 5.81 0 0 1 4.135 1.713 5.81 5.81 0 0 1 1.713 4.135 5.81 5.81 0 0 1-1.713 4.135A5.81 5.81 0 0 1 7 13.043a5.81 5.81 0 0 1-4.136-1.713 5.81 5.81 0 0 1-1.712-4.135c0-.93.211-1.817.628-2.64a.479.479 0 0 0-.854-.433 6.733 6.733 0 0 0-.732 3.072 6.76 6.76 0 0 0 1.994 4.813A6.76 6.76 0 0 0 7 14a6.76 6.76 0 0 0 4.812-1.993 6.76 6.76 0 0 0 1.994-4.813 6.76 6.76 0 0 0-1.994-4.812Z"/></g><defs><clipPath id="a"><path fill="#fff" d="M0 0h14v14H0z"/></clipPath></defs></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14" fill="none"><g clip-path="url(#a)"><path fill="#37352F" d="M11.812 2.382A6.762 6.762 0 0 0 7 .39c-.992 0-1.963.214-2.852.625l.141-.36a.479.479 0 0 0-.891-.35l-.59 1.51a.657.657 0 0 0 .413.864l1.547.485a.475.475 0 0 0 .6-.313.479.479 0 0 0-.313-.6l-.764-.24A5.831 5.831 0 0 1 7 1.347a5.81 5.81 0 0 1 4.135 1.713 5.81 5.81 0 0 1 1.713 4.135 5.81 5.81 0 0 1-1.713 4.135A5.81 5.81 0 0 1 7 13.043a5.81 5.81 0 0 1-4.136-1.713 5.81 5.81 0 0 1-1.712-4.135c0-.93.211-1.817.628-2.64a.479.479 0 0 0-.854-.433 6.733 6.733 0 0 0-.732 3.072 6.76 6.76 0 0 0 1.994 4.813A6.76 6.76 0 0 0 7 14a6.76 6.76 0 0 0 4.812-1.993 6.76 6.76 0 0 0 1.994-4.813 6.76 6.76 0 0 0-1.994-4.812Z"/></g><defs><clipPath id="a"><path fill="#fff" d="M0 0h14v14H0z"/></clipPath></defs></svg>

Before

Width:  |  Height:  |  Size: 814 B

After

Width:  |  Height:  |  Size: 811 B

View File

@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none"><path fill="#37352F" d="M18.071 8.571H7.786v-2.82a4.037 4.037 0 0 1 4.037-4.037h.497a4.037 4.037 0 0 1 4.037 4.037.857.857 0 1 0 1.714 0A5.76 5.76 0 0 0 12.32 0h-.497A5.76 5.76 0 0 0 6.07 5.751v2.82A2.571 2.571 0 0 0 3.5 11.143v7.971A4.894 4.894 0 0 0 8.386 24h7.371a4.894 4.894 0 0 0 4.886-4.886v-7.971A2.572 2.572 0 0 0 18.07 8.57Zm.858 10.543a3.172 3.172 0 0 1-3.172 3.172H8.386a3.171 3.171 0 0 1-3.172-3.172v-7.971a.857.857 0 0 1 .857-.857h12a.857.857 0 0 1 .858.857v7.971Zm-6-3.068v2.811a.857.857 0 1 1-1.715 0v-2.811a1.714 1.714 0 1 1 1.715 0Z"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"><path fill="#37352F" d="M18.071 8.571H7.786v-2.82a4.037 4.037 0 0 1 4.037-4.037h.497a4.037 4.037 0 0 1 4.037 4.037.857.857 0 1 0 1.714 0A5.76 5.76 0 0 0 12.32 0h-.497A5.76 5.76 0 0 0 6.07 5.751v2.82A2.571 2.571 0 0 0 3.5 11.143v7.971A4.894 4.894 0 0 0 8.386 24h7.371a4.894 4.894 0 0 0 4.886-4.886v-7.971A2.572 2.572 0 0 0 18.07 8.57Zm.858 10.543a3.172 3.172 0 0 1-3.172 3.172H8.386a3.171 3.171 0 0 1-3.172-3.172v-7.971a.857.857 0 0 1 .857-.857h12a.857.857 0 0 1 .858.857v7.971Zm-6-3.068v2.811a.857.857 0 1 1-1.715 0v-2.811a1.714 1.714 0 1 1 1.715 0Z"/></svg>

Before

Width:  |  Height:  |  Size: 633 B

After

Width:  |  Height:  |  Size: 630 B

View File

@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="16" fill="none"><path fill="#37352F" d="M12 15.5C4.149 15.5.256 8.655.095 8.364a.75.75 0 0 1 0-.729C.256 7.346 4.149.5 12 .5c7.851 0 11.744 6.845 11.905 7.136a.75.75 0 0 1 0 .728C23.744 8.655 19.852 15.5 12 15.5ZM1.633 7.999C2.525 9.35 6.027 14 12 14c5.992 0 9.479-4.645 10.367-5.999C21.475 6.65 17.973 2 12 2 6.008 2 2.521 6.645 1.633 7.999ZM12 12.5A4.505 4.505 0 0 1 7.5 8c0-2.481 2.019-4.5 4.5-4.5s4.5 2.019 4.5 4.5-2.019 4.5-4.5 4.5ZM12 5c-1.654 0-3 1.346-3 3s1.346 3 3 3 3-1.346 3-3-1.346-3-3-3Z"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 16" fill="none"><path fill="#37352F" d="M12 15.5C4.149 15.5.256 8.655.095 8.364a.75.75 0 0 1 0-.729C.256 7.346 4.149.5 12 .5c7.851 0 11.744 6.845 11.905 7.136a.75.75 0 0 1 0 .728C23.744 8.655 19.852 15.5 12 15.5ZM1.633 7.999C2.525 9.35 6.027 14 12 14c5.992 0 9.479-4.645 10.367-5.999C21.475 6.65 17.973 2 12 2 6.008 2 2.521 6.645 1.633 7.999ZM12 12.5A4.505 4.505 0 0 1 7.5 8c0-2.481 2.019-4.5 4.5-4.5s4.5 2.019 4.5 4.5-2.019 4.5-4.5 4.5ZM12 5c-1.654 0-3 1.346-3 3s1.346 3 3 3 3-1.346 3-3-1.346-3-3-3Z"/></svg>

Before

Width:  |  Height:  |  Size: 568 B

After

Width:  |  Height:  |  Size: 565 B

View File

@ -28,6 +28,7 @@ import { ItemType } from 'antd/lib/menu/hooks/useItems';
import { ColumnsType } from 'antd/lib/table';
import { AxiosError } from 'axios';
import classNames from 'classnames';
import { DROPDOWN_ICON_SIZE_PROPS } from 'constants/ManageButton.constants';
import { ERROR_PLACEHOLDER_TYPE } from 'enums/common.enum';
import { compare } from 'fast-json-patch';
import { cloneDeep, isEmpty, isUndefined, orderBy, uniqueId } from 'lodash';
@ -39,7 +40,11 @@ import { Link } from 'react-router-dom';
import { restoreTeam } from 'rest/teamsAPI';
import AppState from '../../AppState';
import { ReactComponent as IconEdit } from '../../assets/svg/ic-edit.svg';
import { ReactComponent as IconRestore } from '../../assets/svg/ic-restore.svg';
import { ReactComponent as IconDropdown } from '../../assets/svg/menu.svg';
import { ReactComponent as IconOpenLock } from '../../assets/svg/open-lock.svg';
import { ReactComponent as IconRemove } from '../../assets/svg/Remove.svg';
import { ReactComponent as IconShowPassword } from '../../assets/svg/show-password.svg';
import {
getTeamAndUserDetailsPath,
getUserPath,
@ -73,7 +78,6 @@ import {
DEFAULT_ENTITY_PERMISSION,
} from '../../utils/PermissionsUtils';
import { getTeamsWithFqnPath } from '../../utils/RouterUtils';
import SVGIcons, { Icons } from '../../utils/SvgUtils';
import {
filterChildTeams,
getDeleteMessagePostFix,
@ -290,13 +294,7 @@ const TeamDetailsV1 = ({
<Button
data-testid="remove-user-btn"
disabled={!entityPermissions.EditAll}
icon={
<SVGIcons
alt={t('label.remove')}
className="tw-w-4 tw-mb-2.5"
icon={Icons.ICON_REMOVE}
/>
}
icon={<IconRemove name={t('label.remove')} />}
type="text"
onClick={() => deleteUserHandler(record.id)}
/>
@ -624,29 +622,9 @@ const TeamDetailsV1 = ({
return t('message.are-you-sure-want-to-text', { text });
};
const deletedTeamIcon = useMemo(
() => (
<SVGIcons
alt={t('label.delete')}
icon={showDeletedTeam ? Icons.HIDE_PASSWORD : Icons.SHOW_PASSWORD}
/>
),
[showDeletedTeam]
);
const openGroupIcon = useMemo(
() => (
<SVGIcons
alt={t('label.delete')}
icon={currentTeam.isJoinable ? Icons.OPEN_LOCK : Icons.CLOSED_LOCK}
/>
),
[currentTeam.isJoinable]
);
const restoreIcon = useMemo(
() => (
<SVGIcons alt={t('label.restore')} icon={Icons.RESTORE} width="16px" />
<IconRestore {...DROPDOWN_ICON_SIZE_PROPS} name={t('label.restore')} />
),
[currentTeam.isJoinable]
);
@ -654,18 +632,18 @@ const TeamDetailsV1 = ({
const DELETED_TOGGLE_MENU_ITEM = {
label: (
<Row className="cursor-pointer" data-testid="deleted-team-menu-item">
<Col span={3}>{deletedTeamIcon}</Col>
<Col span={3}>
<IconShowPassword {...DROPDOWN_ICON_SIZE_PROPS} />
</Col>
<Col span={21}>
<Row>
<Col span={21}>
<Typography.Text
className="font-medium"
data-testid="deleted-menu-item-label">
{t(
showDeletedTeam
? 'label.hide-deleted-team'
: 'label.show-deleted-team'
)}
{t('label.show-deleted-entity', {
entity: t('label.team'),
})}
</Typography.Text>
</Col>
@ -680,7 +658,10 @@ const TeamDetailsV1 = ({
<Col className="p-t-xss">
<Typography.Paragraph className="text-grey-muted text-xs m-b-0 line-height-16">
{t('message.view-deleted-teams')}
{t('message.view-deleted-entity', {
entity: t('label.team-plural'),
parent: t('label.team'),
})}
</Typography.Paragraph>
</Col>
</Row>
@ -728,18 +709,16 @@ const TeamDetailsV1 = ({
className="cursor-pointer"
data-testid="deleted-team-menu-item"
onClick={handleOpenToJoinToggle}>
<Col span={3}>{openGroupIcon}</Col>
<Col span={3}>
<IconOpenLock {...DROPDOWN_ICON_SIZE_PROPS} />
</Col>
<Col data-testid="open-group" span={21}>
<Row>
<Col span={21}>
<Typography.Text
className="font-medium"
data-testid="open-group-label">
{`${
currentTeam.isJoinable
? t('label.close')
: t('label.open')
} ${t('label.group')}`}
{t('label.public-team')}
</Typography.Text>
</Col>

View File

@ -13,6 +13,7 @@
import { ExclamationCircleOutlined, StarFilled } from '@ant-design/icons';
import { Button, Popover, Space, Tooltip } from 'antd';
import { ItemType } from 'antd/lib/menu/hooks/useItems';
import { AxiosError } from 'axios';
import classNames from 'classnames';
import Tags from 'components/Tag/Tags/tags';
@ -90,6 +91,7 @@ interface Props {
onRestoreEntity?: () => void;
allowSoftDelete?: boolean;
isRecursiveDelete?: boolean;
extraDropdownContent?: ItemType[];
}
const EntityPageInfo = ({
@ -123,6 +125,7 @@ const EntityPageInfo = ({
onRestoreEntity,
isRecursiveDelete = false,
allowSoftDelete,
extraDropdownContent,
}: Props) => {
const history = useHistory();
const tagThread = entityFieldThreads?.[0];
@ -466,6 +469,7 @@ const EntityPageInfo = ({
entityId={entityId}
entityName={entityName}
entityType={entityType}
extraDropdownContent={extraDropdownContent}
isRecursiveDelete={isRecursiveDelete}
onAnnouncementClick={() => setIsAnnouncementDrawer(true)}
onRestoreEntity={onRestoreEntity}

View File

@ -14,6 +14,7 @@
import { Button, Col, Dropdown, Modal, Row, Tooltip, Typography } from 'antd';
import { ItemType } from 'antd/lib/menu/hooks/useItems';
import classNames from 'classnames';
import { DROPDOWN_ICON_SIZE_PROPS } from 'constants/ManageButton.constants';
import React, { FC, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { ReactComponent as IconAnnouncementsBlack } from '../../../../assets/svg/announcements-black.svg';
@ -89,7 +90,11 @@ const ManageButton: FC<Props> = ({
}
}}>
<Col span={3}>
<IconDelete className="m-t-xss" name="Delete" width={20} />
<IconDelete
className="m-t-xss"
{...DROPDOWN_ICON_SIZE_PROPS}
name="Delete"
/>
</Col>
<Col span={21}>
<Row data-testid="delete-button">
@ -134,7 +139,7 @@ const ManageButton: FC<Props> = ({
<IconRestore
className="m-t-xss"
name="Restore"
width={20}
{...DROPDOWN_ICON_SIZE_PROPS}
/>
</Col>
<Col span={21}>
@ -178,7 +183,7 @@ const ManageButton: FC<Props> = ({
<IconAnnouncementsBlack
className="m-t-xss"
name="announcement"
width={20}
{...DROPDOWN_ICON_SIZE_PROPS}
/>
</Col>
<Col span={21}>

View File

@ -0,0 +1,17 @@
/*
* 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.
*/
export const DROPDOWN_ICON_SIZE_PROPS = {
width: 20,
height: 20,
};

View File

@ -348,7 +348,7 @@
"has-been-action-type-lowercase": "has been {{actionType}}",
"here-lowercase": "here",
"hide": "Hide",
"hide-deleted-team": "Hide Deleted Team",
"hide-deleted-entity": "Hide Deleted {{entity}}",
"home": "Home",
"hour": "Hour",
"http-config-source": "HTTP Config Source",
@ -576,6 +576,7 @@
"project-id": "Project ID",
"project-lowercase": "project",
"property": "Property",
"public-team": "Public Team",
"quality": "Quality",
"query": "Query",
"query-log-duration": "Query Log Duration",
@ -692,7 +693,7 @@
"shift": "Shift",
"show": "Show",
"show-deleted": "Show Deleted",
"show-deleted-team": "Show Deleted Team",
"show-deleted-entity": "Show Deleted {{entity}}",
"show-or-hide-advanced-config": "{{showAdv}} Advanced Config",
"sign-in-with-sso": "Sign in with {{sso}}",
"skew": "Skew",
@ -1169,7 +1170,7 @@
"user-mentioned-in-comment": "{{user}} mentioned you in a comment.",
"user-verified-successfully": "User Verified Successfully",
"valid-url-endpoint": "Endpoints should be valid URL",
"view-deleted-teams": "View All the Deleted Teams, which come under this Team.",
"view-deleted-entity": "View All the Deleted {{entity}}, which come under this {{parent}}.",
"view-sample-data": "To view Sample Data, run the Profiler Ingestion. Please refer to this doc to schedule the",
"view-sample-data-message": "To view Sample Data, run the MetaData Ingestion. Please refer to this doc to schedule the",
"view-test-suite": "View test suite",

View File

@ -348,7 +348,7 @@
"has-been-action-type-lowercase": "has been {{actionType}}",
"here-lowercase": "here",
"hide": "Masquer",
"hide-deleted-team": "Hide Deleted Team",
"hide-deleted-entity": "Hide Deleted {{entity}}",
"home": "Home",
"hour": "Hour",
"http-config-source": "HTTP Config Source",
@ -576,6 +576,7 @@
"project-id": "Project ID",
"project-lowercase": "project",
"property": "Property",
"public-team": "Public Team",
"quality": "Qualité",
"query": "Query",
"query-log-duration": "Query Log Duration",
@ -692,7 +693,7 @@
"shift": "Shift",
"show": "Voir",
"show-deleted": "Montrer les Supprimé.es",
"show-deleted-team": "Show Deleted Team",
"show-deleted-entity": "Show Deleted {{entity}}",
"show-or-hide-advanced-config": "{{showAdv}} Config Avancée",
"sign-in-with-sso": "Sign in with {{sso}}",
"skew": "Skew",
@ -1169,7 +1170,7 @@
"user-mentioned-in-comment": "{{user}} mentioned you in a comment.",
"user-verified-successfully": "User Verified Successfully",
"valid-url-endpoint": "Endpoints should be valid URL",
"view-deleted-teams": "Voir toutes les équipes supprimées qui relèvent de cette équipe.",
"view-deleted-entity": "View All the Deleted {{entity}}, which come under this {{parent}}.",
"view-sample-data": "To view Sample Data, run the Profiler Ingestion. Please refer to this doc to schedule the",
"view-sample-data-message": "To view Sample Data, run the MetaData Ingestion. Please refer to this doc to schedule the",
"view-test-suite": "View test suite",

View File

@ -348,7 +348,7 @@
"has-been-action-type-lowercase": "has been {{actionType}}",
"here-lowercase": "ここ",
"hide": "隠す",
"hide-deleted-team": "削除されたチームを隠す",
"hide-deleted-entity": "Hide Deleted {{entity}}",
"home": "ホーム",
"hour": "時",
"http-config-source": "HTTP Config Source",
@ -576,6 +576,7 @@
"project-id": "プロジェクトID",
"project-lowercase": "プロジェクト",
"property": "プロパティ",
"public-team": "Public Team",
"quality": "品質",
"query": "クエリ",
"query-log-duration": "クエリログの時間",
@ -692,7 +693,7 @@
"shift": "Shift",
"show": "Show",
"show-deleted": "削除された項目も表示",
"show-deleted-team": "削除されたチームも表示",
"show-deleted-entity": "Show Deleted {{entity}}",
"show-or-hide-advanced-config": "{{showAdv}} 高度な設定",
"sign-in-with-sso": "{{sso}}でサインインする",
"skew": "Skew",
@ -1169,7 +1170,7 @@
"user-mentioned-in-comment": "{{user}}がコメントであなたにメンションしました。",
"user-verified-successfully": "ユーザ認証に成功しました",
"valid-url-endpoint": "エンドポイントは有効なURLでなければなりません",
"view-deleted-teams": "このチームの下にある全ての削除されたチームを表示する。",
"view-deleted-entity": "View All the Deleted {{entity}}, which come under this {{parent}}.",
"view-sample-data": "To view Sample Data, run the Profiler Ingestion. Please refer to this doc to schedule the",
"view-sample-data-message": "To view Sample Data, run the MetaData Ingestion. Please refer to this doc to schedule the",
"view-test-suite": "View test suite",

View File

@ -348,7 +348,7 @@
"has-been-action-type-lowercase": "has been {{actionType}}",
"here-lowercase": "这儿",
"hide": "隐藏",
"hide-deleted-team": "Hide Deleted Team",
"hide-deleted-entity": "Hide Deleted {{entity}}",
"home": "Home",
"hour": "Hour",
"http-config-source": "HTTP Config Source",
@ -576,6 +576,7 @@
"project-id": "Project ID",
"project-lowercase": "project",
"property": "属性",
"public-team": "Public Team",
"quality": "质量",
"query": "查询",
"query-log-duration": "Query Log Duration",
@ -692,7 +693,7 @@
"shift": "Shift",
"show": "显示",
"show-deleted": "显示被删除",
"show-deleted-team": "Show Deleted Team",
"show-deleted-entity": "Show Deleted {{entity}}",
"show-or-hide-advanced-config": "{{showAdv}} 高级配置",
"sign-in-with-sso": "Sign in with {{sso}}",
"skew": "Skew",
@ -1169,7 +1170,7 @@
"user-mentioned-in-comment": "{{user}} mentioned you in a comment.",
"user-verified-successfully": "User Verified Successfully",
"valid-url-endpoint": "Endpoints should be valid URL",
"view-deleted-teams": "View all the Deleted Teams, which come under this Team.",
"view-deleted-entity": "View All the Deleted {{entity}}, which come under this {{parent}}.",
"view-sample-data": "To view Sample Data, run the Profiler Ingestion. Please refer to this doc to schedule the",
"view-sample-data-message": "To view Sample Data, run the MetaData Ingestion. Please refer to this doc to schedule the",
"view-test-suite": "View test suite",

View File

@ -11,7 +11,16 @@
* limitations under the License.
*/
import { Card, Col, Row, Skeleton, Table as TableAntd } from 'antd';
import {
Card,
Col,
Row,
Skeleton,
Switch,
Table as TableAntd,
Typography,
} from 'antd';
import { ItemType } from 'antd/lib/menu/hooks/useItems';
import { ColumnsType } from 'antd/lib/table';
import { AxiosError } from 'axios';
import ActivityFeedList from 'components/ActivityFeed/ActivityFeedList/ActivityFeedList';
@ -30,6 +39,7 @@ import {
OperationPermission,
ResourceEntity,
} from 'components/PermissionProvider/PermissionProvider.interface';
import { DROPDOWN_ICON_SIZE_PROPS } from 'constants/ManageButton.constants';
import { compare, Operation } from 'fast-json-patch';
import { TagLabel } from 'generated/type/tagLabel';
import { isUndefined, startCase, toNumber } from 'lodash';
@ -58,6 +68,7 @@ import {
} from 'rest/feedsAPI';
import { searchQuery } from 'rest/searchAPI';
import { default as AppState, default as appState } from '../../AppState';
import { ReactComponent as IconShowPassword } from '../../assets/svg/show-password.svg';
import { FQN_SEPARATOR_CHAR } from '../../constants/char.constants';
import {
getDatabaseDetailsPath,
@ -160,6 +171,8 @@ const DatabaseSchemaPage: FunctionComponent = () => {
const [tags, setTags] = useState<Array<EntityTags>>([]);
const [tier, setTier] = useState<TagLabel>();
const [showDeletedTables, setShowDeletedTables] = useState<boolean>(false);
const fetchDatabaseSchemaPermission = async () => {
setIsLoading(true);
try {
@ -347,7 +360,7 @@ const DatabaseSchemaPage: FunctionComponent = () => {
sortOrder: 'asc',
pageSize: PAGE_SIZE,
searchIndex: SearchIndex.TABLE,
includeDeleted: false,
includeDeleted: showDeletedTables,
});
setTableData(getTablesFromSearchResponse(res));
setTableInstanceCount(res.hits.total.value);
@ -670,6 +683,53 @@ const DatabaseSchemaPage: FunctionComponent = () => {
);
};
const extraDropdownContent: ItemType[] = useMemo(
() => [
{
label: (
<Row className="cursor-pointer" data-testid="deleted-table-menu-item">
<Col span={3}>
<IconShowPassword {...DROPDOWN_ICON_SIZE_PROPS} />
</Col>
<Col span={21}>
<Row>
<Col span={21}>
<Typography.Text
className="font-medium"
data-testid="deleted-table-menu-item-label">
{t('label.show-deleted-entity', {
entity: t('label.table'),
})}
</Typography.Text>
</Col>
<Col span={3}>
<Switch
checked={showDeletedTables}
data-testid="deleted-table-menu-item-switch"
size="small"
onChange={setShowDeletedTables}
/>
</Col>
<Col className="p-t-xss">
<Typography.Paragraph className="text-grey-muted text-xs m-b-0 line-height-16">
{t('message.view-deleted-entity', {
entity: t('label.table-plural'),
parent: t('label.schema'),
})}
</Typography.Paragraph>
</Col>
</Row>
</Col>
</Row>
),
key: 'deleted-team-dropdown',
},
],
[showDeletedTables]
);
useEffect(() => {
if (TabSpecificField.ACTIVITY_FEED === tab) {
fetchActivityFeed();
@ -700,13 +760,13 @@ const DatabaseSchemaPage: FunctionComponent = () => {
useEffect(() => {
tablePaginationHandler(INITIAL_PAGING_VALUE);
}, [databaseSchema]);
}, [showDeletedTables, databaseSchema]);
useEffect(() => {
fetchDatabaseSchemaPermission();
}, [databaseSchemaFQN]);
// alwyas Keep this useEffect at the end...
// always Keep this useEffect at the end...
useEffect(() => {
isMounting.current = false;
appState.inPageSearchText = '';
@ -753,6 +813,7 @@ const DatabaseSchemaPage: FunctionComponent = () => {
entityId={databaseSchemaId}
entityName={databaseSchemaName}
entityType={EntityType.DATABASE_SCHEMA}
extraDropdownContent={extraDropdownContent}
extraInfo={extraInfo}
followersList={[]}
isTagEditable={