From 88e8aff5202d544f60ad485e1cd0b32a85bfa5c2 Mon Sep 17 00:00:00 2001 From: fcv-iteratorIt <123963294+fcv-iteratorIt@users.noreply.github.com> Date: Mon, 26 Jun 2023 14:08:29 +0200 Subject: [PATCH 1/2] It is now possible to add permission to application on creation (#138) --- .../permission-edit.component.html | 12 +++- src/app/applications/application.model.ts | 2 + .../form-body-application.component.html | 40 ++++++++--- .../form-body-application.component.ts | 72 ++++++++++++++++++- .../shared/components/forms/form.module.ts | 10 +-- src/assets/i18n/da.json | 4 +- 6 files changed, 118 insertions(+), 22 deletions(-) diff --git a/src/app/admin/permission/permission-edit/permission-edit.component.html b/src/app/admin/permission/permission-edit/permission-edit.component.html index af8876ae4..7ab628f45 100644 --- a/src/app/admin/permission/permission-edit/permission-edit.component.html +++ b/src/app/admin/permission/permission-edit/permission-edit.component.html @@ -67,9 +67,15 @@
- + {{app.name}} diff --git a/src/app/applications/application.model.ts b/src/app/applications/application.model.ts index 5b796a68b..3282eb415 100644 --- a/src/app/applications/application.model.ts +++ b/src/app/applications/application.model.ts @@ -30,6 +30,7 @@ export class Application { public hardware?: string; public controlledProperties?: ControlledProperty[]; public deviceTypes?: ApplicationDeviceType[]; + public permissionIds: number[]; } export class ApplicationRequest { @@ -48,6 +49,7 @@ export class ApplicationRequest { public hardware?: string; public controlledProperties?: ControlledPropertyTypes[]; public deviceTypes?: ApplicationDeviceTypeUnion[]; + public permissionIds: number[]; } export interface ApplicationData { diff --git a/src/app/shared/components/forms/form-body-application/form-body-application.component.html b/src/app/shared/components/forms/form-body-application/form-body-application.component.html index 344131afd..d5256f0bf 100644 --- a/src/app/shared/components/forms/form-body-application/form-body-application.component.html +++ b/src/app/shared/components/forms/form-body-application/form-body-application.component.html @@ -24,9 +24,27 @@ [ngClass]="{'is-invalid' : formFailedSubmit && errorFields.includes('description'), 'is-valid' : formFailedSubmit && !errorFields.includes('description')}">
+
+ + + + + {{permission.name}} + + + {{'QUESTION.APPLICATION.PERMISSION-HINT' | translate}} +
+
- - {{'APPLICATION.METADATA-FIELD.STATUS' | translate}} + {{statusOption.label}} @@ -37,7 +55,7 @@
- + {{'QUESTION.APPLICATION.START-DATE-PLACEHOLDER' | translate}} - + {{'QUESTION.APPLICATION.END-DATE-PLACEHOLDER' | translate}}
- +
- +
-