diff --git a/project/ws/app/src/lib/head/ui-admin-table/create-organisation/create-organisation.component.ts b/project/ws/app/src/lib/head/ui-admin-table/create-organisation/create-organisation.component.ts index 89aca2da..29605ba8 100644 --- a/project/ws/app/src/lib/head/ui-admin-table/create-organisation/create-organisation.component.ts +++ b/project/ws/app/src/lib/head/ui-admin-table/create-organisation/create-organisation.component.ts @@ -5,6 +5,7 @@ import * as _ from 'lodash' import { CreateMDOService } from '../../../routes/home/services/create-mdo.services' import { ActivatedRoute } from '@angular/router' import { LoaderService } from '../../../routes/home/services/loader.service' +import { IUploadedLogoresponse } from '../interface/interfaces' @Component({ selector: 'ws-app-create-organisation', templateUrl: './create-organisation.component.html', @@ -12,9 +13,6 @@ import { LoaderService } from '../../../routes/home/services/loader.service' }) export class CreateOrganisationComponent implements OnInit, OnDestroy { - //#region (global variables) - - //#region (input and output) @Input() rowData: any @Input() dropdownList: { statesList: any[], @@ -26,7 +24,6 @@ export class CreateOrganisationComponent implements OnInit, OnDestroy { @Input() openMode: string = '' @Output() buttonClick = new EventEmitter() @Output() organizationCreated = new EventEmitter() - //#endregion organisationForm!: FormGroup statesList: any = [] @@ -40,6 +37,8 @@ export class CreateOrganisationComponent implements OnInit, OnDestroy { filteredStates: any[] = [] filteredMinistry: any[] = [] heirarchyObject: any + selectedLogoFile: any + uploadedLogoResponse!: IUploadedLogoresponse constructor( private formBuilder: FormBuilder, private snackBar: MatSnackBar, @@ -51,7 +50,6 @@ export class CreateOrganisationComponent implements OnInit, OnDestroy { this.addOverflowHidden() } - //#region (ng onint) ngOnInit(): void { this.loggedInUserId = _.get(this.activatedRoute, 'snapshot.parent.data.configService.userProfile.userId') this.initialization() @@ -128,9 +126,6 @@ export class CreateOrganisationComponent implements OnInit, OnDestroy { }) } } - //#endregion - - //#region (UI interaction lick click) get getCategory() { return this.organisationForm.controls.category.value @@ -153,7 +148,7 @@ export class CreateOrganisationComponent implements OnInit, OnDestroy { isTenant: true, requestedBy: this.loggedInUserId, - logo: this.selectedLogo, + logo: this.uploadedLogoResponse?.qrcodepath || "", description: this.controls['description'].value, parentMapId: this.heirarchyObject?.parentMapId || "", sbRootOrgId: this.heirarchyObject?.sbRootOrgId || "", @@ -173,7 +168,7 @@ export class CreateOrganisationComponent implements OnInit, OnDestroy { next: (response: any) => { if (response.result) { this.organizationCreated.emit(payload) - this.snackBar.open('Organization successfully created.', 'Close', { panelClass: ['success'] }) + this.snackBar.open('Organization successfully created.', 'X', { panelClass: ['success'] }) this.closeNaveBar() this.loaderService.changeLoad.next(false) this.isLoading = false @@ -194,7 +189,7 @@ export class CreateOrganisationComponent implements OnInit, OnDestroy { // organisationSubType: this.heirarchyObject.sbOrgSubType, organisationSubType: "board", orgId: this.rowData.id, - logo: request.logo, + logo: this.uploadedLogoResponse?.qrcodepath || this.rowData.logo, description: request.description } @@ -202,7 +197,7 @@ export class CreateOrganisationComponent implements OnInit, OnDestroy { next: (response: any) => { if (response.result) { this.organizationCreated.emit(payload) - this.snackBar.open('Organization successfully updated.', 'Close', { panelClass: ['success'] }) + this.snackBar.open('Organization successfully updated.', 'X', { panelClass: ['success'] }) this.closeNaveBar() this.loaderService.changeLoad.next(false) this.isLoading = false @@ -219,28 +214,22 @@ export class CreateOrganisationComponent implements OnInit, OnDestroy { uploadLogo(event: Event) { const input = event.target as HTMLInputElement if (input.files?.length) { - const selectedFile = input.files[0] - this.selectedLogoName = selectedFile.name + this.selectedLogoFile = input.files[0] + this.selectedLogoName = this.selectedLogoFile.name const maxFileSize = this.maxFileSize * 1024 - if (!this.validFileTypes.includes(selectedFile.type)) { - this.snackBar.open('Invalid file type', 'Close', { panelClass: ['error'] }) + if (!this.validFileTypes.includes(this.selectedLogoFile.type)) { + this.snackBar.open('Invalid file type', 'X', { panelClass: ['error'] }) return } - if (selectedFile.size > maxFileSize) { - this.snackBar.open(`File size exceeds ${this.maxFileSize} KB. Please select a smaller file.`, 'Close', { panelClass: ['error'] }) + if (this.selectedLogoFile.size > maxFileSize) { + this.snackBar.open(`File size exceeds ${this.maxFileSize} KB. Please select a smaller file.`, 'X', { panelClass: ['error'] }) return } - - const reader = new FileReader() - reader.onload = () => { - this.selectedLogo = reader.result - } - reader.readAsDataURL(selectedFile) + this.uploadOrganizationLogo() } } - //#endregion addOverflowHidden() { document.body.classList.add('overflow-hidden') @@ -268,4 +257,19 @@ export class CreateOrganisationComponent implements OnInit, OnDestroy { } + uploadOrganizationLogo() { + const formData = new FormData() + formData.append('file', this.selectedLogoFile) + this.createMDOService.uploadOrganizationLogo(formData).subscribe({ + next: (response: any) => { + if (response.result) { + this.uploadedLogoResponse = response.result + this.selectedLogo = this.uploadedLogoResponse.qrcodepath + } + }, + error: () => { + this.snackBar.open(`Couldn't upload the logo, Please try again`, 'X', { panelClass: ['error'] }) + } + }) + } } diff --git a/project/ws/app/src/lib/head/ui-admin-table/custom-self-registration/custom-self-registration.component.html b/project/ws/app/src/lib/head/ui-admin-table/custom-self-registration/custom-self-registration.component.html index dd40f7c1..49b14cee 100644 --- a/project/ws/app/src/lib/head/ui-admin-table/custom-self-registration/custom-self-registration.component.html +++ b/project/ws/app/src/lib/head/ui-admin-table/custom-self-registration/custom-self-registration.component.html @@ -7,7 +7,7 @@ close -
+
-
+
@@ -47,15 +47,15 @@ -
+ +
@@ -65,9 +65,8 @@ [href]="customRegistrationLinks.registrationLink" target="_blank">{{customRegistrationLinks.registrationLink}}
-
- {{checkRegistrationStatus(this.initialData.endDateRegistration) ? +
+ {{checkRegistrationStatus() ? 'Active': 'None'}}
@@ -137,17 +136,11 @@
- +
diff --git a/project/ws/app/src/lib/head/ui-admin-table/custom-self-registration/custom-self-registration.component.scss b/project/ws/app/src/lib/head/ui-admin-table/custom-self-registration/custom-self-registration.component.scss index bff8ccda..4c7e2727 100644 --- a/project/ws/app/src/lib/head/ui-admin-table/custom-self-registration/custom-self-registration.component.scss +++ b/project/ws/app/src/lib/head/ui-admin-table/custom-self-registration/custom-self-registration.component.scss @@ -97,6 +97,7 @@ color: #1d8923; background: #1d892329; } + &.in-active { color: #00000099; background: #00000029; @@ -118,9 +119,11 @@ white-space: normal; } -// .mat-btn-outline.active-button { -// background: #1b4ca1 !important; -// span { -// color: #fff !important; -// } -// } +.center-position { + position: absolute; + top: 0; + right: 0; + left: 0; + bottom: 0; + +} \ No newline at end of file diff --git a/project/ws/app/src/lib/head/ui-admin-table/custom-self-registration/custom-self-registration.component.ts b/project/ws/app/src/lib/head/ui-admin-table/custom-self-registration/custom-self-registration.component.ts index f5238dc0..cb778973 100644 --- a/project/ws/app/src/lib/head/ui-admin-table/custom-self-registration/custom-self-registration.component.ts +++ b/project/ws/app/src/lib/head/ui-admin-table/custom-self-registration/custom-self-registration.component.ts @@ -61,12 +61,13 @@ export class CustomSelfRegistrationComponent implements OnInit, OnDestroy { } } - checkRegistrationStatus(endDateRegistration: string): boolean { - if (!endDateRegistration) return true + checkRegistrationStatus(): boolean { + // if (!endDateRegistration) return true - const endDate = new Date(endDateRegistration) - const today = new Date() - return today <= endDate + // const endDate = new Date(endDateRegistration) + // const today = new Date() + // return today <= endDate + return true } closeNaveBar() { diff --git a/project/ws/app/src/lib/head/ui-admin-table/directory-list/directory-table.component.html b/project/ws/app/src/lib/head/ui-admin-table/directory-list/directory-table.component.html index b4123575..d46feda3 100644 --- a/project/ws/app/src/lib/head/ui-admin-table/directory-list/directory-table.component.html +++ b/project/ws/app/src/lib/head/ui-admin-table/directory-list/directory-table.component.html @@ -71,7 +71,7 @@ + Access
- +

No designations found

+ +
+
+ +
+
+
= new EventEmitter(); + @Input() loader: boolean = false; environmentVal: any designationConfig: any frameworkConfig: any @@ -56,12 +57,21 @@ export class ImportDesignationComponent implements OnInit, OnDestroy { ngOnInit() { this.configSvc = this.activateRoute.snapshot.data['configService'] - this.loadDesignations() - this.valueChangeSubscription() - this.getRoutesData() + // this.loadDesignations() + // this.valueChangeSubscription() + // this.getRoutesData() } + ngOnChanges(changes: SimpleChanges): void { + if (changes['loader'].currentValue === false) { + this.frameworkInfo = this.designationsService.frameWorkInfo + this.loadDesignations() + this.valueChangeSubscription() + this.getRoutesData() + } + } + getFrameWorkDetails() { this.frameworkInfo = this.designationsService.frameWorkInfo if (this.frameworkInfo === undefined) { diff --git a/project/ws/app/src/lib/routes/create-mdo/routes/users/users.component.html b/project/ws/app/src/lib/routes/create-mdo/routes/users/users.component.html index c29af032..84a4157b 100644 --- a/project/ws/app/src/lib/routes/create-mdo/routes/users/users.component.html +++ b/project/ws/app/src/lib/routes/create-mdo/routes/users/users.component.html @@ -9,7 +9,7 @@
- - + --> + + + + + + + + + diff --git a/project/ws/app/src/lib/routes/home/services/create-mdo.services.ts b/project/ws/app/src/lib/routes/home/services/create-mdo.services.ts index b134efb7..bfaaab04 100644 --- a/project/ws/app/src/lib/routes/home/services/create-mdo.services.ts +++ b/project/ws/app/src/lib/routes/home/services/create-mdo.services.ts @@ -16,6 +16,8 @@ const API_END_POINTS = { UPDATE_STATE_OR_MINISTRY: '/apis/proxies/v8/org/ext/v1/update', SEARCH_ORG: '/api/org/ext/v2/signup/search', UPDATE_ORGANIZATION: '/apis/proxies/v8/org/ext/v1/update', + UPLOAD_ORGANIZATION_LOGO: '/apis/proxies/v8/customselfregistration/upload/logo/gcpcontainer', + } @Injectable({ @@ -123,4 +125,8 @@ export class CreateMDOService { updateOrganization(req: any): Observable { return this.http.patch(`${API_END_POINTS.UPDATE_ORGANIZATION}`, req) } + + uploadOrganizationLogo(payload: any) { + return this.http.post(`${API_END_POINTS.UPLOAD_ORGANIZATION_LOGO}`, payload) + } }