Skip to content

Commit

Permalink
#817 - Ownership Functionality - Done
Browse files Browse the repository at this point in the history
  • Loading branch information
suvarnakale committed Oct 13, 2023
1 parent b5cb4a3 commit e431dc8
Show file tree
Hide file tree
Showing 6 changed files with 235 additions and 91 deletions.
2 changes: 2 additions & 0 deletions src/app/admin/create-entity/create-entity.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,8 @@ <h3 class="heading-5">{{'SAVE_CONFIGURATION' | translate}}</h3>
<button *ngIf="isActive == 'create-vc'" (click)="saveAsDraftMsg()"
class="btn fw-bold float-end bg-color-primary bg-color-primary-sm px-3 my-2 ml-2 mr-2 text-white">{{'SAVE_AS_DRAFT' | translate}}</button>
&nbsp;
<button (click)="nextStep()" *ngIf="isActive == 'ownership' "
class="fs-14 fw-bold float-end btn bg-color-secondary submit-button color-sec px-3 my-2 ml-2 mr-2 ">{{'SKIP' | translate}}</button> &nbsp;
</div>
</div>
</footer>
Expand Down
4 changes: 2 additions & 2 deletions src/app/admin/create-entity/create-entity.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1945,8 +1945,8 @@ export class CreateEntityComponent implements OnInit, AfterContentChecked {
}

saveOwnershipAttributes(moveNext = false) {
this.OwnershipComp.submitOwnershipForm();
moveNext ? this.nextStep() : this.saveAsDraftMsg();
let toMoveNext = this.OwnershipComp.submitOwnershipForm(moveNext);
(moveNext ? (toMoveNext ? this.nextStep() : undefined) : (toMoveNext ? undefined : this.saveAsDraftMsg()));
}

