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. 14
      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. 10
      src/app/creation/joins-table/joins-table.component.html
  7. 2
      src/app/creation/joins-table/joins-table.component.ts
  8. 5
      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. 6
      src/app/joins/joins-page/joins-page.component.html
  15. 4
      src/app/joins/joins-page/joins-page.component.ts
  16. 15
      src/app/manager/add-script/add-script.component.html
  17. 8
      src/app/manager/edit-script/edit-script.component.html
  18. 11
      src/app/manager/script-management/script-management.component.html
  19. 13
      src/app/manager/script-management/script-management.component.ts
  20. 15
      src/app/manager/tags-management/tags-management.component.html
  21. 11
      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 { MatToolbarModule } from '@angular/material/toolbar';
import {MatDialogModule} from '@angular/material/dialog'; import {MatDialogModule} from '@angular/material/dialog';
import { MatIconModule } from "@angular/material/icon"; 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 { FormsModule } from '@angular/forms';
import { JoinsPageComponent } from './joins/joins-page/joins-page.component'; import { JoinsPageComponent } from './joins/joins-page/joins-page.component';
import { CreateJoinsPageComponent } from './creation/create-joins-page/create-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 { ScriptManagementComponent } from './manager/script-management/script-management.component';
import { AddScriptComponent } from './manager/add-script/add-script.component'; import { AddScriptComponent } from './manager/add-script/add-script.component';
import { DndDirective } from './directives/dnd.directive' import { DndDirective } from './directives/dnd.directive'
import { CustomFilterScript } from 'src/CustomFilterScript'; import { CustomFilterScript } from 'src/app/custom-pipe/CustomFilterScript';
import { CustomFilterTable } from 'src/CustomInfoTableSearchPipe'; import { CustomFilterTable } from 'src/app/custom-pipe/CustomInfoTableSearchPipe';
import { EditScriptComponent } from './manager/edit-script/edit-script.component'; import { EditScriptComponent } from './manager/edit-script/edit-script.component';
import { TagsManagementComponent } from './manager/tags-management/tags-management.component'; import { TagsManagementComponent } from './manager/tags-management/tags-management.component';
import { NgMultiSelectDropDownModule } from 'ng-multiselect-dropdown'; 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 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> <div>
<label class="text-black text-left">Colonnes(Base) : </label> <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..."> <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(){ public sendColumnsData(){
if(this.baseColumnData && this.specificColumnData){ if(this.baseColumnData && this.specificColumnData){
console.log(this.baseColumnData, this.specificColumnData)
let tempsOpe = "AND"; let tempsOpe = "AND";
if(this.childIndex === 0){ if(this.childIndex === 0){
tempsOpe = "ON"; tempsOpe = "ON";
@ -31,7 +30,6 @@ export class ColumnsCardComponent {
aliasColumn: this.baseColumnData.nameColumn, aliasColumn: this.baseColumnData.nameColumn,
specColumn: this.specificColumnData.nameColumn, specColumn: this.specificColumnData.nameColumn,
} }
console.log(tempColumnData)
this.selectedColumn.emit(tempColumnData); this.selectedColumn.emit(tempColumnData);
} }
} }

@ -1,12 +1,12 @@
<!--Card--> <!--Card-->
<div class="my-4">
<div class="flex sm:flex-nowrap flex-wrap sm:space-x-4"> <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="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="rounded-lg overflow-hidden shadow-lg bg-slate-100 border-solid border-orange-400 border-2 p-4">
<div class="p-4">
<div class="font-bold text-xl text-left">Selectionner un Schéma et une Table (Base) :</div> <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="grid grid-cols-1 sm:grid-cols-2 gap-4">
<div class="mt-2"> <div class="mt-2">
<label class="text-black text-left">Schémas : </label> <label class="text-black text-left">Schémas : </label>
@ -26,7 +26,6 @@
<option *ngFor="let table of tablesByBaseSchema | filter : filterBaseTables" id="{{ table.id }}" [ngValue]="table">{{ table.nameTable }}</option> <option *ngFor="let table of tablesByBaseSchema | filter : filterBaseTables" id="{{ table.id }}" [ngValue]="table">{{ table.nameTable }}</option>
</select> </select>
</div> </div>
</div> </div>
<div *ngIf="tablesByBaseSchema"> <div *ngIf="tablesByBaseSchema">
@ -34,12 +33,8 @@
<label class="ml-2 text-sm font-medium text-gray-900 dark:text-gray-300">Afficher aussi les Vues</label> <label class="ml-2 text-sm font-medium text-gray-900 dark:text-gray-300">Afficher aussi les Vues</label>
</div> </div>
</div> </div>
</div>
<div *ngIf="baseTableName"> <div *ngIf="baseTableName">
<div *ngFor="let hop of requestInfoJoin; index as i" > <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> <app-joins-table [allAlias]="aliasData" [passJoinData]="allData[i]" (data)="retrieveData($event, i)" id="{{hop}}"></app-joins-table>
@ -76,5 +71,4 @@
</div> </div>
</div>

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

