fix: publish the new example dashboards (#15803)

* fix: publish the new example dashboards

* Fix tests
This commit is contained in:
Beto Dealmeida
2021-07-21 17:26:03 -07:00
committed by GitHub
parent f104fba61d
commit 211319673f
2 changed files with 6 additions and 4 deletions

View File

@@ -59,13 +59,13 @@ describe('dashboard filters card view', () => {
// filter by published
cy.get('.Select__control').eq(2).click();
cy.get('.Select__menu').contains('Published').click({ timeout: 5000 });
cy.get('[data-test="styled-card"]').should('have.length', 2);
cy.get('[data-test="styled-card"]').should('have.length', 3);
cy.get('[data-test="styled-card"]')
.contains('USA Births Names')
.should('be.visible');
cy.get('.Select__control').eq(1).click();
cy.get('.Select__control').eq(1).type('unpub{enter}');
cy.get('[data-test="styled-card"]').should('have.length', 2);
cy.get('[data-test="styled-card"]').should('have.length', 3);
});
});
@@ -110,12 +110,12 @@ describe('dashboard filters list view', () => {
// filter by published
cy.get('.Select__control').eq(2).click();
cy.get('.Select__menu').contains('Published').click();
cy.get('[data-test="table-row"]').should('have.length', 2);
cy.get('[data-test="table-row"]').should('have.length', 3);
cy.get('[data-test="table-row"]')
.contains('USA Births Names')
.should('be.visible');
cy.get('.Select__control').eq(2).click();
cy.get('.Select__control').eq(2).type('unpub{enter}');
cy.get('[data-test="table-row"]').should('have.length', 2);
cy.get('[data-test="table-row"]').should('have.length', 3);
});
});

View File

@@ -125,6 +125,8 @@ class ImportExamplesCommand(ImportModelsCommand):
if file_name.startswith("dashboards/"):
config = update_id_refs(config, chart_ids)
dashboard = import_dashboard(session, config, overwrite=overwrite)
dashboard.published = True
for uuid in find_chart_uuids(config["position"]):
chart_id = chart_ids[uuid]
if (dashboard.id, chart_id) not in existing_relationships: