// Dialogs import Dialog from 'new-dashboard/components/Backbone/Dialog.vue'; import CreateDialog from 'new-dashboard/components/Backbone/Dialogs/CreateDialog'; import ChangePrivacy from 'new-dashboard/components/Backbone/Dialogs/ChangePrivacy'; import DeleteDialog from 'new-dashboard/components/Backbone/Dialogs/DeleteDialog'; import DuplicateMap from 'new-dashboard/components/Backbone/Dialogs/DuplicateMap'; import LockVisualization from 'new-dashboard/components/Backbone/Dialogs/LockVisualization'; import MapMetadata from 'new-dashboard/components/Backbone/Dialogs/MapMetadata'; import DatasetMetadata from 'new-dashboard/components/Backbone/Dialogs/DatasetMetadata'; import Share from 'new-dashboard/components/Backbone/Dialogs/Share'; export function editMapMetadata (visualization, actionHandlers) { this.showModal( { template: ` `, props: ['visualization'], components: { Dialog, MapMetadata }, methods: { getEventListeners: function () { return actionHandlers || {}; } } }, { visualization } ); } export function editDatasetMetadata (dataset, actionHandlers) { this.showModal( { template: ` `, props: ['dataset'], components: { Dialog, DatasetMetadata }, methods: { getEventListeners: function () { return actionHandlers || {}; } } }, { dataset } ); } export function createMap (selectedDatasets, backgroundPollingView, mamufasImportView) { this.showModal( { template: ` `, props: ['selectedItems', 'backgroundPollingView', 'mamufasImportView'], components: { Dialog, CreateDialog } }, { selectedItems: selectedDatasets, backgroundPollingView, mamufasImportView } ); } export function changePrivacy (visualization, actionHandlers) { this.showModal( { template: ` `, props: ['visualization'], components: { Dialog, ChangePrivacy }, methods: { getEventListeners: function () { return actionHandlers || {}; } } }, { visualization } ); } export function shareVisualization (visualization, actionHandlers) { this.showModal( { template: ` `, props: ['visualization'], components: { Dialog, Share }, methods: { getEventListeners: function () { return actionHandlers || {}; } } }, { visualization } ); } export function duplicateVisualization (visualization) { this.showModal( { template: ` `, props: ['visualization'], components: { Dialog, DuplicateMap } }, { visualization } ); } export function changeLockState (visualization, contentType, actionHandlers) { const dialogProps = { visualization, contentType }; this.showModal( { template: ` `, props: ['visualization', 'contentType'], components: { Dialog, LockVisualization }, methods: { getEventListeners: function () { return actionHandlers || {}; } } }, dialogProps ); } export function changeVisualizationsLockState (visualizations, contentType, actionHandlers) { const dialogProps = { visualizations, contentType }; this.showModal( { template: ` `, props: ['visualizations', 'contentType'], components: { Dialog, LockVisualization }, methods: { getEventListeners: function () { return actionHandlers || {}; } } }, dialogProps ); } export function deleteVisualization (visualization, contentType, actionHandlers) { const dialogProps = { visualization, contentType }; this.showModal( { template: ` `, props: ['visualization', 'contentType'], components: { Dialog, DeleteDialog }, methods: { getEventListeners: function () { return actionHandlers || {}; } } }, dialogProps ); } export function deleteVisualizations (visualizations, contentType, actionHandlers) { const dialogProps = { visualizations, contentType }; this.showModal( { template: ` `, props: ['visualizations', 'contentType'], components: { Dialog, DeleteDialog }, methods: { getEventListeners: function () { return actionHandlers || {}; } } }, dialogProps ); }