Skip to content

Commit

Permalink
fix bug in columnToColumnModel that was only setting hasDomainFilter …
Browse files Browse the repository at this point in the history
…when a prefilled object was present
  • Loading branch information
jrchudy committed Sep 12, 2023
1 parent 4818ba9 commit 4f91ae8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/utils/recordedit-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,10 @@ export function columnToColumnModel(column: any, queryParams?: any): RecordeditC

const prefillObj = getPrefillObject(queryParams ? queryParams : {});
let isPrefilled = false, hasDomainFilter = false;
if (column.isForeignKey) hasDomainFilter = column.hasDomainFilter;

if (prefillObj) {
if (column.isForeignKey) {
hasDomainFilter = column.hasDomainFilter;
if (
// whether the fk is already marked as prefilled
prefillObj.fkColumnNames.indexOf(column.name) !== -1 ||
Expand Down
17 changes: 13 additions & 4 deletions test/e2e/specs/default-config/recordedit/domain-filter.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,16 +109,16 @@ describe("Domain filter pattern support,", function () {

constrainedColDropdown.click().then(() => {
const dropdownOptions = chaisePage.recordEditPage.getDropdownSelectableOptions();

// make sure the number of dropdown options load
browser.wait(() => {
return dropdownOptions.count().then((ct) => {
return ct === 7;
});
});

expect(dropdownOptions.count()).toBe(7, 'total rows loaded in constrained col dropdown are incorrect')

done();
}).catch(chaisePage.catchTestError(done));
});
Expand All @@ -134,6 +134,15 @@ describe("Domain filter pattern support,", function () {
}).then(function (text) {
expect(text.indexOf("Select")).toBeGreaterThan(-1);
rows = chaisePage.recordsetPage.getRows();

// make sure the number of displayed rows are correct
browser.wait(() => {
return rows.count().then((ct) => {
return ct === 4;
});
});


return rows.get(0).all(by.css(".select-action-button"));
}).then(function (selectButtons) {

Expand All @@ -155,7 +164,7 @@ describe("Domain filter pattern support,", function () {

expect(dropdownOptions.count()).toBe(3, "count missmatch");


// select option 5 (index 4) and close the dropdown
return dropdownOptions;
}).then((options) => {
Expand Down

0 comments on commit 4f91ae8

Please sign in to comment.