Hide print-template button

Hides the "create final print template" button if
a print template exists.
Should be more user friendly and less dangerous to use.
This commit is contained in:
Sean Engelhardt 2020-01-30 13:13:52 +01:00
parent ec79f70648
commit 2236f63fe9
2 changed files with 2 additions and 14 deletions

View File

@ -532,7 +532,7 @@
type="button"
mat-icon-button
matTooltip="{{ 'Create final print template' | translate }}"
*ngIf="motion.state.isFinalState"
*ngIf="motion.state.isFinalState && !motion.modified_final_version"
(click)="createModifiedFinalVersion()"
>
<mat-icon>file_copy</mat-icon>

View File

@ -1116,19 +1116,7 @@ export class MotionDetailComponent extends BaseViewComponent implements OnInit,
// Update the motion
try {
// Just confirm this, if there is one modified final version the user would override.
if (this.motion.modified_final_version) {
const title = this.translate.instant(
'Are you sure you want to copy the final version to the print template?'
);
if (await this.promptService.open(title)) {
this.updateMotion({ modified_final_version: finalVersion }, this.motion).then(
() => this.setChangeRecoMode(ChangeRecoMode.ModifiedFinal),
this.raiseError
);
}
} else {
await this.updateMotion({ modified_final_version: finalVersion }, this.motion);
}
await this.updateMotion({ modified_final_version: finalVersion }, this.motion);
} catch (e) {
this.raiseError(e);
}