#15101 : supported project in dashboard right panel and explore filter (#15242)

* supported project in dashboard rightpanel and explore filter

* fix aggregation key and supported unit test for the dropdown items

* minor fix
This commit is contained in:
Ashish Gupta 2024-03-21 18:14:32 +05:30 committed by GitHub
parent 0358ec848d
commit 834720c445
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 124 additions and 8 deletions

View File

@ -98,6 +98,7 @@ describe('Entity Summary Panel', () => {
'be.visible'
);
cy.get('[data-testid="Dashboard URL-label"]').should('be.visible');
cy.get('[data-testid="Project-label"]').should('be.visible');
cy.get('[data-testid="tags-header"]').scrollIntoView().should('be.visible');
cy.get('[data-testid="description-header"]')
.scrollIntoView()

View File

@ -88,6 +88,10 @@ export const DASHBOARD_DROPDOWN_ITEMS = [
label: t('label.chart'),
key: 'charts.displayName.keyword',
},
{
label: t('label.project'),
key: 'project.keyword',
},
];
export const DASHBOARD_DATA_MODEL_TYPE = [

View File

@ -365,7 +365,8 @@ const getPipelineOverview = (pipelineDetails: Pipeline) => {
};
const getDashboardOverview = (dashboardDetails: Dashboard) => {
const { owner, tags, sourceUrl, service, displayName } = dashboardDetails;
const { owner, tags, sourceUrl, service, displayName, project } =
dashboardDetails;
const tier = getTierFromTableTags(tags ?? []);
const serviceDisplayName = getEntityName(service);
@ -401,7 +402,6 @@ const getDashboardOverview = (dashboardDetails: Dashboard) => {
isLink: true,
visible: [DRAWER_NAVIGATION_OPTIONS.lineage],
},
{
name: i18next.t('label.tier'),
value: tier ? tier.split(FQN_SEPARATOR_CHAR)[1] : NO_DATA,
@ -409,6 +409,15 @@ const getDashboardOverview = (dashboardDetails: Dashboard) => {
isExternal: false,
visible: [DRAWER_NAVIGATION_OPTIONS.lineage],
},
{
name: i18next.t('label.project'),
value: project ?? NO_DATA,
isLink: false,
visible: [
DRAWER_NAVIGATION_OPTIONS.explore,
DRAWER_NAVIGATION_OPTIONS.lineage,
],
},
];
return overview;

View File

@ -10,6 +10,19 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {
COMMON_DROPDOWN_ITEMS,
CONTAINER_DROPDOWN_ITEMS,
DASHBOARD_DATA_MODEL_TYPE,
DASHBOARD_DROPDOWN_ITEMS,
DATA_PRODUCT_DROPDOWN_ITEMS,
GLOSSARY_DROPDOWN_ITEMS,
PIPELINE_DROPDOWN_ITEMS,
SEARCH_INDEX_DROPDOWN_ITEMS,
TABLE_DROPDOWN_ITEMS,
TAG_DROPDOWN_ITEMS,
TOPIC_DROPDOWN_ITEMS,
} from '../constants/AdvancedSearch.constants';
import { EntityType } from '../enums/entity.enum';
import { SearchIndex } from '../enums/search.enum';
import { SearchClassBase } from './SearchClassBase';
@ -83,4 +96,94 @@ describe('SearchClassBase', () => {
SearchIndex.DATABASE_SCHEMA
);
});
it('should return dropdown item based on entity type', () => {
const tableItems = searchClassBase.getDropDownItems(SearchIndex.TABLE);
const topicItems = searchClassBase.getDropDownItems(SearchIndex.TOPIC);
const dashboardItems = searchClassBase.getDropDownItems(
SearchIndex.DASHBOARD
);
const pipelineItems = searchClassBase.getDropDownItems(
SearchIndex.PIPELINE
);
const searchIndexItems = searchClassBase.getDropDownItems(
SearchIndex.SEARCH_INDEX
);
const mlmodelsItems = searchClassBase.getDropDownItems(SearchIndex.MLMODEL);
const containerItems = searchClassBase.getDropDownItems(
SearchIndex.CONTAINER
);
const storedProcedureItems = searchClassBase.getDropDownItems(
SearchIndex.STORED_PROCEDURE
);
const dashboardDataModelItems = searchClassBase.getDropDownItems(
SearchIndex.DASHBOARD_DATA_MODEL
);
const glossaryTermItems = searchClassBase.getDropDownItems(
SearchIndex.GLOSSARY_TERM
);
const tagItems = searchClassBase.getDropDownItems(SearchIndex.TAG);
const dataProductItems = searchClassBase.getDropDownItems(
SearchIndex.DATA_PRODUCT
);
const databaseItems = searchClassBase.getDropDownItems(
SearchIndex.DATABASE
);
const databaseSchemaItems = searchClassBase.getDropDownItems(
SearchIndex.DATABASE_SCHEMA
);
expect(tableItems).toEqual([
...COMMON_DROPDOWN_ITEMS,
...TABLE_DROPDOWN_ITEMS,
]);
expect(topicItems).toEqual([
...COMMON_DROPDOWN_ITEMS,
...TOPIC_DROPDOWN_ITEMS,
]);
expect(dashboardItems).toEqual([
...COMMON_DROPDOWN_ITEMS,
...DASHBOARD_DROPDOWN_ITEMS,
]);
expect(pipelineItems).toEqual([
...COMMON_DROPDOWN_ITEMS,
...PIPELINE_DROPDOWN_ITEMS,
]);
expect(mlmodelsItems).toEqual([
...COMMON_DROPDOWN_ITEMS.filter((item) => item.key !== 'service_type'),
]);
expect(searchIndexItems).toEqual([
...COMMON_DROPDOWN_ITEMS,
...SEARCH_INDEX_DROPDOWN_ITEMS,
]);
expect(containerItems).toEqual([
...COMMON_DROPDOWN_ITEMS,
...CONTAINER_DROPDOWN_ITEMS,
]);
expect(storedProcedureItems).toEqual([...COMMON_DROPDOWN_ITEMS]);
expect(dashboardDataModelItems).toEqual([
...COMMON_DROPDOWN_ITEMS,
...DASHBOARD_DATA_MODEL_TYPE,
]);
expect(glossaryTermItems).toEqual(GLOSSARY_DROPDOWN_ITEMS);
expect(tagItems).toEqual(TAG_DROPDOWN_ITEMS);
expect(dataProductItems).toEqual(DATA_PRODUCT_DROPDOWN_ITEMS);
expect(databaseItems).toEqual(COMMON_DROPDOWN_ITEMS);
expect(databaseSchemaItems).toEqual(COMMON_DROPDOWN_ITEMS);
});
it('should return empty dropdown item based if index not related to explore items', () => {
const dropdownItem = searchClassBase.getDropDownItems(SearchIndex.DOMAIN);
expect(dropdownItem).toEqual([]);
});
});

