Skip to content

Commit

Permalink
#795 - View/add button on dashboard activated
Browse files Browse the repository at this point in the history
  • Loading branch information
suvarnakale committed Sep 12, 2023
1 parent b340520 commit 3fe6508
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/app/admin/configurations/configurations.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ <h3 class="pl-3 h2 text-color">{{'SCHEMA' | translate}}</h3>
</div>

<div class="mt-4">
<button class="btn bg-color-secondary submit-button color-sec">
<button class="btn bg-color-secondary submit-button color-sec" (click)="viewOrEditSchema(item.status, item.name)">
{{'VIEW_ADD' | translate}}
</button>
</div>
Expand Down
12 changes: 11 additions & 1 deletion src/app/admin/configurations/configurations.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,15 @@ export class ConfigurationsComponent implements OnInit {
});
this.router.navigateByUrl('/create/' + this.currentTab + '/' + this.usecase + '/' + this.entityKey);
}

viewOrEditSchema(status: string, schemaName : string) {
this.entityKey = schemaName;
if (status === 'PUBLISHED') {
this.router.navigateByUrl('/create/0' + '/' + this.usecase + '/' + this.entityKey);
} else if (status === 'DRAFT') {
this.router.navigateByUrl('/create/0' + '/' + this.usecase + '/' + this.entityKey);
}
}
}


}
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 @@ -168,7 +168,7 @@ <h3>{{usecaseSchema[activeMenuNo]?.title}}</h3>
<td>
<select
(change)="onVisibilityChange($event, childNastedArrayfield?.data?.visiblity, 'childNased', j, k , m)"
class="br-4 border-grey-3 bg-card fs-14 m-2 py-1 px-3 mr-3">
class="br-4 border-grey-3 bg-card fs-14 m-2 py-1 px-3 mr-3" [disabled]="usecaseSchema[activeMenuNo]['status'] == 'PUBLISHED'">
<option *ngFor="let opt of visiblityOpt"
value={{opt.key}}
[selected]="opt?.key == childNastedArrayfield?.data?.visiblity">
Expand Down Expand Up @@ -212,7 +212,7 @@ <h3>{{usecaseSchema[activeMenuNo]?.title}}</h3>
<td>
<select
(change)="onVisibilityChange($event, secArrayfield?.visiblity, 'nasted', j , k)"
class="br-4 border-grey-3 bg-card fs-14 m-2 py-1 px-3 mr-3">
class="br-4 border-grey-3 bg-card fs-14 m-2 py-1 px-3 mr-3" [disabled]="usecaseSchema[activeMenuNo]['status'] == 'PUBLISHED'">
<option *ngFor="let opt of visiblityOpt"
value={{opt.key}}
[selected]="opt.key== secArrayfield?.visiblity">
Expand Down Expand Up @@ -251,7 +251,7 @@ <h3>{{usecaseSchema[activeMenuNo]?.title}}</h3>
</td>
<td>
<select (change)="onVisibilityChange($event, field?.data?.visiblity, j, k)"
class="br-4 border-grey-3 bg-card fs-14 m-2 py-1 px-3 mr-3">
class="br-4 border-grey-3 bg-card fs-14 m-2 py-1 px-3 mr-3" [disabled]="usecaseSchema[activeMenuNo]['status'] == 'PUBLISHED'">
<option *ngFor="let opt of visiblityOpt" value={{opt.key}}
[selected]="opt.key== field?.data?.visiblity">
{{opt.name}}
Expand Down Expand Up @@ -289,7 +289,7 @@ <h3>{{usecaseSchema[activeMenuNo]?.title}}</h3>
</td>
<td>
<select (change)="onVisibilityChange($event, field?.visiblity, 'string', j, k )"
class="br-4 bg-card border-grey-3 fs-14 m-2 py-1 px-3 mr-3">
class="br-4 bg-card border-grey-3 fs-14 m-2 py-1 px-3 mr-3" [disabled]="usecaseSchema[activeMenuNo]['status'] == 'PUBLISHED'">
<option *ngFor="let opt of visiblityOpt" value={{opt.key}}
[selected]="opt?.key == field?.visiblity">
{{opt.name}}
Expand Down

0 comments on commit 3fe6508

Please sign in to comment.