Skip to content

Commit

Permalink
Merge pull request #146 from suvarnakale/main
Browse files Browse the repository at this point in the history
#846 - Dashboard changes- done
  • Loading branch information
Pratikshakhandagale authored Oct 19, 2023
2 parents 3f9591d + 594bdbf commit d26e069
Show file tree
Hide file tree
Showing 10 changed files with 98 additions and 86 deletions.
4 changes: 2 additions & 2 deletions src/app/admin/configurations/configurations.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ <h3 class="pl-3 h2 text-color">{{'SCHEMA' | translate}}</h3>
<p class="card-title text-color fw-bold"> {{'VERIFIABLE_CREDENTIAL' | translate}}</p>
</div>
<div class="col-2">
<button class="btn bg-color-secondary submit-button color-sec" (click)="addVC()">
<button class="btn bg-color-secondary submit-button color-sec" (click)="addVC('')">
+{{'ADD' | translate}}
</button>
</div>
Expand All @@ -75,7 +75,7 @@ <h3 class="pl-3 h2 text-color">{{'SCHEMA' | translate}}</h3>
<p class="fs-16 fw-bold">{{ item?.name }}</p>
<div class="d-flex align-items-center" *ngFor="let certName of item?.schema?._osConfig?.certificateTemplates | keyvalue">

<img src="{{imgUrl}}" class="float-left mr-2 img16" alt="">
<img src="{{imgUrl}}" type="button" class="float-left mr-2 img16" alt="" (click)="addVC(item?.name)">
<span class="fs-14 fw-bold" >
{{certName.key}}
</span>
Expand Down
15 changes: 11 additions & 4 deletions src/app/admin/configurations/configurations.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ export class ConfigurationsComponent implements OnInit {
})
}

