+
diff --git a/src/app/joins-table/joins-table.component.scss b/src/app/joins-table/joins-table.component.scss
index e69de29..d91fba7 100644
--- a/src/app/joins-table/joins-table.component.scss
+++ b/src/app/joins-table/joins-table.component.scss
@@ -0,0 +1,25 @@
+// rounded-lg overflow-hidden shadow-lg bg-slate-100 border-solid border-orange-400 border-2 my-2
+
+.normalCard {
+ border-radius: 0.5rem;
+ overflow: hidden;
+ box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
+ background-color: rgb(241 245 249);
+ border-style: solid;
+ border-color: rgb(251 146 60);
+ border-width: 2px;
+ margin-top: 0.5rem; /* 8px */
+ margin-bottom: 0.5rem; /* 8px */
+}
+
+.alternativeCard {
+ border-radius: 0.5rem;
+ overflow: hidden;
+ box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
+ background-color: rgb(71 85 105);
+ border-style: solid;
+ border-color: rgb(251 146 60);
+ border-width: 2px;
+ margin-top: 0.5rem; /* 8px */
+ margin-bottom: 0.5rem; /* 8px */
+}
diff --git a/src/app/joins-table/joins-table.component.ts b/src/app/joins-table/joins-table.component.ts
index 66c74aa..ca1f713 100644
--- a/src/app/joins-table/joins-table.component.ts
+++ b/src/app/joins-table/joins-table.component.ts
@@ -39,10 +39,10 @@ export class JoinsTableComponent implements OnInit, OnChanges{
myJoinData: Join | undefined;
isGood: boolean = true;
positionIndex: number =0;
- tempAliasData: Alias[] = []
+ tempAliasData: Alias[] = [];
+ goodAlias = true;
constructor(
-
private infoColumnService: InfoColumnService,
private infoTableService: InfoTableService
){}
@@ -50,39 +50,24 @@ export class JoinsTableComponent implements OnInit, OnChanges{
ngOnInit(): void {
this.getSchemas();
this.getBaseColumns();
- this.verifyAlias();
}
ngOnChanges(): void {
this.getBaseColumns();
this.verifyAlias();
-
}
public verifyAlias(){
-
- // console.log(this.allAlias);
this.tempAliasData = this.allAlias;
- // if(this.passJoinData){
- // this.tempAliasData = [];
-
- // const myAlias = this.passJoinData.aliasSpecificTable;
- // console.log(myAlias)
- // this.allAlias.forEach((alias, i) =>{
- // if(alias.nameAlias == myAlias){
- // console.log(this.tempAliasData[i])
-
- // this.positionIndex = i;
- // } else {
- // this.tempAliasData.push(alias);
-
- // }
-
- // })
-
- // console.log(this.allAlias)
- // console.log(this.tempAliasData)
- // }
+ if(this.passJoinData){
+ this.tempAliasData = [];
+ const myAlias = this.passJoinData.aliasSpecificTable;
+ this.allAlias.forEach((alias, i) =>{
+ if(alias.nameAlias !== myAlias){
+ this.tempAliasData.push(alias);
+ }
+ })
+ }
}
public getSchemas():void {
@@ -148,7 +133,6 @@ export class JoinsTableComponent implements OnInit, OnChanges{
aliasSpecificTable: tempLower,
}
this.data.emit([this.joinData, this.specificSchema, this.specificTable, this.baseAlias.nameAlias, this.baseColumnData.nameColumn, this.specificColumnData.nameColumn, tempLower]);
-
}
}
diff --git a/src/app/model/condition.ts b/src/app/model/condition.ts
new file mode 100644
index 0000000..398d1f7
--- /dev/null
+++ b/src/app/model/condition.ts
@@ -0,0 +1,7 @@
+export interface Condition {
+ operator: String;
+ alias: String;
+ column: String;
+ condition: String;
+ value: String;
+}
diff --git a/src/app/where-card/where-card.component.html b/src/app/where-card/where-card.component.html
new file mode 100644
index 0000000..9d3e88a
--- /dev/null
+++ b/src/app/where-card/where-card.component.html
@@ -0,0 +1,42 @@
+
+
+
Selectionner les informations de la Condition :
+
+
+
diff --git a/src/app/where-card/where-card.component.scss b/src/app/where-card/where-card.component.scss
new file mode 100644
index 0000000..e69de29
diff --git a/src/app/where-card/where-card.component.ts b/src/app/where-card/where-card.component.ts
new file mode 100644
index 0000000..9715e72
--- /dev/null
+++ b/src/app/where-card/where-card.component.ts
@@ -0,0 +1,54 @@
+import { HttpErrorResponse } from '@angular/common/http';
+import { Component, EventEmitter, Input, Output } from '@angular/core';
+import { Alias } from '../model/alias';
+import { InfoColumn } from '../model/info-column';
+import { InfoColumnService } from '../service/info-column.service';
+import { InfoTableService } from '../service/info-table.service';
+
+@Component({
+ selector: 'app-where-card',
+ templateUrl: './where-card.component.html',
+ styleUrls: ['./where-card.component.scss']
+})
+export class WhereCardComponent {
+ @Input() allAlias: Alias[] = [];
+ @Input() childIndex: number | undefined;
+ @Output() conditionData = new EventEmitter
();
+
+ operator: any
+ operatorList: String[] = ["AND", "OR"];
+ conditionValue: any;
+ conditionOperator: any;
+ filterAlias: any;
+ filterColumn: any;
+ baseAlias: Alias | undefined;
+ baseColumns: InfoColumn[] | undefined;
+ baseColumnData: any;
+
+ constructor(
+ private infoColumnService: InfoColumnService,
+ private infoTableService: InfoTableService
+ ){}
+
+ public getColumns():void {
+ if(this.baseAlias){
+ this.infoColumnService.getSelectedColumns(this.baseAlias.nameSchema, this.baseAlias.nameTable).subscribe(
+ (response : InfoColumn[]) => {
+ this.baseColumns = response;
+ },
+ (error: HttpErrorResponse) => {
+ alert(error.message)
+ }
+ );
+ }
+ }
+
+ public verifyAndSendConditionData(){
+ if(this.childIndex === 0){
+ this.operator = "WHERE";
+ }
+ if(this.operator && this.baseAlias && this.baseColumnData && this.baseColumnData && this.conditionOperator && this.conditionValue){
+ this.conditionData.emit([this.operator, this.baseAlias.nameAlias, this.baseColumnData.nameColumn, this.conditionOperator, this.conditionValue]);
+ }
+ }
+}