Skip to content

Commit

Permalink
Merge pull request #338 from chaitrali-r/demo-donor
Browse files Browse the repository at this point in the history
Generalize Donor Registry
  • Loading branch information
Pratikshakhandagale authored Sep 11, 2023
2 parents 0f2f3a8 + 112886e commit fc7188d
Show file tree
Hide file tree
Showing 54 changed files with 7,738 additions and 2,752 deletions.
6 changes: 3 additions & 3 deletions donor-registry/proxy.conf.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
{
"/registry/api/v1": {
"target": "https://demo-nha-donor-registry.sunbirdrc.dev",
"target": "https://demo-donor-registry.sunbirdrc.dev",
"changeOrigin": true,
"logLevel": "debug",
"secure": false

},

"/registry/api": {
"target": "https://demo-nha-donor-registry.sunbirdrc.dev",
"target": "https://demo-donor-registry.sunbirdrc.dev",
"changeOrigin": true,
"logLevel": "debug",
"secure": false

},

"/registry/api/docs": {
"target": "https://demo-nha-donor-registry.sunbirdrc.dev",
"target": "https://demo-donor-registry.sunbirdrc.dev",
"changeOrigin": true,
"logLevel": "debug",
"secure": false
Expand Down
15 changes: 15 additions & 0 deletions donor-registry/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ import { ScanQrCodeComponent } from './documents/scan-qr-code/scan-qr-code.compo
import { BrowseDocumentsComponent } from './documents/browse-documents/browse-documents.component';
import { PagesComponent } from './pages/pages.component';
import { DocDetailViewComponent } from './documents/doc-detail-view/doc-detail-view.component';
import { CertificateComponent } from './certificate/certificate.component';
// import { VerifyCertificateComponent } from './verify-certificate/verify-certificate.component';
import { ShareStatusComponent } from './share-status/share-status.component';
import { StatusComponent } from './status/status.component';


// import { CreateCertificateComponent } from './create-certificate/create-certificate.component';
// import { FaqComponent } from './custom-components/faq/faq.component';
const routes: Routes = [
Expand Down Expand Up @@ -88,6 +94,15 @@ const routes: Routes = [
// { path: 'document/detail', component: DocDetailViewComponent, canActivate: [AuthGuard] },
// { path: 'document/view/:id', component: DocViewComponent, canActivate: [AuthGuard] },
{ path: 'discovery', component: SearchComponent },
{ path: 'certificate', component: CertificateComponent },
{ path: 'certificate/:stateVal/:identifier', component: CertificateComponent, canActivate: [AuthGuard] },
// { path: 'verify-certificate', component: VerifyCertificateComponent },
{ path: ':layout/status/:id', component: ShareStatusComponent, canActivate: [AuthGuard]},
{ path: 'profile/certs/share/:layout/:id/template/:templateid', component: StatusComponent },
{ path: ':layout/status/:id/template/:templateid', component: ShareStatusComponent },



// { path: 'template', component: CreateCertificateComponent },


Expand Down
47 changes: 43 additions & 4 deletions donor-registry/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ import { TranslateHttpLoader } from '@ngx-translate/http-loader';
import { HttpClient } from '@angular/common/http';
import { config } from 'process';
import { ColorPickerModule } from 'ngx-color-picker';
// import { VerifyCertificateComponent } from './verify-certificate/verify-certificate.component';



//form validations
Expand Down Expand Up @@ -109,6 +111,10 @@ export function constValidationMessage(err, field: FormlyFieldConfig) {
return `should be equal to constant "${field.templateOptions.const}"`;
}

export function errValidatorMessage(error: any, field: FormlyFieldConfig) {
return `Please Enter ${field.templateOptions.label}`;
}

function initConfig(config: AppConfig) {
return () => config.load()
}
Expand All @@ -125,10 +131,29 @@ import { DocDetailViewComponent } from './documents/doc-detail-view/doc-detail-v
import { SafeHtmlPipe } from './safe-html.pipe';
import { initTheme } from './theme.config';
import { VerifyIndentityCode } from './forms/types/verify-identity-no.type';
import { VerifyMobileNo } from './forms/types/verify-mobileno.type';
import { VerifyAadhaar } from './forms/types/verify-aadhaar.type';

import { FormlyTemplateType } from './forms/types/template.type';
import { FormlyFieldNgSelectAllCheckbox } from './forms/types/select-all-checkbox.type';
import { CertificateComponent } from './certificate/certificate.component';
import { TooltipWrapper } from './forms/types/tooltip.type';
// import { VerifyModule } from 'vc-verification';

// import { ZXingScannerModule } from '@zxing/ngx-scanner';
import { ShareStatusComponent } from './share-status/share-status.component';
import { StatusComponent } from './status/status.component';

// import { FormlyFieldSelect } from './forms/types/select.type';
// import { CreateCertificateComponent } from './create-certificate/create-certificate.component';

let baseConfig = require('../assets/config/config.json')

let configData = {
baseUrl: baseConfig['baseUrl']
}


@NgModule({
declarations: [
AppComponent,
Expand All @@ -144,6 +169,8 @@ import { FormlyTemplateType } from './forms/types/template.type';
PanelsComponent, EditPanelComponent, AddPanelComponent, TablesComponent,
AutocompleteTypeComponent,
VerifyIndentityCode,
VerifyMobileNo,
VerifyAadhaar,
FormlyColorInput,
FormlyFieldStepper,
HeaderComponent,
Expand All @@ -161,7 +188,13 @@ import { FormlyTemplateType } from './forms/types/template.type';
ScanQrCodeComponent,
BrowseDocumentsComponent,
AuthImagePipe,
FormlyTemplateType
FormlyTemplateType,
FormlyFieldNgSelectAllCheckbox,
CertificateComponent,
TooltipWrapper,
ShareStatusComponent,
SafeHtmlPipe,
StatusComponent
],
imports: [
BrowserModule,
Expand All @@ -177,7 +210,6 @@ import { FormlyTemplateType } from './forms/types/template.type';
Bootstrap4FrameworkModule,
AngularMultiSelectModule,
NgSelectModule,

HttpClientModule,
TranslateModule.forRoot(),

Expand All @@ -188,9 +220,10 @@ import { FormlyTemplateType } from './forms/types/template.type';
FormlyModule.forRoot({
extras: { resetFieldOnHide: true },
wrappers: [{ name: 'form-field-horizontal', component: FormlyHorizontalWrapper },
{ name: 'panel', component: PanelWrapperComponent }],
{ name: 'panel', component: PanelWrapperComponent },
{ name: 'tooltip', component: TooltipWrapper }],
validationMessages: [
{ name: 'required', message: '' },
{ name: 'required', message: errValidatorMessage },

],
types: [
Expand Down Expand Up @@ -225,8 +258,12 @@ import { FormlyTemplateType } from './forms/types/template.type';
},
{ name: 'file', component: FormlyFieldFile, wrappers: ['form-field'] },
{ name: 'multiselect', component: FormlyFieldNgSelect },
{ name: 'selectall-checkbox', component: FormlyFieldNgSelectAllCheckbox },
{ name: 'color', component: FormlyColorInput },
{ name: 'verify-code', component: VerifyIndentityCode },
{ name: 'verify-mobileno', component: VerifyMobileNo },
{ name: 'verify-aadhaar', component: VerifyAadhaar },

{ name: 'stepper', component: FormlyFieldStepper, wrappers: [] },
{ name: 'template', component: FormlyTemplateType }
],
Expand Down Expand Up @@ -271,6 +308,7 @@ import { FormlyTemplateType } from './forms/types/template.type';

export class AppModule {
languages;

constructor(translate: TranslateService, authConfig: AuthConfigService) {

authConfig.getConfig().subscribe((config) => {
Expand Down Expand Up @@ -299,5 +337,6 @@ export class AppModule {
});

}

}

31 changes: 31 additions & 0 deletions donor-registry/src/app/certificate/certificate.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<header>
<nav class="navbar navbar-expand-lg navbar-light bg-header nav-b navbar-inverse">
<!-- <a class="nav-link pl-4" href="" onClick="history.go(-1); return false;"><i
class="fa fa-angle-left primary-text"></i> </a> -->
<div class="d-flex align-items-center flex-justify-between w-100">
<div class="heading-2 fw-bold">Download Pledge Certificate</div>
<div class="btn btn-primary-green btn-style float-end mr-1 font-weight-bold p-2 p14" data-mdb-toggle="tooltip" (click)="dowbloadCard1()" > <i class="fa fa-download" aria-hidden="true"></i> Download Pledge Certificate</div>
</div>
</nav>
</header>
<div class="text-center" *ngIf="orientation == '_portrait'" >
<button (click)="zoominbutton()" class="w-30px" type="button">+</button> &nbsp;
<button (click)="zoomoutbutton()" class="w-30px" type="button"> - </button>
</div>

<div *ngIf="url && orientation == '_landscape'" class="modal-body" class="wrapper">
<iframe class="pdfDisplay" [src]="url"></iframe>
</div>

<div *ngIf="orientation == '_portrait'" id="pdf_container">
<canvas id="the-canvas" style="border:1px solid black"></canvas>

</div>

<div *ngIf="isLoading">
<div class="d-flex justify-content-center p-4">
<div class="spinner-border" role="status">
<span class="sr-only">{{'LOADING' | translate}}</span>
</div>
</div>
</div>
22 changes: 22 additions & 0 deletions donor-registry/src/app/certificate/certificate.component.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
.wrapper{
width: 100% !important;
height: 100% !important;
overflow: hidden;

}

.temp{
margin-left: 30%;
margin-top: 1%;
}

.pdfDisplay{
height: 100%;
width: 100%;
}

#pdf_container { background: #ccc; text-align: center; display: none; padding: 5px; overflow: auto }

.w-30px{
width: 30px;
}
25 changes: 25 additions & 0 deletions donor-registry/src/app/certificate/certificate.component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { CertificateComponent } from './certificate.component';

describe('CertificateComponent', () => {
let component: CertificateComponent;
let fixture: ComponentFixture<CertificateComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ CertificateComponent ]
})
.compileComponents();
});

beforeEach(() => {
fixture = TestBed.createComponent(CertificateComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
Loading

0 comments on commit fc7188d

Please sign in to comment.