Skip to content

Commit

Permalink
Merge pull request #49 from 90TechSAS/fix/tech-name-order
Browse files Browse the repository at this point in the history
Fix/tech name order
  • Loading branch information
aessare committed May 4, 2022
2 parents bf3db33 + fcef6d2 commit 6428366
Show file tree
Hide file tree
Showing 10 changed files with 103 additions and 78 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
Version numbers correspond to `bower.json` version

# 1.10.8

## Fixes

- Fix technician name reordering
# 1.10.7

## Feature
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zl-planning",
"version": "1.10.7",
"version": "1.10.8",
"authors": [
"Florent Gouget <[email protected]>"
],
Expand Down
136 changes: 68 additions & 68 deletions dist/planning.css

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

2 changes: 1 addition & 1 deletion dist/planning.css.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/planning.js
100644 → 100755

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/planning.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"author": "",
"name": "zl-planning",
"version": "1.10.7",
"version": "1.10.8",
"description": "",
"homepage": "",
"dependencies": {},
Expand Down
7 changes: 5 additions & 2 deletions src/directives/planning-left-column/planning-left-column.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,14 @@
});
}
} else if (self.mode === 'day' && self.dayField) {
self.column = Object.keys(self.events).sort()
self.column = Object.keys(self.events)
// check if displayNoTechnician to move it to the first place of column array
if ((/\s/).test(self.column[self.column.length -1])) {
self.column.unshift(self.column.pop())
}
}
}


}

function PlanningDirective () {
Expand Down
18 changes: 17 additions & 1 deletion src/directives/planning/planning.js
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,23 @@
case 'week-advanced':
case 'day':
case '3day':
return Object.keys(sortedEvents).sort()
/* reorder sortedEvents (which are technician ids)
* to be at the same order as entitiesName which
* are technician fullnames (sorted alphabitically by default)
*/
const orderedTech = []
const eventKeys = Object.keys(sortedEvents)
if (eventKeys.includes(' Sans technicien')) {
orderedTech.push(eventKeys[eventKeys.length -1])
}
if(self.entitiesName && self.entitiesName.length > 0) {
self.entitiesName.forEach(e => {
if (!(/\s/).test(e._id)) {
orderedTech.push(e._id)
}
})
}
return orderedTech
}
}

Expand Down

0 comments on commit 6428366

Please sign in to comment.