Skip to content

Commit

Permalink
Feat/fe check contraints (#10)
Browse files Browse the repository at this point in the history
* Add the UI changes  for supporting check constraints

---------

Co-authored-by: Vivek Yadav <vivek.yadav@ollion.com>
Co-authored-by: taherkl <taher.lakdawala@ollion.com>
  • Loading branch information
3 people authored and akashthawaitcc committed Dec 23, 2024
1 parent 1b71560 commit dad575e
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 9 deletions.
45 changes: 45 additions & 0 deletions ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"babel-loader": "^9.1.3",
"jszip": "^3.10.1",
"loader-utils": "^3.2.1",
"node-sql-parser": "^5.3.5",
"rxjs": "~7.8.1",
"terser": "^5.22.0",
"tslib": "^2.6.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -377,5 +377,4 @@ describe('ObjectDetailComponent', () => {

})


});
Original file line number Diff line number Diff line change
Expand Up @@ -592,20 +592,17 @@ export class ObjectDetailComponent implements OnInit {
} else if (this.checkIfCcColumn(colId)) {
let message = `Column ${spColName} is a part of`;
const dependencies = [];

if (this.checkIfPkColumn(colId)) {
dependencies.push(' Primary key');
}
if (associatedIndexes.length !== 0) {
dependencies.push(` Index ${associatedIndexes}`);
}

// Join dependencies with appropriate punctuation
if (dependencies.length > 0) {
message += `${dependencies.join(' ,')} and`;
}
message += ' check constraints. Remove the dependencies from respective tabs before dropping the Column.';

this.dialog.open(InfodialogComponent, {
data: {
message,
Expand Down Expand Up @@ -874,7 +871,6 @@ export class ObjectDetailComponent implements OnInit {
this.ccArray = this.fb.array([]);
const srcArr: ICcTabData[] = [];
const spArr: ICcTabData[] = [];

// Populate srcArr and spArr
this.ccData.forEach((cc, index) => {
const baseObject : ICcTabData = {
Expand All @@ -893,7 +889,6 @@ export class ObjectDetailComponent implements OnInit {
spArr.push(baseObject);
}
});

const createFormGroup = (data : ICcTabData) => new FormGroup({
srcSno: new FormControl(data.srcSno || ''),
srcConstraintName: new FormControl(data.srcConstraintName || ''),
Expand All @@ -912,7 +907,6 @@ export class ObjectDetailComponent implements OnInit {
for (let i = 0; i < Math.min(srcArr.length, spArr.length); i++) {
this.ccArray.push(createFormGroup(srcArr[i]));
}

for (let i = Math.min(srcArr.length, spArr.length); i < srcArr.length; i++) {
this.ccArray.push(createFormGroup(srcArr[i]));
}
Expand All @@ -936,7 +930,6 @@ export class ObjectDetailComponent implements OnInit {
if (this.isCcEditMode) {
this.setCCRows();
}

this.isCcEditMode = !this.isCcEditMode;
}

Expand Down
1 change: 0 additions & 1 deletion ui/src/app/services/fetch/fetch.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ export class FetchService {
}

verifyCheckConstraintExpression() {
debugger
return this.http.get(`${this.url}/verifyCheckConstraintExpression`)
}

Expand Down

0 comments on commit dad575e

Please sign in to comment.