myrtex-mf-competition 1.0.94-beta.2 → 1.0.96
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -16
- package/esm2020/lib/modules/competition-header/components/competition-header.component.mjs +14 -18
- package/esm2020/lib/modules/competition-header/constants/competition-permission.constants.mjs +3 -1
- package/esm2020/lib/modules/competition-header/services/competition-header.service.mjs +27 -7
- package/fesm2015/myrtex-mf-competition.mjs +41 -25
- package/fesm2015/myrtex-mf-competition.mjs.map +1 -1
- package/fesm2020/myrtex-mf-competition.mjs +40 -25
- package/fesm2020/myrtex-mf-competition.mjs.map +1 -1
- package/lib/modules/competition-header/constants/competition-permission.constants.d.ts +2 -0
- package/lib/modules/competition-header/services/competition-header.service.d.ts +5 -1
- package/package.json +1 -1
|
@@ -7,7 +7,7 @@ import { createEffect, ofType, EffectsModule } from '@ngrx/effects';
|
|
|
7
7
|
import * as i2 from '@ngrx/store';
|
|
8
8
|
import { createAction, props, createFeatureSelector, createSelector, select, createReducer, on, StoreModule } from '@ngrx/store';
|
|
9
9
|
import * as i3 from 'myrtex-mf-ui-composite';
|
|
10
|
-
import { selectCompetitionIdAndVersionId, EndpointBaseService, UnSubscriber, CompetitionStatusEnum, CancelCompetitionTypeEnum, CompetitionVersionStatusEnum, CompetitionVersionStatusEnumLabel, CompetitionStatusEnumLabel, CompetitionModeEnum, selectCompetitionLabel, selectCompetitionConfig,
|
|
10
|
+
import { selectCompetitionIdAndVersionId, EndpointBaseService, UnSubscriber, CompetitionStatusEnum, CancelCompetitionTypeEnum, CompetitionVersionStatusEnum, CompetitionVersionStatusEnumLabel, CompetitionStatusEnumLabel, CompetitionModeEnum, selectCompetitionLabel, selectCompetitionConfig, CompetitionVersionStatusGrouppingLabel, DialogColor, DialogType, MessageSeverity, CompetitionTypeEnum, selectCompetitionId, selectVersionId, Utilities, TenantSettingsModule, MyrtexUiComponentsModule, MyrtexMfUiCompositeModule } from 'myrtex-mf-ui-composite';
|
|
11
11
|
import * as i1$1 from 'myrtex-mf-signer';
|
|
12
12
|
import { MyrtexSignerModule } from 'myrtex-mf-signer';
|
|
13
13
|
import * as i1 from '@angular/common/http';
|
|
@@ -20,7 +20,7 @@ import * as i7 from 'myrtex-mf-ui';
|
|
|
20
20
|
import { DropdownModule, CdkTooltipModule } from 'myrtex-mf-ui';
|
|
21
21
|
import * as i9 from '@angular/forms';
|
|
22
22
|
import { FormsModule } from '@angular/forms';
|
|
23
|
-
import { EMPTY } from 'rxjs';
|
|
23
|
+
import { Subject, EMPTY } from 'rxjs';
|
|
24
24
|
import { withLatestFrom, switchMap, map, catchError, tap } from 'rxjs/operators';
|
|
25
25
|
|
|
26
26
|
var ECompetitionHeaderActions;
|
|
@@ -91,7 +91,9 @@ const CAN_CREATE_COMPETITION_VERSION = 'can-create-competition-version';
|
|
|
91
91
|
const CAN_AGREEMENT_COMPETITION = 'can-agreement-competition';
|
|
92
92
|
const CAN_PUBLIC_COMPETITION = 'can-public-competition';
|
|
93
93
|
const CAN_CANCEL_COMPETITION = 'can-cancel-competition';
|
|
94
|
-
const CAN_COMPLETE_COMPETITION = 'can-complete-competition';
|
|
94
|
+
const CAN_COMPLETE_COMPETITION = 'can-complete-competition';
|
|
95
|
+
const CAN_VIEW_COMPETITION_SETTINGS_ANY_STATUS = 'can-view-competition-settings-any-status';
|
|
96
|
+
const CAN_VIEW_COMPETITION_SETTINGS_PUBLIC_STATUS = 'can-view-competition-settings-public-status';
|
|
95
97
|
|
|
96
98
|
class SettingsService extends EndpointBaseService {
|
|
97
99
|
constructor(http, injector) {
|
|
@@ -275,6 +277,16 @@ class LibCompetitionHeaderComponent extends UnSubscriber {
|
|
|
275
277
|
this.appendSubscription(this.store.pipe(select(selectCompetitionStatus)).subscribe(result => {
|
|
276
278
|
if (result) {
|
|
277
279
|
this.competition = result;
|
|
280
|
+
this._accessService.checkPermission(this.getAccessControl(CAN_AGREEMENT_COMPETITION))
|
|
281
|
+
.subscribe(result => this._canAgreementVersionAccess = true); // TODO true => result
|
|
282
|
+
this._accessService.checkPermission(this.getAccessControl(CAN_CREATE_COMPETITION_VERSION))
|
|
283
|
+
.subscribe(result => this._canCreateVersionAccess = true); // TODO true => result
|
|
284
|
+
this._accessService.checkPermission(this.getAccessControl(CAN_PUBLIC_COMPETITION))
|
|
285
|
+
.subscribe(result => this._canPublicVersionAccess = true); // TODO true => result
|
|
286
|
+
this._accessService.checkPermission(this.getAccessControl(CAN_COMPLETE_COMPETITION))
|
|
287
|
+
.subscribe(result => this._canCompleteEntityAccess = true); // TODO true => result
|
|
288
|
+
this._accessService.checkPermission(this.getAccessControl(CAN_CANCEL_COMPETITION))
|
|
289
|
+
.subscribe(result => this._canCancelEntityAccess = true); // TODO true => result
|
|
278
290
|
}
|
|
279
291
|
}));
|
|
280
292
|
this.appendSubscription(this.store.pipe(select(selectCompetitionType)).subscribe(result => {
|
|
@@ -318,20 +330,6 @@ class LibCompetitionHeaderComponent extends UnSubscriber {
|
|
|
318
330
|
}, 10000);
|
|
319
331
|
}
|
|
320
332
|
}));
|
|
321
|
-
this.appendSubscription(this.store.pipe(select(selectUserInfo)).subscribe(result => {
|
|
322
|
-
if (result) {
|
|
323
|
-
this._accessService.checkPermission(this.getAccessControl(CAN_AGREEMENT_COMPETITION))
|
|
324
|
-
.subscribe(result => this._canAgreementVersionAccess = true);
|
|
325
|
-
this._accessService.checkPermission(this.getAccessControl(CAN_CREATE_COMPETITION_VERSION))
|
|
326
|
-
.subscribe(result => this._canCreateVersionAccess = true);
|
|
327
|
-
this._accessService.checkPermission(this.getAccessControl(CAN_PUBLIC_COMPETITION))
|
|
328
|
-
.subscribe(result => this._canPublicVersionAccess = true);
|
|
329
|
-
this._accessService.checkPermission(this.getAccessControl(CAN_COMPLETE_COMPETITION))
|
|
330
|
-
.subscribe(result => this._canCompleteEntityAccess = true);
|
|
331
|
-
this._accessService.checkPermission(this.getAccessControl(CAN_CANCEL_COMPETITION))
|
|
332
|
-
.subscribe(result => this._canCancelEntityAccess = true);
|
|
333
|
-
}
|
|
334
|
-
}));
|
|
335
333
|
this.settingsService.getSelelectionEditEbLinks().subscribe(res => {
|
|
336
334
|
this._ebLinksModel = res;
|
|
337
335
|
});
|
|
@@ -392,8 +390,8 @@ class LibCompetitionHeaderComponent extends UnSubscriber {
|
|
|
392
390
|
title: 'Направление документа на согласование',
|
|
393
391
|
okLabel: 'Отправить',
|
|
394
392
|
cancelLabel: 'Отменить',
|
|
395
|
-
pdfUrl: `/m-data/minfin/pdf-competition/${selectedItem.id}`,
|
|
396
|
-
xmlUrl: `/m-data/minfin/xml-competition/${selectedItem.id}`,
|
|
393
|
+
pdfUrl: `/m-data/minfin/pdf-competition/${this.competition?.id}?versionId=${selectedItem.id}`,
|
|
394
|
+
xmlUrl: `/m-data/minfin/xml-competition/${this.competition?.id}?versionId=${selectedItem.id}`,
|
|
397
395
|
provider: 'empty'
|
|
398
396
|
}, () => {
|
|
399
397
|
this.alertService.showMessage('', 'Ожидайте. Выполняется отправка на согласование.', MessageSeverity.wait);
|
|
@@ -598,14 +596,21 @@ function competitionHeaderReducer(state, action) {
|
|
|
598
596
|
}
|
|
599
597
|
|
|
600
598
|
class CompetitionHeaderService extends EndpointBaseService {
|
|
601
|
-
constructor(http, injector) {
|
|
599
|
+
constructor(http, injector, _accessService) {
|
|
602
600
|
super(http, injector);
|
|
601
|
+
this._accessService = _accessService;
|
|
603
602
|
this.url = '/application' + this.restPath + '/competition';
|
|
604
603
|
}
|
|
605
604
|
getHeader(competitionId, versionId) {
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
605
|
+
const subject = new Subject();
|
|
606
|
+
this._accessService.checkPermission(this.getAccessControl(CAN_VIEW_COMPETITION_SETTINGS_ANY_STATUS, (competitionId ?? '')))
|
|
607
|
+
.subscribe(anyVersionAccess => {
|
|
608
|
+
const statusSuffix = anyVersionAccess ? '' : '/public';
|
|
609
|
+
const params = this.getHttpVersionParam(versionId ?? '', anyVersionAccess);
|
|
610
|
+
this.http.get(`${this.url}/${competitionId}/header${statusSuffix}`, { params })
|
|
611
|
+
.subscribe(header => subject.next(header));
|
|
612
|
+
});
|
|
613
|
+
return subject.asObservable();
|
|
609
614
|
}
|
|
610
615
|
createVersion(competitionId) {
|
|
611
616
|
return this.http.post(`${this.url}/${competitionId}/version`, {});
|
|
@@ -628,12 +633,22 @@ class CompetitionHeaderService extends EndpointBaseService {
|
|
|
628
633
|
cancel(competitionId) {
|
|
629
634
|
return this.http.post(`${this.url}/${competitionId}/cancel`, {});
|
|
630
635
|
}
|
|
636
|
+
getAccessControl(permission, entityId) {
|
|
637
|
+
return {
|
|
638
|
+
permission,
|
|
639
|
+
objectType: COMPETITION_ENTITY_NAME,
|
|
640
|
+
objectId: entityId
|
|
641
|
+
};
|
|
642
|
+
}
|
|
643
|
+
getHttpVersionParam(versionId, anyVersionAccess) {
|
|
644
|
+
return anyVersionAccess && !!versionId ? new HttpParams().set('versionId', versionId) : undefined;
|
|
645
|
+
}
|
|
631
646
|
}
|
|
632
|
-
CompetitionHeaderService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: CompetitionHeaderService, deps: [{ token: i1.HttpClient }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
647
|
+
CompetitionHeaderService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: CompetitionHeaderService, deps: [{ token: i1.HttpClient }, { token: i0.Injector }, { token: i5.AccessService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
633
648
|
CompetitionHeaderService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: CompetitionHeaderService });
|
|
634
649
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: CompetitionHeaderService, decorators: [{
|
|
635
650
|
type: Injectable
|
|
636
|
-
}], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: i0.Injector }]; } });
|
|
651
|
+
}], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: i0.Injector }, { type: i5.AccessService }]; } });
|
|
637
652
|
|
|
638
653
|
class CompetitionHeaderEffects {
|
|
639
654
|
constructor(competitionHeaderService, actions$, store, alertService) {
|