Commit 153823b8 authored by sourabh_roy's avatar sourabh_roy
Browse files

osdu eds ui modifications

parent 4b8fcaa8
Pipeline #47231 failed with stages
in 2 minutes and 4 seconds
......@@ -2,7 +2,7 @@
<div class="modal-header" style=" padding: 4px 20px;" id="videoTitle">
<h4 class="modal-title" id="videoTitle1" style="width: 100%;">
Service Account
Authorization Profile
<button style="float: right;"
type="button"
(click)="closePopup()"
......@@ -19,21 +19,25 @@
<table>
<tr>
<td>
<label>Service Account Name:&nbsp; </label>
<label> Authorization Profile Name:&nbsp; </label>
</td>
<td>
<input type="text" placeholder="Service Account Label" [(ngModel)]="txtAccLabel" name="txtAccLabel">
<input type="text" placeholder="Authorization Profile Name" [(ngModel)]="ngAuthProfileName" name="txtAccLabel">
</td>
</tr>
<!-- <tr>
<tr>
<td>
<label>Authorization Type: </label>
<label>OAuth Grant Type: </label>
</td>
<td>
<input type="text" placeholder="Authorization Type" [(ngModel)]="txtAccAuthType" name="txtAccAuthType">
<select class="form-control" [(ngModel)]="ngAuthType" (change)="onAuthTypeChange($event.target.value)" name="ngParameters">
<option value="0" disabled="disabled" selected="selected">OAuth Grant Type</option>
<option value="{{type}}" *ngFor="let type of grantTypes">{{type}}</option>
</select>
</td>
</tr> -->
<tr>
</tr>
<!-- <tr>
<td>
<label>Account Name: </label>
</td>
......@@ -56,7 +60,115 @@
<td>
<input type="text" placeholder="Auth Server Endpoint" [(ngModel)]="txtAuthEndpoint" name="txtAuthEndpoint">
</td>
</tr>
</tr> -->
</table>
<table *ngIf="isAuthTypeSelected && isAuthType">
<tr>
<td style=" width: 45%;">
<label>Flow: </label>
</td>
<td>
<input type="text" placeholder="Flow" [(ngModel)]="ngFlow" name="ngFlow">
</td>
</tr>
<tr>
<td >
<label>Callback Url: </label>
</td>
<td>
<input type="text" placeholder="Callback Url" [(ngModel)]="ngCallbackUrl" name="txtAccName">
</td>
</tr>
<tr>
<td>
<label>Authorization URL: </label>
</td>
<td>
<input type="text" placeholder="Authorization URL" [(ngModel)]="ngAuthEndpoints" name="txtSecretManKey">
</td>
</tr>
<tr>
<td>
<label>Token URL: </label>
</td>
<td>
<input type="text" placeholder="Token URL" [(ngModel)]="ngTokenEndpoints" name="txtSecretManKey">
</td>
</tr>
<tr>
<td>
<label>Client Id: </label>
</td>
<td>
<input type="text" placeholder="Client Id" [(ngModel)]="ngClientId" name="txtSecretManKey">
</td>
</tr>
<tr>
<td>
<label>Client Secret: </label>
</td>
<td>
<input type="text" placeholder="Token Endpoint" [(ngModel)]="ngClientSecret" name="txtSecretManKey">
</td>
</tr>
<tr>
<td>
<label>Scopes: </label>
</td>
<td>
<select class="form-control" [(ngModel)]="ngScope" name="ngParameters">
<option value="0" selected="selected">Scopes</option>
<option value="{{type}}" *ngFor="let type of grantTypes">{{type}}</option>
</select>
</td>
</tr>
</table>
<table *ngIf="isAuthTypeSelected && isBearerToken">
<tr>
<td style=" width: 45%;">
<label>Access Token: </label>
</td>
<td>
<input type="text" placeholder="Access Token" [(ngModel)]="ngAccToken" name="ngAccToken">
</td>
</tr>
<!-- <tr>
<td>
<label>Secret Manager Key: </label>
</td>
<td>
<input type="text" placeholder="Secret Manager Key" [(ngModel)]="txtSecretManKey" name="txtSecretManKey">
</td>
</tr>
<tr>
<td>
<label>Token URL: </label>
</td>
<td>
<input type="text" placeholder="Auth Server Endpoint" [(ngModel)]="txtAuthEndpoint" name="txtAuthEndpoint">
</td>
</tr> -->
</table>
<table *ngIf="isAuthTypeSelected && isAPIKey">
<tr>
<td style=" width: 45%;">
<label>API Key: </label>
</td>
<td>
<input type="text" placeholder="API Key" [(ngModel)]="ngAPIKey" name="ngAPIKey">
</td>
</tr>
</table>
<table>
<tr>
<td style=" width: 45%;">
<label>Secret Repository URL: </label>
</td>
<td>
<input type="text" placeholder="Secret Repository URL" [(ngModel)]="ngSecretRepoUrl" name="ngSecretRepoUrl">
</td>
</tr>
</table>
</form>
<div style="text-align: center;">
......@@ -75,3 +187,110 @@
<!-- <ngx-spinner bdColor = "rgba(0, 0, 0, 0.4)" size = "medium" color = "#fff" type = "ball-scale-multiple" ><p style="color: white" > Loading... </p></ngx-spinner>
<div class="modal-header" style=" padding: 4px 20px;" id="videoTitle">
<h4 class="modal-title" id="videoTitle1" style="width: 100%;">
Authorization Profile
<button style="float: right;"
type="button"
(click)="closePopup()"
class="close"
data-dismiss="modal"
aria-label="Close"
>
&times;
</button>
</h4>
</div>
<div class="modal-body" style=" height: auto;">
<form #myForm id="myForm">
<table>
<tr>
<td>
<label> Authorization Profile Name:&nbsp; </label>
</td>
<td>
<input type="text" placeholder="Authorization Profile Name" [(ngModel)]="txtAccLabel" name="txtAccLabel">
</td>
</tr>
<tr>
<td>
<label>OAuth Grant Type: </label>
</td>
<td>
<select class="form-control" [(ngModel)]="ngParameters" name="ngParameters">
<option value="0" selected="selected">OAuth Grant Type</option>
<option value="{{type}}" *ngFor="let type of grantTypes">{{type}}</option>
</select>
</td>
</tr>
<tr>
<td>
<label>Callback Url: </label>
</td>
<td>
<input type="text" placeholder="Callback Url" [(ngModel)]="txtAccName" name="txtAccName">
</td>
</tr>
<tr>
<td>
<label>Authorization Endpoint: </label>
</td>
<td>
<input type="text" placeholder="Authorization Endpoint" [(ngModel)]="txtSecretManKey" name="txtSecretManKey">
</td>
</tr>
<tr>
<td>
<label>Token Endpoint: </label>
</td>
<td>
<input type="text" placeholder="Token Endpoint" [(ngModel)]="txtSecretManKey" name="txtSecretManKey">
</td>
</tr>
<tr>
<td>
<label>Client Id: </label>
</td>
<td>
<input type="text" placeholder="Client Id" [(ngModel)]="txtSecretManKey" name="txtSecretManKey">
</td>
</tr>
<tr>
<td>
<label>Client Secret: </label>
</td>
<td>
<input type="text" placeholder="Token Endpoint" [(ngModel)]="txtSecretManKey" name="txtSecretManKey">
</td>
</tr>
<tr>
<td>
<label>Scopes: </label>
</td>
<td>
<select class="form-control" [(ngModel)]="ngParameters" name="ngParameters">
<option value="0" selected="selected">Scopes</option>
<option value="{{type}}" *ngFor="let type of grantTypes">{{type}}</option>
</select>
</td>
</tr>
</table>
</form>
<div style="text-align: center;">
<p *ngIf="isSuccess" style="color:green"> {{successMessge}}</p>
<p *ngIf="isError" style="color:red"> {{errorMessge}}</p>
</div>
<div class="row" style="justify-content: center;">
<button class="btn btn-success" form="login-form" type="submit"
style="width: 150px;" (click)="requestSubmit()" >
{{btnLabel}}<i class="icon-material-outline-arrow-right-alt"></i>
</button>
</div>
</div>
-->
......@@ -3,6 +3,7 @@ import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
import { NgxSpinnerService } from 'ngx-spinner';
import { CommonService } from 'src/app/common/common.service';
import { RestAPILayerService } from 'src/app/common/rest-apilayer.service';
import {grantTypes,scope} from '../../../config';
@Component({
selector: 'app-add-service-acc',
......@@ -24,6 +25,27 @@ export class AddServiceAccComponent implements OnInit {
txtAuthEndpoint='';
Type;
btnLabel='';
grantTypes=grantTypes;
scope=scope;
ngAuthProfileName;
ngAuthType='0';
ngCallbackUrl;
ngAuthEndpoints;
ngTokenEndpoints;
ngClientId;
ngClientSecret;
ngScope='0';
ngFlow;
ngSecretRepoUrl;
ngAccToken;
ngAPIKey;
isAuthType:boolean;
isBearerToken:boolean;
isAPIKey:boolean;
isAuthTypeSelected:boolean=false;
constructor(public activeModal: NgbActiveModal,public cmnSrvc: CommonService, private spinner: NgxSpinnerService,public restService:RestAPILayerService,) { }
ngOnInit(): void {
......@@ -42,6 +64,28 @@ export class AddServiceAccComponent implements OnInit {
closePopup(){
this.activeModal.close();
}
onAuthTypeChange(val){
this.isAuthTypeSelected=true;
if(val != 0){
if(val=="OAuth2"){
this.isAuthType=true;
this.isBearerToken=false;
this.isAPIKey=false;
}
else if(val=="Bearer Token"){
this.isAuthType=false;
this.isBearerToken=true;
this.isAPIKey=false;
}
else if(val=="API Key"){
this.isAuthType=false;
this.isBearerToken=false;
this.isAPIKey=true;
}
}
}
requestSubmit(){
let count=0;
for (let element in this) {
......
......@@ -81,7 +81,7 @@ export class ExternalDataSourceComponent implements OnInit {
this.eds_connectionsource_List=result["results"];
}, (err) => {
this.spinner.hide();
console.log(err);
});
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment