poi-plugin-remodel-assistant 1.2.3-beta.4 → 1.2.3-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -41,6 +41,8 @@ var _materialInventoryDomain = require("../../shared/domain/material-inventory-d
|
|
|
41
41
|
|
|
42
42
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
43
43
|
|
|
44
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
45
|
+
|
|
44
46
|
const {
|
|
45
47
|
__: translate
|
|
46
48
|
} = window.i18n[_pluginMeta.PLUGIN_ID];
|
|
@@ -49,6 +51,16 @@ const __ = (key, ...args) => translate(`equipment.${key}`, ...args);
|
|
|
49
51
|
|
|
50
52
|
const localizedName = name => window.i18n.resources.__(name || '');
|
|
51
53
|
|
|
54
|
+
const ownedLevelSummary = levels => {
|
|
55
|
+
const counts = (levels || []).reduce((result, level) => {
|
|
56
|
+
const key = Number(level) || 0;
|
|
57
|
+
return _extends({}, result, {
|
|
58
|
+
[key]: (result[key] || 0) + 1
|
|
59
|
+
});
|
|
60
|
+
}, {});
|
|
61
|
+
return Object.keys(counts).map(Number).sort((left, right) => left - right).map(level => `${(0, _planStorage.starText)(level)} ×${counts[level]}`);
|
|
62
|
+
};
|
|
63
|
+
|
|
52
64
|
const startSpecText = (row, masterEquips) => {
|
|
53
65
|
const equipmentId = Number(row && row.startEquipmentId) || 0;
|
|
54
66
|
const level = Number(row && row.startLevel);
|
|
@@ -120,6 +132,7 @@ class EquipmentPlanSection extends _react.default.Component {
|
|
|
120
132
|
} = this.state;
|
|
121
133
|
const rows = (0, _planManagementDomain.buildPlanOccurrenceDisplayRows)(item);
|
|
122
134
|
const allowed = item.planPolicy ? item.planPolicy.allowedStars || [] : [];
|
|
135
|
+
const ownedSummary = ownedLevelSummary(item.levels);
|
|
123
136
|
const canAdd = allowed.includes(Number(star)) && (0, _planStorage.isValidPlanAddCount)(Number(count));
|
|
124
137
|
return _react.default.createElement(_detailPlugin.DetailPlugin, {
|
|
125
138
|
pluginKey: "equipment-plans",
|
|
@@ -131,7 +144,7 @@ class EquipmentPlanSection extends _react.default.Component {
|
|
|
131
144
|
className: "decision-equipment-plan-ownership"
|
|
132
145
|
}, _react.default.createElement("span", {
|
|
133
146
|
className: "decision-pill decision-owned-count-pill"
|
|
134
|
-
}, __('Owned count %d').replace('%d',
|
|
147
|
+
}, ownedSummary.length > 0 ? ownedSummary.join(' / ') : __('Owned count %d').replace('%d', 0))), rows.length > 0 ? _react.default.createElement(_react.default.Fragment, null, _react.default.createElement("div", {
|
|
135
148
|
className: "decision-equipment-plan-list-actions"
|
|
136
149
|
}, _react.default.createElement(_reactBootstrap.Button, {
|
|
137
150
|
bsSize: "xsmall",
|