Skip to content

Commit

Permalink
Merge pull request #262 from digi-serve/guy/team-widget
Browse files Browse the repository at this point in the history
Team node content
  • Loading branch information
nh758 authored Nov 18, 2024
2 parents 27ff6af + d0886d1 commit 8da7ae1
Show file tree
Hide file tree
Showing 8 changed files with 173 additions and 97 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,12 @@ jobs:
run: npm run test:e2e:app -- --browser chrome
working-directory: ./AppBuilder
- name: Save Screenshots
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-screenshots
path: ./AppBuilder/test/e2e/cypress/screenshots
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
if: failure()
with:
name: ABServices.log
Expand Down
150 changes: 79 additions & 71 deletions ABDataCollectionCore.js

Large diffs are not rendered by default.

40 changes: 23 additions & 17 deletions FilterComplexCore.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ module.exports = class FilterComplexCore extends ABComponent {
return;
}
// Skip incomplete filter condition
else if (!filter.key || !filter.rule) return;
else if (!filter || !filter.key || !filter.rule) return;

const fieldInfo = (this._Fields || []).filter(
(f) => f.id == filter.key || f.columnName == filter.key
Expand Down Expand Up @@ -958,23 +958,29 @@ module.exports = class FilterComplexCore extends ABComponent {

let result = [];

for (let condKey in dateConditions) {
if (condKey == "is_current_date") {
result.push({
id: condKey,
value: dateConditions[condKey],
batch: "none",
handler: (a, b) => this.dateValid(a, condKey, b),
});
} else {
result.push({
id: condKey,
value: dateConditions[condKey],
batch: "datepicker",
handler: (a, b) => this.dateValid(a, condKey, b),
});
for (let condKey in dateConditions)
switch (condKey) {
case "is_current_date":
case "less_current":
case "greater_current":
case "less_or_equal_current":
case "greater_or_equal_current":
result.push({
id: condKey,
value: dateConditions[condKey],
batch: "none",
handler: (a, b) => this.dateValid(a, condKey, b),
});
break;
default:
result.push({
id: condKey,
value: dateConditions[condKey],
batch: "datepicker",
handler: (a, b) => this.dateValid(a, condKey, b),
});
break;
}
}
return result;
}

Expand Down
2 changes: 1 addition & 1 deletion dataFields/ABFieldConnectCore.js
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ module.exports = class ABFieldConnectCore extends ABField {
} else {
colName = indexField
? indexField.columnName
: this.fieldLink.columnName;
: datasourceLink.PK();
}
}
// NO CUSTOM INDEX
Expand Down
36 changes: 32 additions & 4 deletions dataFields/ABFieldDateCore.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

const ABField = require("../../platform/dataFields/ABField");

function L(key, altText) {
// TODO:
return altText; // AD.lang.label.getLabel(key) || altText;
}
/*function L(key, altText) {
// TODO:git
// return altText; // AD.lang.label.getLabel(key) || altText;
}*/

const ABFieldDateDefaults = {
key: "date",
Expand Down Expand Up @@ -158,6 +158,10 @@ module.exports = class ABFieldDateCore extends ABField {
*/
isValidData(data, validator) {
super.isValidData(data, validator);
var L = this.AB.Label();

const currentDate = new Date();
currentDate.setHours(0, 0, 0, 0);

if (data[this.columnName]) {
let value = data[this.columnName];
Expand Down Expand Up @@ -301,6 +305,30 @@ module.exports = class ABFieldDateCore extends ABField {
L("Should before or equal {0}", [startDateDisplay])
);
break;
case "lessCurrentDate":
isValid =
value.getTime &&
value.getTime() < currentDate.getTime();
if (!isValid)
validator.addError(
this.columnName,
L("Should before {0}", [
this.getDateDisplay(currentDate),
])
);
break;
case "lessEqualCurrentDate":
isValid =
value.getTime &&
value.getTime() <= currentDate.getTime();
if (!isValid)
validator.addError(
this.columnName,
L("Should before or equal {0}", [
this.getDateDisplay(currentDate),
])
);
break;
}
}

Expand Down
2 changes: 1 addition & 1 deletion dataFields/ABFieldDateTimeCore.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const ABFieldDateDefaults = {
// if a {fn} is provided, it will be called with the ABField as a parameter:
// (field) => field.setting.something == true

isSortable: false,
isSortable: true,
// {bool} / {fn}
// determines if the current ABField can be used to Sort data.
// if a {fn} is provided, it will be called with the ABField as a parameter:
Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.2.13
2.2.20
34 changes: 34 additions & 0 deletions views/ABViewOrgChartTeamsCore.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,19 @@ const ABViewOrgChartTeamsPropertyComponentDefaults = {
color: "#00BCD4",
// visibleLevel: 2,
draggable: 1,
showGroupTitle: 0,
dropContentToCreate: 0,
pan: 1,
zoom: 1,
height: 0,
export: 0,
exportFilename: "",
contentField: "",
contentFieldFilter: null,
contentGroupByField: "",
contentDisplayedFields: {},
showDataPanel: 0,
dataPanelDCs: {},
};

const ABViewOrgChartTeamsDefaults = {
Expand Down Expand Up @@ -120,6 +128,11 @@ module.exports = class ABViewOrgChartTeamsCore extends ABViewWidget {
ABViewOrgChartTeamsPropertyComponentDefaults.draggable
);

this.settings.dropContentToCreate = JSON.parse(
this.settings.dropContentToCreate ??
ABViewOrgChartTeamsPropertyComponentDefaults.dropContentToCreate
);

this.settings.height = parseInt(
this.settings.height ??
ABViewOrgChartTeamsPropertyComponentDefaults.height
Expand All @@ -133,6 +146,27 @@ module.exports = class ABViewOrgChartTeamsCore extends ABViewWidget {
this.settings.exportFilename =
this.settings.exportFilename ??
ABViewOrgChartTeamsPropertyComponentDefaults.exportFilename;
this.settings.contentField =
this.settings.contentField ??
ABViewOrgChartTeamsPropertyComponentDefaults.contentField;
this.settings.contentFieldFilter =
this.settings.contentFieldFilter ??
ABViewOrgChartTeamsPropertyComponentDefaults.contentFieldFilter;
this.settings.contentGroupByField =
this.settings.contentGroupByField ??
ABViewOrgChartTeamsPropertyComponentDefaults.contentGroupByField;
this.settings.showGroupTitle =
this.settings.showGroupTitle ??
ABViewOrgChartTeamsPropertyComponentDefaults.showGroupTitle;
this.settings.contentDisplayedFields =
this.settings.contentDisplayedFields ??
ABViewOrgChartTeamsPropertyComponentDefaults.contentDisplayedFields;
this.settings.showDataPanel =
this.settings.showDataPanel ??
ABViewOrgChartTeamsPropertyComponentDefaults.showDataPanel;
this.settings.dataPanelDCs =
this.settings.dataPanelDCs ??
ABViewOrgChartTeamsPropertyComponentDefaults.dataPanelDCs;
}

get datacollection() {
Expand Down

0 comments on commit 8da7ae1

Please sign in to comment.