Fix: Update data model header asset (#19729)

* update data model header asset to include project

* add playwright test for project

* update entity test

* update condition for test

(cherry picked from commit d897332c260472ce4d21d808d7215b512bb733e5)
This commit is contained in:
Sweta Agarwalla 2025-02-11 18:40:48 +05:30 committed by OpenMetadata Release Bot
parent fe4eb23d68
commit 8e80125cee
3 changed files with 21 additions and 2 deletions

View File

@ -10,7 +10,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import { test } from '@playwright/test'; import { expect, test } from '@playwright/test';
import { isUndefined } from 'lodash'; import { isUndefined } from 'lodash';
import { CustomPropertySupportedEntityList } from '../../constant/customProperty'; import { CustomPropertySupportedEntityList } from '../../constant/customProperty';
import { ApiEndpointClass } from '../../support/entity/ApiEndpointClass'; import { ApiEndpointClass } from '../../support/entity/ApiEndpointClass';
@ -65,8 +65,9 @@ test.use({ storageState: 'playwright/.auth/admin.json' });
entities.forEach((EntityClass) => { entities.forEach((EntityClass) => {
const entity = new EntityClass(); const entity = new EntityClass();
const deleteEntity = new EntityClass(); const deleteEntity = new EntityClass();
const entityName = entity.getType();
test.describe(entity.getType(), () => { test.describe(entityName, () => {
test.beforeAll('Setup pre-requests', async ({ browser }) => { test.beforeAll('Setup pre-requests', async ({ browser }) => {
const { apiContext, afterAction } = await createNewPage(browser); const { apiContext, afterAction } = await createNewPage(browser);
@ -192,6 +193,16 @@ entities.forEach((EntityClass) => {
); );
}); });
if (['Dashboard', 'Dashboard Data Model'].includes(entityName)) {
test(`${entityName} page should show the project name`, async ({
page,
}) => {
await expect(
page.getByText((entity.entity as { project: string }).project)
).toBeVisible();
});
}
test('Update description', async ({ page }) => { test('Update description', async ({ page }) => {
await entity.descriptionUpdate(page); await entity.descriptionUpdate(page);
}); });

View File

@ -26,6 +26,7 @@ import { EntityClass } from './EntityClass';
export class DashboardClass extends EntityClass { export class DashboardClass extends EntityClass {
private dashboardName = `pw-dashboard-${uuid()}`; private dashboardName = `pw-dashboard-${uuid()}`;
private dashboardDataModelName = `pw-dashboard-data-model-${uuid()}`; private dashboardDataModelName = `pw-dashboard-data-model-${uuid()}`;
private projectName = `pw-project-${uuid()}`;
service = { service = {
name: `pw-dashboard-service-${uuid()}`, name: `pw-dashboard-service-${uuid()}`,
serviceType: 'Superset', serviceType: 'Superset',
@ -51,6 +52,7 @@ export class DashboardClass extends EntityClass {
name: this.dashboardName, name: this.dashboardName,
displayName: this.dashboardName, displayName: this.dashboardName,
service: this.service.name, service: this.service.name,
project: this.projectName,
}; };
children = [ children = [
{ {

View File

@ -239,6 +239,12 @@ export const getDataAssetsHeaderInfo = (
value={dataModelDetails.dataModelType} value={dataModelDetails.dataModelType}
/> />
)} )}
{dataModelDetails.project && (
<ExtraInfoLabel
label={t('label.project')}
value={dataModelDetails.project}
/>
)}
</> </>
); );