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) {
|
|
@@ -287,6 +289,16 @@ class LibCompetitionHeaderComponent extends UnSubscriber {
|
|
|
287
289
|
this.appendSubscription(this.store.pipe(select(selectCompetitionStatus)).subscribe(result => {
|
|
288
290
|
if (result) {
|
|
289
291
|
this.competition = result;
|
|
292
|
+
this._accessService.checkPermission(this.getAccessControl(CAN_AGREEMENT_COMPETITION))
|
|
293
|
+
.subscribe(result => this._canAgreementVersionAccess = true); // TODO true => result
|
|
294
|
+
this._accessService.checkPermission(this.getAccessControl(CAN_CREATE_COMPETITION_VERSION))
|
|
295
|
+
.subscribe(result => this._canCreateVersionAccess = true); // TODO true => result
|
|
296
|
+
this._accessService.checkPermission(this.getAccessControl(CAN_PUBLIC_COMPETITION))
|
|
297
|
+
.subscribe(result => this._canPublicVersionAccess = true); // TODO true => result
|
|
298
|
+
this._accessService.checkPermission(this.getAccessControl(CAN_COMPLETE_COMPETITION))
|
|
299
|
+
.subscribe(result => this._canCompleteEntityAccess = true); // TODO true => result
|
|
300
|
+
this._accessService.checkPermission(this.getAccessControl(CAN_CANCEL_COMPETITION))
|
|
301
|
+
.subscribe(result => this._canCancelEntityAccess = true); // TODO true => result
|
|
290
302
|
}
|
|
291
303
|
}));
|
|
292
304
|
this.appendSubscription(this.store.pipe(select(selectCompetitionType)).subscribe(result => {
|
|
@@ -330,20 +342,6 @@ class LibCompetitionHeaderComponent extends UnSubscriber {
|
|
|
330
342
|
}, 10000);
|
|
331
343
|
}
|
|
332
344
|
}));
|
|
333
|
-
this.appendSubscription(this.store.pipe(select(selectUserInfo)).subscribe(result => {
|
|
334
|
-
if (result) {
|
|
335
|
-
this._accessService.checkPermission(this.getAccessControl(CAN_AGREEMENT_COMPETITION))
|
|
336
|
-
.subscribe(result => this._canAgreementVersionAccess = true);
|
|
337
|
-
this._accessService.checkPermission(this.getAccessControl(CAN_CREATE_COMPETITION_VERSION))
|
|
338
|
-
.subscribe(result => this._canCreateVersionAccess = true);
|
|
339
|
-
this._accessService.checkPermission(this.getAccessControl(CAN_PUBLIC_COMPETITION))
|
|
340
|
-
.subscribe(result => this._canPublicVersionAccess = true);
|
|
341
|
-
this._accessService.checkPermission(this.getAccessControl(CAN_COMPLETE_COMPETITION))
|
|
342
|
-
.subscribe(result => this._canCompleteEntityAccess = true);
|
|
343
|
-
this._accessService.checkPermission(this.getAccessControl(CAN_CANCEL_COMPETITION))
|
|
344
|
-
.subscribe(result => this._canCancelEntityAccess = true);
|
|
345
|
-
}
|
|
346
|
-
}));
|
|
347
345
|
this.settingsService.getSelelectionEditEbLinks().subscribe(res => {
|
|
348
346
|
this._ebLinksModel = res;
|
|
349
347
|
});
|
|
@@ -400,12 +398,13 @@ class LibCompetitionHeaderComponent extends UnSubscriber {
|
|
|
400
398
|
const selectedItem = this.selected;
|
|
401
399
|
if (this.validateVersionAction) {
|
|
402
400
|
this.validateVersionAction(selectedItem.id, () => {
|
|
401
|
+
var _a, _b;
|
|
403
402
|
this.signService.sign({
|
|
404
403
|
title: 'Направление документа на согласование',
|
|
405
404
|
okLabel: 'Отправить',
|
|
406
405
|
cancelLabel: 'Отменить',
|
|
407
|
-
pdfUrl: `/m-data/minfin/pdf-competition/${selectedItem.id}`,
|
|
408
|
-
xmlUrl: `/m-data/minfin/xml-competition/${selectedItem.id}`,
|
|
406
|
+
pdfUrl: `/m-data/minfin/pdf-competition/${(_a = this.competition) === null || _a === void 0 ? void 0 : _a.id}?versionId=${selectedItem.id}`,
|
|
407
|
+
xmlUrl: `/m-data/minfin/xml-competition/${(_b = this.competition) === null || _b === void 0 ? void 0 : _b.id}?versionId=${selectedItem.id}`,
|
|
409
408
|
provider: 'empty'
|
|
410
409
|
}, () => {
|
|
411
410
|
this.alertService.showMessage('', 'Ожидайте. Выполняется отправка на согласование.', MessageSeverity.wait);
|
|
@@ -606,14 +605,21 @@ function competitionHeaderReducer(state, action) {
|
|
|
606
605
|
}
|
|
607
606
|
|
|
608
607
|
class CompetitionHeaderService extends EndpointBaseService {
|
|
609
|
-
constructor(http, injector) {
|
|
608
|
+
constructor(http, injector, _accessService) {
|
|
610
609
|
super(http, injector);
|
|
610
|
+
this._accessService = _accessService;
|
|
611
611
|
this.url = '/application' + this.restPath + '/competition';
|
|
612
612
|
}
|
|
613
613
|
getHeader(competitionId, versionId) {
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
614
|
+
const subject = new Subject();
|
|
615
|
+
this._accessService.checkPermission(this.getAccessControl(CAN_VIEW_COMPETITION_SETTINGS_ANY_STATUS, (competitionId !== null && competitionId !== void 0 ? competitionId : '')))
|
|
616
|
+
.subscribe(anyVersionAccess => {
|
|
617
|
+
const statusSuffix = anyVersionAccess ? '' : '/public';
|
|
618
|
+
const params = this.getHttpVersionParam(versionId !== null && versionId !== void 0 ? versionId : '', anyVersionAccess);
|
|
619
|
+
this.http.get(`${this.url}/${competitionId}/header${statusSuffix}`, { params })
|
|
620
|
+
.subscribe(header => subject.next(header));
|
|
621
|
+
});
|
|
622
|
+
return subject.asObservable();
|
|
617
623
|
}
|
|
618
624
|
createVersion(competitionId) {
|
|
619
625
|
return this.http.post(`${this.url}/${competitionId}/version`, {});
|
|
@@ -636,12 +642,22 @@ class CompetitionHeaderService extends EndpointBaseService {
|
|
|
636
642
|
cancel(competitionId) {
|
|
637
643
|
return this.http.post(`${this.url}/${competitionId}/cancel`, {});
|
|
638
644
|
}
|
|
645
|
+
getAccessControl(permission, entityId) {
|
|
646
|
+
return {
|
|
647
|
+
permission,
|
|
648
|
+
objectType: COMPETITION_ENTITY_NAME,
|
|
649
|
+
objectId: entityId
|
|
650
|
+
};
|
|
651
|
+
}
|
|
652
|
+
getHttpVersionParam(versionId, anyVersionAccess) {
|
|
653
|
+
return anyVersionAccess && !!versionId ? new HttpParams().set('versionId', versionId) : undefined;
|
|
654
|
+
}
|
|
639
655
|
}
|
|
640
|
-
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 });
|
|
656
|
+
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 });
|
|
641
657
|
CompetitionHeaderService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: CompetitionHeaderService });
|
|
642
658
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: CompetitionHeaderService, decorators: [{
|
|
643
659
|
type: Injectable
|
|
644
|
-
}], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: i0.Injector }]; } });
|
|
660
|
+
}], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: i0.Injector }, { type: i5.AccessService }]; } });
|
|
645
661
|
|
|
646
662
|
class CompetitionHeaderEffects {
|
|
647
663
|
constructor(competitionHeaderService, actions$, store, alertService) {
|