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..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 @@ -14,7 +14,7 @@ (loadProviderDetails)="getProviderDetails($event)"> - +
+ + + +
+ + +
+
+ Configure Certificate +
+
+ +
+
+ Open & follow these instruction + + {{i+1}}.{{instruction}} + +
+ + +
+
+
+
+
+
+ + + +
+ + + + 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..14fba3dd 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,18 @@ 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`, + } + + instructionsList = [ + 'Please ensure the Certificate file is named correctly' + ] + constructor( private activateRoute: ActivatedRoute, private snackBar: MatSnackBar, @@ -41,6 +53,10 @@ export class ConfigureMarketplaceProvidersComponent implements OnInit { this.disableCourseCatalog = false this.providerDetails = data.providerDetails.data.result } + if (_.get(data, 'pageData.data.configureCertificateGuide')) { + this.helpCenterGuide = _.get(data, 'pageData.data.configureCertificateGuide.helpCenterGuide', this.helpCenterGuide) + this.instructionsList = _.get(data, 'pageData.data.configureCertificateGuide.instructions', this.instructionsList) + } }) } @@ -61,6 +77,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..f3b2c27d 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 @@ -73,18 +73,18 @@ Website URL - + Website URL is mandatory - Only ( a-z/A-Z/0-9 . - _ $ / : [ ]' !) characters are supported + 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 8066d4f3..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(/^[a-zA-Z0-9.\-_$/:\[\] ' !]*$/), 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.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..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 @@ -184,6 +184,12 @@ } } +.certificatePreview { + width: 40%; + min-width: 180px; + max-width: 400px; +} + :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..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 @@ -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,30 @@ export class TransformationsComponent implements OnInit, OnChanges { } } + generatePublicUrl(googleUrl: string): string { + const urlToReplace = 'https://storage.googleapis.com/igot' + let url = googleUrl + if (googleUrl && 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 { + 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 url + } + ngOnInit(): void { } @@ -141,6 +168,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 +282,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 +465,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 { }