How to use the @grafana/data.AppEvents.alertSuccess function in @grafana/data

To help you get started, we’ve selected a few @grafana/data examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github GridProtectionAlliance / openHistorian / Source / Applications / openHistorian / openHistorian / Grafana / public / app / features / folders / state / actions.ts View on Github external
return async dispatch => {
    const res = await getBackendSrv().put(`/api/folders/${folder.uid}`, {
      title: folder.title,
      version: folder.version,
    });

    // this should be redux action at some point
    appEvents.emit(AppEvents.alertSuccess, ['Folder saved']);

    dispatch(updateLocation({ path: `${res.url}/settings` }));
  };
}
github GridProtectionAlliance / openHistorian / Source / Applications / openHistorian / openHistorian / Grafana / public / app / features / plugins / PluginDashboards.tsx View on Github external
.then((res: PluginDashboard) => {
        appEvents.emit(AppEvents.alertSuccess, ['Dashboard Imported', dash.title]);
        extend(dash, res);
        this.setState({ dashboards: [...this.state.dashboards] });
      });
  };
github GridProtectionAlliance / openHistorian / Source / Applications / openHistorian / openHistorian / Grafana / public / app / core / directives / misc.ts View on Github external
scope.clipboard.on('success', () => {
        appEvents.emit(AppEvents.alertSuccess, ['Content copied to clipboard']);
      });
github grafana / grafana / public / app / core / services / backend_srv.ts View on Github external
(results: any) => {
        if (options.method !== 'GET') {
          if (results && results.data.message) {
            if (options.showSuccessAlert !== false) {
              appEvents.emit(AppEvents.alertSuccess, [results.data.message]);
            }
          }
        }
        return results.data;
      },
      (err: any) => {
github grafana / grafana / public / app / features / folders / CreateFolderCtrl.ts View on Github external
return this.backendSrv.createFolder({ title: this.title }).then((result: any) => {
      appEvents.emit(AppEvents.alertSuccess, ['Folder Created', 'OK']);
      this.$location.url(locationUtil.stripBaseFromUrl(result.url));
    });
  }
github GridProtectionAlliance / openHistorian / Source / Applications / openHistorian / openHistorian / Grafana / public / app / features / manage-dashboards / components / MoveToFolderModal / MoveToFolderCtrl.ts View on Github external
return this.backendSrv.moveDashboards(this.dashboards, this.folder).then((result: any) => {
      if (result.successCount > 0) {
        const header = `Dashboard${result.successCount === 1 ? '' : 's'} Moved`;
        const msg = `${result.successCount} dashboard${result.successCount === 1 ? '' : 's'} moved to ${
          this.folder.title
        }`;
        appEvents.emit(AppEvents.alertSuccess, [header, msg]);
      }

      if (result.totalCount === result.alreadyInFolderCount) {
        appEvents.emit(AppEvents.alertError, ['Error', `Dashboards already belongs to folder ${this.folder.title}`]);
      }

      this.dismiss();
      return this.afterSave();
    });
  }
github GridProtectionAlliance / openHistorian / Source / Applications / openHistorian / openHistorian / Grafana / public / app / core / services / backend_srv.ts View on Github external
(results: any) => {
        if (options.method !== 'GET') {
          if (results && results.data.message) {
            if (options.showSuccessAlert !== false) {
              appEvents.emit(AppEvents.alertSuccess, [results.data.message]);
            }
          }
        }
        return results.data;
      },
      (err: any) => {
github GridProtectionAlliance / openHistorian / Source / Applications / openHistorian / openHistorian / Grafana / public / app / features / dashboard / utils / panel.ts View on Github external
export const copyPanel = (panel: PanelModel) => {
  store.set(LS_PANEL_COPY_KEY, JSON.stringify(panel.getSaveModel()));
  appEvents.emit(AppEvents.alertSuccess, ['Panel copied. Open Add Panel to paste']);
};