-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow specification of swimlanes via configuration #7200
Merged
Merged
Changes from 11 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
c980e8e
Use specified group order for plans
shefalijoshi e0b0388
Allow groupIds to be a function
shefalijoshi 541a910
Fix typo in if statement
shefalijoshi f74408c
Check that activities are present for a given group
shefalijoshi 49fa8a8
Change refresh to emit the new model
shefalijoshi f629616
Update domainobject on change
shefalijoshi 1f06a3b
Revert changes for domainObject
shefalijoshi a53f557
Revert groupIds as functions. Check if groups are objects with names …
shefalijoshi ebbacb3
Add e2e test for plan swim lane order
shefalijoshi 285ac08
Merge branch 'master' into timelist-swimlane-order-7196
shefalijoshi 378bf61
Merge branch 'master' into timelist-swimlane-order-7196
shefalijoshi b7bbc5d
Address review comments - improve if statement
shefalijoshi 5dd2122
Merge branch 'timelist-swimlane-order-7196' of https://github.com/nas…
shefalijoshi 2bee84f
Move function to right util helper
shefalijoshi 33112f4
Merge branch 'master' into timelist-swimlane-order-7196
shefalijoshi 2e0f0dc
Merge branch 'master' into timelist-swimlane-order-7196
shefalijoshi 83d17e0
Fix path for imported code
shefalijoshi c10676c
Merge branch 'master' into timelist-swimlane-order-7196
shefalijoshi c97e16a
Remove focused test
shefalijoshi 178fae0
Merge branch 'timelist-swimlane-order-7196' of https://github.com/nas…
shefalijoshi 33ebb72
Merge branch 'master' into timelist-swimlane-order-7196
shefalijoshi f75e9ea
Change the name of the ordered group configuration
shefalijoshi 95f352c
Merge branch 'master' into timelist-swimlane-order-7196
shefalijoshi 1925420
Merge branch 'master' into timelist-swimlane-order-7196
shefalijoshi e1ad784
Merge branch 'master' into timelist-swimlane-order-7196
shefalijoshi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
e2e/test-data/examplePlans/ExamplePlanWithOrderedLanes.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{ | ||
"Groups": [ | ||
{ | ||
"name": "Group 1" | ||
}, | ||
{ | ||
"name": "Group 2" | ||
} | ||
], | ||
"Group 2": [ | ||
{ | ||
"name": "Past event 3", | ||
"start": 1660493208000, | ||
"end": 1660503981000, | ||
"type": "Group 2", | ||
"color": "orange", | ||
"textColor": "white" | ||
}, | ||
{ | ||
"name": "Past event 4", | ||
"start": 1660579608000, | ||
"end": 1660624108000, | ||
"type": "Group 2", | ||
"color": "orange", | ||
"textColor": "white" | ||
}, | ||
{ | ||
"name": "Past event 5", | ||
"start": 1660666008000, | ||
"end": 1660681529000, | ||
"type": "Group 2", | ||
"color": "orange", | ||
"textColor": "white" | ||
} | ||
], | ||
"Group 1": [ | ||
{ | ||
"name": "Past event 1", | ||
"start": 1660320408000, | ||
"end": 1660343797000, | ||
"type": "Group 1", | ||
"color": "orange", | ||
"textColor": "white" | ||
}, | ||
{ | ||
"name": "Past event 2", | ||
"start": 1660406808000, | ||
"end": 1660429160000, | ||
"type": "Group 1", | ||
"color": "orange", | ||
"textColor": "white" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,17 +22,7 @@ | |
|
||
export function getValidatedData(domainObject) { | ||
const sourceMap = domainObject.sourceMap; | ||
const body = domainObject.selectFile?.body; | ||
let json = {}; | ||
if (typeof body === 'string') { | ||
try { | ||
json = JSON.parse(body); | ||
} catch (e) { | ||
return json; | ||
} | ||
} else if (body !== undefined) { | ||
json = body; | ||
} | ||
const json = getObjectJson(domainObject); | ||
|
||
if ( | ||
sourceMap !== undefined && | ||
|
@@ -69,6 +59,45 @@ export function getValidatedData(domainObject) { | |
} | ||
} | ||
|
||
function getObjectJson(domainObject) { | ||
const body = domainObject.selectFile?.body; | ||
let json = {}; | ||
if (typeof body === 'string') { | ||
try { | ||
json = JSON.parse(body); | ||
} catch (e) { | ||
return json; | ||
} | ||
} else if (body !== undefined) { | ||
json = body; | ||
} | ||
|
||
return json; | ||
} | ||
|
||
export function getValidatedGroups(domainObject, planData) { | ||
let groupIds; | ||
const sourceMap = domainObject.sourceMap; | ||
const json = getObjectJson(domainObject); | ||
if (sourceMap !== undefined && sourceMap.groupIds !== undefined) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you can simplify this as |
||
const groups = json[sourceMap.groupIds]; | ||
if (groups.length && typeof groups[0] === 'object') { | ||
const groupsWithNames = groups.filter( | ||
(groupObj) => groupObj.name !== undefined && groupObj.name !== '' | ||
); | ||
groupIds = groupsWithNames.map((groupObj) => groupObj.name); | ||
} else { | ||
groupIds = groups; | ||
} | ||
} | ||
|
||
if (groupIds === undefined) { | ||
groupIds = Object.keys(planData); | ||
} | ||
|
||
return groupIds; | ||
} | ||
|
||
export function getContrastingColor(hexColor) { | ||
function cutHex(h, start, end) { | ||
const hStr = h.charAt(0) === '#' ? h.substring(1, 7) : h; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's move this to
planningUtils
since it is specific to the Plan / Gantt Chart testing suites