Disable some actions for archived dossiers
This commit is contained in:
parent
3e69276734
commit
b90b1168b1
@ -16,7 +16,7 @@ import { firstValueFrom } from 'rxjs';
|
||||
import { AdminDialogService } from '../../services/admin-dialog.service';
|
||||
import { UserService } from '@services/user.service';
|
||||
import { HttpStatusCode } from '@angular/common/http';
|
||||
import { DoughnutChartConfig } from '../../../shared/components/simple-doughnut-chart/simple-doughnut-chart.component';
|
||||
import { DoughnutChartConfig } from '@shared/components/simple-doughnut-chart/simple-doughnut-chart.component';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { DossierTemplatesService } from '@services/entity-services/dossier-templates.service';
|
||||
|
||||
@ -93,7 +93,7 @@ export class DossierStatesListingScreenComponent extends ListingComponent<Dossie
|
||||
|
||||
async #createNewDossierStateAndRefreshView(newValue: IDossierState): Promise<void> {
|
||||
this._loadingService.start();
|
||||
await firstValueFrom(this.dossierStateService.setDossierState(newValue)).catch(error => {
|
||||
await firstValueFrom(this.dossierStateService.updateDossierState(newValue)).catch(error => {
|
||||
if (error.status === HttpStatusCode.Conflict) {
|
||||
this._toaster.error(_('dossier-states-listing.error.conflict'));
|
||||
} else {
|
||||
@ -106,6 +106,7 @@ export class DossierStatesListingScreenComponent extends ListingComponent<Dossie
|
||||
|
||||
async #loadData(): Promise<void> {
|
||||
this._loadingService.start();
|
||||
// TODO: Move this in service; dossiers states service should be a mapping service
|
||||
await firstValueFrom(this._activeDossiersService.loadAll());
|
||||
|
||||
try {
|
||||
|
||||
@ -133,7 +133,9 @@ export class DossierOverviewScreenComponent extends ListingComponent<File> imple
|
||||
)
|
||||
.subscribe();
|
||||
|
||||
this._fileDropOverlayService.initFileDropHandling(this.dossierId);
|
||||
if (this.currentDossier.isActive) {
|
||||
this._fileDropOverlayService.initFileDropHandling(this.dossierId);
|
||||
}
|
||||
|
||||
this.addSubscription = this.configService.listingMode$.subscribe(() => {
|
||||
this._computeAllFilters();
|
||||
|
||||
@ -14,7 +14,7 @@ export class DossierStateService extends EntitiesService<DossierState, IDossierS
|
||||
}
|
||||
|
||||
@Validate()
|
||||
setDossierState(@RequiredParam() body: IDossierState) {
|
||||
updateDossierState(@RequiredParam() body: IDossierState) {
|
||||
return this._post<unknown>(body, this._defaultModelPath);
|
||||
}
|
||||
|
||||
|
||||
@ -38,7 +38,10 @@ export class PermissionsService {
|
||||
|
||||
canEditFileAttributes(file: File): boolean {
|
||||
const dossier = this._getDossier(file);
|
||||
return ((file.isUnderReview || file.isNew) && this.isDossierMember(dossier)) || (file.isUnderApproval && this.isApprover(dossier));
|
||||
return (
|
||||
this._isActive(file) &&
|
||||
(((file.isUnderReview || file.isNew) && this.isDossierMember(dossier)) || (file.isUnderApproval && this.isApprover(dossier)))
|
||||
);
|
||||
}
|
||||
|
||||
canToggleAnalysis(file: File | File[]): boolean {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user