Browse Source

Merge pull request #9186 from vvlladd28/bug/import-export-widget/same-id

Fixed widget import in the dashboard when the duplicate IDs
pull/9205/head
Igor Kulikov 2 years ago
committed by GitHub
parent
commit
f830dd0ae2
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      ui-ngx/src/app/modules/home/components/import-export/import-export.service.ts

3
ui-ngx/src/app/modules/home/components/import-export/import-export.service.ts

@ -21,7 +21,7 @@ import { Store } from '@ngrx/store';
import { AppState } from '@core/core.state';
import { ActionNotificationShow } from '@core/notification/notification.actions';
import { Dashboard, DashboardLayoutId } from '@shared/models/dashboard.models';
import { deepClone, isDefined, isObject, isString, isUndefined } from '@core/utils';
import { deepClone, guid, isDefined, isObject, isString, isUndefined } from '@core/utils';
import { WINDOW } from '@core/services/window.service';
import { DOCUMENT } from '@angular/common';
import {
@ -184,6 +184,7 @@ export class ImportExportService {
} else {
let widget = widgetItem.widget;
widget = this.dashboardUtils.validateAndUpdateWidget(widget);
widget.id = guid();
const aliasesInfo = this.prepareAliasesInfo(widgetItem.aliasesInfo);
const filtersInfo: FiltersInfo = widgetItem.filtersInfo || {
datasourceFilters: {}

Loading…
Cancel
Save