mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
BackendSrv: Cancellable requests & Observable all the way (#25746)
* BackendSrv: Observable all the way POC * starting to unify code paths * tests pass * Unified error handling * Single request path and error handling * Fixed ts issue * another ts issu * Added back old requestId cancellation * Slow progress trying to grasp the full picture of cancellation * Updates * refactoring * Remove a bunch of stuff from backendSrv * Removed another function * Do not show error alerts for data queries * Muu * Updated comment * fixed ts issue * unify request options type * Made query inspector subscribe to backendSrv stream instead of legacy app events * Add back support for err.isHandled to limit scope * never show success alerts * Updated tests * Fixing tests * Minor weak * Improved logic for the showErrorAlert and showSuccessAlert boolean flags, now they work more logically * Fix issue
This commit is contained in:
@@ -7,11 +7,11 @@ import { CoreEvents, StoreState } from 'app/types';
|
||||
import appEvents from 'app/core/app_events';
|
||||
import { updateLocation } from 'app/core/reducers/location';
|
||||
import { DashboardModel } from 'app/features/dashboard/state';
|
||||
import { getBackendSrv } from 'app/core/services/backend_srv';
|
||||
import { saveDashboard as saveDashboardApiCall } from 'app/features/manage-dashboards/state/actions';
|
||||
|
||||
const saveDashboard = async (saveModel: any, options: SaveDashboardOptions, dashboard: DashboardModel) => {
|
||||
const folderId = options.folderId >= 0 ? options.folderId : dashboard.meta.folderId || saveModel.folderId;
|
||||
return await getBackendSrv().saveDashboard(saveModel, { ...options, folderId });
|
||||
return await saveDashboardApiCall({ ...options, folderId, dashboard: saveModel });
|
||||
};
|
||||
|
||||
export const useDashboardSave = (dashboard: DashboardModel) => {
|
||||
|
||||
Reference in New Issue
Block a user