Merge pull request #5559 from tsiegleauq/no-final-version-in-amendments
Avoid final version to amendments
This commit is contained in:
commit
04477d9ebd
@ -553,7 +553,7 @@
|
|||||||
type="button"
|
type="button"
|
||||||
mat-icon-button
|
mat-icon-button
|
||||||
matTooltip="{{ 'Create final print template' | translate }}"
|
matTooltip="{{ 'Create final print template' | translate }}"
|
||||||
*ngIf="motion.state.isFinalState && !motion.modified_final_version"
|
*ngIf="showCreateFinalVersionButton"
|
||||||
(click)="createModifiedFinalVersion()"
|
(click)="createModifiedFinalVersion()"
|
||||||
>
|
>
|
||||||
<mat-icon>file_copy</mat-icon>
|
<mat-icon>file_copy</mat-icon>
|
||||||
@ -564,6 +564,7 @@
|
|||||||
type="button"
|
type="button"
|
||||||
mat-icon-button
|
mat-icon-button
|
||||||
*ngIf="isRecoMode(ChangeRecoMode.ModifiedFinal) && !isFinalEdit"
|
*ngIf="isRecoMode(ChangeRecoMode.ModifiedFinal) && !isFinalEdit"
|
||||||
|
matTooltip="{{ 'Edit final print template' | translate }}"
|
||||||
(click)="editModifiedFinal()"
|
(click)="editModifiedFinal()"
|
||||||
>
|
>
|
||||||
<mat-icon>edit</mat-icon>
|
<mat-icon>edit</mat-icon>
|
||||||
@ -574,6 +575,7 @@
|
|||||||
*ngIf="isRecoMode(ChangeRecoMode.ModifiedFinal) && isFinalEdit"
|
*ngIf="isRecoMode(ChangeRecoMode.ModifiedFinal) && isFinalEdit"
|
||||||
mat-icon-button
|
mat-icon-button
|
||||||
[disabled]="!finalVersionEdited"
|
[disabled]="!finalVersionEdited"
|
||||||
|
matTooltip="{{ 'Save final print template' | translate }}"
|
||||||
(click)="onSubmitFinalVersion()"
|
(click)="onSubmitFinalVersion()"
|
||||||
>
|
>
|
||||||
<mat-icon>save</mat-icon>
|
<mat-icon>save</mat-icon>
|
||||||
@ -583,6 +585,7 @@
|
|||||||
type="button"
|
type="button"
|
||||||
*ngIf="isRecoMode(ChangeRecoMode.ModifiedFinal) && isFinalEdit"
|
*ngIf="isRecoMode(ChangeRecoMode.ModifiedFinal) && isFinalEdit"
|
||||||
mat-icon-button
|
mat-icon-button
|
||||||
|
matTooltip="{{ 'Cancel editing without saving' | translate }}"
|
||||||
(click)="cancelFinalVersionEdit()"
|
(click)="cancelFinalVersionEdit()"
|
||||||
>
|
>
|
||||||
<mat-icon>close</mat-icon>
|
<mat-icon>close</mat-icon>
|
||||||
|
@ -171,6 +171,17 @@ export class MotionDetailComponent extends BaseViewComponent implements OnInit,
|
|||||||
return this.motion.showPreamble;
|
return this.motion.showPreamble;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public get showCreateFinalVersionButton(): boolean {
|
||||||
|
if (
|
||||||
|
this.motion.isParagraphBasedAmendment() ||
|
||||||
|
!this.motion.state.isFinalState ||
|
||||||
|
this.motion.modified_final_version
|
||||||
|
) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Saves the target motion. Accessed via the getter and setter.
|
* Saves the target motion. Accessed via the getter and setter.
|
||||||
*/
|
*/
|
||||||
@ -1267,6 +1278,9 @@ export class MotionDetailComponent extends BaseViewComponent implements OnInit,
|
|||||||
* Sets the modified final version to the final version.
|
* Sets the modified final version to the final version.
|
||||||
*/
|
*/
|
||||||
public async createModifiedFinalVersion(): Promise<void> {
|
public async createModifiedFinalVersion(): Promise<void> {
|
||||||
|
if (this.motion.isParagraphBasedAmendment()) {
|
||||||
|
throw new Error('Cannot create a final version of an amendment.');
|
||||||
|
}
|
||||||
// Get the final version and remove line numbers
|
// Get the final version and remove line numbers
|
||||||
const changes: ViewUnifiedChange[] = Object.assign([], this.getChangesForFinalMode());
|
const changes: ViewUnifiedChange[] = Object.assign([], this.getChangesForFinalMode());
|
||||||
let finalVersion = this.repo.formatMotion(
|
let finalVersion = this.repo.formatMotion(
|
||||||
|
Loading…
Reference in New Issue
Block a user