multiples changes and opti (git ticket)

version_2
floxx2112 1 year ago
parent cc47e34572
commit 99791e3b2e
  1. 6
      src/app/app.module.ts
  2. 1
      src/app/creation/columns-card/columns-card.component.html
  3. 2
      src/app/creation/columns-card/columns-card.component.ts
  4. 108
      src/app/creation/create-joins-page/create-joins-page.component.html
  5. 1
      src/app/creation/create-joins-page/create-joins-page.component.ts
  6. 92
      src/app/creation/joins-table/joins-table.component.html
  7. 2
      src/app/creation/joins-table/joins-table.component.ts
  8. 77
      src/app/creation/where-card/where-card.component.html
  9. 1
      src/app/creation/where-card/where-card.component.ts
  10. 2
      src/app/custom-pipe/CustomFilterScript.ts
  11. 4
      src/app/custom-pipe/CustomInfoTableSearchPipe.ts
  12. 0
      src/app/custom-pipe/Custom_Ng2SearchPipe.ts
  13. 11
      src/app/directives/dnd.directive.ts
  14. 34
      src/app/joins/joins-page/joins-page.component.html
  15. 4
      src/app/joins/joins-page/joins-page.component.ts
  16. 111
      src/app/manager/add-script/add-script.component.html
  17. 48
      src/app/manager/edit-script/edit-script.component.html
  18. 107
      src/app/manager/script-management/script-management.component.html
  19. 13
      src/app/manager/script-management/script-management.component.ts
  20. 91
      src/app/manager/tags-management/tags-management.component.html
  21. 61
      src/app/menu/navbar/navbar.component.html
  22. 13
      src/app/search/request-page/request-page.component.ts
  23. 8
      src/app/service/script.service.ts

@ -14,7 +14,7 @@ import { MatStepperModule } from '@angular/material/stepper';
import { MatToolbarModule } from '@angular/material/toolbar';
import {MatDialogModule} from '@angular/material/dialog';
import { MatIconModule } from "@angular/material/icon";
import { Custom_Ng2SearchPipe } from './../Custom_Ng2SearchPipe';
import { Custom_Ng2SearchPipe } from './custom-pipe/Custom_Ng2SearchPipe';
import { FormsModule } from '@angular/forms';
import { JoinsPageComponent } from './joins/joins-page/joins-page.component';
import { CreateJoinsPageComponent } from './creation/create-joins-page/create-joins-page.component';
@ -25,8 +25,8 @@ import {MatProgressSpinnerModule} from '@angular/material/progress-spinner';
import { ScriptManagementComponent } from './manager/script-management/script-management.component';
import { AddScriptComponent } from './manager/add-script/add-script.component';
import { DndDirective } from './directives/dnd.directive'
import { CustomFilterScript } from 'src/CustomFilterScript';
import { CustomFilterTable } from 'src/CustomInfoTableSearchPipe';
import { CustomFilterScript } from 'src/app/custom-pipe/CustomFilterScript';
import { CustomFilterTable } from 'src/app/custom-pipe/CustomInfoTableSearchPipe';
import { EditScriptComponent } from './manager/edit-script/edit-script.component';
import { TagsManagementComponent } from './manager/tags-management/tags-management.component';
import { NgMultiSelectDropDownModule } from 'ng-multiselect-dropdown';

@ -1,5 +1,4 @@
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 rounded-lg overflow-hidden shadow-lg bg-slate-300 border-solid border-orange-400 border-2 p-2">
<div>
<label class="text-black text-left">Colonnes(Base) : </label>
<input type="text" class="block w-full my-2 pl-2 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-slate-800 focus:border-slate-800" [(ngModel)]="filterBaseColumn" placeholder="Rechercher...">

