Skip to content

Commit

Permalink
Merge pull request #50 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 5, 2022
2 parents 6428366 + e994753 commit d21e126
Show file tree
Hide file tree
Showing 11 changed files with 135 additions and 146 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
Version numbers correspond to `bower.json` version

# 1.10.9

## Fixes

- Fix technician intervention desorder

# 1.10.8

## Fixes
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.8",
"version": "1.10.9",
"authors": [
"Florent Gouget <[email protected]>"
],
Expand Down
230 changes: 115 additions & 115 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

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.8",
"version": "1.10.9",
"description": "",
"homepage": "",
"dependencies": {},
Expand Down
4 changes: 2 additions & 2 deletions src/directives/planning-left-column/planning-left-column.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ <h4>
</div>
<div class="days-body" ng-switch-when="day">
<div class="dayName row8 b-b animate"
ng-repeat="col in planningLeftColumn.column">
ng-repeat="tech in planningLeftColumn.column">
<h4>
{{planning.getName(col)}}
{{tech.fullname || ''}}
</h4>
</div>
</div>
Expand Down
8 changes: 2 additions & 6 deletions src/directives/planning-left-column/planning-left-column.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

self.$onInit = function () {
$scope.$watchCollection(function () {
return [self.events, self.position, self.mode, self.dayStart, self.dayEnd, self.usableDays]
return [self.events, self.position, self.mode, self.dayStart, self.dayEnd, self.usableDays, self.entitiesName]
}, init)
}

Expand Down Expand Up @@ -44,11 +44,7 @@
});
}
} else if (self.mode === 'day' && self.dayField) {
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())
}
self.column = self.entitiesName
}
}

Expand Down
19 changes: 3 additions & 16 deletions src/directives/planning/planning.js
Original file line number Diff line number Diff line change
Expand Up @@ -391,23 +391,10 @@
case 'week-advanced':
case 'day':
case '3day':
/* 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) {
return self.entitiesName.map(e => e._id)
}
if(self.entitiesName && self.entitiesName.length > 0) {
self.entitiesName.forEach(e => {
if (!(/\s/).test(e._id)) {
orderedTech.push(e._id)
}
})
}
return orderedTech
return []
}
}

Expand Down

0 comments on commit d21e126

Please sign in to comment.