@ -1,5 +1,4 @@
<div [ngClass]="{'normalCard' : goodAlias, 'alternativeCard' : !goodAlias}"> <div [ngClass]="{'normalCard' : goodAlias, 'alternativeCard' : !goodAlias}" class="p-4">
<div class="p-4">
<div class="font-bold text-xl text-left mb-2">Selectionner les informations de la jointure :</div> <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 class="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-4 gap-4">
@ -47,11 +46,10 @@
<div *ngFor="let cols of columnsInfo, index as ind"> <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> <app-columns-card [baseColumns]="baseColumns" [specificColumns]="specificColumns" [childIndex]="ind" (selectedColumn)="retrieveColumnsData($event, ind)"></app-columns-card>
<div class="flex inline-flex space-x-4"> <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 text-sm px-5 py-2.5 text-center mr-2 my-2">+</button> <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> <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>
</div> </div>
</div> </div>

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

@ -1,5 +1,4 @@
<div class="rounded-lg overflow-hidden shadow-lg bg-slate-100 border-solid border-orange-400 border-2 my-2"> <div class="rounded-lg overflow-hidden shadow-lg bg-slate-100 border-solid border-orange-400 border-2 my-2 p-4">
<div class="p-4">
<div class="font-bold text-xl text-left mb-2">Selectionner les informations de la Condition :</div> <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 class="grid grid-cols-1 md:grid-cols-3 xl:grid-cols-5 gap-4">
@ -37,6 +36,6 @@
<label class="text-black text-left">Valeurs : </label> <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..."> <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>
</div> </div>
</div> </div>

