Skip to content

Commit

Permalink
Merge pull request #164 from mansurskTarento/cios-via-api
Browse files Browse the repository at this point in the history
Cios via api
  • Loading branch information
venkykandagaddala authored Jan 17, 2025
2 parents 55db521 + 364b012 commit cfa8cc0
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
</mat-panel-description>
</mat-expansion-panel-header>
<ws-app-transformations [providerDetails]="providerDetails"
[transformationType]="'trasformContentJson'" (loadProviderDetails)="sendDetailsUpdateEvent()"
[transformationType]="'transformProgressJson'" (loadProviderDetails)="sendDetailsUpdateEvent()"
(loadTablesData)="getTablesData()">
</ws-app-transformations>
</mat-expansion-panel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@
</div>
<div class="pt-5" *ngIf="showTopSection">
<div class="flex gap-20 items-center justify-between">
<div class="flex-1 flex-col gap-4">
<p class="flex items-center" *ngFor="let note of helpCenterGuide?.guideNotes">
<mat-icon class="mat-icon mr-4">error_outline</mat-icon>
<span>{{note}}</span>
</p>
<div class="flex flex-column gap-4">
<ng-container *ngFor="let note of helpCenterGuide?.guideNotes">
<div class="flex w-full gap-3">
<div><mat-icon class="mat-icon mr-4">error_outline</mat-icon></div>
<div>{{note}}</div>
</div>
</ng-container>
</div>
<div class="pb-3">
<div class="helpCenterDemo flex justify-end section-2">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@
{{transforamtionForm.value[transFormControl.controlName]}}
</mat-option>
</ng-container>
<mat-option value="">
select
</mat-option>
</mat-select>
</mat-form-field>
<span class="colun">:</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ export class TransformationsComponent implements OnInit, OnChanges {
})

} else {
const message = 'Please provide all mandatory fields'
const message = this.transforamtionType === 'viaForm' ? 'Please provide all mandatory fields' : 'Please provide spec json'
this.showSnackBar(message)
}
}
Expand Down Expand Up @@ -286,7 +286,7 @@ export class TransformationsComponent implements OnInit, OnChanges {
header = 'Upload Course Catalog'
break
case 'transformProgressJson':
header = 'Upload Course Pregress'
header = 'Upload Course Progress'
break
case 'certificateTemplateUrl':
header = 'Upload Course Certificate'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,10 @@ export class ViaApiComponent implements OnInit, OnChanges {
}
})
this.viaApiFormGroup.controls.apiUrl.valueChanges.subscribe((event: string) => {
if (event !== this.displayUrl) {
const trimValue = event.replace(' ', '')
if (trimValue !== event) {
this.viaApiFormGroup.controls.apiUrl.patchValue(trimValue)
} else if (event !== this.displayUrl) {
this.displayUrl = event
this.apiUrlEdited = true
this.constructParamsFormArray()
Expand Down Expand Up @@ -268,7 +271,7 @@ export class ViaApiComponent implements OnInit, OnChanges {
this.authenticationFormGroup.controls.rawData.patchValue(authPayload)
}

const transformContent = _.get(configurationDetails, this.transformationType, _.get(this.providerConfiguration, this.transformationType))
const transformContent = _.get(this.providerDetails, this.transformationType, _.get(this.providerConfiguration, this.transformationType))
this.transformationSpecForm.patchValue(transformContent)

}
Expand Down Expand Up @@ -323,13 +326,13 @@ export class ViaApiComponent implements OnInit, OnChanges {
get getUpdateBtnText(): string {
let btnText = ''
if (this.transformationType === 'transformContentViaApi') {
if (this.providerConfiguration.trasformContentViaApi) {
if (this.providerConfiguration && this.providerConfiguration.transformContentViaApi) {
btnText = 'Update Transform Content'
} else {
btnText = 'Save Transform Content'
}
} else if (this.transformationType === 'transformProgressViaApi') {
if (this.providerConfiguration.transformProgressViaApi) {
if (this.providerConfiguration && this.providerConfiguration.transformProgressViaApi) {
btnText = 'Update Transform Progress'
} else {
btnText = 'Save Transform Progress'
Expand Down Expand Up @@ -392,6 +395,7 @@ export class ViaApiComponent implements OnInit, OnChanges {
serviceDetails['serviceCode'] = this.servicesFormGroup.controls.serviceCode.value.toUpperCase()
const params = this.getParamsAndUrl()
const isFormData = this.bodyFormGroup.value.tableListFormArray[0].key ? true : false
const authPayload = _.get(this.authenticationFormGroup, 'value.rawData', '{}')
const formBody = {
isFormData,
requestMethod: this.viaApiFormGroup.controls.apiType.value,
Expand All @@ -411,7 +415,7 @@ export class ViaApiComponent implements OnInit, OnChanges {
headerMap: this.generateObjectFromForm(this.headersFormGroup.value.tableListFormArray),
urlMap: this.generateObjectFromForm(this.paramsFormGroup.value.tableListFormArray, true)
},
authPayload: this.authenticationFormGroup.value.rawData,
authPayload: authPayload ? authPayload : {},
strictCache: serviceDetails.strictCache,
strictCacheTimeInMinutes: serviceDetails.strictCacheTimeInMinutes
}
Expand Down Expand Up @@ -477,7 +481,7 @@ export class ViaApiComponent implements OnInit, OnChanges {
})

} else {
const message = 'Please provide all mandatory fields'
const message = this.transforamtionType === 'viaForm' ? 'Please provide all mandatory fields' : 'Please provide spec json'
this.showSnackBar(message)
}
}
Expand Down

0 comments on commit cfa8cc0

Please sign in to comment.