@ -21,7 +21,6 @@ export class ColumnsCardComponent {
public sendColumnsData(){
if(this.baseColumnData && this.specificColumnData){
console.log(this.baseColumnData, this.specificColumnData)
let tempsOpe = "AND";
if(this.childIndex === 0){
tempsOpe = "ON";
@ -31,7 +30,6 @@ export class ColumnsCardComponent {
aliasColumn: this.baseColumnData.nameColumn,
specColumn: this.specificColumnData.nameColumn,
}
console.log(tempColumnData)
this.selectedColumn.emit(tempColumnData);
}
}

@ -1,80 +1,74 @@
<!--Card-->
<div class="my-4">
<div class="flex sm:flex-nowrap flex-wrap sm:space-x-4">
<div class="w-full sm:w-2/3 h-full text-center rounded-lg overflow-hidden shadow-lg bg-white p-4 ">
<div class="rounded-lg overflow-hidden shadow-lg bg-slate-100 border-solid border-orange-400 border-2">
<div class="p-4">
<div class="font-bold text-xl text-left">Selectionner un Schéma et une Table (Base) :</div>
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
<div class="mt-2">
<label class="text-black text-left">Schémas : </label>
<input type="text" class="block w-full my-2 pl-2 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-slate-800 focus:border-slate-800" [(ngModel)]="filterBaseSchema" placeholder="Rechercher...">
<div class="flex sm:flex-nowrap flex-wrap sm:space-x-4 my-4">
<div class="w-full sm:w-2/3 h-full text-center rounded-lg overflow-hidden shadow-lg bg-white p-4 ">
<div class="rounded-lg overflow-hidden shadow-lg bg-slate-100 border-solid border-orange-400 border-2 p-4">
<select (change)="useTablesWithBaseSchema($event)" size="3" class="mb-4 bg-gray-50 text-sm text-slate-800 rounded-lg focus:ring-slate-800 focus:border-slate-800 block w-full p-2.5">
<option *ngFor="let schema of allSchema | filter : filterBaseSchema" value="{{ schema }}">{{ schema }}</option>
</select>
</div>
<div class="font-bold text-xl text-left">Selectionner un Schéma et une Table (Base) :</div>
<div *ngIf="tablesByBaseSchema" class="mt-2">
<label *ngIf="!isChecked" class="text-black text-left">Tables : </label>
<label *ngIf="isChecked" class="text-black text-left">Tables et Vues : </label>
<input type="text" class="block w-full my-2 pl-2 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-slate-800 focus:border-slate-800" [(ngModel)]="filterBaseTables" placeholder="Rechercher...">
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
<div class="mt-2">
<label class="text-black text-left">Schémas : </label>
<input type="text" class="block w-full my-2 pl-2 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-slate-800 focus:border-slate-800" [(ngModel)]="filterBaseSchema" placeholder="Rechercher...">
<select [(ngModel)]="baseTableData" (change)="getNameBaseTable()" size="3" class="mb-4 bg-gray-50 text-sm text-slate-800 rounded-lg focus:ring-slate-800 focus:border-slate-800 block w-full p-2.5">
<option *ngFor="let table of tablesByBaseSchema | filter : filterBaseTables" id="{{ table.id }}" [ngValue]="table">{{ table.nameTable }}</option>
</select>
</div>
</div>
<div *ngIf="tablesByBaseSchema">
<input type="checkbox" [(ngModel)]="isChecked" (change)="checkValue(isChecked?'true':'false')" class="w-4 h-4 text-orange-400 bg-slate-400 border-slate-200 rounded focus:ring-orange-400 focus:ring-2"/>
<label class="ml-2 text-sm font-medium text-gray-900 dark:text-gray-300">Afficher aussi les Vues</label>
</div>
<select (change)="useTablesWithBaseSchema($event)" size="3" class="mb-4 bg-gray-50 text-sm text-slate-800 rounded-lg focus:ring-slate-800 focus:border-slate-800 block w-full p-2.5">
<option *ngFor="let schema of allSchema | filter : filterBaseSchema" value="{{ schema }}">{{ schema }}</option>
</select>
</div>
<div *ngIf="tablesByBaseSchema" class="mt-2">
<label *ngIf="!isChecked" class="text-black text-left">Tables : </label>
<label *ngIf="isChecked" class="text-black text-left">Tables et Vues : </label>
<input type="text" class="block w-full my-2 pl-2 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-slate-800 focus:border-slate-800" [(ngModel)]="filterBaseTables" placeholder="Rechercher...">
</div>
<select [(ngModel)]="baseTableData" (change)="getNameBaseTable()" size="3" class="mb-4 bg-gray-50 text-sm text-slate-800 rounded-lg focus:ring-slate-800 focus:border-slate-800 block w-full p-2.5">
<option *ngFor="let table of tablesByBaseSchema | filter : filterBaseTables" id="{{ table.id }}" [ngValue]="table">{{ table.nameTable }}</option>
</select>
</div>
</div>
<div *ngIf="tablesByBaseSchema">
<input type="checkbox" [(ngModel)]="isChecked" (change)="checkValue(isChecked?'true':'false')" class="w-4 h-4 text-orange-400 bg-slate-400 border-slate-200 rounded focus:ring-orange-400 focus:ring-2"/>
<label class="ml-2 text-sm font-medium text-gray-900 dark:text-gray-300">Afficher aussi les Vues</label>
</div>
</div>
</div>
<div *ngIf="baseTableName">
<div *ngFor="let hop of requestInfoJoin; index as i" >
<app-joins-table [allAlias]="aliasData" [passJoinData]="allData[i]" (data)="retrieveData($event, i)" id="{{hop}}"></app-joins-table>
<div class="sm:inline-flex sm:space-x-4">
<button (click)="addTable()" type="button" class="text-white bg-gradient-to-br from-pink-500 to-orange-400 hover:bg-gradient-to-bl focus:ring-4 focus:outline-none focus:ring-pink-200 font-medium rounded-lg text-sm px-5 py-2.5 text-center mr-2 mb-2">Ajouter une Jointure</button>
<div *ngIf="baseTableName">
<div *ngFor="let hop of requestInfoJoin; index as i" >
<app-joins-table [allAlias]="aliasData" [passJoinData]="allData[i]" (data)="retrieveData($event, i)" id="{{hop}}"></app-joins-table>
<div class="sm:inline-flex sm:space-x-4">
<button (click)="addTable()" type="button" class="text-white bg-gradient-to-br from-pink-500 to-orange-400 hover:bg-gradient-to-bl focus:ring-4 focus:outline-none focus:ring-pink-200 font-medium rounded-lg text-sm px-5 py-2.5 text-center mr-2 mb-2">Ajouter une Jointure</button>
<button *ngIf="!oneJoinRemaining" (click)="removeTable(i)" type="button" class="text-gray-900 bg-gradient-to-r from-red-200 via-red-300 to-yellow-200 hover:bg-gradient-to-bl focus:ring-4 focus:outline-none focus:ring-red-100 font-medium rounded-lg text-sm px-5 py-2.5 text-center mr-2 mb-2">Supprimer cette jointure</button>
<button *ngIf="!oneJoinRemaining" (click)="removeTable(i)" type="button" class="text-gray-900 bg-gradient-to-r from-red-200 via-red-300 to-yellow-200 hover:bg-gradient-to-bl focus:ring-4 focus:outline-none focus:ring-red-100 font-medium rounded-lg text-sm px-5 py-2.5 text-center mr-2 mb-2">Supprimer cette jointure</button>
<button (click)="addCondition()" type="button" class="text-white bg-gradient-to-br from-green-400 to-blue-600 hover:bg-gradient-to-bl focus:ring-4 focus:outline-none focus:ring-green-200 font-medium rounded-lg text-sm px-5 py-2.5 text-center mr-2 mb-2">Ajouter une Condition</button>
</div>
</div>
<button (click)="addCondition()" type="button" class="text-white bg-gradient-to-br from-green-400 to-blue-600 hover:bg-gradient-to-bl focus:ring-4 focus:outline-none focus:ring-green-200 font-medium rounded-lg text-sm px-5 py-2.5 text-center mr-2 mb-2">Ajouter une Condition</button>
</div>
</div>
</div>
<div *ngIf="whereCardList.length != 0">
<div *ngFor="let whereCards of whereCardList; index as i" >
<app-where-card [allAlias]="aliasData" [childIndex]="i" id="{{whereCards}}" (conditionData)="getConditionData($event, i)"></app-where-card>
<div class="sm:inline-flex sm:space-x-4">
<button (click)="addCondition()" type="button" class="text-white bg-gradient-to-br from-green-400 to-blue-600 hover:bg-gradient-to-bl focus:ring-4 focus:outline-none focus:ring-green-200 font-medium rounded-lg text-sm px-5 py-2.5 text-center mr-2 mb-2">Ajouter une Condition</button>
<div *ngIf="whereCardList.length != 0">
<div *ngFor="let whereCards of whereCardList; index as i" >
<app-where-card [allAlias]="aliasData" [childIndex]="i" id="{{whereCards}}" (conditionData)="getConditionData($event, i)"></app-where-card>
<div class="sm:inline-flex sm:space-x-4">
<button (click)="addCondition()" type="button" class="text-white bg-gradient-to-br from-green-400 to-blue-600 hover:bg-gradient-to-bl focus:ring-4 focus:outline-none focus:ring-green-200 font-medium rounded-lg text-sm px-5 py-2.5 text-center mr-2 mb-2">Ajouter une Condition</button>
<button (click)="removeWhereCard(i)" type="button" class="text-white bg-gradient-to-r from-cyan-500 to-blue-500 hover:bg-gradient-to-bl focus:ring-4 focus:outline-none focus:ring-cyan-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center mr-2 mb-2">Supprimer cette Condition</button>
</div>
</div>
<button (click)="removeWhereCard(i)" type="button" class="text-white bg-gradient-to-r from-cyan-500 to-blue-500 hover:bg-gradient-to-bl focus:ring-4 focus:outline-none focus:ring-cyan-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center mr-2 mb-2">Supprimer cette Condition</button>
</div>
</div>
</div>
</div>
<div class="sticky top-20 w-full mt-2 sm:mt-0 sm:w-1/3 h-full text-center rounded-lg overflow-hidden shadow-lg bg-white p-4 ">
<div class="flex justify-between mb-2">
<div class="text-xl font-bold">Résultat de la requête :</div>
<mat-icon matTooltip="Copier la requête" [cdkCopyToClipboard]="newRequestData" class="text-green-400 ml-2 hover:cursor-pointer" svgIcon="copy"></mat-icon>
</div>
<div class="rounded-lg overflow-hidden shadow-lg bg-slate-900 text-white text-left pl-2">{{newRequestData}}
</div>
</div>
<div class="sticky top-20 w-full mt-2 sm:mt-0 sm:w-1/3 h-full text-center rounded-lg overflow-hidden shadow-lg bg-white p-4 ">
<div class="flex justify-between mb-2">
<div class="text-xl font-bold">Résultat de la requête :</div>
<mat-icon matTooltip="Copier la requête" [cdkCopyToClipboard]="newRequestData" class="text-green-400 ml-2 hover:cursor-pointer" svgIcon="copy"></mat-icon>
</div>
<div class="rounded-lg overflow-hidden shadow-lg bg-slate-900 text-white text-left pl-2">{{newRequestData}}
</div>
</div>
</div>
</div>

@ -135,7 +135,6 @@ export class CreateJoinsPageComponent implements OnInit, AfterViewInit{
public getNameBaseTable(){
let previousBaseAlias;
if(this.baseSchema && this.baseTableData){
console.log(this.baseTableData)
this.baseTableName = this.baseTableData.nameTable;
this.baseTableNameLowerCase = this.baseTableName?.toLowerCase();
this.baseAlias = {

@ -1,57 +1,55 @@
<div [ngClass]="{'normalCard' : goodAlias, 'alternativeCard' : !goodAlias}">
<div class="p-4">
<div class="font-bold text-xl text-left mb-2">Selectionner les informations de la jointure :</div>
<div class="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-4 gap-4">
<div>
<label class="text-black text-left">Jointures : </label>
<select [(ngModel)]="joinData" (change)="verifyAndSendData()" size="4" class="my-2 bg-gray-50 text-sm text-slate-800 rounded-lg focus:ring-slate-800 focus:border-slate-800 block w-full p-2.5">
<option *ngFor="let join of alljoins" [ngValue]="join">{{ join }}</option>
</select>
</div>
<div>
<label class="text-black text-left">Schémas : </label>
<input type="text" class="block w-full my-2 pl-2 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-slate-800 focus:border-slate-800" [(ngModel)]="filterBaseSchema" placeholder="Rechercher...">
<select (change)="useTablesWithSpecificSchema($event)" size="3" class="mb-4 bg-gray-50 text-sm text-slate-800 rounded-lg focus:ring-slate-800 focus:border-slate-800 block w-full p-2.5">
<option *ngFor="let schema of allSchema | filter : filterBaseSchema" value="{{ schema }}">{{ schema }}</option>
</select>
</div>
<div>
<label class="text-black text-left">Tables : </label>
<input type="text" class="block w-full my-2 pl-2 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-slate-800 focus:border-slate-800" [(ngModel)]="filterBaseTables" placeholder="Rechercher...">
<select [(ngModel)]="specificTableData" (change)="getSpecificColumns()" size="3" class="mb-4 bg-gray-50 text-sm text-slate-800 rounded-lg focus:ring-slate-800 focus:border-slate-800 block w-full p-2.5">
<option *ngFor="let table of tablesByBaseSchema | filter : filterBaseTables" id="{{ table.id }}" [ngValue]="table">{{ table.nameTable }}</option>
</select>
</div>
<div *ngIf="allAlias">
<label class="text-black text-left">Alias(Base) : </label>
<input type="text" class="block w-full my-2 pl-2 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-slate-800 focus:border-slate-800" [(ngModel)]="filterAlias" placeholder="Rechercher...">
<select [(ngModel)]="baseAlias" (change)="getBaseColumns()" size="3" class="mb-4 bg-gray-50 text-sm text-slate-800 rounded-lg focus:ring-slate-800 focus:border-slate-800 block w-full p-2.5">
<option *ngFor="let alias of tempAliasData | filter : filterAlias" [ngValue]="alias">{{ alias.nameAlias }}</option>
</select>
</div>
<div [ngClass]="{'normalCard' : goodAlias, 'alternativeCard' : !goodAlias}" class="p-4">
<div class="font-bold text-xl text-left mb-2">Selectionner les informations de la jointure :</div>
<div class="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-4 gap-4">
<div>
<label class="text-black text-left">Jointures : </label>
<select [(ngModel)]="joinData" (change)="verifyAndSendData()" size="4" class="my-2 bg-gray-50 text-sm text-slate-800 rounded-lg focus:ring-slate-800 focus:border-slate-800 block w-full p-2.5">
<option *ngFor="let join of alljoins" [ngValue]="join">{{ join }}</option>
</select>
</div>
<div>
<label class="text-black text-left">Schémas : </label>
<input type="text" class="block w-full my-2 pl-2 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-slate-800 focus:border-slate-800" [(ngModel)]="filterBaseSchema" placeholder="Rechercher...">
<select (change)="useTablesWithSpecificSchema($event)" size="3" class="mb-4 bg-gray-50 text-sm text-slate-800 rounded-lg focus:ring-slate-800 focus:border-slate-800 block w-full p-2.5">
<option *ngFor="let schema of allSchema | filter : filterBaseSchema" value="{{ schema }}">{{ schema }}</option>
</select>
</div>
<div>
<label class="text-black text-left">Tables : </label>
<input type="text" class="block w-full my-2 pl-2 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-slate-800 focus:border-slate-800" [(ngModel)]="filterBaseTables" placeholder="Rechercher...">
<select [(ngModel)]="specificTableData" (change)="getSpecificColumns()" size="3" class="mb-4 bg-gray-50 text-sm text-slate-800 rounded-lg focus:ring-slate-800 focus:border-slate-800 block w-full p-2.5">
<option *ngFor="let table of tablesByBaseSchema | filter : filterBaseTables" id="{{ table.id }}" [ngValue]="table">{{ table.nameTable }}</option>
</select>
</div>
<div *ngIf="tablesByBaseSchema" class="mb-2">
<input type="checkbox" [(ngModel)]="isChecked" (change)="checkValue(isChecked?'true':'false')" class="w-4 h-4 text-orange-400 bg-slate-400 border-slate-200 rounded focus:ring-orange-400 focus:ring-2"/>
<label class="ml-2 text-sm font-medium text-gray-900 dark:text-gray-300">Afficher aussi les Vues</label>
<div *ngIf="allAlias">
<label class="text-black text-left">Alias(Base) : </label>
<input type="text" class="block w-full my-2 pl-2 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-slate-800 focus:border-slate-800" [(ngModel)]="filterAlias" placeholder="Rechercher...">
<select [(ngModel)]="baseAlias" (change)="getBaseColumns()" size="3" class="mb-4 bg-gray-50 text-sm text-slate-800 rounded-lg focus:ring-slate-800 focus:border-slate-800 block w-full p-2.5">
<option *ngFor="let alias of tempAliasData | filter : filterAlias" [ngValue]="alias">{{ alias.nameAlias }}</option>
</select>
</div>
<div *ngFor="let cols of columnsInfo, index as ind">
<app-columns-card [baseColumns]="baseColumns" [specificColumns]="specificColumns" [childIndex]="ind" (selectedColumn)="retrieveColumnsData($event, ind)"></app-columns-card>
</div>
<div *ngIf="tablesByBaseSchema" class="mb-2">
<input type="checkbox" [(ngModel)]="isChecked" (change)="checkValue(isChecked?'true':'false')" class="w-4 h-4 text-orange-400 bg-slate-400 border-slate-200 rounded focus:ring-orange-400 focus:ring-2"/>
<label class="ml-2 text-sm font-medium text-gray-900 dark:text-gray-300">Afficher aussi les Vues</label>
</div>
<div *ngFor="let cols of columnsInfo, index as ind">
<app-columns-card [baseColumns]="baseColumns" [specificColumns]="specificColumns" [childIndex]="ind" (selectedColumn)="retrieveColumnsData($event, ind)"></app-columns-card>
<div class="flex inline-flex space-x-4">
<button (click)="addSelectColumns()" type="button" class="text-white text-lg bg-gradient-to-br from-teal-400 to-green-500 hover:bg-gradient-to-bl focus:ring-4 focus:outline-none focus:ring-pink-200 font-medium rounded-full text-sm px-5 py-2.5 text-center mr-2 my-2">+</button>
<div class="inline-flex space-x-4">
<button (click)="addSelectColumns()" type="button" class="text-white text-lg bg-gradient-to-br from-teal-400 to-green-500 hover:bg-gradient-to-bl focus:ring-4 focus:outline-none focus:ring-pink-200 font-medium rounded-full px-5 py-2.5 text-center mr-2 my-2">+</button>
<button *ngIf="columnsInfo.length > 1" (click)="removeSelectColumns(ind)" type="button" class="text-gray-900 text-lg bg-gradient-to-br from-rose-600 to-red-400 hover:bg-gradient-to-bl focus:ring-4 focus:outline-none focus:ring-red-100 font-medium rounded-full text-sm px-5 py-2.5 text-center my-2">-</button>
</div>
<button *ngIf="columnsInfo.length > 1" (click)="removeSelectColumns(ind)" type="button" class="text-gray-900 text-lg bg-gradient-to-br from-rose-600 to-red-400 hover:bg-gradient-to-bl focus:ring-4 focus:outline-none focus:ring-red-100 font-medium rounded-full px-5 py-2.5 text-center my-2">-</button>
</div>
</div>
</div>

@ -144,7 +144,6 @@ export class JoinsTableComponent implements OnInit, OnChanges{
}
public verifyAndSendData(){
console.log(this.joinData)
if(this.specificSchema && this.specificTable && this.joinData && this.baseAlias && this.columnsData){
const tempLower = this.specificTable.toLowerCase();
this.myJoinData = {
@ -186,7 +185,6 @@ export class JoinsTableComponent implements OnInit, OnChanges{
}
this.verifyAndSendData();
console.log(this.columnsData);
}
public checkValue(event: any){

@ -1,42 +1,41 @@
<div class="rounded-lg overflow-hidden shadow-lg bg-slate-100 border-solid border-orange-400 border-2 my-2">
<div class="p-4">
<div class="font-bold text-xl text-left mb-2">Selectionner les informations de la Condition :</div>
<div class="grid grid-cols-1 md:grid-cols-3 xl:grid-cols-5 gap-4">
<div *ngIf="childIndex != 0">
<label class="text-black text-left">Opérateurs : </label>
<select [(ngModel)]="operator" (change)="verifyAndSendConditionData()" size="4" class="my-2 bg-gray-50 text-sm text-slate-800 rounded-lg focus:ring-slate-800 focus:border-slate-800 block w-full p-2.5">
<option *ngFor="let ope of operatorList" [ngValue]="ope">{{ ope }}</option>
</select>
</div>
<div>
<label class="text-black text-left">Alias : </label>
<input type="text" class="block w-full my-2 pl-2 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-slate-800 focus:border-slate-800" [(ngModel)]="filterAlias" placeholder="Rechercher...">
<select [(ngModel)]="baseAlias" (change)="getColumns()" size="3" class="mb-4 bg-gray-50 text-sm text-slate-800 rounded-lg focus:ring-slate-800 focus:border-slate-800 block w-full p-2.5">
<option *ngFor="let alias of allAlias | filter : filterAlias" [ngValue]="alias">{{ alias.nameAlias }}</option>
</select>
</div>
<div>
<label class="text-black text-left">Colonnes : </label>
<input type="text" class="block w-full my-2 pl-2 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-slate-800 focus:border-slate-800" [(ngModel)]="filterColumn" placeholder="Rechercher...">
<select [(ngModel)]="baseColumnData" (change)="verifyAndSendConditionData()" size="3" class="mb-4 bg-gray-50 text-sm text-slate-800 rounded-lg focus:ring-slate-800 focus:border-slate-800 block w-full p-2.5">
<option *ngFor="let col of baseColumns | filter : filterColumn" id="{{ col.id }}" [ngValue]="col">{{ col.nameColumn }} ({{col.columnText}})</option>
</select>
</div>
<div *ngIf="allAlias">
<label class="text-black text-left">Conditions : </label>
<input type="text" (change)="verifyAndSendConditionData()" class="block w-full my-2 pl-2 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-slate-800 focus:border-slate-800" [(ngModel)]="conditionOperator" placeholder="Condition...">
</div>
<div>
<label class="text-black text-left">Valeurs : </label>
<input type="text" (change)="verifyAndSendConditionData()" class="block w-full my-2 pl-2 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-slate-800 focus:border-slate-800" [(ngModel)]="conditionValue" placeholder="Valeur...">
</div>
<div class="rounded-lg overflow-hidden shadow-lg bg-slate-100 border-solid border-orange-400 border-2 my-2 p-4">
<div class="font-bold text-xl text-left mb-2">Selectionner les informations de la Condition :</div>
<div class="grid grid-cols-1 md:grid-cols-3 xl:grid-cols-5 gap-4">
<div *ngIf="childIndex != 0">
<label class="text-black text-left">Opérateurs : </label>
<select [(ngModel)]="operator" (change)="verifyAndSendConditionData()" size="4" class="my-2 bg-gray-50 text-sm text-slate-800 rounded-lg focus:ring-slate-800 focus:border-slate-800 block w-full p-2.5">
<option *ngFor="let ope of operatorList" [ngValue]="ope">{{ ope }}</option>
</select>
</div>
<div>
<label class="text-black text-left">Alias : </label>
<input type="text" class="block w-full my-2 pl-2 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-slate-800 focus:border-slate-800" [(ngModel)]="filterAlias" placeholder="Rechercher...">
<select [(ngModel)]="baseAlias" (change)="getColumns()" size="3" class="mb-4 bg-gray-50 text-sm text-slate-800 rounded-lg focus:ring-slate-800 focus:border-slate-800 block w-full p-2.5">
<option *ngFor="let alias of allAlias | filter : filterAlias" [ngValue]="alias">{{ alias.nameAlias }}</option>
</select>
</div>
<div>
<label class="text-black text-left">Colonnes : </label>
<input type="text" class="block w-full my-2 pl-2 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-slate-800 focus:border-slate-800" [(ngModel)]="filterColumn" placeholder="Rechercher...">
<select [(ngModel)]="baseColumnData" (change)="verifyAndSendConditionData()" size="3" class="mb-4 bg-gray-50 text-sm text-slate-800 rounded-lg focus:ring-slate-800 focus:border-slate-800 block w-full p-2.5">
<option *ngFor="let col of baseColumns | filter : filterColumn" id="{{ col.id }}" [ngValue]="col">{{ col.nameColumn }} ({{col.columnText}})</option>
</select>
</div>
<div *ngIf="allAlias">
<label class="text-black text-left">Conditions : </label>
<input type="text" (change)="verifyAndSendConditionData()" class="block w-full my-2 pl-2 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-slate-800 focus:border-slate-800" [(ngModel)]="conditionOperator" placeholder="Condition...">
</div>
<div>
<label class="text-black text-left">Valeurs : </label>
<input type="text" (change)="verifyAndSendConditionData()" class="block w-full my-2 pl-2 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-slate-800 focus:border-slate-800" [(ngModel)]="conditionValue" placeholder="Valeur...">
</div>
</div>
</div>

@ -48,7 +48,6 @@ export class WhereCardComponent {
this.operator = "WHERE";
}
if(this.operator && this.baseAlias && this.baseColumnData && this.conditionOperator && this.conditionValue){
console.log(this.baseColumnData);
this.conditionData.emit([this.operator, this.baseAlias.nameAlias, this.baseColumnData.nameColumn, this.conditionOperator, this.conditionValue]);
}
}

@ -1,5 +1,5 @@
import { Pipe, PipeTransform } from '@angular/core';
import { Script } from './app/model/script';
import { Script } from '../model/script';
@Pipe({
name: 'filterscript',

@ -1,4 +1,4 @@
import { InfoTable } from './app/model/info-table';
import { InfoTable } from '../model/info-table';
import { Pipe, PipeTransform } from '@angular/core';
@ -14,7 +14,7 @@ export class CustomFilterTable implements PipeTransform {
// filter items array, items which match and return true will be
// kept, false will be filtered out
if(filter){
return items.filter(item => item.nameTable.toLowerCase().indexOf(filter) !== -1);
return items.filter(item => item.nameTable.toLowerCase().indexOf(filter.toLowerCase()) !== -1);
}
}

@ -31,17 +31,6 @@ export class DndDirective {
let files = evt.dataTransfer.files;
if (files.length > 0) {
this.fileDropped.emit(files);
// for(let i = 0; i < files.length; i++){
// var reader = new FileReader();
// console.log(files[i])
// reader.readAsText(files[i]);
// reader.onload = () => {
// this.listOfContent.push(reader.result as string);
// }
// }
// this.textDrop.emit( this.listOfContent);
}
}

@ -26,35 +26,31 @@
</div>
</div>
<div class="rounded-lg overflow-hidden shadow-lg bg-white">
<div class="px-6 py-4 ">
<div class="font-bold text-xl text-center">Selectionner un Schéma et une Table :</div>
<div class="bg-orange-400 w-full h-2 rounded-lg overflow-hidden my-2"></div>
<div class="bg-orange-400 w-full h-2 rounded-lg overflow-hidden my-2"></div>
<label class="text-black">Schémas : </label>
<input type="text" class="block w-full my-2 pl-2 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-slate-800 focus:border-slate-800" [(ngModel)]="filterSecondSchema" placeholder="Rechercher...">
<label class="text-black">Schémas : </label>
<input type="text" class="block w-full my-2 pl-2 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-slate-800 focus:border-slate-800" [(ngModel)]="filterSecondSchema" placeholder="Rechercher...">
<select (change)="useTablesWithSecondSchema($event)" size="5" class="mb-4 bg-gray-50 text-sm text-slate-800 rounded-lg focus:ring-slate-800 focus:border-slate-800 block w-full p-2.5">
<option *ngFor="let schema of allSchema | filter : filterSecondSchema" value="{{ schema }}">{{ schema }}</option>
</select>
<select (change)="useTablesWithSecondSchema($event)" size="5" class="mb-4 bg-gray-50 text-sm text-slate-800 rounded-lg focus:ring-slate-800 focus:border-slate-800 block w-full p-2.5">
<option *ngFor="let schema of allSchema | filter : filterSecondSchema" value="{{ schema }}">{{ schema }}</option>
</select>
<div class="bg-orange-400 w-full h-2 rounded-lg overflow-hidden my-2"></div>
<div class="bg-orange-400 w-full h-2 rounded-lg overflow-hidden my-2"></div>
<div *ngIf="tablesBySecondSchema">
<label class="text-black">Tables : </label>
<input type="text" class="block w-full my-2 pl-2 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-slate-800 focus:border-slate-800" [(ngModel)]="filterSecondTable" placeholder="Rechercher...">
<div *ngIf="tablesBySecondSchema">
<label class="text-black">Tables : </label>
<input type="text" class="block w-full my-2 pl-2 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-slate-800 focus:border-slate-800" [(ngModel)]="filterSecondTable" placeholder="Rechercher...">
<select [(ngModel)]="secondTableData" (change)="getColumnsForJoinTwo()" size="5" class="mb-4 bg-gray-50 text-sm text-slate-800 rounded-lg focus:ring-slate-800 focus:border-slate-800 block w-full p-2.5">
<option *ngFor="let table of tablesBySecondSchema | filtertable : filterSecondTable" id="{{ table.id }}" [ngValue]="table">{{ table.nameTable }}</option>
</select>
</div>
<select [(ngModel)]="secondTableData" (change)="getColumnsForJoinTwo()" size="5" class="mb-4 bg-gray-50 text-sm text-slate-800 rounded-lg focus:ring-slate-800 focus:border-slate-800 block w-full p-2.5">
<option *ngFor="let table of tablesBySecondSchema | filtertable : filterSecondTable" id="{{ table.id }}" [ngValue]="table">{{ table.nameTable }}</option>
</select>
</div>
</div>
</div>
</div>
<div *ngIf="!columnIsFull && infoColumn" class="my-4 grid grid-cols-1 sm:grid-cols-4 gap-5">

@ -50,7 +50,6 @@ export class JoinsPageComponent implements OnInit{
this.infoTableService.getSchemas().subscribe(
(response : String[]) => {
this.allSchema = response;
console.log(response);
},
(error: HttpErrorResponse) => {
alert(error.message)
@ -81,7 +80,6 @@ export class JoinsPageComponent implements OnInit{
this.infoTableService.getTablesBySchema(event.target.value).subscribe(
(response : InfoTable[]) => {
this.tablesBySecondSchema = response;
console.log(response);
},
(error: HttpErrorResponse) => {
alert(error.message)
@ -98,7 +96,6 @@ export class JoinsPageComponent implements OnInit{
this.infoColumnService.getColumn(event.target.value).subscribe(
(response : InfoColumn) => {
this.displayColumns = response;
console.log(response);
},
(error: HttpErrorResponse) => {
alert(error.message)
@ -117,7 +114,6 @@ export class JoinsPageComponent implements OnInit{
this.infoColumnService.getColumnsForJoinTwo(this.tables, this.schemas).subscribe(
(response : InfoColumn[]) => {
this.infoColumn = response;
console.log(this.infoColumn);
if(this.infoColumn?.length === 0){
this.columnIsFull = false;
} else {

@ -1,76 +1,71 @@
<div class="my-4">
<div class="flex sm:flex-nowrap flex-wrap sm:space-x-4">
<div class="w-full sm:w-2/3 h-full text-center rounded-lg overflow-hidden shadow-lg bg-white p-4 ">
<div class="flex">
<button (click)="isNewFile()" class="text-white bg-gradient-to-r from-purple-500 to-pink-500 hover:bg-gradient-to-l focus:ring-4 focus:outline-none focus:ring-purple-200 font-semibold py-2 px-4 rounded shadow m-2" >Nouveau</button>
<button (click)="isExistingFile()" class="text-white bg-gradient-to-r from-purple-500 to-pink-500 hover:bg-gradient-to-l focus:ring-4 focus:outline-none focus:ring-purple-200 font-semibold py-2 px-4 rounded shadow m-2" >Fichier Existant</button>
<div class="flex sm:flex-nowrap flex-wrap sm:space-x-4 my-4">
<div class="w-full sm:w-2/3 h-full text-center rounded-lg overflow-hidden shadow-lg bg-white p-4 ">
<div class="flex">
<button (click)="isNewFile()" class="text-white bg-gradient-to-r from-purple-500 to-pink-500 hover:bg-gradient-to-l focus:ring-4 focus:outline-none focus:ring-purple-200 font-semibold py-2 px-4 rounded shadow m-2" >Nouveau</button>
<button (click)="isExistingFile()" class="text-white bg-gradient-to-r from-purple-500 to-pink-500 hover:bg-gradient-to-l focus:ring-4 focus:outline-none focus:ring-purple-200 font-semibold py-2 px-4 rounded shadow m-2" >Fichier Existant</button>
</div>
<div class="rounded-lg overflow-hidden shadow-lg bg-slate-100 border-solid border-orange-400 border-2 p-4">
<div *ngIf="newFile">
<div class="font-bold text-xl text-left mb-2">Veuillez rentrer le contenu du Script : </div>
<textarea [(ngModel)]="newFileData" rows="20" class="block p-2.5 w-full text-sm rounded-lg border bg-gray-700 border-gray-600 placeholder-gray-400 text-white focus:ring-orange-400 focus:border-orange-400">
</textarea>
</div>
<div class="rounded-lg overflow-hidden shadow-lg bg-slate-100 border-solid border-orange-400 border-2">
<div class="p-4">
<div *ngIf="newFile">
<div class="font-bold text-xl text-left mb-2">Veuillez rentrer le contenu du Script : </div>
<textarea [(ngModel)]="newFileData" rows="20" class="block p-2.5 w-full text-sm rounded-lg border bg-gray-700 border-gray-600 placeholder-gray-400 text-white focus:ring-orange-400 focus:border-orange-400">
</textarea>
</div>
<div *ngIf="!newFile">
<div class="py-2 relative rounded-lg overflow-hidden bg-slate-900 border-solid border-orange-400 border-2 text-center text-white" appDnd (fileDropped)="onFileDropped($event)" >
<input type="file" multiple class=" z-10 opacity-0 absolute w-full h-full top-0 left-0"/>
<mat-icon class="flex !h-20 !w-20" svgIcon="upload"></mat-icon>
<div>Glisser / Déposer le script ici</div>
</div>
<div *ngIf="files.length > 0" class="my-2">
<div *ngFor="let file of files, index as i" class="mb-2 p-2 rounded-lg overflow-hidden bg-slate-200 border-solid border-orange-400 border-2" (click)="displayText(i)">
<div class="grid grid-cols-1 sm:grid-cols-2 ">
<div class="flex justify-start ">
<div class="font-bold mr-2">{{ file?.name }}</div>
<div>Taille: {{ formatBytes(file.size) }}</div>
</div>
<div *ngIf="!newFile">
<div class="py-2 relative rounded-lg overflow-hidden bg-slate-900 border-solid border-orange-400 border-2 text-center text-white" appDnd (fileDropped)="onFileDropped($event)" >
<input type="file" multiple class=" z-10 opacity-0 absolute w-full h-full top-0 left-0"/>
<mat-icon class="flex !h-20 !w-20" svgIcon="upload"></mat-icon>
<div>Glisser / Déposer le script ici</div>
</div>
<div *ngIf="files.length > 0" class="my-2">
<div *ngFor="let file of files, index as i" class="mb-2 p-2 rounded-lg overflow-hidden bg-slate-200 border-solid border-orange-400 border-2" (click)="displayText(i)">
<div class="grid grid-cols-1 sm:grid-cols-2 ">
<div class="flex justify-start ">
<div class="font-bold mr-2">{{ file?.name }}</div>
<div>Taille: {{ formatBytes(file.size) }}</div>
</div>
<div class="flex justify-end my-auto">
<mat-icon (click)="deleteFile(i)" class="text-red-600 mx-2 hover:cursor-pointer" svgIcon="trash"></mat-icon>
</div>
</div>
<div class="flex justify-end my-auto">
<mat-icon (click)="deleteFile(i)" class="text-red-600 mx-2 hover:cursor-pointer" svgIcon="trash"></mat-icon>
</div>
</div>
<div class="font-bold text-xl text-left mb-2">Contenu du Script : </div>
<textarea [(ngModel)]="existingFileData" rows="20" class="block p-2.5 w-full text-sm rounded-lg border bg-gray-700 border-gray-600 placeholder-gray-400 text-white focus:ring-orange-400 focus:border-orange-400">
</textarea>
</div>
</div>
<div class="font-bold text-xl text-left mb-2">Contenu du Script : </div>
<textarea [(ngModel)]="existingFileData" rows="20" class="block p-2.5 w-full text-sm rounded-lg border bg-gray-700 border-gray-600 placeholder-gray-400 text-white focus:ring-orange-400 focus:border-orange-400">
</textarea>
</div>
</div>
</div>
<div class="w-full mt-2 sm:mt-0 sm:w-1/3 h-full rounded-lg shadow-lg bg-white p-4 ">
<div class="text-xl font-bold pb-2 text-center">Informations du Script :</div>
<div class="font-bold text-lg">Nom du Script :</div>
<input type="text" class="block w-full my-2 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-slate-800 focus:border-slate-800" [(ngModel)]="nameOfFile" placeholder="Tapez ici...">
<div class="font-bold text-lg">Type d'extension :</div>
<select [(ngModel)]="nameOfExtension" class="mb-4 bg-gray-50 text-sm text-slate-800 rounded-lg focus:ring-slate-800 focus:border-slate-800 block w-full p-2.5" required>
<option [ngValue]="undefined" disabled>Sélectionner l'extension</option>
<option *ngFor="let ext of listOfExtension" value="{{ ext }}">{{ ext }}</option>
</select>
<div class="font-bold text-lg">Description du Script :</div>
<textarea type="text" class="block w-full my-2 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-slate-800 focus:border-slate-800" [(ngModel)]="description" placeholder="Description..."></textarea>
<div class="font-bold text-lg">Tags associés :</div>
<ng-multiselect-dropdown class="overflow-y-auto"
[placeholder]="'Selectionner les Tags'"
[settings]="dropdownSettings"
[data]="dropdownTagList"
[(ngModel)]="selectedTagList"
(onSelect)="onItemSelect($event)"
(onSelectAll)="onSelectAll($event)"
(onDeSelect)="onItemDeselect($event)"
(onDeSelectAll)="onDeselectAll($event)"
<div class="w-full mt-2 sm:mt-0 sm:w-1/3 h-full rounded-lg shadow-lg bg-white p-4 ">
<div class="text-xl font-bold pb-2 text-center">Informations du Script :</div>
<div class="font-bold text-lg">Nom du Script :</div>
<input type="text" class="block w-full my-2 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-slate-800 focus:border-slate-800" [(ngModel)]="nameOfFile" placeholder="Tapez ici...">
<div class="font-bold text-lg">Type d'extension :</div>
<select [(ngModel)]="nameOfExtension" class="mb-4 bg-gray-50 text-sm text-slate-800 rounded-lg focus:ring-slate-800 focus:border-slate-800 block w-full p-2.5" required>
<option [ngValue]="undefined" disabled>Sélectionner l'extension</option>
<option *ngFor="let ext of listOfExtension" value="{{ ext }}">{{ ext }}</option>
</select>
<div class="font-bold text-lg">Description du Script :</div>
<textarea type="text" class="block w-full my-2 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-slate-800 focus:border-slate-800" [(ngModel)]="description" placeholder="Description..."></textarea>
<div class="font-bold text-lg">Tags associés :</div>
<ng-multiselect-dropdown class="overflow-y-auto"
[placeholder]="'Selectionner les Tags'"
[settings]="dropdownSettings"
[data]="dropdownTagList"
[(ngModel)]="selectedTagList"
(onSelect)="onItemSelect($event)"
(onSelectAll)="onSelectAll($event)"
(onDeSelect)="onItemDeselect($event)"
(onDeSelectAll)="onDeselectAll($event)"
>
</ng-multiselect-dropdown>
<button (click)="addScriptToCentral()" type="button" class="text-gray-900 bg-gradient-to-r from-teal-200 to-lime-200 hover:bg-gradient-to-l hover:from-teal-200 hover:to-lime-200 focus:ring-4 focus:outline-none focus:ring-lime-200 font-semibold rounded-lg px-4 py-2 text-center mr-2 mb-2 mt-4">Ajouter le Script</button>
<button (click)="addScriptToCentral()" type="button" class="text-gray-900 bg-gradient-to-r from-teal-200 to-lime-200 hover:bg-gradient-to-l hover:from-teal-200 hover:to-lime-200 focus:ring-4 focus:outline-none focus:ring-lime-200 font-semibold rounded-lg px-4 py-2 text-center mr-2 mb-2 mt-4">Ajouter le Script</button>
</div>
</div>
</div>

@ -1,32 +1,28 @@
<div class="my-4">
<div class="flex sm:flex-nowrap flex-wrap sm:space-x-4">
<div class="w-full sm:w-2/3 h-full text-center rounded-lg overflow-hidden shadow-lg bg-white p-4 ">
<div class="rounded-lg overflow-hidden shadow-lg bg-slate-100 border-solid border-orange-400 border-2">
<div class="p-4">
<div class="font-bold text-xl text-left mb-2">Contenu du Script : </div>
<textarea [(ngModel)]="newData" rows="20" class="block p-2.5 w-full text-sm rounded-lg border bg-gray-700 border-gray-600 placeholder-gray-400 text-white focus:ring-orange-400 focus:border-orange-400">
<div class="flex sm:flex-nowrap flex-wrap sm:space-x-4 my-4">
<div class="w-full sm:w-2/3 h-full text-center rounded-lg overflow-hidden shadow-lg bg-white p-4 ">
<div class="rounded-lg overflow-hidden shadow-lg bg-slate-100 border-solid border-orange-400 border-2">
<div class="p-4">
<div class="font-bold text-xl text-left mb-2">Contenu du Script : </div>
<textarea [(ngModel)]="newData" rows="20" class="block p-2.5 w-full text-sm rounded-lg border bg-gray-700 border-gray-600 placeholder-gray-400 text-white focus:ring-orange-400 focus:border-orange-400">
</textarea>
</div>
</div>
</div>
</div>
<div class="w-full mt-2 sm:mt-0 sm:w-1/3 h-full rounded-lg shadow-lg bg-white p-4 ">
<div class="text-xl font-bold pb-2 text-center">Informations du Script :</div>
<div class="font-bold text-lg">Nom du Script :</div>
<input [(ngModel)]="newName" type="text" class="block w-full my-2 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-slate-800 focus:border-slate-800" placeholder="Tapez ici...">
<div class="font-bold text-lg">Type d'extension :</div>
<select [(ngModel)]="newExtension" class="mb-4 bg-gray-50 text-sm text-slate-800 rounded-lg focus:ring-slate-800 focus:border-slate-800 block w-full p-2.5" required>
<option [ngValue]="undefined" disabled>Sélectionner l'extension</option>
<option *ngFor="let ext of listOfExtension" value="{{ ext }}">{{ ext }}</option>
</select>
<div class="font-bold text-lg">Description du Script :</div>
<textarea type="text" class="block w-full my-2 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-slate-800 focus:border-slate-800" [(ngModel)]="description" placeholder="Description..."></textarea>
<div class="font-bold text-lg">Tags associés :</div>
<ng-multiselect-dropdown class="overflow-y-auto"
<div class="w-full mt-2 sm:mt-0 sm:w-1/3 h-full rounded-lg shadow-lg bg-white p-4 ">
<div class="text-xl font-bold pb-2 text-center">Informations du Script :</div>
<div class="font-bold text-lg">Nom du Script :</div>
<input [(ngModel)]="newName" type="text" class="block w-full my-2 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-slate-800 focus:border-slate-800" placeholder="Tapez ici...">
<div class="font-bold text-lg">Type d'extension :</div>
<select [(ngModel)]="newExtension" class="mb-4 bg-gray-50 text-sm text-slate-800 rounded-lg focus:ring-slate-800 focus:border-slate-800 block w-full p-2.5" required>
<option [ngValue]="undefined" disabled>Sélectionner l'extension</option>
<option *ngFor="let ext of listOfExtension" value="{{ ext }}">{{ ext }}</option>
</select>
<div class="font-bold text-lg">Description du Script :</div>
<textarea type="text" class="block w-full my-2 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-slate-800 focus:border-slate-800" [(ngModel)]="description" placeholder="Description..."></textarea>
<div class="font-bold text-lg">Tags associés :</div>
<ng-multiselect-dropdown class="overflow-y-auto"
[placeholder]="'Selectionner les Tags'"
[settings]="dropdownSettings"
[data]="dropdownTagList"
@ -37,8 +33,8 @@
(onDeSelectAll)="onDeselectAll($event)"
>
</ng-multiselect-dropdown>
<button (click)="editScript()" type="button" class="text-gray-900 bg-gradient-to-r from-teal-200 to-lime-200 hover:bg-gradient-to-l hover:from-teal-200 hover:to-lime-200 focus:ring-4 focus:outline-none focus:ring-lime-200 font-semibold rounded-lg px-4 py-2 text-center mr-2 mb-2 mt-4">Modifier le Script</button>
</div>
<button (click)="editScript()" type="button" class="text-gray-900 bg-gradient-to-r from-teal-200 to-lime-200 hover:bg-gradient-to-l hover:from-teal-200 hover:to-lime-200 focus:ring-4 focus:outline-none focus:ring-lime-200 font-semibold rounded-lg px-4 py-2 text-center mr-2 mb-2 mt-4">Modifier le Script</button>
</div>
</div>

@ -9,7 +9,6 @@
<div class="sm:col-span-3 my-auto md:flex">
<a routerLink="/tagsmanagement" class="flex text-black text-center bg-gradient-to-r from-red-200 via-red-300 to-yellow-200 hover:bg-gradient-to-bl focus:ring-4 focus:outline-none focus:ring-red-100 dark:focus:ring-red-400 font-semibold py-2 px-4 rounded shadow m-2" >Gérer les Tags</a>
<button (click)="addScript()" class="flex text-black bg-gradient-to-r from-red-200 via-red-300 to-yellow-200 hover:bg-gradient-to-bl focus:ring-4 focus:outline-none focus:ring-red-100 dark:focus:ring-red-400 font-semibold py-2 px-4 rounded shadow m-2" >Ajouter un Script</button>
</div>
</div>
</div>
@ -26,10 +25,10 @@
[settings]="dropdownSettings"
[data]="dropdownTagList"
[(ngModel)]="selectedTagList"
(onSelect)="onItemSelect($event)"
(onSelect)="sortWithFilter()"
(onSelectAll)="onSelectAll($event)"
(onDeSelect)="onItemDeselect($event)"
(onDeSelectAll)="onDeselectAll($event)"
(onDeSelect)="sortWithFilter()"
(onDeSelectAll)="onDeselectAll()"
>
</ng-multiselect-dropdown>
</div>
@ -50,66 +49,64 @@
</div>
</div>
</div>
</div>
</div>
</div>
<div class="mt-4 md:mt-0">
<cdk-accordion>
<cdk-accordion-item >
<div class="rounded-lg bg-slate-300 shadow-lg p-2">
<div class="flex justify-between hover:cursor-pointer" (click)="descriptionDisplay = !descriptionDisplay">
<div class="text-xl font-bold pb-2">Description :</div>
<span class="example-accordion-item-description" class="font-semibold">
Cliquer pour {{ descriptionDisplay ? 'fermer' : 'ouvrir' }}
</span>
</div>
<div
role="region"
[style.display]="descriptionDisplay ? '' : 'none'"
class="rounded-lg bg-white p-2 shadow-md"
*ngIf="descText">
{{ descText }}
</div>
<cdk-accordion>
<cdk-accordion-item >
<div class="rounded-lg bg-slate-300 shadow-lg p-2">
<div class="flex justify-between hover:cursor-pointer" (click)="descriptionDisplay = !descriptionDisplay">
<div class="text-xl font-bold pb-2">Description :</div>
<span class="example-accordion-item-description" class="font-semibold">
Cliquer pour {{ descriptionDisplay ? 'fermer' : 'ouvrir' }}
</span>
</div>
</cdk-accordion-item>
<cdk-accordion-item>
<div class="rounded-lg bg-slate-300 p-2 mt-2">
<div (click)="contentDisplay = !contentDisplay" class="flex justify-between hover:cursor-pointer">
<div class="text-xl font-bold pb-2">Contenu du Script :</div>
<span class="example-accordion-item-description" class="font-semibold">
Cliquer pour {{ contentDisplay ? 'fermer' : 'ouvrir' }}
</span>
</div>
<div
role="region"
[style.display]="contentDisplay ? '' : 'none'">
<textarea rows="20" class="block p-2.5 w-full text-sm rounded-lg border bg-gray-700 border-gray-600 placeholder-gray-400 text-white focus:ring-orange-400 focus:border-orange-400">
<div
role="region"
[style.display]="descriptionDisplay ? '' : 'none'"
class="rounded-lg bg-white p-2 shadow-md"
*ngIf="descText">
{{ descText }}
</div>
</div>
</cdk-accordion-item>
<cdk-accordion-item>
<div class="rounded-lg bg-slate-300 p-2 mt-2">
<div (click)="contentDisplay = !contentDisplay" class="flex justify-between hover:cursor-pointer">
<div class="text-xl font-bold pb-2">Contenu du Script :</div>
<span class="example-accordion-item-description" class="font-semibold">
Cliquer pour {{ contentDisplay ? 'fermer' : 'ouvrir' }}
</span>
</div>
<div
role="region"
[style.display]="contentDisplay ? '' : 'none'">
<textarea rows="20" class="block p-2.5 w-full text-sm rounded-lg border bg-gray-700 border-gray-600 placeholder-gray-400 text-white focus:ring-orange-400 focus:border-orange-400">
{{textTo}}</textarea>
</div>
</div>
</cdk-accordion-item>
<cdk-accordion-item>
<div class="rounded-lg bg-slate-300 p-2 mt-2">
<div (click)="tagsDisplay = !tagsDisplay" class="flex justify-between hover:cursor-pointer">
<div class="text-xl font-bold pb-2">Tags associés :</div>
<span class="example-accordion-item-description" class="font-semibold">
Cliquer pour {{ tagsDisplay ? 'fermer' : 'ouvrir' }}
</span>
</div>
<div
role="region"
[style.display]="tagsDisplay ? '' : 'none'">
<div class="grid grid-cols-2 xl:grid-cols-4 text-center">
<div *ngFor="let tagString of tagsListOfSpecScript" class="rounded-2xl overflow-hidden shadow-lg bg-green-300 p-4 m-2 font-bold">
{{tagString}}
</div>
</div>
</cdk-accordion-item>
<cdk-accordion-item>
<div class="rounded-lg bg-slate-300 p-2 mt-2">
<div (click)="tagsDisplay = !tagsDisplay" class="flex justify-between hover:cursor-pointer">
<div class="text-xl font-bold pb-2">Tags associés :</div>
<span class="example-accordion-item-description" class="font-semibold">
Cliquer pour {{ tagsDisplay ? 'fermer' : 'ouvrir' }}
</span>
</div>
<div
role="region"
[style.display]="tagsDisplay ? '' : 'none'">
<div class="grid grid-cols-2 xl:grid-cols-4 text-center">
<div *ngFor="let tagString of tagsListOfSpecScript" class="rounded-2xl overflow-hidden shadow-lg bg-green-300 p-4 m-2 font-bold">
{{tagString}}
</div>
</div>
</div>
</cdk-accordion-item>
</cdk-accordion>
</div>
</cdk-accordion-item>
</cdk-accordion>
</div>
</div>
</div>

@ -65,7 +65,6 @@ export class ScriptManagementComponent implements OnInit {
const tempDescScript = this.allLinksScriptTag.filter(link => link.scriptName === script.name);
this.descText = tempDescScript[0].description;
this.tagsListOfSpecScript = tempDescScript[0].tags;
console.log(this.tagsListOfSpecScript);
}
}
@ -79,25 +78,16 @@ export class ScriptManagementComponent implements OnInit {
});
}
onItemSelect(item: any) {
this.sortWithFilter();
}
onSelectAll(items: any) {
this.selectedTagList = items;
this.sortWithFilter();
}
onItemDeselect(item: any){
this.sortWithFilter();
}
onDeselectAll(items: any){
onDeselectAll(){
this.selectedTagList = [];
this.allScripts = this.memoryScripts;
}
public sortWithFilter(){
let tempLinksScriptsWithTags: LinkScriptTag[] = [];
if(this.selectedTagList.length !==0){
@ -165,7 +155,6 @@ export class ScriptManagementComponent implements OnInit {
(response : Script[]) => {
this.allScripts = response;
this.memoryScripts = response;
console.log(this.memoryScripts)
},
(error: HttpErrorResponse) => {
alert(error.message)

@ -1,61 +1,58 @@
<div class="my-4">
<div class="text-center rounded-lg overflow-hidden shadow-lg bg-white p-4 ">
<div class="text-2xl font-bold">Gestion des Tags</div>
<div class="grid grid-cols-3 gap-4 mt-2">
<button class="text-black bg-gradient-to-r from-teal-200 to-lime-200 hover:bg-gradient-to-l hover:from-teal-200 hover:to-lime-200 focus:ring-4 focus:outline-none focus:ring-lime-200 font-semibold py-2 px-2 rounded shadow mx-2" (click)="addPress = !addPress">Ajouter un Tag</button>
<input [(ngModel)]="filterTag" type="text" class="block w-full my-2 pl-2 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-slate-800 focus:border-slate-800" placeholder="Rechercher...">
<button class="text-white bg-gradient-to-br from-pink-500 to-orange-400 hover:bg-gradient-to-bl focus:ring-4 focus:outline-none focus:ring-pink-200 font-semibold py-2 px- rounded shadow mx-2" (click)="deleteAllTags()" disabled>Supprimer tous les Tags</button>
</div>
<div *ngIf="addPress">
<div class="bg-orange-400 w-full h-2 overflow-hidden my-4 rounded-lg"></div>
<div class="grid grid-cols-2 gap-4">
<div>
<div class="text-lg font-semibold">Nom du Tag : </div>
<input [(ngModel)]="nameOfTag" type="text" class="block w-full my-2 pl-2 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-slate-800 focus:border-slate-800" placeholder="Taper le nom ici...">
</div>
<div>
<div class="text-lg font-semibold">Description du Tag : </div>
<input [(ngModel)]="descOfTag" type="text" class="block w-full my-2 pl-2 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-slate-800 focus:border-slate-800" placeholder="Taper la description ici...">
</div>
</div>
<button class="text-white bg-gradient-to-br from-green-400 to-blue-600 hover:bg-gradient-to-bl focus:ring-4 focus:outline-none focus:ring-green-200 font-semibold py-2 px-2 rounded shadow mx-2 mt-4" (click)="addTag()">Valider</button>
</div>
<div class="text-center rounded-lg overflow-hidden shadow-lg bg-white p-4 my-4">
<div class="text-2xl font-bold">Gestion des Tags</div>
<div class="grid grid-cols-3 gap-4 mt-2">
<button class="text-black bg-gradient-to-r from-teal-200 to-lime-200 hover:bg-gradient-to-l hover:from-teal-200 hover:to-lime-200 focus:ring-4 focus:outline-none focus:ring-lime-200 font-semibold py-2 px-2 rounded shadow mx-2" (click)="addPress = !addPress">Ajouter un Tag</button>
<input [(ngModel)]="filterTag" type="text" class="block w-full my-2 pl-2 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-slate-800 focus:border-slate-800" placeholder="Rechercher...">
<button class="text-white bg-gradient-to-br from-pink-500 to-orange-400 hover:bg-gradient-to-bl focus:ring-4 focus:outline-none focus:ring-pink-200 font-semibold py-2 px- rounded shadow mx-2" (click)="deleteAllTags()" disabled>Supprimer tous les Tags</button>
</div>
<div *ngIf="addPress">
<div class="bg-orange-400 w-full h-2 overflow-hidden my-4 rounded-lg"></div>
<div *ngIf="modifyPress">
<div class="grid grid-cols-2 gap-4">
<div>
<div class="text-lg font-semibold">Nom du Tag : </div>
<div>{{ previousName }}</div>
<div class="text-lg font-semibold">Nouveau nom : </div>
<input [(ngModel)]="modifyName" type="text" class="block w-full my-2 pl-2 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-slate-800 focus:border-slate-800" placeholder="Taper le nom ici...">
</div>
<div>
<div class="text-lg font-semibold">Description du Tag : </div>
<div>{{ previousDesc }}</div>
<div class="text-lg font-semibold">Nouvelle description : </div>
<input [(ngModel)]="modifyDesc" type="text" class="block w-full my-2 pl-2 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-slate-800 focus:border-slate-800" placeholder="Taper la description ici...">
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div>
<div class="text-lg font-semibold">Nom du Tag : </div>
<input [(ngModel)]="nameOfTag" type="text" class="block w-full my-2 pl-2 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-slate-800 focus:border-slate-800" placeholder="Taper le nom ici...">
</div>
<div>
<div class="text-lg font-semibold">Description du Tag : </div>
<input [(ngModel)]="descOfTag" type="text" class="block w-full my-2 pl-2 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-slate-800 focus:border-slate-800" placeholder="Taper la description ici...">
</div>
<button class="text-white bg-gradient-to-br from-green-400 to-blue-600 hover:bg-gradient-to-bl focus:ring-4 focus:outline-none focus:ring-green-200 font-semibold py-2 px-2 rounded shadow mx-2 my-4" (click)="modifyTag()">Valider</button>
</div>
<button class="text-white bg-gradient-to-br from-green-400 to-blue-600 hover:bg-gradient-to-bl focus:ring-4 focus:outline-none focus:ring-green-200 font-semibold py-2 px-2 rounded shadow mx-2 mt-4" (click)="addTag()">Valider</button>
</div>
<div class="grid grid-cols-4 gap-4">
<div *ngFor="let tag of allTags | filter: filterTag" class="rounded-2xl overflow-hidden shadow-lg bg-slate-800 p-2">
<div class="text-white font-bold">Nom du Tag : {{ tag.nameTag }}</div>
<div class="text-white">{{ tag.descriptionTag }}</div>
<div class="flex justify-between my-2">
<button class="text-white bg-gradient-to-br from-purple-600 to-blue-500 hover:bg-gradient-to-bl focus:ring-4 focus:outline-none focus:ring-blue-300 font-semibold py-2 px-2 rounded shadow mx-2" (click)="pressModifyBtn(tag.tagId, tag.nameTag, tag.descriptionTag)">Modifier</button>
<button class="text-white bg-gradient-to-br from-pink-500 to-orange-400 hover:bg-gradient-to-bl focus:ring-4 focus:outline-none focus:ring-pink-200 font-semibold py-2 px-2 rounded shadow mx-2" (click)="deleleTag(tag)">Supprimer</button>
</div>
<div class="bg-orange-400 w-full h-2 overflow-hidden my-4 rounded-lg"></div>
<div *ngIf="modifyPress">
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div>
<div class="text-lg font-semibold">Nom du Tag : </div>
<div>{{ previousName }}</div>
<div class="text-lg font-semibold">Nouveau nom : </div>
<input [(ngModel)]="modifyName" type="text" class="block w-full my-2 pl-2 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-slate-800 focus:border-slate-800" placeholder="Taper le nom ici...">
</div>
<div>
<div class="text-lg font-semibold">Description du Tag : </div>
<div>{{ previousDesc }}</div>
<div class="text-lg font-semibold">Nouvelle description : </div>
<input [(ngModel)]="modifyDesc" type="text" class="block w-full my-2 pl-2 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-slate-800 focus:border-slate-800" placeholder="Taper la description ici...">
</div>
</div>
<button class="text-white bg-gradient-to-br from-green-400 to-blue-600 hover:bg-gradient-to-bl focus:ring-4 focus:outline-none focus:ring-green-200 font-semibold py-2 px-2 rounded shadow mx-2 my-4" (click)="modifyTag()">Valider</button>
</div>
<div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-4 gap-4">
<div *ngFor="let tag of allTags | filter: filterTag" class="rounded-2xl overflow-hidden shadow-lg bg-slate-800 p-2">
<div class="text-white font-bold">Nom du Tag : {{ tag.nameTag }}</div>
<div class="text-white">{{ tag.descriptionTag }}</div>
<div class="flex justify-between my-2">
<button class="text-white bg-gradient-to-br from-purple-600 to-blue-500 hover:bg-gradient-to-bl focus:ring-4 focus:outline-none focus:ring-blue-300 font-semibold py-2 px-2 rounded shadow mx-2" (click)="pressModifyBtn(tag.tagId, tag.nameTag, tag.descriptionTag)">Modifier</button>
<button class="text-white bg-gradient-to-br from-pink-500 to-orange-400 hover:bg-gradient-to-bl focus:ring-4 focus:outline-none focus:ring-pink-200 font-semibold py-2 px-2 rounded shadow mx-2" (click)="deleleTag(tag)">Supprimer</button>
</div>
</div>
</div>
</div>

@ -1,47 +1,40 @@
<nav class="sticky top-0 left-0 right-0 z-50 bg-slate-900 hover:border-solid hover:border-b-2 hover:border-white border-b-2 border-slate-900 hover:ease-in-out duration-300">
<div class="mx-auto max-w-7xl px-2 md:px-6 lg:px-8">
<div class="relative flex h-16 items-center justify-between">
<div class="absolute inset-y-0 left-0 flex items-center md:hidden">
<!-- Mobile menu button-->
<button type="button" class="inline-flex items-center justify-center rounded-md p-2 text-gray-400 hover:bg-gray-700 hover:text-white focus:outline-none focus:ring-2 focus:ring-inset focus:ring-white" aria-controls="mobile-menu" aria-expanded="false">
<svg (click)="openMobileMenu()" class="block h-6 w-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" d="M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5" />
</svg>
</button>
<div class="mx-auto max-w-7xl px-2 md:px-6 lg:px-8 relative flex h-16 items-center justify-between">
<div class="absolute inset-y-0 left-0 flex items-center md:hidden">
<!-- Mobile menu button-->
<button type="button" class="inline-flex items-center justify-center rounded-md p-2 text-gray-400 hover:bg-gray-700 hover:text-white focus:outline-none focus:ring-2 focus:ring-inset focus:ring-white" aria-controls="mobile-menu" aria-expanded="false">
<svg (click)="openMobileMenu()" class="block h-6 w-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" d="M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5" />
</svg>
</button>
</div>
<div class="flex flex-1 items-center justify-center md:items-stretch md:justify-start">
<div class="flex flex-shrink-0 items-center">
<img routerLink="" class="block h-8 w-auto lg:hidden hover:cursor-pointer" src="../../assets/images/logo-apsidetop-blanc.png" alt="Your Company">
<img routerLink="" class="hidden h-8 w-auto lg:block hover:cursor-pointer" src="../../assets/images/logo-apsidetop-blanc.png" alt="Your Company">
</div>
<div class="flex flex-1 items-center justify-center md:items-stretch md:justify-start">
<div class="flex flex-shrink-0 items-center">
<img routerLink="" class="block h-8 w-auto lg:hidden hover:cursor-pointer" src="../../assets/images/logo-apsidetop-blanc.png" alt="Your Company">
<img routerLink="" class="hidden h-8 w-auto lg:block hover:cursor-pointer" src="../../assets/images/logo-apsidetop-blanc.png" alt="Your Company">
</div>
<div class="hidden md:ml-6 md:block" id="extend-menu">
<div class="flex space-x-4">
<a routerLinkActive="active" routerLink="request" class="text-gray-300 hover:bg-gray-700 hover:text-white px-3 py-2 rounded-md text-sm font-medium ">Recherche</a>
<div class="hidden md:ml-6 md:flex space-x-4" id="extend-menu">
<a routerLinkActive="active" routerLink="request" class="text-gray-300 hover:bg-gray-700 hover:text-white px-3 py-2 rounded-md text-sm font-medium ">Recherche</a>
<a routerLinkActive="active" routerLink="joins" class="text-gray-300 hover:bg-gray-700 hover:text-white px-3 py-2 rounded-md text-sm font-medium ">Jointures</a>
<a routerLinkActive="active" routerLink="joins" class="text-gray-300 hover:bg-gray-700 hover:text-white px-3 py-2 rounded-md text-sm font-medium ">Jointures</a>
<a routerLinkActive="active" routerLink="createjoins" class="text-gray-300 hover:bg-gray-700 hover:text-white px-3 py-2 rounded-md text-sm font-medium ">Création</a>
<a routerLinkActive="active" routerLink="createjoins" class="text-gray-300 hover:bg-gray-700 hover:text-white px-3 py-2 rounded-md text-sm font-medium ">Création</a>
<a routerLinkActive="active" routerLink="scriptmanagement" class="text-gray-300 hover:bg-gray-700 hover:text-white px-3 py-2 rounded-md text-sm font-medium">Gestionnaire</a>
<a routerLinkActive="active" routerLink="scriptmanagement" class="text-gray-300 hover:bg-gray-700 hover:text-white px-3 py-2 rounded-md text-sm font-medium">Gestionnaire</a>
<button (click)="applyResetDatabase()" class="text-white bg-orange-400 hover:bg-gray-700 hover:text-white px-3 py-2 rounded-md text-sm font-medium hover:animate-pulse">MAJ BDD</button>
<button (click)="applyResetDatabase()" class="text-white bg-orange-400 hover:bg-gray-700 hover:text-white px-3 py-2 rounded-md text-sm font-medium hover:animate-pulse">MAJ BDD</button>
<mat-spinner *ngIf="isLoading" diameter="30"></mat-spinner>
</div>
</div>
<mat-spinner *ngIf="isLoading" diameter="30"></mat-spinner>
</div>
<div class="absolute inset-y-0 right-0 flex items-center pr-2 md:static md:inset-auto md:ml-6 md:pr-0">
<!-- Profile dropdown -->
</div>
<div class="absolute inset-y-0 right-0 flex items-center pr-2 md:static md:inset-auto md:ml-6 md:pr-0">
<!-- Profile dropdown -->
<div class="relative ml-3">
<div>
<button type="button" class="flex rounded-full bg-gray-800 text-sm focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-gray-800" id="user-menu-button" aria-expanded="false" aria-haspopup="true">
<img class="h-8 w-8 rounded-full border-solid border-2 border-white" src="../../assets/images/userpng.png" alt="">
</button>
</div>
</div>
<div class="relative ml-3">
<button type="button" class="flex rounded-full bg-gray-800 text-sm focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-gray-800" id="user-menu-button" aria-expanded="false" aria-haspopup="true">
<img class="h-8 w-8 rounded-full border-solid border-2 border-white" src="../../assets/images/userpng.png" alt="">
</button>
</div>
</div>
</div>

@ -77,13 +77,11 @@ export class RequestPageComponent implements OnInit {
if(this.schemaName){
this.infoTableService.getTablesWithFilterAndSchema(this.filterTable, this.schemaName).subscribe(
(response: InfoTable[]) => {
console.log(response);
this.tablesBySchema = response;
});
} else {
this.infoTableService.getTablesWithFilter(this.filterTable).subscribe(
(response: InfoTable[]) => {
console.log(response);
this.infoTable = response;
});
}
@ -92,11 +90,9 @@ export class RequestPageComponent implements OnInit {
}
public divideColumns(nameSch: String, tempsTab: InfoTable):void {
console.log(nameSch, tempsTab.nameTable)
this.infoColumnService.getSelectedColumns(nameSch, tempsTab.nameTable).subscribe(
(response : InfoColumn[]) => {
this.infoColumn = response;
console.log(this.infoColumn)
},
(error: HttpErrorResponse) => {
alert(error.message)
@ -132,14 +128,6 @@ export class RequestPageComponent implements OnInit {
this.selectedSchema = this.schemaData.nameSchema;
}
if(this.selectedSchema){
// this.infoTableService.getTablesBySchema(this.selectedSchema).subscribe(
// (response : InfoTable[]) => {
// this.tablesBySchema = response;
// },
// (error: HttpErrorResponse) => {
// alert(error.message)
// }
// );
if(this.tableData){
this.divideColumns(this.selectedSchema, this.tableData);
}
@ -151,7 +139,6 @@ export class RequestPageComponent implements OnInit {
this.infoTableService.getSchemasByTable(this.tableData.nameTable).subscribe(
(response : InfoTable[]) => {
this.schemasByTable = response;
console.log(response);
},
(error: HttpErrorResponse) => {
alert(error.message)

@ -26,12 +26,12 @@ export class ScriptService {
}
public addOneScript(script: Script, description: String, tagList: String[], id: number){
const paramsAddScript = new HttpParams().set('content', script.data.toString()).set('name', script.name.toString()).set('desc', description.toString()).set('tagList', tagList.join(', ')).set('linkid', id);
return this.http.get<void>(`${this.apiServerUrl}/api/script/add`, {params: paramsAddScript});
const paramsAddScript = new HttpParams().set('name', script.name.toString()).set('desc', description.toString()).set('tagList', tagList.join(', ')).set('linkid', id);
return this.http.post<void>(`${this.apiServerUrl}/api/script/add`, script.data, {params: paramsAddScript});
}
public editScript(content: String, defaultName: String, newName: String, description: String, tagList: String[], id: number){
const paramsAddScript = new HttpParams().set('content', content.toString()).set('defaultname', defaultName.toString()).set('newname', newName.toString()).set('desc', description.toString()).set('tagList', tagList.join(', ')).set('linkid', id);
return this.http.get<void>(`${this.apiServerUrl}/api/script/edit`, {params: paramsAddScript});
const paramsAddScript = new HttpParams().set('defaultname', defaultName.toString()).set('newname', newName.toString()).set('desc', description.toString()).set('tagList', tagList.join(', ')).set('linkid', id);
return this.http.post<void>(`${this.apiServerUrl}/api/script/edit`, content, {params: paramsAddScript});
}
}

Loading…
Cancel
Save