Skip to content

Commit

Permalink
Merge pull request #156 from mansurskTarento/cios-via-api
Browse files Browse the repository at this point in the history
cios via csv new ui changes
  • Loading branch information
venkykandagaddala authored Jan 9, 2025
2 parents c4ee0d7 + 6d0c75a commit 7eaeee4
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
</mat-card>

<ng-container *ngIf="!delayTabLoad">
<mat-tab-group [ngClass]="{'hideTabs': uploadMode === 'viaApi'}">
<mat-tab-group [ngClass]="{'hideTabs': !(uploadMode === 'viaCsv' && viaApiTabIndex === 0)}">
<mat-tab label="Upload Status">
<div class="w-full mt-3 flex flex-col">
<ng-container *ngIf="!showUploadedStatusLoader; else showLoader">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,58 @@
Configure Courses API
</div>
<div class="viaApi">

<div class="linkLable required flex items-center">
Link
<mat-icon class="info-icon">info_outline</mat-icon>
</div>

<div class="flex gap-4 viaApiUrl">
<form [formGroup]="viaApiFormGroup" class="flex w-full gap-0">
<div class="apiTypeSelect">
<mat-form-field appearance="outline" class="w-full">
<mat-select class="event-select" formControlName="apiType" placeholder="Select">
<ng-container *ngFor="let type of apiTypesList">
<mat-option [value]="type.value">{{type.type}}</mat-option>
</ng-container>
</mat-select>
</mat-form-field>
</div>
<div class="apiUrl w-full">
<mat-form-field appearance="outline" class="w-full">
<input type="text" matInput formControlName="apiUrl" placeholder="API Url">
</mat-form-field>
</div>
</form>
</div>

<div class="vai-api-tabs mt-1">
<ng-container *ngIf="!delayTabLoad">
<mat-tab-group>
<mat-tab label="Params">
<ws-app-via-api-params-table [tableListFormGroup]="paramsFormGroup"
[paramsType]="'params'"></ws-app-via-api-params-table>
</mat-tab>
<mat-tab label="Headers">
<ws-app-via-api-params-table [tableListFormGroup]="headersFormGroup"
[paramsType]="'headers'"></ws-app-via-api-params-table>
</mat-tab>
<mat-tab label="Body">
<ws-app-via-api-params-table [tableListFormGroup]="bodyFormGroup"
[paramsType]="'body'"></ws-app-via-api-params-table>
</mat-tab>
<ng-container *ngIf="servicesFormGroup?.controls?.isAuthenticated.value">
<mat-tab label="Authentication">
<ws-app-via-api-params-table [tableListFormGroup]="authenticationFormGroup"
[paramsType]="'authentication'"></ws-app-via-api-params-table>
</mat-tab>
</ng-container>
</mat-tab-group>
</ng-container>
</div>

<form [formGroup]="servicesFormGroup">
<div class="flex flex-column gap-14">
<div class="flex flex-column gap-14 mt-14">
<div class="flex flex-column gap-1 w-full">
<div class="flex items-center gap-1 required">
<span class="lable">Service Name</span>
Expand Down Expand Up @@ -71,7 +121,7 @@
</mat-form-field>
</div>

<div class="flex flex-col gap-4 mb-6">
<div class="flex flex-col gap-4">
<div class="flex justify-between">
<mat-slide-toggle formControlName="isAuthenticated" (change)="authenticationToggleChange()">
<span class="lable">Has Authentication</span>
Expand Down Expand Up @@ -102,54 +152,6 @@
</div>
</form>

<div class="linkLable required flex items-center mt-8">
Link
<mat-icon class="info-icon">info_outline</mat-icon>
</div>

<div class="flex gap-4 viaApiUrl">
<form [formGroup]="viaApiFormGroup" class="flex w-full gap-0">
<div class="apiTypeSelect">
<mat-form-field appearance="outline" class="w-full">
<mat-select class="event-select" formControlName="apiType" placeholder="Select">
<ng-container *ngFor="let type of apiTypesList">
<mat-option [value]="type.value">{{type.type}}</mat-option>
</ng-container>
</mat-select>
</mat-form-field>
</div>
<div class="apiUrl w-full">
<mat-form-field appearance="outline" class="w-full">
<input type="text" matInput formControlName="apiUrl" placeholder="API Url">
</mat-form-field>
</div>
</form>
</div>

<div class="vai-api-tabs mt-1">
<ng-container *ngIf="!delayTabLoad">
<mat-tab-group>
<mat-tab label="Params">
<ws-app-via-api-params-table [tableListFormGroup]="paramsFormGroup"
[paramsType]="'params'"></ws-app-via-api-params-table>
</mat-tab>
<mat-tab label="Headers">
<ws-app-via-api-params-table [tableListFormGroup]="headersFormGroup"
[paramsType]="'headers'"></ws-app-via-api-params-table>
</mat-tab>
<mat-tab label="Body">
<ws-app-via-api-params-table [tableListFormGroup]="bodyFormGroup"
[paramsType]="'body'"></ws-app-via-api-params-table>
</mat-tab>
<ng-container *ngIf="servicesFormGroup?.controls?.isAuthenticated.value">
<mat-tab label="Authentication">
<ws-app-via-api-params-table [tableListFormGroup]="authenticationFormGroup"
[paramsType]="'authentication'"></ws-app-via-api-params-table>
</mat-tab>
</ng-container>
</mat-tab-group>
</ng-container>
</div>
</div>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export class ViaApiComponent implements OnInit, OnChanges {
}

get actualUrl(): string {
const actualUrl = this.actualUrl
const actualUrl = this.viaApiFormGroup.controls.apiUrl.value.split('?')[0]
return actualUrl
}

Expand Down Expand Up @@ -402,7 +402,7 @@ export class ViaApiComponent implements OnInit, OnChanges {

getParamsAndUrl() {
const parmsAndUrl = {
url: `${this.viaApiFormGroup.controls.apiUrl.value.split('?')[0]}`,
url: `${this.actualUrl}`,
urlPlaceholder: '',
}
const params = this.paramsFormGroup.value.tableListFormArray
Expand Down

0 comments on commit 7eaeee4

Please sign in to comment.