Fixed ordering of entity enums
Thanks to
/*
* Waltz - Enterprise Architecture
- * Copyright (C) 2016, 2017 Waltz open source project
+ * Copyright (C) 2016, 2017, 2018, 2019 Waltz open source project
* See README.md for more information
*
* This program is free software: you can redistribute it and/or modify
@@ -24,7 +24,7 @@ import template from "./entity-enum.html";
const bindings = {
- parentEntityRef: '<'
+ parentEntityRef: "<"
};
@@ -36,7 +36,7 @@ const initialState = {
function mkChunks(entries, chunkSize) {
const chunkedEntries = [];
- for (var i = 0; i < entries.length; i += chunkSize) {
+ for (let i = 0; i < entries.length; i += chunkSize) {
chunkedEntries.push(entries.slice(i, i + chunkSize));
}
return chunkedEntries;
@@ -62,14 +62,14 @@ function controller($q, serviceBroker) {
$q.all([definitionsPromise, valuesPromise])
.then(([defs, vals]) => {
- const valsByDefId = _.keyBy(vals, 'definitionId');
+ const valsByDefId = _.keyBy(vals, "definitionId");
const entries = _.chain(defs)
.map(d => ({
definition: d,
value: valsByDefId[d.id] || {enumValueKey: "-"}
}))
- .sortBy(o => [o.definition.position, o.definition.id])
+ .sortBy(["definition.position", "definition.id"])
.value();
vm.chunkedEntries = mkChunks(entries, vm.numColumns);
@@ -81,8 +81,8 @@ function controller($q, serviceBroker) {
controller.$inject = [
- '$q',
- 'ServiceBroker'
+ "$q",
+ "ServiceBroker"
];
@@ -95,5 +95,5 @@ const component = {
export default {
component,
- id: 'waltzEntityEnum'
+ id: "waltzEntityEnum"
};
