Add "Published" feature to dashboards (#4725)

* Allow users to publish dashboards

* Rework publish dashboards feature

- The eye next to the title has been replaced with a [draft] badge
- Published status is now toggled in the Header Action Dropdown
- CRUD list shows published status

* Fix linter errors

* Update javascript tests

* Add tests and change DashboardFilter

Add some tests to make sure the published status is rendered and
Make it so that users cannot see dashboards that are published
if they don't have access to any of the slices within

* Fix some linter errors

* Remove commas from core.py

* Fix some failing tests

* More linter errors I introduced

* Fix more linter errors I introduced

* update alembic migration

* Update design of publish dash feature

* Upgrade migration version

* Secure publish endpoint

* Remove bad quotes

* Give publish span its own style

* fix publish rendering

* Add new test for publish feature

* Update migration

* update slug in test

* Update migration

* Address reviwer comments

* Fix linter errors

* Add licenses

* Remove fetchPublished(), use bootstrap data

* Update migration

* Update croniter to existing version

* Fix linter errors

* Upgrade DB Revisions

* Fix flake8 linter error

* Set all dashboards to published on migration

* Migration proper line spacing

* Fix migration to work with postgres

* UPDATE statement works with postgresql and sqlite hopefully

* Update wording to kick off travis
This commit is contained in:
Tresdon Jones
2019-07-11 00:14:13 -06:00
committed by Maxime Beauchemin
parent 8d81c3049a
commit 97ffb762d0
13 changed files with 432 additions and 24 deletions

View File

@@ -21,6 +21,7 @@ import { shallow } from 'enzyme';
import Header from '../../../../src/dashboard/components/Header';
import EditableTitle from '../../../../src/components/EditableTitle';
import FaveStar from '../../../../src/components/FaveStar';
import PublishedStatus from '../../../../src/dashboard/components/PublishedStatus';
import HeaderActionsDropdown from '../../../../src/dashboard/components/HeaderActionsDropdown';
import Button from '../../../../src/components/Button';
import UndoRedoKeylisteners from '../../../../src/dashboard/components/UndoRedoKeylisteners';
@@ -43,6 +44,8 @@ describe('Header', () => {
fetchFaveStar: () => {},
fetchCharts: () => {},
saveFaveStar: () => {},
savePublished: () => {},
isPublished: () => {},
startPeriodicRender: () => {},
updateDashboardTitle: () => {},
editMode: false,
@@ -78,6 +81,11 @@ describe('Header', () => {
expect(wrapper.find(EditableTitle)).toHaveLength(1);
});
it('should render the PublishedStatus', () => {
const wrapper = setup(overrideProps);
expect(wrapper.find(PublishedStatus)).toHaveLength(1);
});
it('should render the FaveStar', () => {
const wrapper = setup(overrideProps);
expect(wrapper.find(FaveStar)).toHaveLength(1);
@@ -110,6 +118,11 @@ describe('Header', () => {
expect(wrapper.find(EditableTitle)).toHaveLength(1);
});
it('should render the PublishedStatus', () => {
const wrapper = setup(overrideProps);
expect(wrapper.find(PublishedStatus)).toHaveLength(1);
});
it('should render the FaveStar', () => {
const wrapper = setup(overrideProps);
expect(wrapper.find(FaveStar)).toHaveLength(1);
@@ -147,6 +160,11 @@ describe('Header', () => {
expect(wrapper.find(FaveStar)).toHaveLength(1);
});
it('should render the PublishedStatus', () => {
const wrapper = setup(overrideProps);
expect(wrapper.find(PublishedStatus)).toHaveLength(1);
});
it('should render the HeaderActionsDropdown', () => {
const wrapper = setup(overrideProps);
expect(wrapper.find(HeaderActionsDropdown)).toHaveLength(1);