Skip to content

Commit

Permalink
Task #1 : Issue fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Pratikshakhandagale committed Dec 6, 2022
1 parent f0c6ef4 commit 3eabc2b
Show file tree
Hide file tree
Showing 8 changed files with 96 additions and 90 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ <h4>{{ entityName }}</h4>
<div class="col-sm-3">
<select
#mySelect
class="custom-dropdown-attester-w-auto"
class="custom-dropdown-attester"
(change)="onSelect(mySelect.value)"
>
Expand Down
28 changes: 24 additions & 4 deletions src/app/admin/config-workflow/config-workflow.component.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { Component, OnInit, Input } from "@angular/core";
import { Component, OnInit, Input, SimpleChanges } from "@angular/core";
import { ActivatedRoute, Router } from "@angular/router";
import { GeneralService } from "src/app/services/general/general.service";
import { SchemaService } from "src/app/services/data/schema.service";
import CommonData from "src/assets/schemas/education/Common.json";
import { TranslateService } from '@ngx-translate/core';

@Component({
selector: "config-workflow",
templateUrl: "./config-workflow.component.html",
styleUrls: ["./config-workflow.component.scss"],
})
export class ConfigWorkflowComponent implements OnInit {
@Input() usecaseSchema;
entityName: any;
schemaName = [];
schemaName_data = [];
Expand All @@ -27,18 +27,25 @@ export class ConfigWorkflowComponent implements OnInit {

constructor(
private route: ActivatedRoute,
private router: Router,
public translate: TranslateService,
public generalService: GeneralService
) {
this.entityName = this.route.snapshot.params.entity;
}

ngOnInit(): void {

let selectedMenuList: any;
this.generalService.getData("/Schema").subscribe((res) => {
for (let i = 0; i < res.length; i++) {
this.schemaName.push(JSON.parse(res[i]["schema"]));
this.entityList.push(this.schemaName[i]["title"]);

if(!this.schemaName[i].hasOwnProperty('isRefSchema') && !this.schemaName[i]['isRefSchema'])
{
this.entityList.push(this.schemaName[i]["title"]);
}

this.fieldList.push(this.schemaName[i]["definitions"]);
selectedMenuList = this.fieldList.find((e) => e[this.entityName]);
}
Expand All @@ -47,6 +54,17 @@ export class ConfigWorkflowComponent implements OnInit {
});
}


ngOnChanges(changes: SimpleChanges): void {
const latestRequest = changes['usecaseSchema'];
if (latestRequest.currentValue) {
this.entityName = latestRequest.currentValue;
this.global_properties_student = [];

this.onChangeSelect(this.entityName);
}
}

onChangeSelect(item: any) {
let arr = [];
this.studentFieldList = [];
Expand All @@ -60,6 +78,7 @@ export class ConfigWorkflowComponent implements OnInit {
this.getPropertiesNameStudent(item, "", Object.keys(main_item), 0);
return this.global_properties_student;
}

getPropertiesNameStudent(
item: any,
key_name: any,
Expand Down Expand Up @@ -95,6 +114,7 @@ export class ConfigWorkflowComponent implements OnInit {
onSelect(item: any) {
let arr = [];
this.feildNameList = [];
this.global_properties = [];
const attest = this.fieldList.find((e) => e[item]);
arr = this.getProperties(attest?.[item], attest);

Expand Down
8 changes: 4 additions & 4 deletions src/app/admin/create-entity/create-entity.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@
<ul class="list-unstyled components">
<ng-template ngFor let-menuItem [ngForOf]="usecaseSchema" let-i="index">
<li class="menu" *ngIf="!menuItem['isRefSchema']" (click)="openEntity(i, menuItem?.title)">
<a class="a-menu"> {{menuItem?.title}}
<a class="a-menu" [class.selected]=" menuItem?.title === usecaseSchema[i].title" (click)="onSelect(menuItem?.title);"> {{menuItem?.title}}
<div *ngIf="isActive == 'createSchema' && menuItem['status'] != 'PUBLISHED'"
class="dropdown p14 float-end">
<i class="fa fa-ellipsis-h text-grey-color" aria-hidden="true"></i>
<div class="dropdown-content dropdown-content-margin">
<a data-toggle="modal" data-target="#addEntity"
(click)="openEntityModal('edit', i)" class="ml-0">{{'EDIT' | translate}}</a>
(click)="openEntityModal('edit', i)" class="ml-0">{{'EDIT' | translate}}</a>
<a data-toggle="modal" data-target="#deleteEntity" (click)="deleteEntity(i, '')" class="ml-0">{{'DELETE' | translate}}</a>
</div>
</div>
Expand Down Expand Up @@ -381,13 +381,13 @@ <h3>{{usecaseSchema[activeMenuNo]?.title}}</h3>
</div>
</div>
<div *ngIf="isActive == 'configurations'">
<config-workflow></config-workflow>
<config-workflow [usecaseSchema]="usecaseSchemaData"></config-workflow>
</div>



<div *ngIf="isActive =='create-vc'">
<create-vc-template></create-vc-template>
<create-vc-template [usecaseSchema]="usecaseSchemaData"></create-vc-template>
</div>

<div *ngIf="isActive == 'ownership'">
Expand Down
13 changes: 9 additions & 4 deletions src/app/admin/create-entity/create-entity.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ export class CreateEntityComponent implements OnInit {
commonSchemaField: any;
deleteingOsid: any;
index: any;
usecaseSchemaData: any;
constructor(
private activeRoute: ActivatedRoute,
public router: Router,
Expand Down Expand Up @@ -898,7 +899,7 @@ export class CreateEntityComponent implements OnInit {

nextStep() {
this.saveData();
if (this.currentTab < 4) {
if (this.currentTab < this.steps.length) {
this.steps[this.currentTab].classList.remove("activeTab");
this.currentTab += 1;
this.steps[this.currentTab].classList.add("activeTab")
Expand All @@ -908,12 +909,19 @@ export class CreateEntityComponent implements OnInit {
this['active' + (this.currentTab - 1)] = false;

this.location.replaceState('/create/' + this.currentTab + '/' + this.usecase + '/' + this.entityKey);

} else {
this.location.replaceState('/create/' + this.currentTab + '/' + this.usecase + '/' + this.entityKey);

}

}


onSelect(userSchema) {
this.usecaseSchemaData = userSchema;
}

backStep() {
if (this.currentTab >= 1 && this.currentTab < 4) {
this.steps[this.currentTab].classList.remove("activeTab");
Expand Down Expand Up @@ -1600,9 +1608,6 @@ export class CreateEntityComponent implements OnInit {
if (this.isNew) {
this.generalService.postData('/Schema', payload).subscribe((res) => {




// let schemaParams = {
// 'title': this.usecase,
// 'schema': this.usecaseSchema,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<div class="img-hold">
<div class="thmbCol" *ngFor="let item of credTemp" >
<div class="wrap">
<iframe id="iframe1" class="iframe-container embed-responsive-item"></iframe>
<iframe id="iframe1" class="iframe-container embed-responsive-item"></iframe>
</div>
<div class="l12 fw-bold">{{item?.title}}</div>
</div>
Expand All @@ -27,10 +27,10 @@
<i class="fa fa-plus text-secondary-color pt-c" aria-hidden="true"></i>
</a>
</div>
<div class="ft-12">
<div class="fs-12">
<b>{{'ADD_TEMPLATE' | translate}}</b>
</div>
<div class="ft-10 thmbCol2">
<div class="fs-10 thmbCol2">
<div>
{{'ANY_EDIT_IN_QR_CODE' | translate}}
</div>
Expand Down
Loading

0 comments on commit 3eabc2b

Please sign in to comment.