addVC() {
addVC(schemaName) {
if (this.res.length === 1) {
const temp = JSON.parse(this.res[0]['schema']);
if (temp.hasOwnProperty('isRefSchema')) {
alert('Only Common Schema exists, please add other schema!');
} else {
this.entityKey = temp.title;
this.navigateToCreateVC();
this.navigateToCreateVC(schemaName);
}
} else {
for (let i = 0; i < this.res.length; i++) {
Expand All @@ -58,11 +58,11 @@ export class ConfigurationsComponent implements OnInit {
break;
}
}
this.navigateToCreateVC();
this.navigateToCreateVC(schemaName);
}
}

navigateToCreateVC() {
navigateToCreateVC(schemaName) {
Object.keys(this.allUsecases).forEach((key) => {
if (key === this.usecase) {
this.allUsecases[key]['steps']?.forEach((step, i) => {
Expand All @@ -72,7 +72,14 @@ export class ConfigurationsComponent implements OnInit {
});
}
});
if(schemaName == ''){
this.router.navigateByUrl('/create/' + this.currentTab + '/' + this.usecase + '/' + this.entityKey);
}
if(schemaName !== ''){
this.entityKey = schemaName;
this.router.navigateByUrl('/create/' + this.currentTab + '/' + this.usecase + '/' + this.entityKey);
}

}

viewOrEditSchema(status: string, schemaName : string) {
Expand Down
26 changes: 26 additions & 0 deletions src/app/admin/help/help.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

<div class="col bg-grey-4 w-100">
<div class="col pr-4 mb-6 w-100">
<div class="w-100 d-flex justify-content-between card-body py-2 mt-3 align-items-center">
<div class="pl-3 h2 text-color mt-3">
<h3>{{'NEED_HELP' | translate}}</h3>
</div>
</div>

<div class="card w-75 p-3 px-2 m-3 ml-2">
<div>
<p class="p-2 m-2">{{'GET_HELP' | translate}}</p>
<div>
<span class="fs-16 fw-bold mb-2 p-3">{{'OFFICIAL_DOCUMENTATION' | translate}}</span>
<p class="p-2 m-2">{{ 'SBRC_OFFICIAL_DOC' | translate}}</p>
<a href="https://docs.sunbirdrc.dev/developer-documentation/admin-portal" class="p-2 m-2" target="_blank">{{ 'EXPLORE_OFFICIAL_DOC' | translate}}</a>
</div>
<div class="mt-3">
<span class="fs-16 fw-bold mb-2 p-3">{{ 'COMMUNITY_DISCUSSION' | translate}}</span>
<p class="p-2 m-2">{{ 'SBRC_GITHUB_COMMUNITY' | translate}}</p>
<a href="https://github.com/orgs/Sunbird-RC/discussions" class="p-2 m-2" target="_blank">{{ 'EXPLORE_GITHUB_COMMUNITY' | translate}}</a>
</div>
</div>
</div>
</div>
</div>
15 changes: 15 additions & 0 deletions src/app/admin/help/help.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';
import { TranslateService } from '@ngx-translate/core';

@Component({
selector: 'app-help',
templateUrl: './help.component.html'
})
export class HelpComponent implements OnInit {

constructor(public translate: TranslateService) { }

ngOnInit(): void {
}

}
69 changes: 2 additions & 67 deletions src/app/admin/roles/roles.component.html
Original file line number Diff line number Diff line change
@@ -1,77 +1,12 @@
<app-header></app-header>

<div class="m-0 mt-5 row h-100">
<nav id="sidebar" class="col-2 border3 card">
<ul id="sideMenu" class="list-unstyled components">
<!-- <li class="menu" routerLinkActive="active-link" [routerLinkActiveOptions]="{exact:true}">
<a class="a-menu"routerLink="/started/get-started" (click)="openMenu('get-started')">{{'GET_STARTED' | translate}}</a>
</li> -->
<li class="menu" routerLinkActive="active-link">
<a class="a-menu fs-14 p-3 d-block" routerLink="/#"
><b>{{ "DASHBOARD" | translate }}</b></a
>
</li>
<li class="menu" routerLinkActive="active-link" *ngIf="isSchemaCreated">
<a class="a-menu fs-14 p-3 d-block" routerLink="/schema"
><b>{{ "SCHEMA" | translate }}</b></a
>
</li>
<li class="menu" routerLinkActive="active-link">
<a class="a-menu fs-14 p-3 d-block" routerLink="/a"
><b>{{ "ATTESTATION_WORKFLOW" | translate }}</b></a
>
</li>
<li class="menu" routerLinkActive="active-link">
<a class="a-menu fs-14 p-3 d-block" routerLink="/a"
><b>{{ "VERIFIABLE_CREDENTIALS" | translate }}</b></a
>
</li>

<li class="menu" routerLinkActive="active-link">
<a class="a-menu fs-14 p-3 d-block" routerLink="/a"
><b>{{ "OWNERSHIP" | translate }}</b></a
>
</li>
<li
class="menu"
routerLinkActive="active-link"
class="active-link"
[routerLinkActiveOptions]="{ exact: true }"
>
<a class="a-menu fs-14 p-3 d-block" routerLink="/roles"
><b>{{ "ROLES" | translate }}</b></a
>
</li>
<li class="menu" routerLinkActive="active-link">
<a class="a-menu fs-14 p-3 d-block" routerLink="/a"
><b>{{ "THEME" | translate }}</b></a
>
</li>

<li class="menu" routerLinkActive="active-link">
<a class="a-menu fs-14 p-3 d-block" routerLink="/#"
><b>{{ "HELP" | translate }}</b></a
>
</li>
<li class="menu" routerLinkActive="active-link">
<a class="a-menu fs-14 p-3 d-block" routerLink="/#"
><b>{{ "ACCOUNT" | translate }}</b></a
>
</li>
</ul>
</nav>

<div class="col bg-grey-4 w-100">
<div class="col pr-4 mb-6 w-100">
<div
class="w-100 d-flex justify-content-between card-body py-2 mt-3 align-items-center"
>
<div class="w-100 d-flex justify-content-between card-body py-2 mt-3 align-items-center">
<div class="heading-2">
<h3>Roles</h3>
</div>
<button
class="btn flex-end bg-color-primary bg-color-primary-sm px-3 my-2 ml-auto mr-2 text-white fs-16"
>
<button class="btn flex-end bg-color-primary bg-color-primary-sm px-3 my-2 ml-auto mr-2 text-white fs-16">
<i class="fa fa-plus mx-2" aria-hidden="true"></i>Add Role
</button>
</div>
Expand Down
29 changes: 17 additions & 12 deletions src/app/admin/sidemenu/sidemenu.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<!-- <li class="menu" routerLinkActive="active-link" [routerLinkActiveOptions]="{exact:true}">
<a class="a-menu"routerLink="/started/get-started" (click)="openMenu('get-started')">{{'GET_STARTED' | translate}}</a>
</li> -->
<li class="menu" class="active-link" routerLinkActive="active-link" [routerLinkActiveOptions]="{exact:true}">
<a class="a-menu fs-14 p-3 d-block" routerLink="/#"><b>{{'DASHBOARD' | translate}}</b></a>
<li class="menu" routerLinkActive="active-link" [routerLinkActiveOptions]="{exact:true}">
<a class="a-menu fs-14 p-3 d-block" type="button" (click)="show('dashboard')"><b>{{'DASHBOARD' | translate}}</b></a>
</li>
<li class="menu" routerLinkActive="active-link" *ngIf="isSchemaCreated">
<a class="a-menu fs-14 p-3 d-block" routerLink="/schema"><b>{{'SCHEMA' | translate}}</b></a>
Expand All @@ -24,18 +24,17 @@
<a class="a-menu fs-14 p-3 d-block" type="button" (click)="navigateTo('ownership')"><b>{{'OWNERSHIP' | translate}}</b></a>
</li>
<li class="menu" routerLinkActive="active-link">
<a class="a-menu fs-14 p-3 d-block" routerLink="/roles"><b>{{'ROLES' | translate}}</b></a>
</li>
<li class="menu" routerLinkActive="active-link">
<a class="a-menu fs-14 p-3 d-block" routerLink="/a"><b>{{'THEME' | translate}}</b></a>
<a class="a-menu fs-14 p-3 d-block" type="button" (click)="show('roles')"><b>{{'ROLES' | translate}}</b></a>
</li>

<li class="menu" routerLinkActive="active-link">
<a class="a-menu fs-14 p-3 d-block" routerLink="/#"><b>{{'HELP' | translate}}</b></a>
<a class="a-menu fs-14 p-3 d-block" type="button" (click)="show('help')"><b>{{'HELP' | translate}}</b></a>
</li>
<li class="menu" routerLinkActive="active-link">
<!-- <li class="menu" routerLinkActive="active-link">
<a class="a-menu fs-14 p-3 d-block" routerLink="/a"><b>{{'THEME' | translate}}</b></a>
</li> -->
<!-- <li class="menu" routerLinkActive="active-link">
<a class="a-menu fs-14 p-3 d-block" routerLink="/#"><b>{{'ACCOUNT' | translate}}</b></a>
</li>
</li> -->

</ul>
</nav>
Expand All @@ -48,8 +47,14 @@
<div *ngIf="!isSchemaCreated ">
<get-started></get-started>
</div>
<div *ngIf="isSchemaCreated && !isLoading">
<configurations [schemaItems]="items"></configurations>
<div *ngIf="isSchemaCreated && !isLoading && showDashboard">
<configurations [schemaItems]="items" [fromRoles]="isFromRoles"></configurations>
</div>
<div *ngIf="showRoles">
<roles-template></roles-template>
</div>
<div *ngIf="showHelp">
<app-help></app-help>
</div>

<!-- <div *ngIf="activeMenu === 'ownership'">
Expand Down
8 changes: 8 additions & 0 deletions src/app/admin/sidemenu/sidemenu.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ activeMenu: string = '';
entityKey: any;
res: any;
allUsecases: any = {};
showRoles: boolean = false;
showHelp: boolean = false;
showDashboard: boolean = true;

constructor(
private activeRoute: ActivatedRoute,
Expand Down Expand Up @@ -112,6 +115,11 @@ activeMenu: string = '';
}
}

show(menu){
this.showDashboard = (menu == 'dashboard' ) ? true : false;
this.showRoles = (menu == 'roles' ) ? true : false;
this.showHelp = (menu == 'help' ) ? true : false;
}

clickEvent() {
this.status = !this.status;
Expand Down
4 changes: 3 additions & 1 deletion src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ import { DloginComponent } from './admin/dlogin/dlogin.component';
import { AdvanceEditorComponent } from './admin/advance-editor/advance-editor.component';
import { PublishComponent } from './admin/publish/publish.component';
import { SwaggeruiComponent } from './admin/publish/swaggerui/swaggerui.component';
import { HelpComponent } from './admin/help/help.component';

@NgModule({
declarations: [
Expand Down Expand Up @@ -192,7 +193,8 @@ import { SwaggeruiComponent } from './admin/publish/swaggerui/swaggerui.componen
DloginComponent,
AdvanceEditorComponent,
PublishComponent,
SwaggeruiComponent
SwaggeruiComponent,
HelpComponent
],
imports: [
BrowserModule,
Expand Down
7 changes: 7 additions & 0 deletions src/assets/i18n/global/en-global.json
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,13 @@
"SETTINGS": "Settings",
"WORKFLOW": "Workflow",
"VC_TEMPLATE": "VC template",
"GET_HELP":"Whether you're just starting or a seasoned pro, our help center is designed to assist you at every step. Get answers to your questions and tap into additional resources for a smoother product experience.",
"OFFICIAL_DOCUMENTATION":"Official Documentation",
"SBRC_OFFICIAL_DOC":"Our official documentation is your complete guide, offering everything from basic setup to advanced features, troubleshooting, and best practices. It's the best place to begin for detailed information and instructions.",
"EXPLORE_OFFICIAL_DOC":"Explore Official Documentation",
"COMMUNITY_DISCUSSION":"Community Discussion Forum",
"SBRC_GITHUB_COMMUNITY":"Our community discussion forum is the hub for connecting with fellow users. Share your experiences, ask questions, and learn from the collective knowledge of our community. It's a great place to get quick answers, share tips, and be part of a supportive user network.",
"EXPLORE_GITHUB_COMMUNITY":"Explore Community Discussion Forum",

"YOU_ARE_READY_AND_CAN_TEST_VERIFIED_CERTIFICATE": "Now, you are ready and can Test Verified Certifcate",
"SAVED_VC_TEMPLATE": "Saved VC Template",
Expand Down
7 changes: 7 additions & 0 deletions src/assets/i18n/global/hi-global.json
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,13 @@
"SETTINGS": "सेटिंग्स",
"WORKFLOW": "वर्कफ़्लो",
"VC_TEMPLATE": "वीसी टेम्पलेट",
"GET_HELP":"चाहे आप अभी शुरुआत कर रहे हों या एक अनुभवी पेशेवर हों, हमारा सहायता केंद्र हर कदम पर आपकी सहायता के लिए डिज़ाइन किया गया है। अपने प्रश्नों के उत्तर प्राप्त करें और बेहतर उत्पाद अनुभव के लिए अतिरिक्त संसाधनों का उपयोग करें।",
"OFFICIAL_DOCUMENTATION":"आधिकारिक दस्तावेज़ीकरण",
"SBRC_OFFICIAL_DOC":"हमारा आधिकारिक दस्तावेज़ीकरण आपका संपूर्ण मार्गदर्शक है, जो बुनियादी सेटअप से लेकर उन्नत सुविधाओं, समस्या निवारण और सर्वोत्तम प्रथाओं तक सब कुछ प्रदान करता है। विस्तृत जानकारी और निर्देशों के लिए शुरुआत करने के लिए यह सबसे अच्छी जगह है।",
"EXPLORE_OFFICIAL_DOC":"आधिकारिक दस्तावेज़ीकरण का अन्वेषण करें",
"COMMUNITY_DISCUSSION":"सामुदायिक चर्चा मंच",
"SBRC_GITHUB_COMMUNITY":"हमारा सामुदायिक चर्चा मंच साथी उपयोगकर्ताओं से जुड़ने का केंद्र है। अपने अनुभव साझा करें, प्रश्न पूछें और हमारे समुदाय के सामूहिक ज्ञान से सीखें। यह त्वरित उत्तर पाने, सुझाव साझा करने और सहायक उपयोगकर्ता नेटवर्क का हिस्सा बनने के लिए एक शानदार जगह है।",
"EXPLORE_GITHUB_COMMUNITY":"सामुदायिक चर्चा मंच का अन्वेषण करें",

"YOU_ARE_READY_AND_CAN_TEST_VERIFIED_CERTIFICATE" : "अब, आप तैयार हैं और सत्यापित प्रमाणपत्र का परीक्षण कर सकते हैं",
"SAVED_VC_TEMPLATE" : "सहेजे गए वीसी टेम्पलेट",
Expand Down

0 comments on commit d26e069

Please sign in to comment.