@ -48,7 +48,6 @@ export class WhereCardComponent {
this.operator = "WHERE"; this.operator = "WHERE";
} }
if(this.operator && this.baseAlias && this.baseColumnData && this.conditionOperator && this.conditionValue){ 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]); 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 { Pipe, PipeTransform } from '@angular/core';
import { Script } from './app/model/script'; import { Script } from '../model/script';
@Pipe({ @Pipe({
name: 'filterscript', 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'; 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 // filter items array, items which match and return true will be
// kept, false will be filtered out // kept, false will be filtered out
if(filter){ 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; let files = evt.dataTransfer.files;
if (files.length > 0) { if (files.length > 0) {
this.fileDropped.emit(files); 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,14 +26,9 @@
</div> </div>
</div> </div>
<div class="rounded-lg overflow-hidden shadow-lg bg-white"> <div class="rounded-lg overflow-hidden shadow-lg bg-white">
<div class="px-6 py-4 "> <div class="px-6 py-4 ">
<div class="font-bold text-xl text-center">Selectionner un Schéma et une Table :</div> <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> <label class="text-black">Schémas : </label>
@ -55,6 +50,7 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div *ngIf="!columnIsFull && infoColumn" class="my-4 grid grid-cols-1 sm:grid-cols-4 gap-5"> <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( this.infoTableService.getSchemas().subscribe(
(response : String[]) => { (response : String[]) => {
this.allSchema = response; this.allSchema = response;
console.log(response);
}, },
(error: HttpErrorResponse) => { (error: HttpErrorResponse) => {
alert(error.message) alert(error.message)
@ -81,7 +80,6 @@ export class JoinsPageComponent implements OnInit{
this.infoTableService.getTablesBySchema(event.target.value).subscribe( this.infoTableService.getTablesBySchema(event.target.value).subscribe(
(response : InfoTable[]) => { (response : InfoTable[]) => {
this.tablesBySecondSchema = response; this.tablesBySecondSchema = response;
console.log(response);
}, },
(error: HttpErrorResponse) => { (error: HttpErrorResponse) => {
alert(error.message) alert(error.message)
@ -98,7 +96,6 @@ export class JoinsPageComponent implements OnInit{
this.infoColumnService.getColumn(event.target.value).subscribe( this.infoColumnService.getColumn(event.target.value).subscribe(
(response : InfoColumn) => { (response : InfoColumn) => {
this.displayColumns = response; this.displayColumns = response;
console.log(response);
}, },
(error: HttpErrorResponse) => { (error: HttpErrorResponse) => {
alert(error.message) alert(error.message)
@ -117,7 +114,6 @@ export class JoinsPageComponent implements OnInit{
this.infoColumnService.getColumnsForJoinTwo(this.tables, this.schemas).subscribe( this.infoColumnService.getColumnsForJoinTwo(this.tables, this.schemas).subscribe(
(response : InfoColumn[]) => { (response : InfoColumn[]) => {
this.infoColumn = response; this.infoColumn = response;
console.log(this.infoColumn);
if(this.infoColumn?.length === 0){ if(this.infoColumn?.length === 0){
this.columnIsFull = false; this.columnIsFull = false;
} else { } else {

@ -1,21 +1,17 @@
<div class="my-4">
<div class="flex sm:flex-nowrap flex-wrap sm:space-x-4">
<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="w-full sm:w-2/3 h-full text-center rounded-lg overflow-hidden shadow-lg bg-white p-4 ">
<div class="flex"> <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)="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> <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>
<div class="rounded-lg overflow-hidden shadow-lg bg-slate-100 border-solid border-orange-400 border-2"> <div class="rounded-lg overflow-hidden shadow-lg bg-slate-100 border-solid border-orange-400 border-2 p-4">
<div class="p-4">
<div *ngIf="newFile"> <div *ngIf="newFile">
<div class="font-bold text-xl text-left mb-2">Veuillez rentrer le contenu du Script : </div> <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 [(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> </textarea>
</div> </div>
<div *ngIf="!newFile"> <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)" > <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"/> <input type="file" multiple class=" z-10 opacity-0 absolute w-full h-full top-0 left-0"/>
@ -25,13 +21,16 @@
<div *ngIf="files.length > 0" class="my-2"> <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 *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="grid grid-cols-1 sm:grid-cols-2 ">
<div class="flex justify-start "> <div class="flex justify-start ">
<div class="font-bold mr-2">{{ file?.name }}</div> <div class="font-bold mr-2">{{ file?.name }}</div>
<div>Taille: {{ formatBytes(file.size) }}</div> <div>Taille: {{ formatBytes(file.size) }}</div>
</div> </div>
<div class="flex justify-end my-auto"> <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> <mat-icon (click)="deleteFile(i)" class="text-red-600 mx-2 hover:cursor-pointer" svgIcon="trash"></mat-icon>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
@ -39,8 +38,6 @@
<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 [(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> </textarea>
</div> </div>
</div>
</div> </div>
</div> </div>
@ -70,8 +67,6 @@
<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>
</div> </div>

@ -1,14 +1,11 @@
<div class="my-4">
<div class="flex sm:flex-nowrap flex-wrap sm:space-x-4">
<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="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="rounded-lg overflow-hidden shadow-lg bg-slate-100 border-solid border-orange-400 border-2">
<div class="p-4"> <div class="p-4">
<div class="font-bold text-xl text-left mb-2">Contenu du Script : </div> <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 [(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> </textarea>
</div> </div>
</div> </div>
</div> </div>
@ -21,7 +18,6 @@
<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> <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 [ngValue]="undefined" disabled>Sélectionner l'extension</option>
<option *ngFor="let ext of listOfExtension" value="{{ ext }}">{{ ext }}</option> <option *ngFor="let ext of listOfExtension" value="{{ ext }}">{{ ext }}</option>
</select> </select>
<div class="font-bold text-lg">Description du Script :</div> <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> <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>
@ -40,5 +36,5 @@
<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> <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>
</div> </div>
</div>

@ -9,7 +9,6 @@
<div class="sm:col-span-3 my-auto md:flex"> <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> <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> <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> </div>
</div> </div>
@ -26,10 +25,10 @@
[settings]="dropdownSettings" [settings]="dropdownSettings"
[data]="dropdownTagList" [data]="dropdownTagList"
[(ngModel)]="selectedTagList" [(ngModel)]="selectedTagList"
(onSelect)="onItemSelect($event)" (onSelect)="sortWithFilter()"
(onSelectAll)="onSelectAll($event)" (onSelectAll)="onSelectAll($event)"
(onDeSelect)="onItemDeselect($event)" (onDeSelect)="sortWithFilter()"
(onDeSelectAll)="onDeselectAll($event)" (onDeSelectAll)="onDeselectAll()"
> >
</ng-multiselect-dropdown> </ng-multiselect-dropdown>
</div> </div>
@ -51,11 +50,9 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="mt-4 md:mt-0">
<div class="mt-4 md:mt-0">
<cdk-accordion> <cdk-accordion>
<cdk-accordion-item > <cdk-accordion-item >
<div class="rounded-lg bg-slate-300 shadow-lg p-2"> <div class="rounded-lg bg-slate-300 shadow-lg p-2">

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

@ -1,5 +1,5 @@
<div class="my-4">
<div class="text-center rounded-lg overflow-hidden shadow-lg bg-white p-4 "> <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="text-2xl font-bold">Gestion des Tags</div>
<div class="grid grid-cols-3 gap-4 mt-2"> <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> <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>
@ -9,7 +9,7 @@
<div *ngIf="addPress"> <div *ngIf="addPress">
<div class="bg-orange-400 w-full h-2 overflow-hidden my-4 rounded-lg"></div> <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 class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div> <div>
<div class="text-lg font-semibold">Nom du Tag : </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..."> <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...">
@ -25,7 +25,7 @@
<div class="bg-orange-400 w-full h-2 overflow-hidden my-4 rounded-lg"></div> <div class="bg-orange-400 w-full h-2 overflow-hidden my-4 rounded-lg"></div>
<div *ngIf="modifyPress"> <div *ngIf="modifyPress">
<div class="grid grid-cols-2 gap-4"> <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div> <div>
<div class="text-lg font-semibold">Nom du Tag : </div> <div class="text-lg font-semibold">Nom du Tag : </div>
<div>{{ previousName }}</div> <div>{{ previousName }}</div>
@ -42,20 +42,17 @@
<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> <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>
<div class="grid grid-cols-4 gap-4"> <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 *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 font-bold">Nom du Tag : {{ tag.nameTag }}</div>
<div class="text-white">{{ tag.descriptionTag }}</div> <div class="text-white">{{ tag.descriptionTag }}</div>
<div class="flex justify-between my-2"> <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-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> <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> </div>
</div> </div>
</div> </div>

@ -1,7 +1,6 @@
<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"> <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="mx-auto max-w-7xl px-2 md:px-6 lg:px-8 relative flex h-16 items-center justify-between">
<div class="relative flex h-16 items-center justify-between">
<div class="absolute inset-y-0 left-0 flex items-center md:hidden"> <div class="absolute inset-y-0 left-0 flex items-center md:hidden">
<!-- Mobile menu button--> <!-- 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"> <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">
@ -15,9 +14,7 @@
<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="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"> <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>
<div class="hidden md:ml-6 md:block" id="extend-menu"> <div class="hidden md:ml-6 md:flex space-x-4" 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> <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>
@ -31,20 +28,16 @@
<mat-spinner *ngIf="isLoading" diameter="30"></mat-spinner> <mat-spinner *ngIf="isLoading" diameter="30"></mat-spinner>
</div> </div>
</div> </div>
</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"> <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 --> <!-- Profile dropdown -->
<div class="relative ml-3"> <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"> <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=""> <img class="h-8 w-8 rounded-full border-solid border-2 border-white" src="../../assets/images/userpng.png" alt="">
</button> </button>
</div> </div>
</div> </div>
</div> </div>
</div>
</div>
<!-- Mobile menu, show/hide based on menu state. --> <!-- Mobile menu, show/hide based on menu state. -->
<div *ngIf="mobileOpen" class="md:hidden" id="mobile-menu"> <div *ngIf="mobileOpen" class="md:hidden" id="mobile-menu">

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

@ -26,12 +26,12 @@ export class ScriptService {
} }
public addOneScript(script: Script, description: String, tagList: String[], id: number){ 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); const paramsAddScript = new HttpParams().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}); 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){ 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); 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.get<void>(`${this.apiServerUrl}/api/script/edit`, {params: paramsAddScript}); return this.http.post<void>(`${this.apiServerUrl}/api/script/edit`, content, {params: paramsAddScript});
} }
} }

Loading…
Cancel
Save