Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • dlcm/ui/dlcm-portal
1 result
Show changes
Showing
with 119 additions and 43 deletions
......@@ -4,6 +4,7 @@
<dlcm-admin-license-form #formPresentational
*ngIf="isReadyToBeDisplayedInCreateModeObs | async"
(submitChange)="create($event)"
(checkAvailableChange)="checkAvailable($event)"
(dirtyChange)="updateCanDeactivate($event)"
></dlcm-admin-license-form>
</div>
......@@ -5,11 +5,13 @@ import {
} from "@admin/license/stores/admin-license.state";
import {
ChangeDetectionStrategy,
ChangeDetectorRef,
Component,
ViewChild,
} from "@angular/core";
import {License} from "@app/generated-api";
import {
Actions,
Select,
Store,
} from "@ngxs/store";
......@@ -31,7 +33,9 @@ export class AdminLicenseCreateRoutable extends SharedAbstractCreateRoutable<Lic
@ViewChild("formPresentational", {static: false})
readonly formPresentational: SharedAbstractFormPresentational<License>;
constructor(protected store: Store) {
super(store, LocalStateEnum.admin_license, adminLicenseActionNameSpace, LocalStateEnum.admin);
constructor(protected readonly _store: Store,
protected readonly _actions$: Actions,
protected readonly _changeDetector: ChangeDetectorRef) {
super(_store, _actions$, _changeDetector, LocalStateEnum.admin_license, adminLicenseActionNameSpace, LocalStateEnum.admin);
}
}
......@@ -15,6 +15,7 @@
[model]="currentObs| async"
[readonly]="!isEdit"
(submitChange)="update($event)"
(checkAvailableChange)="checkAvailable($event)"
(dirtyChange)="updateCanDeactivate($event)"
></dlcm-admin-license-form>
</div>
......@@ -30,14 +30,14 @@ export class AdminLicenseDetailEditRoutable extends SharedAbstractDetailEditComm
@Select(AdminLicenseState.isLoadingWithDependency) isLoadingWithDependencyObs: Observable<boolean>;
@Select(AdminLicenseState.isReadyToBeDisplayed) isReadyToBeDisplayedObs: Observable<boolean>;
readonly KEY_PARAM_NAME: string = "name";
readonly KEY_PARAM_NAME: keyof License & string = "title";
constructor(protected _store: Store,
protected route: ActivatedRoute,
protected _route: ActivatedRoute,
protected readonly _actions$: Actions,
protected readonly _changeDetector: ChangeDetectorRef,
public dialog: MatDialog) {
super(_store, route, _actions$, _changeDetector, dialog, LocalStateEnum.admin_license, adminLicenseActionNameSpace, LocalStateEnum.admin);
public _dialog: MatDialog) {
super(_store, _route, _actions$, _changeDetector, _dialog, LocalStateEnum.admin_license, adminLicenseActionNameSpace, LocalStateEnum.admin);
}
getSubResourceWithParentId(id: string): void {
......
......@@ -5,9 +5,13 @@ import {
ChangeDetectorRef,
Component,
} from "@angular/core";
import {MatDialog} from "@angular/material/dialog";
import {ActivatedRoute} from "@angular/router";
import {License} from "@app/generated-api";
import {Store} from "@ngxs/store";
import {
Actions,
Store,
} from "@ngxs/store";
import {SharedAbstractListRoutable} from "@shared/components/routables/shared-abstract-list/shared-abstract-list.routable";
import {FieldTypeEnum} from "@shared/enums/field-type.enum";
import {LocalStateEnum} from "@shared/enums/local-state.enum";
......@@ -26,11 +30,22 @@ export class AdminLicenseListRoutable extends SharedAbstractListRoutable<License
readonly KEY_CREATE_BUTTON: string = TRANSLATE("admin.license.button.new");
readonly KEY_REFRESH_BUTTON: string = TRANSLATE("admin.license.button.refresh");
readonly KEY_BACK_BUTTON: string | undefined = TRANSLATE("admin.button.goBackToAdminHome");
readonly KEY_PARAM_NAME: keyof License & string = "title";
constructor(protected readonly _store: Store,
protected readonly _changeDetector: ChangeDetectorRef,
protected readonly _route: ActivatedRoute,
protected readonly _actions$: Actions,
protected readonly _dialog: MatDialog) {
super(_store, _changeDetector, _route, _actions$, _dialog, LocalStateEnum.admin_license, adminLicenseActionNameSpace, {}, LocalStateEnum.admin);
}
conditionDisplayEditButton(model: License | undefined): boolean {
return true;
}
constructor(protected store: Store,
protected _changeDetector: ChangeDetectorRef,
protected _route: ActivatedRoute) {
super(store, _changeDetector, _route, LocalStateEnum.admin_license, adminLicenseActionNameSpace, {}, LocalStateEnum.admin);
conditionDisplayDeleteButton(model: License | undefined): boolean {
return true;
}
defineColumns(): void {
......@@ -43,6 +58,14 @@ export class AdminLicenseListRoutable extends SharedAbstractListRoutable<License
isFilterable: true,
isSortable: true,
},
{
field: "openLicenseId",
header: TRANSLATE("admin.license.table.header.openLicenseId"),
type: FieldTypeEnum.string,
order: OrderEnum.none,
isFilterable: false,
isSortable: true,
},
];
}
}
......@@ -20,6 +20,7 @@
[solidifyValidation]="errors"
[formControl]="fd"
[required]="formValidationHelper.hasRequiredField(fd)"
(blur)="checkAvailable(formDefinition.name, fd)"
>
<mat-error #errors></mat-error>
</mat-form-field>
......
......@@ -8,12 +8,14 @@ import {
} from "@admin/oai-set/stores/admin-oai-set.state";
import {
ChangeDetectionStrategy,
ChangeDetectorRef,
Component,
ViewChild,
} from "@angular/core";
import {OrganizationalUnit} from "@app/generated-api";
import {OaiSetExtended} from "@deposit/models/oai-set-extended.model";
import {
Actions,
Select,
Store,
} from "@ngxs/store";
......@@ -36,17 +38,19 @@ import {
export class AdminOaiSetBulkCreateRoutable extends SharedAbstractCreateRoutable<OaiSetExtended, AdminOaiSetStateModel> {
@Select(AdminOaiSetState.isLoadingWithDependency) isLoadingWithDependencyObs: Observable<boolean>;
@Select(AdminOaiSetState.isReadyToBeDisplayedInCreateMode) isReadyToBeDisplayedInCreateModeObs: Observable<boolean>;
listOrgUnit: Observable<OrganizationalUnit[]> = ResourceState.list(this.store, SharedOrganizationalUnitState);
listOrgUnit: Observable<OrganizationalUnit[]> = ResourceState.list(this._store, SharedOrganizationalUnitState);
@ViewChild("formPresentational", {static: false})
readonly formPresentational: SharedAbstractFormPresentational<OaiSetExtended>;
constructor(protected store: Store) {
super(store, LocalStateEnum.admin_oaiSet, adminOaiSetActionNameSpace, LocalStateEnum.admin);
constructor(protected readonly _store: Store,
protected readonly _actions$: Actions,
protected readonly _changeDetector: ChangeDetectorRef) {
super(_store, _actions$, _changeDetector, LocalStateEnum.admin_oaiSet, adminOaiSetActionNameSpace, LocalStateEnum.admin);
}
create(modelFormControlEvent: ModelFormControlEvent<OaiSetExtended>): void {
super.saveInProgress();
this.store.dispatch(new AdminOaiSetAction.BulkCreate(modelFormControlEvent.model.organizationalUnits));
this._store.dispatch(new AdminOaiSetAction.BulkCreate(modelFormControlEvent.model.organizationalUnits));
}
}
......@@ -4,6 +4,7 @@
<dlcm-admin-oai-set-form #formPresentational
*ngIf="isReadyToBeDisplayedInCreateModeObs | async"
(submitChange)="create($event)"
(checkAvailableChange)="checkAvailable($event)"
(dirtyChange)="updateCanDeactivate($event)"
></dlcm-admin-oai-set-form>
</div>
......@@ -5,11 +5,13 @@ import {
} from "@admin/oai-set/stores/admin-oai-set.state";
import {
ChangeDetectionStrategy,
ChangeDetectorRef,
Component,
ViewChild,
} from "@angular/core";
import {OaiSet} from "@app/generated-api";
import {
Actions,
Select,
Store,
} from "@ngxs/store";
......@@ -25,13 +27,15 @@ import {Observable} from "rxjs";
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class AdminOaiSetCreateRoutable extends SharedAbstractCreateRoutable<OaiSet, AdminOaiSetStateModel> {
@Select (AdminOaiSetState.isLoadingWithDependency) isLoadingWithDependencyObs: Observable<boolean>;
@Select (AdminOaiSetState.isReadyToBeDisplayedInCreateMode) isReadyToBeDisplayedInCreateModeObs: Observable<boolean>;
@Select(AdminOaiSetState.isLoadingWithDependency) isLoadingWithDependencyObs: Observable<boolean>;
@Select(AdminOaiSetState.isReadyToBeDisplayedInCreateMode) isReadyToBeDisplayedInCreateModeObs: Observable<boolean>;
@ViewChild("formPresentational", {static: false})
readonly formPresentational: SharedAbstractFormPresentational<OaiSet>;
constructor(protected store: Store) {
super(store, LocalStateEnum.admin_oaiSet, adminOaiSetActionNameSpace, LocalStateEnum.admin);
constructor(protected readonly _store: Store,
protected readonly _actions$: Actions,
protected readonly _changeDetector: ChangeDetectorRef) {
super(_store, _actions$, _changeDetector, LocalStateEnum.admin_oaiSet, adminOaiSetActionNameSpace, LocalStateEnum.admin);
}
}
......@@ -15,6 +15,7 @@
[model]="currentObs | async"
[readonly]="!isEdit"
(submitChange)="update($event)"
(checkAvailableChange)="checkAvailable($event)"
(dirtyChange)="updateCanDeactivate($event)"
></dlcm-admin-oai-set-form>
</div>
......@@ -10,9 +10,7 @@ import {
} from "@angular/core";
import {MatDialog} from "@angular/material";
import {ActivatedRoute} from "@angular/router";
import {
OaiSet,
} from "@app/generated-api";
import {OaiSet} from "@app/generated-api";
import {
Actions,
Select,
......@@ -32,14 +30,14 @@ export class AdminOaiSetDetailEditRoutable extends SharedAbstractDetailEditCommo
@Select(AdminOaiSetState.isLoadingWithDependency) isLoadingWithDependencyObs: Observable<boolean>;
@Select(AdminOaiSetState.isReadyToBeDisplayed) isReadyToBeDisplayedObs: Observable<boolean>;
readonly KEY_PARAM_NAME: string = "name";
readonly KEY_PARAM_NAME: keyof OaiSet & string = "name";
constructor(protected _store: Store,
protected route: ActivatedRoute,
protected _route: ActivatedRoute,
protected readonly _actions$: Actions,
protected readonly _changeDetector: ChangeDetectorRef,
public dialog: MatDialog) {
super(_store, route, _actions$, _changeDetector, dialog, LocalStateEnum.admin_oaiSet, adminOaiSetActionNameSpace, LocalStateEnum.admin);
public _dialog: MatDialog) {
super(_store, _route, _actions$, _changeDetector, _dialog, LocalStateEnum.admin_oaiSet, adminOaiSetActionNameSpace, LocalStateEnum.admin);
}
getSubResourceWithParentId(id: string): void {
......
......@@ -5,9 +5,13 @@ import {
ChangeDetectorRef,
Component,
} from "@angular/core";
import {MatDialog} from "@angular/material/dialog";
import {ActivatedRoute} from "@angular/router";
import {OaiSet} from "@app/generated-api";
import {Store} from "@ngxs/store";
import {
Actions,
Store,
} from "@ngxs/store";
import {SharedAbstractListRoutable} from "@shared/components/routables/shared-abstract-list/shared-abstract-list.routable";
import {FieldTypeEnum} from "@shared/enums/field-type.enum";
import {LocalStateEnum} from "@shared/enums/local-state.enum";
......@@ -27,11 +31,14 @@ export class AdminOaiSetListRoutable extends SharedAbstractListRoutable<OaiSet,
readonly KEY_CREATE_BUTTON: string = TRANSLATE("admin.oai-set.button.new");
readonly KEY_REFRESH_BUTTON: string = TRANSLATE("admin.oai-set.button.refresh");
readonly KEY_BACK_BUTTON: string | undefined = TRANSLATE("admin.button.goBackToAdminHome");
readonly KEY_PARAM_NAME: keyof OaiSet & string = "name";
constructor(protected store: Store,
protected _changeDetector: ChangeDetectorRef,
protected _route: ActivatedRoute) {
super(store, _changeDetector, _route, LocalStateEnum.admin_oaiSet, adminOaiSetActionNameSpace, {
constructor(protected readonly _store: Store,
protected readonly _changeDetector: ChangeDetectorRef,
protected readonly _route: ActivatedRoute,
protected readonly _actions$: Actions,
protected readonly _dialog: MatDialog) {
super(_store, _changeDetector, _route, _actions$, _dialog, LocalStateEnum.admin_oaiSet, adminOaiSetActionNameSpace, {
listExtraButtons: [
{
color: "primary",
......@@ -43,6 +50,14 @@ export class AdminOaiSetListRoutable extends SharedAbstractListRoutable<OaiSet,
}, LocalStateEnum.admin);
}
conditionDisplayEditButton(model: OaiSet | undefined): boolean {
return true;
}
conditionDisplayDeleteButton(model: OaiSet | undefined): boolean {
return true;
}
defineColumns(): void {
this.columns = [
{
......
......@@ -10,6 +10,7 @@
[formControl]="fd"
[solidifyValidation]="errors"
[required]="formValidationHelper.hasRequiredField(fd)"
(blur)="checkAvailable(formDefinition.name, fd)"
>
<mat-error #errors></mat-error>
</mat-form-field>
......
......@@ -4,6 +4,7 @@
<dlcm-admin-oauth-form #formPresentational
*ngIf="isReadyToBeDisplayedInCreateModeObs | async"
(submitChange)="create($event)"
(checkAvailableChange)="checkAvailable($event)"
(dirtyChange)="updateCanDeactivate($event)"
>
</dlcm-admin-oauth-form>
......
......@@ -5,12 +5,14 @@ import {
} from "@admin/oauth2-client/stores/admin-oauth2-client.state";
import {
ChangeDetectionStrategy,
ChangeDetectorRef,
Component,
OnInit,
ViewChild,
} from "@angular/core";
import {Oauth2Client} from "@app/generated-api";
import {
Actions,
Select,
Store,
} from "@ngxs/store";
......@@ -32,8 +34,10 @@ export class AdminOauth2ClientCreateRoutable extends SharedAbstractCreateRoutabl
@ViewChild("formPresentational", {static: false})
readonly formPresentational: SharedAbstractFormPresentational<Oauth2Client>;
constructor(protected store: Store) {
super(store, LocalStateEnum.admin_oauth2Client, adminOAuth2ClientActionNameSpace, LocalStateEnum.admin);
constructor(protected readonly _store: Store,
protected readonly _actions$: Actions,
protected readonly _changeDetector: ChangeDetectorRef) {
super(_store, _actions$, _changeDetector, LocalStateEnum.admin_oauth2Client, adminOAuth2ClientActionNameSpace, LocalStateEnum.admin);
}
ngOnInit(): void {
......
......@@ -15,6 +15,7 @@
[model]="currentObs| async"
[readonly]="!isEdit"
(submitChange)="update($event)"
(checkAvailableChange)="checkAvailable($event)"
(dirtyChange)="updateCanDeactivate($event)"
>
</dlcm-admin-oauth-form>
......
......@@ -30,14 +30,14 @@ export class AdminOauth2ClientDetailEditRoutable extends SharedAbstractDetailEdi
@Select(AdminOAuth2ClientState.isLoadingWithDependency) isLoadingWithDependencyObs: Observable<boolean>;
@Select(AdminOAuth2ClientState.isReadyToBeDisplayed) isReadyToBeDisplayedObs: Observable<boolean>;
readonly KEY_PARAM_NAME: string = "name";
readonly KEY_PARAM_NAME: keyof Oauth2Client & string = "name";
constructor(protected _store: Store,
protected route: ActivatedRoute,
protected _route: ActivatedRoute,
protected readonly _actions$: Actions,
protected readonly _changeDetector: ChangeDetectorRef,
public dialog: MatDialog) {
super(_store, route, _actions$, _changeDetector, dialog, LocalStateEnum.admin_oauth2Client, adminOAuth2ClientActionNameSpace, LocalStateEnum.admin);
public _dialog: MatDialog) {
super(_store, _route, _actions$, _changeDetector, _dialog, LocalStateEnum.admin_oauth2Client, adminOAuth2ClientActionNameSpace, LocalStateEnum.admin);
}
getSubResourceWithParentId(id: string): void {
......
......@@ -5,9 +5,13 @@ import {
ChangeDetectorRef,
Component,
} from "@angular/core";
import {MatDialog} from "@angular/material/dialog";
import {ActivatedRoute} from "@angular/router";
import {Oauth2Client} from "@app/generated-api";
import {Store} from "@ngxs/store";
import {
Actions,
Store,
} from "@ngxs/store";
import {SharedAbstractListRoutable} from "@shared/components/routables/shared-abstract-list/shared-abstract-list.routable";
import {FieldTypeEnum} from "@shared/enums/field-type.enum";
import {LocalStateEnum} from "@shared/enums/local-state.enum";
......@@ -26,11 +30,22 @@ export class AdminOAuth2ClientListRoutable extends SharedAbstractListRoutable<Oa
readonly KEY_CREATE_BUTTON: string = TRANSLATE("admin.oauth2.button.new");
readonly KEY_REFRESH_BUTTON: string = TRANSLATE("admin.oauth2.button.refresh");
readonly KEY_BACK_BUTTON: string | undefined = TRANSLATE("admin.button.goBackToAdminHome");
readonly KEY_PARAM_NAME: keyof Oauth2Client & string = "name";
constructor(protected readonly _store: Store,
protected readonly _changeDetector: ChangeDetectorRef,
protected readonly _route: ActivatedRoute,
protected readonly _actions$: Actions,
protected readonly _dialog: MatDialog) {
super(_store, _changeDetector, _route, _actions$, _dialog, LocalStateEnum.admin_oauth2Client, adminOAuth2ClientActionNameSpace, {}, LocalStateEnum.admin);
}
conditionDisplayEditButton(model: Oauth2Client | undefined): boolean {
return true;
}
constructor(protected store: Store,
protected _changeDetector: ChangeDetectorRef,
protected _route: ActivatedRoute) {
super(store, _changeDetector, _route, LocalStateEnum.admin_oauth2Client, adminOAuth2ClientActionNameSpace, {}, LocalStateEnum.admin);
conditionDisplayDeleteButton(model: Oauth2Client | undefined): boolean {
return true;
}
defineColumns(): void {
......
......@@ -7,10 +7,10 @@
<mat-form-field *ngIf="getFormControl(formDefinition.name) as fd">
<input [formControl]="fd"
[solidifyValidation]="errors"
solidifyValidation
matInput
[placeholder]="'admin.organizationalUnit.form.name' | translate"
[required]="formValidationHelper.hasRequiredField(fd)"
(blur)="checkAvailable(formDefinition.name, fd)"
>
<mat-error #errors></mat-error>
</mat-form-field>
......
......@@ -13,6 +13,7 @@
(submitChange)="create($event)"
[selectedFundingAgencies]="selectedFundingAgenciesObs | async"
[selectedInstitutions]="selectedInstitutionsObs | async"
(checkAvailableChange)="checkAvailable($event)"
(dirtyChange)="updateCanDeactivate($event)"
>
</dlcm-admin-orgunit-form>
......