View File

@ -253,19 +253,18 @@ class SearchClassBase {
];
case SearchIndex.CONTAINER:
return [...COMMON_DROPDOWN_ITEMS, ...CONTAINER_DROPDOWN_ITEMS];
case SearchIndex.STORED_PROCEDURE:
return [...COMMON_DROPDOWN_ITEMS];
case SearchIndex.DASHBOARD_DATA_MODEL:
return [...COMMON_DROPDOWN_ITEMS, ...DASHBOARD_DATA_MODEL_TYPE];
case SearchIndex.GLOSSARY_TERM:
return [...GLOSSARY_DROPDOWN_ITEMS];
return GLOSSARY_DROPDOWN_ITEMS;
case SearchIndex.TAG:
return [...TAG_DROPDOWN_ITEMS];
return TAG_DROPDOWN_ITEMS;
case SearchIndex.DATA_PRODUCT:
return [...DATA_PRODUCT_DROPDOWN_ITEMS];
return DATA_PRODUCT_DROPDOWN_ITEMS;
case SearchIndex.STORED_PROCEDURE:
case SearchIndex.DATABASE:
case SearchIndex.DATABASE_SCHEMA:
return [...COMMON_DROPDOWN_ITEMS];
return COMMON_DROPDOWN_ITEMS;
default:
return [];