Skip to content

Commit cfa8cc0

Browse files
Merge pull request #164 from mansurskTarento/cios-via-api
Cios via api
2 parents 55db521 + 364b012 commit cfa8cc0

File tree

5 files changed

+23
-14
lines changed

5 files changed

+23
-14
lines changed

project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/content-upload/content-upload.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
</mat-panel-description>
5555
</mat-expansion-panel-header>
5656
<ws-app-transformations [providerDetails]="providerDetails"
57-
[transformationType]="'trasformContentJson'" (loadProviderDetails)="sendDetailsUpdateEvent()"
57+
[transformationType]="'transformProgressJson'" (loadProviderDetails)="sendDetailsUpdateEvent()"
5858
(loadTablesData)="getTablesData()">
5959
</ws-app-transformations>
6060
</mat-expansion-panel>

project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/help-center-guide/help-center-guide.component.html

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@
88
</div>
99
<div class="pt-5" *ngIf="showTopSection">
1010
<div class="flex gap-20 items-center justify-between">
11-
<div class="flex-1 flex-col gap-4">
12-
<p class="flex items-center" *ngFor="let note of helpCenterGuide?.guideNotes">
13-
<mat-icon class="mat-icon mr-4">error_outline</mat-icon>
14-
<span>{{note}}</span>
15-
</p>
11+
<div class="flex flex-column gap-4">
12+
<ng-container *ngFor="let note of helpCenterGuide?.guideNotes">
13+
<div class="flex w-full gap-3">
14+
<div><mat-icon class="mat-icon mr-4">error_outline</mat-icon></div>
15+
<div>{{note}}</div>
16+
</div>
17+
</ng-container>
1618
</div>
1719
<div class="pb-3">
1820
<div class="helpCenterDemo flex justify-end section-2">

project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/transformations/transformations.component.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@
7979
{{transforamtionForm.value[transFormControl.controlName]}}
8080
</mat-option>
8181
</ng-container>
82+
<mat-option value="">
83+
select
84+
</mat-option>
8285
</mat-select>
8386
</mat-form-field>
8487
<span class="colun">:</span>

project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/transformations/transformations.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ export class TransformationsComponent implements OnInit, OnChanges {
249249
})
250250

251251
} else {
252-
const message = 'Please provide all mandatory fields'
252+
const message = this.transforamtionType === 'viaForm' ? 'Please provide all mandatory fields' : 'Please provide spec json'
253253
this.showSnackBar(message)
254254
}
255255
}
@@ -286,7 +286,7 @@ export class TransformationsComponent implements OnInit, OnChanges {
286286
header = 'Upload Course Catalog'
287287
break
288288
case 'transformProgressJson':
289-
header = 'Upload Course Pregress'
289+
header = 'Upload Course Progress'
290290
break
291291
case 'certificateTemplateUrl':
292292
header = 'Upload Course Certificate'

project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/via-api/via-api.component.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,10 @@ export class ViaApiComponent implements OnInit, OnChanges {
125125
}
126126
})
127127
this.viaApiFormGroup.controls.apiUrl.valueChanges.subscribe((event: string) => {
128-
if (event !== this.displayUrl) {
128+
const trimValue = event.replace(' ', '')
129+
if (trimValue !== event) {
130+
this.viaApiFormGroup.controls.apiUrl.patchValue(trimValue)
131+
} else if (event !== this.displayUrl) {
129132
this.displayUrl = event
130133
this.apiUrlEdited = true
131134
this.constructParamsFormArray()
@@ -268,7 +271,7 @@ export class ViaApiComponent implements OnInit, OnChanges {
268271
this.authenticationFormGroup.controls.rawData.patchValue(authPayload)
269272
}
270273

271-
const transformContent = _.get(configurationDetails, this.transformationType, _.get(this.providerConfiguration, this.transformationType))
274+
const transformContent = _.get(this.providerDetails, this.transformationType, _.get(this.providerConfiguration, this.transformationType))
272275
this.transformationSpecForm.patchValue(transformContent)
273276

274277
}
@@ -323,13 +326,13 @@ export class ViaApiComponent implements OnInit, OnChanges {
323326
get getUpdateBtnText(): string {
324327
let btnText = ''
325328
if (this.transformationType === 'transformContentViaApi') {
326-
if (this.providerConfiguration.trasformContentViaApi) {
329+
if (this.providerConfiguration && this.providerConfiguration.transformContentViaApi) {
327330
btnText = 'Update Transform Content'
328331
} else {
329332
btnText = 'Save Transform Content'
330333
}
331334
} else if (this.transformationType === 'transformProgressViaApi') {
332-
if (this.providerConfiguration.transformProgressViaApi) {
335+
if (this.providerConfiguration && this.providerConfiguration.transformProgressViaApi) {
333336
btnText = 'Update Transform Progress'
334337
} else {
335338
btnText = 'Save Transform Progress'
@@ -392,6 +395,7 @@ export class ViaApiComponent implements OnInit, OnChanges {
392395
serviceDetails['serviceCode'] = this.servicesFormGroup.controls.serviceCode.value.toUpperCase()
393396
const params = this.getParamsAndUrl()
394397
const isFormData = this.bodyFormGroup.value.tableListFormArray[0].key ? true : false
398+
const authPayload = _.get(this.authenticationFormGroup, 'value.rawData', '{}')
395399
const formBody = {
396400
isFormData,
397401
requestMethod: this.viaApiFormGroup.controls.apiType.value,
@@ -411,7 +415,7 @@ export class ViaApiComponent implements OnInit, OnChanges {
411415
headerMap: this.generateObjectFromForm(this.headersFormGroup.value.tableListFormArray),
412416
urlMap: this.generateObjectFromForm(this.paramsFormGroup.value.tableListFormArray, true)
413417
},
414-
authPayload: this.authenticationFormGroup.value.rawData,
418+
authPayload: authPayload ? authPayload : {},
415419
strictCache: serviceDetails.strictCache,
416420
strictCacheTimeInMinutes: serviceDetails.strictCacheTimeInMinutes
417421
}
@@ -477,7 +481,7 @@ export class ViaApiComponent implements OnInit, OnChanges {
477481
})
478482

479483
} else {
480-
const message = 'Please provide all mandatory fields'
484+
const message = this.transforamtionType === 'viaForm' ? 'Please provide all mandatory fields' : 'Please provide spec json'
481485
this.showSnackBar(message)
482486
}
483487
}

0 commit comments

Comments
 (0)