From bb3ac30a5e5996fbbad159a3214d9e32470062aa Mon Sep 17 00:00:00 2001 From: mansurskTarento Date: Mon, 3 Mar 2025 16:52:25 +0530 Subject: [PATCH 1/4] new ui cahnges in cios to show transform progress and certificate in top --- ...igure-marketplace-providers.component.html | 48 ++++++++++++++++++- ...igure-marketplace-providers.component.scss | 17 +++++++ ...nfigure-marketplace-providers.component.ts | 10 ++++ .../content-upload.component.html | 12 ++--- .../content-upload.component.scss | 2 +- .../provider-details.component.html | 2 +- .../provider-details.component.ts | 2 +- .../transformations.component.html | 4 +- .../transformations.component.scss | 4 ++ .../transformations.component.ts | 38 +++++++++++---- .../components/via-api/via-api.component.scss | 15 ++++++ .../components/via-api/via-api.component.ts | 47 ++++++++++++++++++ 12 files changed, 181 insertions(+), 20 deletions(-) diff --git a/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/configure-marketplace-providers/configure-marketplace-providers.component.html b/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/configure-marketplace-providers/configure-marketplace-providers.component.html index dc76e00c..eaf1dbaf 100644 --- a/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/configure-marketplace-providers/configure-marketplace-providers.component.html +++ b/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/configure-marketplace-providers/configure-marketplace-providers.component.html @@ -14,7 +14,7 @@ (loadProviderDetails)="getProviderDetails($event)"> - +
+ + + +
+ + +
+
+ Configure Certificate +
+
+ +
+
+ Open & follow these instruction + 1.Please ensure the Certificate file is named correctly. +
+ + +
+
+
+
+
+
+ + + +
+ + + + Via CSV + + + + + + +
+
+
\ No newline at end of file diff --git a/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/configure-marketplace-providers/configure-marketplace-providers.component.scss b/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/configure-marketplace-providers/configure-marketplace-providers.component.scss index e69de29b..39b42a54 100644 --- a/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/configure-marketplace-providers/configure-marketplace-providers.component.scss +++ b/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/configure-marketplace-providers/configure-marketplace-providers.component.scss @@ -0,0 +1,17 @@ +.accoridan-description { + font: 700 20px Lato; +} + +.header { + /* stylelint-enable */ + font: 700 20px / 30px Lato; + /* stylelint-disable */ + color: #212529; + } + +.instruction-text { + color: #000000DE; + /* stylelint-enable */ + font: 400 14px Lato; + /* stylelint-disable */ + } \ No newline at end of file diff --git a/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/configure-marketplace-providers/configure-marketplace-providers.component.ts b/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/configure-marketplace-providers/configure-marketplace-providers.component.ts index 2dee15c3..f021e8ae 100644 --- a/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/configure-marketplace-providers/configure-marketplace-providers.component.ts +++ b/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/configure-marketplace-providers/configure-marketplace-providers.component.ts @@ -24,6 +24,14 @@ export class ConfigureMarketplaceProvidersComponent implements OnInit { providerDetails: any disableCourseCatalog = true + helpCenterGuide = { + header: 'Content Upload Details: Video Guides and Tips', + guideNotes: [ + `Upload the certificate using a SVG file.`, + ], + helpVideoLink: `/assets/public/content/guide-videos/CIOS_Updated_demo.mp4`, + } + constructor( private activateRoute: ActivatedRoute, private snackBar: MatSnackBar, @@ -61,6 +69,8 @@ export class ConfigureMarketplaceProvidersComponent implements OnInit { } } + getTablesData() { } + showSnackBar(message: string) { this.snackBar.open(message) } diff --git a/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/content-upload/content-upload.component.html b/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/content-upload/content-upload.component.html index d0761dfc..05a81619 100644 --- a/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/content-upload/content-upload.component.html +++ b/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/content-upload/content-upload.component.html @@ -25,7 +25,7 @@ - Via CSV + Via CSV - Via API + Via API
- + diff --git a/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/content-upload/content-upload.component.scss b/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/content-upload/content-upload.component.scss index f04f4eba..4e42a780 100644 --- a/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/content-upload/content-upload.component.scss +++ b/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/content-upload/content-upload.component.scss @@ -77,7 +77,7 @@ margin: 0px !important; } -.accoridan-description { +.accordian-description { font: 700 20px Lato; } diff --git a/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/provider-details/provider-details.component.html b/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/provider-details/provider-details.component.html index ccc06e2a..88a24911 100644 --- a/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/provider-details/provider-details.component.html +++ b/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/provider-details/provider-details.component.html @@ -80,7 +80,7 @@ - Only ( a-z/A-Z/0-9 . - _ $ / : [ ]' !) characters are supported + Please give valid URL Only ( a-z/A-Z/0-9 . - _ $ / : [ ]' !) characters are supported diff --git a/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/provider-details/provider-details.component.ts b/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/provider-details/provider-details.component.ts index 8066d4f3..136407d6 100644 --- a/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/provider-details/provider-details.component.ts +++ b/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/provider-details/provider-details.component.ts @@ -64,7 +64,7 @@ export class ProviderDetailsComponent implements OnInit, OnChanges { this.providerFormGroup = this.formBuilder.group({ contentPartnerName: new FormControl('', [Validators.required, Validators.pattern(/^[a-zA-Z0-9.\-_$/:\[\] ' !]*$/), Validators.maxLength(70)]), partnerCode: new FormControl('', [Validators.required, Validators.pattern(/^[a-zA-Z0-9]*$/), Validators.maxLength(6)]), - websiteUrl: new FormControl('', [Validators.required, Validators.pattern(/^[a-zA-Z0-9.\-_$/:\[\] ' !]*$/), Validators.maxLength(70)]), + websiteUrl: new FormControl('', [Validators.required, Validators.pattern(/^(https?|http):\/\/[^\s/$.?#].[^\s]*$/), Validators.maxLength(70)]), description: new FormControl('', [Validators.required, Validators.pattern(/^[a-zA-Z0-9,.\-_$/:\[\] ' !]*$/), Validators.maxLength(500)]), providerTips: this.formBuilder.array([]), }) diff --git a/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/transformations/transformations.component.html b/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/transformations/transformations.component.html index 32c5b57d..cc3091b4 100644 --- a/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/transformations/transformations.component.html +++ b/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/transformations/transformations.component.html @@ -33,8 +33,8 @@ close -
- +
+
{{fileName}} diff --git a/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/transformations/transformations.component.scss b/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/transformations/transformations.component.scss index c976e96c..59d6a0a4 100644 --- a/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/transformations/transformations.component.scss +++ b/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/transformations/transformations.component.scss @@ -184,6 +184,10 @@ } } +.certificatePreview { + width: 40%; +} + :host ::ng-deep .transformationEditor { .jsoneditor { height: 400px; diff --git a/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/transformations/transformations.component.ts b/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/transformations/transformations.component.ts index d4d96c79..fcb02df9 100644 --- a/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/transformations/transformations.component.ts +++ b/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/transformations/transformations.component.ts @@ -35,6 +35,7 @@ export class TransformationsComponent implements OnInit, OnChanges { contentFileUploaded = false fileName = '' dialogRef: any + certificateUrl = '' //#region (transformation variables) transforamtionType = 'viaForm' @@ -107,6 +108,8 @@ export class TransformationsComponent implements OnInit, OnChanges { trasformationJson = _.get(this.providerConfiguration, 'transformProgressJson[0].spec') } else if (_.get(this.providerDetalsBeforUpdate, 'certificateTemplateUrl')) { this.contentFileUploaded = true + this.certificateUrl = this.generatePublicUrl(_.get(this.providerDetalsBeforUpdate, 'certificateTemplateUrl')) + this.fileName = this.getImageName(_.get(this.providerDetalsBeforUpdate, 'certificateTemplateUrl')) } if (trasformationJson) { @@ -126,6 +129,27 @@ export class TransformationsComponent implements OnInit, OnChanges { } } + generatePublicUrl(googleUrl: string): string { + const urlToReplace = 'https://storage.googleapis.com/igot' + let url = googleUrl + if (googleUrl.startsWith(urlToReplace)) { + const urlSplice = googleUrl.slice(urlToReplace.length).split('/') + url = `${environment.karmYogiPath}/content-store/${urlSplice.slice(1).join('/')}` + } + return url + } + + getImageName(url: string): string { + const lastSlashIndex = url.lastIndexOf('/') + const imageWithPrefix = url.slice(lastSlashIndex + 1) + const firstUnderscoreIndex = imageWithPrefix.indexOf('_') + if (firstUnderscoreIndex !== -1) { + return imageWithPrefix.slice(firstUnderscoreIndex + 1) + } + + return imageWithPrefix + } + ngOnInit(): void { } @@ -141,6 +165,7 @@ export class TransformationsComponent implements OnInit, OnChanges { this.showSnackBar('Please upload a file less than 100 MB') } else { this.contentFile = file + this.certificateUrl = URL.createObjectURL(file) this.contentFileUploaded = true if (this.fileName.toLowerCase().endsWith('.csv')) { this.getCsvHeaders(file) @@ -254,6 +279,9 @@ export class TransformationsComponent implements OnInit, OnChanges { } }, error: (error: HttpErrorResponse) => { + if (this.contentFileUploaded) { + this.providerDetalsBeforUpdate['certificateTemplateUrl'] = '' + } const errmsg = _.get(error, 'error.params.errMsg', 'Something went worng, please try again later') this.showSnackBar(errmsg) }, @@ -434,16 +462,10 @@ export class TransformationsComponent implements OnInit, OnChanges { } uploadCertificate(formData: any) { - this.marketPlaceSvc.uploadCIOSContract(formData).subscribe({ + this.marketPlaceSvc.uploadThumbNail(formData).subscribe({ next: responce => { const createdUrl = _.get(responce, 'result.url') - const urlToReplace = 'https://storage.googleapis.com/igot' - let url = createdUrl - if (createdUrl.startsWith(urlToReplace)) { - const urlSplice = createdUrl.slice(urlToReplace.length).split('/') - url = `${environment.karmYogiPath}/content-store/${urlSplice.slice(1).join('/')}` - } - this.providerDetalsBeforUpdate['certificateTemplateUrl'] = url + this.providerDetalsBeforUpdate['certificateTemplateUrl'] = createdUrl this.fileName = '' this.upDateTransforamtionDetails() this.dialogRef.close() diff --git a/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/via-api/via-api.component.scss b/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/via-api/via-api.component.scss index 0d417c9b..1c192cd5 100644 --- a/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/via-api/via-api.component.scss +++ b/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/via-api/via-api.component.scss @@ -103,6 +103,21 @@ min-height: 803px; padding: 24px; + .lable { + /* stylelint-enable */ + font: 700 14px Lato; + /* stylelint-disable */ + color: #212529; + width: 50%; + } + + .colun { + /* stylelint-enable */ + font: 700 14px Lato; + /* stylelint-disable */ + color: #212529; + width: 5px; + } } .transformation-required { diff --git a/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/via-api/via-api.component.ts b/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/via-api/via-api.component.ts index c7deeb1d..5c666ac6 100644 --- a/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/via-api/via-api.component.ts +++ b/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/via-api/via-api.component.ts @@ -30,6 +30,15 @@ export class ViaApiComponent implements OnInit, OnChanges { paramsFormGroup!: FormGroup bodyFormGroup!: FormGroup authenticationFormGroup!: FormGroup + //#region (values added dummy) + // transforamtionForm!: FormGroup + // providerDetalsBeforUpdate: any + // transFormContentKeysAndControls: { + // lable: string, + // controlName: string, + // path: string + // }[] = [] + //#endregion apiTypesList: any[] = [] delayTabLoad = true displayUrl = '' @@ -211,6 +220,11 @@ export class ViaApiComponent implements OnInit, OnChanges { if (changes.viaApiTabIndex && changes.viaApiTabIndex.currentValue === this.tabIndex) { this.delayTabLoad = false } + // if (changes.providerDetails && + // changes.providerDetails.currentValue) { + // this.providerDetalsBeforUpdate = JSON.parse(JSON.stringify(changes.providerDetails.currentValue)) + // this.initializTransforamtionControls() + // } if (changes.providerDetails && changes.providerDetails.previousValue === undefined) { this.getCoursesConfiguration() } @@ -291,6 +305,39 @@ export class ViaApiComponent implements OnInit, OnChanges { } } + //#region (code to remove. added dummy data) + // initializTransforamtionControls() { + // this.transformationSpecForm = new FormControl( + // _.get(this.providerDetalsBeforUpdate, this.transformationType, {}), Validators.required) + // this.transforamtionForm = this.formBuilder.group({}) + // this.providerDetalsBeforUpdate['certificateTemplateUrl'] = + // _.get(this.providerDetalsBeforUpdate, 'certificateTemplateUrl', '').replace(' ', '') + // let trasformationJson: any = {} + // if (this.transformationType === 'transformContentViaApi') { + // trasformationJson = _.get(this.providerConfiguration, 'trasformContentJson[0].spec') + // } else if (this.transformationType === 'transformProgressJson') { + // trasformationJson = _.get(this.providerConfiguration, 'transformProgressJson[0].spec') + // // } else if (_.get(this.providerDetalsBeforUpdate, 'certificateTemplateUrl')) { + // // this.contentFileUploaded = true + // } + + // if (trasformationJson) { + // Object.entries(trasformationJson).forEach(([key, path]) => { + // const transFormContentKeysAndControl: { + // lable: string, + // controlName: string, + // path: string + // } = { + // lable: key, + // controlName: key.replace(' ', ''), + // path: path as string, + // } + // this.transforamtionForm.addControl(key.replace(' ', ''), new FormControl('', Validators.required)) + // this.transFormContentKeysAndControls.push(transFormContentKeysAndControl) + // }) + // } + // } + ngOnInit(): void { } From d3c5524744a1616d169270702903d8afcdf965bf Mon Sep 17 00:00:00 2001 From: mansurskTarento Date: Mon, 3 Mar 2025 17:31:51 +0530 Subject: [PATCH 2/4] fixing website url issue --- .../configure-marketplace-providers.component.html | 4 +++- .../configure-marketplace-providers.component.ts | 8 ++++++++ .../provider-details/provider-details.component.html | 8 ++++---- .../provider-details/provider-details.component.ts | 2 +- .../transformations/transformations.component.scss | 2 ++ 5 files changed, 18 insertions(+), 6 deletions(-) diff --git a/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/configure-marketplace-providers/configure-marketplace-providers.component.html b/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/configure-marketplace-providers/configure-marketplace-providers.component.html index eaf1dbaf..b4881d31 100644 --- a/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/configure-marketplace-providers/configure-marketplace-providers.component.html +++ b/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/configure-marketplace-providers/configure-marketplace-providers.component.html @@ -37,7 +37,9 @@
Open & follow these instruction - 1.Please ensure the Certificate file is named correctly. + + {{i+1}}.{{instruction}} +
Website URL
- + Website URL is mandatory @@ -82,9 +82,9 @@ *ngIf="getControlValidation('websiteUrl', 'pattern')"> Please give valid URL - - Only ( a-z/A-Z/0-9 . - _ $ / : [ ]' !) characters are supported - {{getTextLength('websiteUrl')}}/70 + + + {{getTextLength('websiteUrl')}}/1024
diff --git a/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/provider-details/provider-details.component.ts b/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/provider-details/provider-details.component.ts index 136407d6..bc5bdead 100644 --- a/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/provider-details/provider-details.component.ts +++ b/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/provider-details/provider-details.component.ts @@ -64,7 +64,7 @@ export class ProviderDetailsComponent implements OnInit, OnChanges { this.providerFormGroup = this.formBuilder.group({ contentPartnerName: new FormControl('', [Validators.required, Validators.pattern(/^[a-zA-Z0-9.\-_$/:\[\] ' !]*$/), Validators.maxLength(70)]), partnerCode: new FormControl('', [Validators.required, Validators.pattern(/^[a-zA-Z0-9]*$/), Validators.maxLength(6)]), - websiteUrl: new FormControl('', [Validators.required, Validators.pattern(/^(https?|http):\/\/[^\s/$.?#].[^\s]*$/), Validators.maxLength(70)]), + websiteUrl: new FormControl('', [Validators.required, Validators.pattern(/^(https?|http):\/\/[^\s/$.?#].[^\s]*$/), Validators.maxLength(1024)]), description: new FormControl('', [Validators.required, Validators.pattern(/^[a-zA-Z0-9,.\-_$/:\[\] ' !]*$/), Validators.maxLength(500)]), providerTips: this.formBuilder.array([]), }) diff --git a/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/transformations/transformations.component.scss b/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/transformations/transformations.component.scss index 59d6a0a4..9626d0ec 100644 --- a/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/transformations/transformations.component.scss +++ b/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/transformations/transformations.component.scss @@ -186,6 +186,8 @@ .certificatePreview { width: 40%; + min-width: 180px; + max-width: 400px; } :host ::ng-deep .transformationEditor { From 20340b4f0534f58347cb35f79241d5d81a10ec55 Mon Sep 17 00:00:00 2001 From: mansurskTarento Date: Mon, 3 Mar 2025 17:50:44 +0530 Subject: [PATCH 3/4] checking google url --- .../components/transformations/transformations.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/transformations/transformations.component.ts b/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/transformations/transformations.component.ts index fcb02df9..406aaf9b 100644 --- a/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/transformations/transformations.component.ts +++ b/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/transformations/transformations.component.ts @@ -132,7 +132,7 @@ export class TransformationsComponent implements OnInit, OnChanges { generatePublicUrl(googleUrl: string): string { const urlToReplace = 'https://storage.googleapis.com/igot' let url = googleUrl - if (googleUrl.startsWith(urlToReplace)) { + if (googleUrl && googleUrl.startsWith(urlToReplace)) { const urlSplice = googleUrl.slice(urlToReplace.length).split('/') url = `${environment.karmYogiPath}/content-store/${urlSplice.slice(1).join('/')}` } From 796598044220fbf47738ce3878d06ce6e7e9292d Mon Sep 17 00:00:00 2001 From: mansurskTarento Date: Mon, 3 Mar 2025 17:56:57 +0530 Subject: [PATCH 4/4] undefined for certificateTemplateUrl --- .../transformations.component.ts | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/transformations/transformations.component.ts b/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/transformations/transformations.component.ts index 406aaf9b..4e5ec463 100644 --- a/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/transformations/transformations.component.ts +++ b/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/transformations/transformations.component.ts @@ -140,14 +140,17 @@ export class TransformationsComponent implements OnInit, OnChanges { } getImageName(url: string): string { - const lastSlashIndex = url.lastIndexOf('/') - const imageWithPrefix = url.slice(lastSlashIndex + 1) - const firstUnderscoreIndex = imageWithPrefix.indexOf('_') - if (firstUnderscoreIndex !== -1) { - return imageWithPrefix.slice(firstUnderscoreIndex + 1) - } + if (url) { + const lastSlashIndex = url.lastIndexOf('/') + const imageWithPrefix = url.slice(lastSlashIndex + 1) + const firstUnderscoreIndex = imageWithPrefix.indexOf('_') + if (firstUnderscoreIndex !== -1) { + return imageWithPrefix.slice(firstUnderscoreIndex + 1) + } - return imageWithPrefix + return imageWithPrefix + } + return url } ngOnInit(): void {