saveConfigWorkflow(moveNext = false) {
Expand Down
44 changes: 23 additions & 21 deletions src/app/admin/ownership/ownership.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,24 @@
<div class="mb-3">
<span class="fs-14 fw-bold">{{'FIELD_MAPPING' | translate}}</span><br />
</div>
<fieldset>
<fieldset [disabled]="schemaStatus == 'PUBLISHED'">
<div class="mb-3" formGroupName="primaryLogin">
<div class="row">
<div class="col-6 ml-3">
<span class="fs-12 fw-bold"></span><br />
<div class="d-flex justify-content-center align-items-center ml-1">
<fieldset class="form-check mr-3" [disabled]="schemaStatus == 'PUBLISHED'">
<div style="margin-left: -80%">
<input class="form-check-input rounded-lg checkbox-lg" type="checkbox" id="flexCheckUserID" formControlName="userIDCheckbox" >
<input class="form-check-input rounded-lg checkbox-lg" type="checkbox" id="flexCheckUserID" formControlName="userIDCheckbox" (change)="onCheckboxChange($event)">
<label class="form-check-label fs-14" for="flexCheckUserID">
{{'USERID' | translate}}
{{'USERID' | translate}}<span class="text-danger">*</span>
</label>
</div>
</fieldset>
<fieldset [disabled]="!ownershipForm.value.primaryLogin.userIDCheckbox">
<select name="userID" id="userID" formControlName="userIDField"
class="w-100 br-4 border-1 border-light fs-14 p-3 ml-3">
<option value="" disabled selected hidden>{{'SELECT_FIELD' | translate}}</option>
<option value="{{defaultOptionValue}}" disabled selected hidden>{{'SELECT_FIELD' | translate}}</option>
<option *ngFor="let property of propertyNames; let i = index;"
[value]="property">{{ property }}</option>
</select>
Expand All @@ -44,7 +44,7 @@
<fieldset class="form-check mr-2" [disabled]="schemaStatus == 'PUBLISHED'">
<div style="margin-left: -40%">
<input class="form-check-input rounded-lg checkbox-lg" type="checkbox"
id="flexCheckEmail" formControlName="emailCheckbox">
id="flexCheckEmail" formControlName="emailCheckbox" (change)="onCheckboxChange($event)">
<label class="form-check-label fs-14" for="flexCheckEmail">
{{'EMAIL' | translate}}<span class="text-danger">*</span>
</label>
Expand All @@ -53,7 +53,7 @@
<fieldset [disabled]="!ownershipForm.value.primaryLogin.emailCheckbox">
<select name="email" id="email" formControlName="emailField"
class="w-100 br-4 border-1 border-light fs-14 p-3 ml-3 px-7">
<option value="" disabled selected hidden>{{'SELECT_FIELD' | translate}}</option>
<option value="{{defaultOptionValue}}" disabled selected hidden>{{'SELECT_FIELD' | translate}}</option>
<option *ngFor="let property of propertyNames; let i = index;"
[value]="property">{{ property }}</option>
</select>
Expand All @@ -67,15 +67,15 @@
<div class="d-flex justify-content-center align-items-center">
<fieldset class="form-check" [disabled]="schemaStatus == 'PUBLISHED'">
<input class="form-check-input rounded-lg checkbox-lg" type="checkbox"
id="flexCheckMobile" formControlName="mobilenumberCheckbox">
id="flexCheckMobile" formControlName="mobilenumberCheckbox" (change)="onCheckboxChange($event)">
<label class="form-check-label fs-14" for="flexCheckMobile">
{{'MOBILE_NUMBER' | translate}}<span class="text-danger">*</span>
</label>
</fieldset>
<fieldset [disabled]="!ownershipForm.value.primaryLogin.mobilenumberCheckbox">
<select name="mobile" id="mobile" formControlName="mobilenumberField"
class="w-100 br-4 border-1 border-light fs-14 p-3 ml-3">
<option value="" disabled selected hidden>{{'SELECT_FIELD' | translate}}</option>
<option value="{{defaultOptionValue}}" disabled selected hidden>{{'SELECT_FIELD' | translate}}</option>
<option *ngFor="let property of propertyNames; let i = index;"
[value]="property">{{ property }}</option>
</select>
Expand All @@ -87,15 +87,15 @@
<div class="d-flex justify-content-center align-items-center ml-3">
<fieldset class="form-check" [disabled]="schemaStatus == 'PUBLISHED'">
<input class="form-check-input rounded-lg checkbox-lg" type="checkbox"
id="flexCheckPassword" formControlName="passwordCheckbox">
id="flexCheckPassword" formControlName="passwordCheckbox" (change)="onCheckboxChange($event)">
<label class="form-check-label fs-14" for="flexCheckPassword">
{{'PASSWORD' | translate}}
</label>
</fieldset>
<fieldset [disabled]="!ownershipForm.value.primaryLogin.passwordCheckbox">
<select name="passord" id="passord" formControlName="passwordField"
class="w-100 br-4 border-1 border-light fs-14 p-3 ml-3">
<option value="" disabled selected hidden>{{'SELECT_FIELD' | translate}}</option>
<option value="{{defaultOptionValue}}" disabled selected hidden>{{'SELECT_FIELD' | translate}}</option>
<option *ngFor="let property of propertyNames; let i = index;"
[value]="property">{{ property }}</option>
</select>
Expand All @@ -120,29 +120,30 @@
<fieldset class="form-check" [disabled]="schemaStatus == 'PUBLISHED'">
<div class="custom-control custom-radio my-4" >
<input type="radio" id="customRadio1" class="custom-control-input radio-lg"
value="anonymous" formControlName="issuer" [defaultChecked]="true" >
value="anonymous" formControlName="issuer" [defaultChecked]="true" (change)="onIssuerRadioChange($event)">
<label class="custom-control-label fs-14" for="customRadio1">{{'ANONYMOUS' |
translate}}</label>
</div>
<div class="custom-control custom-radio my-4">
<input type="radio" id="customRadio2" class="custom-control-input radio-lg" value="role"
formControlName="issuer">
formControlName="issuer" (change)="onIssuerRadioChange($event)">
<label class="custom-control-label fs-14" for="customRadio2">{{'ROLE' | translate}}</label>
</div>
</fieldset>
<fieldset class="ml-4" [disabled]="ownershipForm.value.issuer ==='role'?false:true">
<span class="fs-14 fw-bold">{{'SELECT_ROLE' | translate}}</span><br />
<select name="issuerRole" id="issuerRole" formControlName="issuerRole"
class="w-25 br-4 border-1 border-light fs-14 p-3">
<option value="" disabled selected hidden>Add Role</option>
<option value="{{defaultOptionValue}}" disabled selected hidden>{{'SELECT_FIELD' | translate}}</option>
<option *ngFor="let entity of entityList; let i = index;" [value]="entity">{{ entity }}</option>
</select>
</fieldset>
</fieldset>
</div>
<fieldset class="form-check" [disabled]="schemaStatus == 'PUBLISHED'">
<div class="px-1 form-inline">
<label for="newRole" class="fs-14 fw-bold">Create a New Role:</label>
<input type="text" class="form-control col-4 ml-2" id="newRole" name="newRole" placeholder="Enter new role" />
<input type="text" class="form-control col-4 ml-2" id="newRole" name="newRole" formControlName="newRole" placeholder="Enter new role" />
<button (click)="createRole()" class="btn fw-bold float-end bg-color-primary bg-color-primary-sm px-3 my-2 ml-2 mr-2 text-white">{{'CREATE_NEW_ROLE' | translate}}</button>
</div>
</fieldset>
</div>
Expand All @@ -159,28 +160,29 @@
<fieldset class="form-check" [disabled]="schemaStatus == 'PUBLISHED'">
<div class="custom-control custom-radio my-4">
<input type="radio" id="inviteCustomRadio1" class="custom-control-input radio-lg"
value="anonymous" formControlName="invitee" [defaultChecked]="true">
value="anonymous" formControlName="invitee" [defaultChecked]="true" (change)="onInviteRadioChange($event)">
<label class="custom-control-label fs-14" for="inviteCustomRadio1">{{'ANONYMOUS' | translate}}</label>
</div>
<div class="custom-control custom-radio my-4">
<input type="radio" id="inviteCustomRadio2" class="custom-control-input radio-lg" value="inviteRoles"
formControlName="invitee">
formControlName="invitee" (change)="onInviteRadioChange($event)">
<label class="custom-control-label fs-14" for="inviteCustomRadio2">{{'INVITE_ROLES' | translate}}</label>
</div>
</fieldset>
</div>
<fieldset class="ml-4" [disabled]="ownershipForm.value.invitee ==='inviteRoles'?false:true">
<span class="fs-14 fw-bold">{{'SELECT_ROLE' | translate}}</span><br />
<select name="inviteRole" id="inviteRole" formControlName="inviteRole"
class="w-25 br-4 border-1 border-light fs-14 p-3">
<option value="" disabled selected hidden>Add Role</option>
<option value="{{defaultOptionValue}}" disabled selected hidden>{{'SELECT_FIELD' | translate}}</option>
<option *ngFor="let entity of entityList; let i = index;" [value]="entity">{{ entity }}</option>
</select>
</fieldset>
</fieldset>
</div>
<fieldset class="form-check" [disabled]="schemaStatus == 'PUBLISHED'">
<div class="px-1 form-inline">
<label for="newRole" class="fs-14 fw-bold">Create a New Role:</label>
<input type="text" class="form-control col-4 ml-2" id="newRole" name="newRole" placeholder="Enter new role" />
<input type="text" class="form-control col-4 ml-2" id="newRole" name="newRole" formControlName="newRole" placeholder="Enter new role" />
<button (click)="createRole()" class="btn fw-bold float-end bg-color-primary bg-color-primary-sm px-3 my-2 ml-2 mr-2 text-white">{{'CREATE_NEW_ROLE' | translate}}</button>
</div>
</fieldset>
</div>
Expand Down
Loading

0 comments on commit e431dc8

Please sign in to comment.