From 6f0d53eed8eaf085a6d0a76f68e50c7733754a3d Mon Sep 17 00:00:00 2001 From: Phillip Kelley-Dotson Date: Mon, 6 Jun 2022 09:41:06 -0700 Subject: [PATCH] feat: add modfied col and timezone info to schedule col (#20165) * feat: add modfied and timezone to to schedule col * test if test works * udpate test * fix test --- .../alerts_and_reports/alerts.test.ts | 3 ++- .../alerts_and_reports/reports.test.ts | 3 ++- .../src/views/CRUD/alert/AlertList.tsx | 19 ++++++++++++++++--- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/superset-frontend/cypress-base/cypress/integration/alerts_and_reports/alerts.test.ts b/superset-frontend/cypress-base/cypress/integration/alerts_and_reports/alerts.test.ts index 0025f4f51..97bf2cc9b 100644 --- a/superset-frontend/cypress-base/cypress/integration/alerts_and_reports/alerts.test.ts +++ b/superset-frontend/cypress-base/cypress/integration/alerts_and_reports/alerts.test.ts @@ -38,8 +38,9 @@ describe('alert list view', () => { cy.get('[data-test="sort-header"]').eq(4).contains('Notification method'); cy.get('[data-test="sort-header"]').eq(5).contains('Created by'); cy.get('[data-test="sort-header"]').eq(6).contains('Owners'); - cy.get('[data-test="sort-header"]').eq(7).contains('Active'); + cy.get('[data-test="sort-header"]').eq(7).contains('Modified'); // TODO: this assert is flaky, we need to find a way to make it work consistenly + // cy.get('[data-test="sort-header"]').eq(7).contains('Active'); // cy.get('[data-test="sort-header"]').eq(8).contains('Actions'); }); }); diff --git a/superset-frontend/cypress-base/cypress/integration/alerts_and_reports/reports.test.ts b/superset-frontend/cypress-base/cypress/integration/alerts_and_reports/reports.test.ts index a44b389d2..ea117c507 100644 --- a/superset-frontend/cypress-base/cypress/integration/alerts_and_reports/reports.test.ts +++ b/superset-frontend/cypress-base/cypress/integration/alerts_and_reports/reports.test.ts @@ -38,8 +38,9 @@ describe('report list view', () => { cy.get('[data-test="sort-header"]').eq(4).contains('Notification method'); cy.get('[data-test="sort-header"]').eq(5).contains('Created by'); cy.get('[data-test="sort-header"]').eq(6).contains('Owners'); - cy.get('[data-test="sort-header"]').eq(7).contains('Active'); + cy.get('[data-test="sort-header"]').eq(7).contains('Modified'); // TODO: this assert is flaky, we need to find a way to make it work consistenly + // cy.get('[data-test="sort-header"]').eq(7).contains('Active'); // cy.get('[data-test="sort-header"]').eq(8).contains('Actions'); }); }); diff --git a/superset-frontend/src/views/CRUD/alert/AlertList.tsx b/superset-frontend/src/views/CRUD/alert/AlertList.tsx index 66fc01092..2f7327570 100644 --- a/superset-frontend/src/views/CRUD/alert/AlertList.tsx +++ b/superset-frontend/src/views/CRUD/alert/AlertList.tsx @@ -238,11 +238,14 @@ function AlertList({ size: 'xl', Cell: ({ row: { - original: { crontab_humanized = '' }, + original: { crontab_humanized = '', timezone }, }, }: any) => ( - - {crontab_humanized} + + {`${crontab_humanized} (${timezone})`} ), }, @@ -283,6 +286,16 @@ function AlertList({ disableSortBy: true, size: 'xl', }, + { + Cell: ({ + row: { + original: { changed_on_delta_humanized: changedOn }, + }, + }: any) => {changedOn}, + Header: t('Modified'), + accessor: 'changed_on_delta_humanized', + size: 'xl', + }, { Cell: ({ row: { original } }: any) => (