poi-plugin-remodel-assistant 1.2.3-beta.3 → 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/i18n/en-US.json CHANGED
@@ -1502,6 +1502,5 @@
1502
1502
  "diagnostics.Canonical plugin backup with plans, route choices, assignments, blacklist, and UI preferences": "Canonical plugin backup with plans, route choices, assignments, blacklist, and UI preferences",
1503
1503
  "equipment.Upgrade chain terminal": "Upgrade endpoint",
1504
1504
  "equipment.Improvement route": "Improvement route",
1505
- "equipment.Improvement endpoint": "Improvement endpoint",
1506
- "equipment.Standalone improvement": "Standalone improvement"
1505
+ "equipment.Improvement endpoint": "Improvement endpoint"
1507
1506
  }
package/i18n/ja-JP.json CHANGED
@@ -1502,6 +1502,5 @@
1502
1502
  "diagnostics.Canonical plugin backup with plans, route choices, assignments, blacklist, and UI preferences": "計画、ルート選択、装備割り当て、低優先装備、UI設定を含む標準プラグインバックアップ",
1503
1503
  "equipment.Upgrade chain terminal": "改修終点",
1504
1504
  "equipment.Improvement route": "改修ルート",
1505
- "equipment.Improvement endpoint": "改修終点",
1506
- "equipment.Standalone improvement": "単独改修"
1505
+ "equipment.Improvement endpoint": "改修終点"
1507
1506
  }
package/i18n/zh-CN.json CHANGED
@@ -1502,6 +1502,5 @@
1502
1502
  "diagnostics.Canonical plugin backup with plans, route choices, assignments, blacklist, and UI preferences": "插件标准备份,包含计划、路线选择、装备分配、低优先装备和界面设置",
1503
1503
  "equipment.Upgrade chain terminal": "改修终点",
1504
1504
  "equipment.Improvement route": "改修路线",
1505
- "equipment.Improvement endpoint": "改修终点",
1506
- "equipment.Standalone improvement": "独立改修"
1505
+ "equipment.Improvement endpoint": "改修终点"
1507
1506
  }
package/i18n/zh-TW.json CHANGED
@@ -1502,6 +1502,5 @@
1502
1502
  "diagnostics.Canonical plugin backup with plans, route choices, assignments, blacklist, and UI preferences": "外掛標準備份,包含計畫、路線選擇、裝備分配、低優先裝備與介面設定",
1503
1503
  "equipment.Upgrade chain terminal": "改修終點",
1504
1504
  "equipment.Improvement route": "改修路線",
1505
- "equipment.Improvement endpoint": "改修終點",
1506
- "equipment.Standalone improvement": "獨立改修"
1505
+ "equipment.Improvement endpoint": "改修終點"
1507
1506
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "poi-plugin-remodel-assistant",
3
- "version": "1.2.3-beta.3",
3
+ "version": "1.2.3-beta.5",
4
4
  "description": "View enhanced KanColle improvement data, manage improvement plans, and receive improvement recommendations.",
5
5
  "main": "index.js",
6
6
  "author": {
@@ -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', Number(item.ownedCount) || 0))), rows.length > 0 ? _react.default.createElement(_react.default.Fragment, null, _react.default.createElement("div", {
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",
@@ -162,7 +162,7 @@ class EquipmentWorkspace extends _react.Component {
162
162
  className: "decision-filter-buttons decision-weekday-buttons"
163
163
  }, WEEKDAY_KEYS.map((key, day) => this.renderToggle(selectedDays.includes(day), __(key), () => this.handleDay(day), key)))), _react.default.createElement(_filterControls.FilterRow, {
164
164
  label: __('Improvement route')
165
- }, _react.default.createElement(_filterControls.FilterButtonGroup, null, [[_equipmentWorkspaceModel.UPGRADE_STATUSES.ALL, __('All equipment')], [_equipmentWorkspaceModel.UPGRADE_STATUSES.TERMINAL, __('Improvement endpoint')], [_equipmentWorkspaceModel.UPGRADE_STATUSES.INDEPENDENT, __('Standalone improvement')], [_equipmentWorkspaceModel.UPGRADE_STATUSES.EVOLVABLE, __('Evolvable')]].map(([value, label]) => this.renderToggle(upgradeStatus === value, label, () => this.setState({
165
+ }, _react.default.createElement(_filterControls.FilterButtonGroup, null, [[_equipmentWorkspaceModel.UPGRADE_STATUSES.ALL, __('All equipment')], [_equipmentWorkspaceModel.UPGRADE_STATUSES.TERMINAL, __('Improvement endpoint')], [_equipmentWorkspaceModel.UPGRADE_STATUSES.EVOLVABLE, __('Evolvable')]].map(([value, label]) => this.renderToggle(upgradeStatus === value, label, () => this.setState({
166
166
  upgradeStatus: value
167
167
  }), value)))), _react.default.createElement(_filterControls.FilterRow, {
168
168
  label: __('Sort by')
@@ -30,8 +30,7 @@ exports.AVAILABILITY_MODES = AVAILABILITY_MODES;
30
30
  const UPGRADE_STATUSES = {
31
31
  ALL: 'all',
32
32
  TERMINAL: 'terminal',
33
- EVOLVABLE: 'evolvable',
34
- INDEPENDENT: 'independent'
33
+ EVOLVABLE: 'evolvable'
35
34
  };
36
35
  exports.UPGRADE_STATUSES = UPGRADE_STATUSES;
37
36
  const EQUIPMENT_SORT_MODES = {
@@ -74,13 +73,11 @@ const matchesPlanStatus = (item, status) => {
74
73
  };
75
74
 
76
75
  const matchesUpgradeStatus = (item, status) => {
77
- if (status === UPGRADE_STATUSES.TERMINAL) return Boolean(item.terminalEvolutionTarget);
78
- if (status === UPGRADE_STATUSES.EVOLVABLE) return item.hasEvolution;
79
-
80
- if (status === UPGRADE_STATUSES.INDEPENDENT) {
81
- return item.hasImprovement && !item.hasEvolution && !item.terminalEvolutionTarget;
76
+ if (status === UPGRADE_STATUSES.TERMINAL) {
77
+ return !item.hasEvolution && (item.hasImprovement || item.terminalEvolutionTarget);
82
78
  }
83
79
 
80
+ if (status === UPGRADE_STATUSES.EVOLVABLE) return item.hasEvolution;
84
81
  return true;
85
82
  };
86
83