Merge pull request #11704 from maxunbearable/fix/4487-version-conflict-fixes
Version Conflict Fixes
This commit is contained in:
commit
7601138535
@ -116,17 +116,18 @@
|
||||
<mat-icon>edit</mat-icon>{{'dashboard.edit-mode' | translate}}</button>
|
||||
</ng-container>
|
||||
<ng-container *ngIf="isEdit">
|
||||
<button fxHide.gt-md mat-icon-button (click)="saveDashboard()"
|
||||
<button fxHide.gt-md mat-icon-button (click)="saveDashboard()" [disabled]="isLoading$ | async"
|
||||
matTooltip="{{'action.save' | translate}}"
|
||||
matTooltipPosition="below">
|
||||
<mat-icon>done</mat-icon></button>
|
||||
<button fxHide.lt-lg mat-stroked-button (click)="saveDashboard()">
|
||||
<button fxHide.lt-lg mat-stroked-button [disabled]="isLoading$ | async" (click)="saveDashboard()">
|
||||
<mat-icon>done</mat-icon>{{ 'action.save' | translate }}</button>
|
||||
<button fxHide.gt-md mat-icon-button (click)="toggleDashboardEditMode()"
|
||||
matTooltip="{{'action.cancel' | translate}}"
|
||||
[disabled]="isLoading$ | async"
|
||||
matTooltipPosition="below">
|
||||
<mat-icon>close</mat-icon></button>
|
||||
<button fxHide.lt-lg mat-button (click)="toggleDashboardEditMode()">
|
||||
<button fxHide.lt-lg mat-button (click)="toggleDashboardEditMode()" [disabled]="isLoading$ | async">
|
||||
<mat-icon>close</mat-icon>{{ 'action.cancel' | translate }}</button>
|
||||
<mat-divider class="tb-toolbar-divider" vertical></mat-divider>
|
||||
</ng-container>
|
||||
@ -352,6 +353,7 @@
|
||||
mat-mini-fab
|
||||
class="tb-btn-header tb-btn-edit"
|
||||
(click)="saveDashboard()"
|
||||
[disabled]="isLoading$ | async"
|
||||
matTooltip="{{'action.save' | translate}}"
|
||||
matTooltipPosition="below">
|
||||
<mat-icon>done</mat-icon></button>
|
||||
@ -360,6 +362,7 @@
|
||||
mat-mini-fab
|
||||
class="tb-btn-header tb-btn-edit"
|
||||
(click)="toggleDashboardEditMode()"
|
||||
[disabled]="isLoading$ | async"
|
||||
matTooltip="{{'action.cancel' | translate}}"
|
||||
matTooltipPosition="below">
|
||||
<mat-icon>close</mat-icon></button>
|
||||
|
||||
@ -29,9 +29,7 @@
|
||||
<div mat-dialog-content>
|
||||
<div class="message-container">
|
||||
<span>
|
||||
{{ 'entity.version-conflict.link' | translate:
|
||||
{ entityType: (entityTypeTranslations.get(entityId.entityType).type | translate) }
|
||||
}}
|
||||
{{ 'entity.version-conflict.link' | translate:{ entityType: entityTypeLabel | translate } }}
|
||||
<a class="cursor-pointer" (click)="onLinkClick($event)">{{ 'entity.link' | translate }}</a>.
|
||||
</span>
|
||||
<br/>
|
||||
|
||||
@ -42,8 +42,10 @@ interface EntityConflictDialogData {
|
||||
export class EntityConflictDialogComponent {
|
||||
|
||||
entityId: EntityId;
|
||||
entityTypeLabel: string;
|
||||
|
||||
readonly entityTypeTranslations = entityTypeTranslations;
|
||||
private readonly defaultEntityLabel = 'entity.entity';
|
||||
|
||||
constructor(
|
||||
@Inject(MAT_DIALOG_DATA) public data: EntityConflictDialogData,
|
||||
@ -51,6 +53,9 @@ export class EntityConflictDialogComponent {
|
||||
private importExportService: ImportExportService,
|
||||
) {
|
||||
this.entityId = (data.entity as EntityInfoData).id ?? (data.entity as RuleChainMetaData).ruleChainId;
|
||||
this.entityTypeLabel = entityTypeTranslations.has(this.entityId.entityType)
|
||||
? (entityTypeTranslations.get(this.entityId.entityType).type)
|
||||
: this.defaultEntityLabel;
|
||||
}
|
||||
|
||||
onCancel(): void {
|
||||
|
||||
@ -55,11 +55,7 @@ import { EntityType } from '@shared/models/entity-type.models';
|
||||
import { UtilsService } from '@core/services/utils.service';
|
||||
import { WidgetService } from '@core/http/widget.service';
|
||||
import { WidgetsBundle } from '@shared/models/widgets-bundle.model';
|
||||
import {
|
||||
EntityInfoData,
|
||||
ImportEntitiesResultInfo,
|
||||
ImportEntityData
|
||||
} from '@shared/models/entity.models';
|
||||
import { EntityInfoData, ImportEntitiesResultInfo, ImportEntityData } from '@shared/models/entity.models';
|
||||
import { RequestConfig } from '@core/http/http-utils';
|
||||
import { RuleChain, RuleChainImport, RuleChainMetaData, RuleChainType } from '@shared/models/rule-chain.models';
|
||||
import { RuleChainService } from '@core/http/rule-chain.service';
|
||||
@ -85,6 +81,7 @@ import { selectUserSettingsProperty } from '@core/auth/auth.selectors';
|
||||
import { ActionPreferencesPutUserSettings } from '@core/auth/auth.actions';
|
||||
import { ExportableEntity } from '@shared/models/base-data';
|
||||
import { EntityId } from '@shared/models/id/entity-id';
|
||||
import { Customer } from '@shared/models/customer.model';
|
||||
|
||||
export type editMissingAliasesFunction = (widgets: Array<Widget>, isSingleWidget: boolean,
|
||||
customTitle: string, missingEntityAliases: EntityAliases) => Observable<EntityAliases>;
|
||||
@ -391,6 +388,10 @@ export class ImportExportService {
|
||||
case EntityType.DASHBOARD:
|
||||
preparedData = this.prepareDashboardExport(entityData as Dashboard);
|
||||
break;
|
||||
case EntityType.CUSTOMER:
|
||||
preparedData = this.prepareExport({...entityData, name: (entityData as Customer).title});
|
||||
(entityData as EntityInfoData).name = (entityData as Customer).title;
|
||||
break;
|
||||
default:
|
||||
preparedData = this.prepareExport(entityData);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user