poi-plugin-akashic-records
Advanced tools
Comparing version 7.0.1 to 7.0.2-beta.0
{ | ||
} |
@@ -0,0 +0,0 @@ { |
@@ -0,0 +0,0 @@ { |
@@ -0,0 +0,0 @@ { |
11
index.js
@@ -6,3 +6,3 @@ 'use strict'; | ||
}); | ||
exports.settingsClass = exports.reactClass = exports.windowMode = undefined; | ||
exports.settingsClass = exports.reducer = exports.reactClass = exports.windowMode = undefined; | ||
@@ -17,2 +17,11 @@ var _views = require('./views'); | ||
}); | ||
var _reducers = require('./views/reducers'); | ||
Object.defineProperty(exports, 'reducer', { | ||
enumerable: true, | ||
get: function () { | ||
return _reducers.reducer; | ||
} | ||
}); | ||
exports.pluginDidLoad = pluginDidLoad; | ||
@@ -19,0 +28,0 @@ exports.pluginWillUnload = pluginWillUnload; |
{ | ||
"name": "poi-plugin-akashic-records", | ||
"version": "7.0.1", | ||
"version": "7.0.2-beta.0", | ||
"description": "logbook plugin for poi", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -0,0 +0,0 @@ [![NPM](https://nodei.co/npm/poi-plugin-akashic-records.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/poi-plugin-akashic-records/) |
@@ -32,3 +32,3 @@ 'use strict'; | ||
return { | ||
type: 'ADD_LOG', | ||
type: '@@poi-plugin-akashic-records/ADD_LOG', | ||
dataType: type, | ||
@@ -41,3 +41,3 @@ log: log | ||
return { | ||
type: 'INITIALIZE_LOGS', | ||
type: '@@poi-plugin-akashic-records/INITIALIZE_LOGS', | ||
dataType: type, | ||
@@ -50,3 +50,3 @@ logs: logs | ||
return { | ||
type: 'SET_LANGUAGE', | ||
type: '@@poi-plugin-akashic-records/SET_LANGUAGE', | ||
language: language | ||
@@ -58,3 +58,3 @@ }; | ||
return { | ||
type: 'SET_TAB_VISIBILITY', | ||
type: '@@poi-plugin-akashic-records/SET_TAB_VISIBILITY', | ||
dataType: type, | ||
@@ -68,3 +68,3 @@ index: index, | ||
return { | ||
type: 'SET_ACTIVE_PAGE', | ||
type: '@@poi-plugin-akashic-records/SET_ACTIVE_PAGE', | ||
dataType: type, | ||
@@ -77,3 +77,3 @@ val: val | ||
return { | ||
type: 'RESET_ACTIVE_PAGE', | ||
type: '@@poi-plugin-akashic-records/RESET_ACTIVE_PAGE', | ||
dataType: type | ||
@@ -85,3 +85,3 @@ }; | ||
return { | ||
type: 'SET_SHOW_AMOUNT', | ||
type: '@@poi-plugin-akashic-records/SET_SHOW_AMOUNT', | ||
dataType: type, | ||
@@ -94,3 +94,3 @@ val: val | ||
return { | ||
type: 'SET_CONFIG_LIST', | ||
type: '@@poi-plugin-akashic-records/SET_CONFIG_LIST', | ||
dataType: type, | ||
@@ -103,3 +103,3 @@ index: index | ||
return { | ||
type: 'SHOW_CHECKBOX_PANEL', | ||
type: '@@poi-plugin-akashic-records/SHOW_CHECKBOX_PANEL', | ||
dataType: type | ||
@@ -111,3 +111,3 @@ }; | ||
return { | ||
type: 'HIDDEN_CHECKBOX_PANEL', | ||
type: '@@poi-plugin-akashic-records/HIDDEN_CHECKBOX_PANEL', | ||
dataType: type | ||
@@ -119,3 +119,3 @@ }; | ||
return { | ||
type: 'SHOW_STATISTICS_PANEL', | ||
type: '@@poi-plugin-akashic-records/SHOW_STATISTICS_PANEL', | ||
dataType: type | ||
@@ -127,3 +127,3 @@ }; | ||
return { | ||
type: 'HIDDEN_STATICTICS_PANEL', | ||
type: '@@poi-plugin-akashic-records/HIDDEN_STATICTICS_PANEL', | ||
dataType: type | ||
@@ -135,3 +135,3 @@ }; | ||
return { | ||
type: 'SET_TIME_SCALE', | ||
type: '@@poi-plugin-akashic-records/SET_TIME_SCALE', | ||
val: val, | ||
@@ -144,3 +144,3 @@ dataType: type | ||
return { | ||
type: 'ADD_SEARCH_RULE', | ||
type: '@@poi-plugin-akashic-records/ADD_SEARCH_RULE', | ||
dataType: type | ||
@@ -152,3 +152,3 @@ }; | ||
return { | ||
type: 'SET_SEARCH_RULE_BASE', | ||
type: '@@poi-plugin-akashic-records/SET_SEARCH_RULE_BASE', | ||
dataType: type, | ||
@@ -162,3 +162,3 @@ index: index, | ||
return { | ||
type: 'SET_SEARCH_RULE_KEY', | ||
type: '@@poi-plugin-akashic-records/SET_SEARCH_RULE_KEY', | ||
dataType: type, | ||
@@ -172,3 +172,3 @@ index: index, | ||
return { | ||
type: 'DELETE_SEARCH_RULE', | ||
type: '@@poi-plugin-akashic-records/DELETE_SEARCH_RULE', | ||
dataType: type, | ||
@@ -181,3 +181,3 @@ index: index | ||
return { | ||
type: 'ADD_STATISTICS_RULE', | ||
type: '@@poi-plugin-akashic-records/ADD_STATISTICS_RULE', | ||
dataType: type | ||
@@ -189,3 +189,3 @@ }; | ||
return { | ||
type: 'SET_STATISTICS_RULE_NUMERATOR_TYPE', | ||
type: '@@poi-plugin-akashic-records/SET_STATISTICS_RULE_NUMERATOR_TYPE', | ||
dataType: type, | ||
@@ -199,3 +199,3 @@ index: index, | ||
return { | ||
type: 'SET_STATISTICS_RULE_DENOMINATOR_TYPE', | ||
type: '@@poi-plugin-akashic-records/SET_STATISTICS_RULE_DENOMINATOR_TYPE', | ||
dataType: type, | ||
@@ -209,3 +209,3 @@ index: index, | ||
return { | ||
type: 'SET_STATISTICS_RULE_NUMERATOR', | ||
type: '@@poi-plugin-akashic-records/SET_STATISTICS_RULE_NUMERATOR', | ||
dataType: type, | ||
@@ -219,3 +219,3 @@ index: index, | ||
return { | ||
type: 'SET_STATISTICS_RULE_DENOMINATOR', | ||
type: '@@poi-plugin-akashic-records/SET_STATISTICS_RULE_DENOMINATOR', | ||
dataType: type, | ||
@@ -229,3 +229,3 @@ index: index, | ||
return { | ||
type: 'DELETE_STATISTICS_RULE', | ||
type: '@@poi-plugin-akashic-records/DELETE_STATISTICS_RULE', | ||
dataType: type, | ||
@@ -238,3 +238,3 @@ index: index | ||
return { | ||
type: 'SET_FILTER_KEY', | ||
type: '@@poi-plugin-akashic-records/SET_FILTER_KEY', | ||
dataType: type, | ||
@@ -241,0 +241,0 @@ index: index, |
@@ -18,3 +18,3 @@ 'use strict'; | ||
var _createStore = require('./create-store'); | ||
var _createStore = require('views/create-store'); | ||
@@ -347,4 +347,4 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
updateUser() { | ||
if (window._nickNameId && this.nickNameId !== window._nickNameId) { | ||
updateUser(forceUpdateLogs = false) { | ||
if (window._nickNameId && this.nickNameId !== window._nickNameId || forceUpdateLogs) { | ||
this.nickNameId = window._nickNameId; | ||
@@ -360,3 +360,3 @@ config.set('plugin.Akashic.nickNameId', this.nickNameId); | ||
window.addEventListener('battle.result', this.handleBattleResultResponse); | ||
this.updateUser(); | ||
this.updateUser(true); | ||
} | ||
@@ -363,0 +363,0 @@ |
@@ -9,2 +9,6 @@ 'use strict'; | ||
var _lodash = require('lodash'); | ||
var _lodash2 = _interopRequireDefault(_lodash); | ||
var _actions = require('../actions'); | ||
@@ -16,9 +20,22 @@ | ||
var _selectors = require('../selectors'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function mapStateToProps(state, ownProps) { | ||
const tabs = []; | ||
for (const type of Object.keys(state)) { | ||
tabs[type] = state[type].tabs; | ||
const emptyProps = { | ||
attackData: [], | ||
missionData: [], | ||
createShipData: [], | ||
createItemData: [], | ||
retirementData: [], | ||
resourceData: [], | ||
tableTab: {} | ||
}; | ||
function mapStateToProps(poi_state, ownProps) { | ||
const state = (0, _selectors.pluginDataSelector)(poi_state); | ||
if (_lodash2.default.isEmpty(state)) { | ||
return emptyProps; | ||
} | ||
return { | ||
@@ -31,3 +48,3 @@ attackData: state.attack.data, | ||
resourceData: state.resource.data, | ||
tableTab: tabs | ||
tableTab: (0, _selectors.tableTabNameSelector)(state) | ||
}; | ||
@@ -34,0 +51,0 @@ } |
@@ -20,2 +20,4 @@ 'use strict'; | ||
var _selectors = require('../selectors'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -35,3 +37,4 @@ | ||
function mapStateToProps(state, ownProps) { | ||
function mapStateToProps(poi_state, ownProps) { | ||
const state = (0, _selectors.pluginDataSelector)(poi_state); | ||
return state[ownProps.contentType] != null ? getPropsFromState(state[ownProps.contentType]) : {}; | ||
@@ -38,0 +41,0 @@ } |
@@ -13,5 +13,8 @@ 'use strict'; | ||
var _selectors = require('../selectors'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function mapStateToProps(state, ownProps) { | ||
function mapStateToProps(poi_state, ownProps) { | ||
const state = (0, _selectors.pluginDataSelector)(poi_state); | ||
return { data: state.resource.data }; | ||
@@ -18,0 +21,0 @@ } |
@@ -34,3 +34,4 @@ 'use strict'; | ||
function mapStateToProps(state, ownProps) { | ||
function mapStateToProps(poi_state, ownProps) { | ||
const state = (0, _selectors.pluginDataSelector)(poi_state); | ||
return state[ownProps.contentType] != null ? getPropsFromState(state[ownProps.contentType], ownProps.contentType) : {}; | ||
@@ -37,0 +38,0 @@ } |
@@ -11,2 +11,4 @@ 'use strict'; | ||
var _reselect = require('reselect'); | ||
var _actions = require('../actions'); | ||
@@ -55,14 +57,22 @@ | ||
function getPropsFromState(state, dataType) { | ||
const filteredLogs = _selectors.filterSelectors[dataType](state); | ||
const loglens = _selectors.searchSelectors[dataType](state.data, filteredLogs, state.searchRules); | ||
return { | ||
show: state.statisticsVisible, | ||
searchItems: getSearchItems(loglens, state.searchRules), | ||
statisticsItems: getStatisticsItems(loglens, state.statisticsRules) | ||
const getPropsFromState = (() => { | ||
const selectors = {}; | ||
return dataType => { | ||
if (selectors[dataType] == null) { | ||
selectors[dataType] = (0, _reselect.createSelector)([state => state.statisticsVisible, state => state.data, state => _selectors.filterSelectors[dataType](state), state => state.searchRules, state => state.statisticsRules], (show, logs, filteredLogs, searchRules, statisticsRules) => { | ||
const loglens = _selectors.searchSelectors[dataType]({ logs, filteredLogs, searchRules }); | ||
return { | ||
show, | ||
searchItems: getSearchItems(loglens, searchRules), | ||
statisticsItems: getStatisticsItems(loglens, statisticsRules) | ||
}; | ||
}); | ||
} | ||
return selectors[dataType]; | ||
}; | ||
} | ||
})(); | ||
function mapStateToProps(state, ownProps) { | ||
return state[ownProps.contentType] != null ? getPropsFromState(state[ownProps.contentType], ownProps.contentType) : {}; | ||
function mapStateToProps(poi_state, ownProps) { | ||
const state = (0, _selectors.pluginDataSelector)(poi_state); | ||
return state[ownProps.contentType] != null ? getPropsFromState(ownProps.contentType)(state[ownProps.contentType]) : {}; | ||
} | ||
@@ -69,0 +79,0 @@ |
@@ -34,3 +34,4 @@ 'use strict'; | ||
function mapStateToProps(state, ownProps) { | ||
function mapStateToProps(poi_state, ownProps) { | ||
const state = (0, _selectors.pluginDataSelector)(poi_state); | ||
return state[ownProps.contentType] != null ? getPropsFromState(state[ownProps.contentType], ownProps.contentType) : {}; | ||
@@ -37,0 +38,0 @@ } |
@@ -8,8 +8,4 @@ 'use strict'; | ||
var _reactRedux = require('react-redux'); | ||
var _pathExtra = require('path-extra'); | ||
var _createStore = require('./create-store'); | ||
var _react = require('react'); | ||
@@ -19,6 +15,2 @@ | ||
var _reactDom = require('react-dom'); | ||
var _reactDom2 = _interopRequireDefault(_reactDom); | ||
var _reactBootstrap = require('react-bootstrap'); | ||
@@ -109,55 +101,51 @@ | ||
return _react2.default.createElement( | ||
_reactRedux.Provider, | ||
{ store: _createStore.store }, | ||
'div', | ||
{ id: 'akashic-records-main-wrapper' }, | ||
_react2.default.createElement('link', { rel: 'stylesheet', href: (0, _pathExtra.join)(__dirname, '..', 'assets', 'main.css') }), | ||
_react2.default.createElement( | ||
'div', | ||
{ id: 'akashic-records-main-wrapper' }, | ||
_react2.default.createElement('link', { rel: 'stylesheet', href: (0, _pathExtra.join)(__dirname, '..', 'assets', 'main.css') }), | ||
{ style: { 'fontSize': 18 } }, | ||
_react2.default.createElement( | ||
'div', | ||
{ style: { 'fontSize': 18 } }, | ||
_react2.default.createElement( | ||
_reactBootstrap.Label, | ||
{ bsStyle: 'danger' }, | ||
this.state.warning | ||
) | ||
_reactBootstrap.Label, | ||
{ bsStyle: 'danger' }, | ||
this.state.warning | ||
) | ||
), | ||
_react2.default.createElement( | ||
_reactBootstrap.Tabs, | ||
{ id: '', activeKey: this.state.selectedKey, animation: false, onSelect: this.handleSelectTab }, | ||
_react2.default.createElement( | ||
_reactBootstrap.Tab, | ||
{ id: '0', eventKey: 0, title: __("Sortie") }, | ||
_react2.default.createElement(_errorBoundary2.default, { component: _akashicRecordsLog2.default, contentType: _constant2.default.typeList.attack }) | ||
), | ||
_react2.default.createElement( | ||
_reactBootstrap.Tabs, | ||
{ id: '', activeKey: this.state.selectedKey, animation: false, onSelect: this.handleSelectTab }, | ||
_react2.default.createElement( | ||
_reactBootstrap.Tab, | ||
{ id: '0', eventKey: 0, title: __("Sortie") }, | ||
_react2.default.createElement(_errorBoundary2.default, { component: _akashicRecordsLog2.default, contentType: _constant2.default.typeList.attack }) | ||
), | ||
_react2.default.createElement( | ||
_reactBootstrap.Tab, | ||
{ id: '1', eventKey: 1, title: __("Expedition") }, | ||
_react2.default.createElement(_errorBoundary2.default, { component: _akashicRecordsLog2.default, contentType: _constant2.default.typeList.mission }) | ||
), | ||
_react2.default.createElement( | ||
_reactBootstrap.Tab, | ||
{ id: '2', eventKey: 2, title: __("Construction") }, | ||
_react2.default.createElement(_errorBoundary2.default, { component: _akashicRecordsLog2.default, contentType: _constant2.default.typeList.createShip }) | ||
), | ||
_react2.default.createElement( | ||
_reactBootstrap.Tab, | ||
{ id: '3', eventKey: 3, title: __("Development") }, | ||
_react2.default.createElement(_errorBoundary2.default, { component: _akashicRecordsLog2.default, contentType: _constant2.default.typeList.createItem }) | ||
), | ||
_react2.default.createElement( | ||
_reactBootstrap.Tab, | ||
{ id: '4', eventKey: 4, title: __("Retirement") }, | ||
_react2.default.createElement(_errorBoundary2.default, { component: _akashicRecordsLog2.default, contentType: _constant2.default.typeList.retirement }) | ||
), | ||
_react2.default.createElement( | ||
_reactBootstrap.Tab, | ||
{ id: '5', eventKey: 5, title: __("Resource") }, | ||
_react2.default.createElement(_errorBoundary2.default, { component: _akashicResourceLog2.default, mapShowFlag: this.state.mapShowFlag }) | ||
), | ||
_react2.default.createElement( | ||
_reactBootstrap.Tab, | ||
{ id: '6', eventKey: 6, title: __("Others") }, | ||
_react2.default.createElement(_errorBoundary2.default, { component: _advancedModule2.default }) | ||
) | ||
_reactBootstrap.Tab, | ||
{ id: '1', eventKey: 1, title: __("Expedition") }, | ||
_react2.default.createElement(_errorBoundary2.default, { component: _akashicRecordsLog2.default, contentType: _constant2.default.typeList.mission }) | ||
), | ||
_react2.default.createElement( | ||
_reactBootstrap.Tab, | ||
{ id: '2', eventKey: 2, title: __("Construction") }, | ||
_react2.default.createElement(_errorBoundary2.default, { component: _akashicRecordsLog2.default, contentType: _constant2.default.typeList.createShip }) | ||
), | ||
_react2.default.createElement( | ||
_reactBootstrap.Tab, | ||
{ id: '3', eventKey: 3, title: __("Development") }, | ||
_react2.default.createElement(_errorBoundary2.default, { component: _akashicRecordsLog2.default, contentType: _constant2.default.typeList.createItem }) | ||
), | ||
_react2.default.createElement( | ||
_reactBootstrap.Tab, | ||
{ id: '4', eventKey: 4, title: __("Retirement") }, | ||
_react2.default.createElement(_errorBoundary2.default, { component: _akashicRecordsLog2.default, contentType: _constant2.default.typeList.retirement }) | ||
), | ||
_react2.default.createElement( | ||
_reactBootstrap.Tab, | ||
{ id: '5', eventKey: 5, title: __("Resource") }, | ||
_react2.default.createElement(_errorBoundary2.default, { component: _akashicResourceLog2.default, mapShowFlag: this.state.mapShowFlag }) | ||
), | ||
_react2.default.createElement( | ||
_reactBootstrap.Tab, | ||
{ id: '6', eventKey: 6, title: __("Others") }, | ||
_react2.default.createElement(_errorBoundary2.default, { component: _advancedModule2.default }) | ||
) | ||
@@ -164,0 +152,0 @@ ) |
@@ -9,5 +9,5 @@ 'use strict'; | ||
switch (action.type) { | ||
case 'ADD_LOG': | ||
case '@@poi-plugin-akashic-records/ADD_LOG': | ||
return [action.log, ...state]; | ||
case 'INITIALIZE_LOGS': | ||
case '@@poi-plugin-akashic-records/INITIALIZE_LOGS': | ||
return action.logs; | ||
@@ -14,0 +14,0 @@ default: |
@@ -9,5 +9,5 @@ 'use strict'; | ||
switch (action.type) { | ||
case 'SET_FILTER_KEY': | ||
case '@@poi-plugin-akashic-records/SET_FILTER_KEY': | ||
return [...state.slice(0, action.index), action.val, ...state.slice(action.index + 1)]; | ||
case 'SET_TAB_VISIBILITY': | ||
case '@@poi-plugin-akashic-records/SET_TAB_VISIBILITY': | ||
if (action.val === false && state[action.val - 1] !== '') { | ||
@@ -14,0 +14,0 @@ return [...state.slice(0, action.index - 1), '', ...state.slice(action.index)]; |
@@ -6,2 +6,3 @@ 'use strict'; | ||
}); | ||
exports.reducer = undefined; | ||
@@ -18,6 +19,5 @@ var _redux = require('redux'); | ||
exports.default = (0, _redux.combineReducers)(typeList.reduce((obj, key) => { | ||
const reducer = exports.reducer = (0, _redux.combineReducers)(typeList.reduce((obj, key) => { | ||
obj[key] = (0, _logContent2.default)(key); | ||
return obj; | ||
}, {})); | ||
module.exports = exports['default']; | ||
}, {})); |
@@ -11,9 +11,9 @@ 'use strict'; | ||
return (state, action) => { | ||
if (action.type === 'SET_LANGUAGE') return logContent(state, action);else if (action.dataType === type) { | ||
if (action.type === '@@poi-plugin-akashic-records/SET_LANGUAGE') return logContent(state, action);else if (action.dataType === type) { | ||
const ret = logContent(state, action); | ||
if (['INITIALIZE_LOGS', 'SET_FILTER_KEY', 'SET_SHOW_AMOUNT', 'SET_ACTIVE_PAGE', 'SET_TIME_SCALE'].includes(action.type)) return boundActivePageNum(ret, type); | ||
if (['@@poi-plugin-akashic-records/INITIALIZE_LOGS', '@@poi-plugin-akashic-records/SET_FILTER_KEY', '@@poi-plugin-akashic-records/SET_SHOW_AMOUNT', '@@poi-plugin-akashic-records/SET_ACTIVE_PAGE', '@@poi-plugin-akashic-records/SET_TIME_SCALE'].includes(action.type)) return boundActivePageNum(ret, type); | ||
return ret; | ||
} else if (state == null) { | ||
return logContent(state, { | ||
type: 'NONE', | ||
type: '@@poi-plugin-akashic-records/NONE', | ||
dataType: type | ||
@@ -20,0 +20,0 @@ }); |
@@ -12,5 +12,5 @@ 'use strict'; | ||
switch (action.type) { | ||
case 'SET_ACTIVE_PAGE': | ||
case '@@poi-plugin-akashic-records/SET_ACTIVE_PAGE': | ||
return parseInt(action.val); | ||
case 'RESET_ACTIVE_PAGE': | ||
case '@@poi-plugin-akashic-records/RESET_ACTIVE_PAGE': | ||
return 1; | ||
@@ -27,3 +27,3 @@ default: | ||
} | ||
if (action.type === 'SET_SHOW_AMOUNT') { | ||
if (action.type === '@@poi-plugin-akashic-records/SET_SHOW_AMOUNT') { | ||
return parseInt(action.val); | ||
@@ -30,0 +30,0 @@ } else { |
@@ -11,3 +11,3 @@ 'use strict'; | ||
switch (action.type) { | ||
case 'ADD_SEARCH_RULE': | ||
case '@@poi-plugin-akashic-records/ADD_SEARCH_RULE': | ||
return { | ||
@@ -17,7 +17,7 @@ baseOn: 1, | ||
}; | ||
case 'SET_SEARCH_RULE_BASE': | ||
case '@@poi-plugin-akashic-records/SET_SEARCH_RULE_BASE': | ||
return _extends({}, state, { | ||
baseOn: action.val | ||
}); | ||
case 'SET_SEARCH_RULE_KEY': | ||
case '@@poi-plugin-akashic-records/SET_SEARCH_RULE_KEY': | ||
return _extends({}, state, { | ||
@@ -33,11 +33,11 @@ content: action.val | ||
if (state == null) { | ||
state = [searchRule(undefined, { type: 'ADD_SEARCH_RULE' })]; | ||
state = [searchRule(undefined, { type: '@@poi-plugin-akashic-records/ADD_SEARCH_RULE' })]; | ||
} | ||
switch (action.type) { | ||
case 'ADD_SEARCH_RULE': | ||
case '@@poi-plugin-akashic-records/ADD_SEARCH_RULE': | ||
return [...state, searchRule(undefined, action)]; | ||
case 'SET_SEARCH_RULE_BASE': | ||
case 'SET_SEARCH_RULE_KEY': | ||
case '@@poi-plugin-akashic-records/SET_SEARCH_RULE_BASE': | ||
case '@@poi-plugin-akashic-records/SET_SEARCH_RULE_KEY': | ||
return [...state.slice(0, action.index), searchRule(state[action.index], action), ...state.slice(action.index + 1)]; | ||
case 'DELETE_SEARCH_RULE': | ||
case '@@poi-plugin-akashic-records/DELETE_SEARCH_RULE': | ||
{ | ||
@@ -44,0 +44,0 @@ const ret = [...state.slice(0, action.index), ...state.slice(action.index + 1)]; |
@@ -11,3 +11,3 @@ 'use strict'; | ||
switch (action.type) { | ||
case 'ADD_STATISTICS_RULE': | ||
case '@@poi-plugin-akashic-records/ADD_STATISTICS_RULE': | ||
return { | ||
@@ -19,15 +19,15 @@ numeratorType: 1, | ||
}; | ||
case 'SET_STATISTICS_RULE_NUMERATOR_TYPE': | ||
case '@@poi-plugin-akashic-records/SET_STATISTICS_RULE_NUMERATOR_TYPE': | ||
return _extends({}, state, { | ||
numeratorType: action.val | ||
}); | ||
case 'SET_STATISTICS_RULE_DENOMINATOR_TYPE': | ||
case '@@poi-plugin-akashic-records/SET_STATISTICS_RULE_DENOMINATOR_TYPE': | ||
return _extends({}, state, { | ||
denominatorType: action.val | ||
}); | ||
case 'SET_STATISTICS_RULE_NUMERATOR': | ||
case '@@poi-plugin-akashic-records/SET_STATISTICS_RULE_NUMERATOR': | ||
return _extends({}, state, { | ||
numerator: action.val | ||
}); | ||
case 'SET_STATISTICS_RULE_DENOMINATOR': | ||
case '@@poi-plugin-akashic-records/SET_STATISTICS_RULE_DENOMINATOR': | ||
return _extends({}, state, { | ||
@@ -53,17 +53,17 @@ denominator: action.val | ||
if (state == null) { | ||
state = [statisticsRule(undefined, { type: 'ADD_STATISTICS_RULE' })]; | ||
state = [statisticsRule(undefined, { type: '@@poi-plugin-akashic-records/ADD_STATISTICS_RULE' })]; | ||
} | ||
switch (action.type) { | ||
case 'ADD_STATISTICS_RULE': | ||
case '@@poi-plugin-akashic-records/ADD_STATISTICS_RULE': | ||
return [...state, statisticsRule(undefined, action)]; | ||
case 'SET_STATISTICS_RULE_NUMERATOR_TYPE': | ||
case 'SET_STATISTICS_RULE_DENOMINATOR_TYPE': | ||
case 'SET_STATISTICS_RULE_NUMERATOR': | ||
case 'SET_STATISTICS_RULE_DENOMINATOR': | ||
case '@@poi-plugin-akashic-records/SET_STATISTICS_RULE_NUMERATOR_TYPE': | ||
case '@@poi-plugin-akashic-records/SET_STATISTICS_RULE_DENOMINATOR_TYPE': | ||
case '@@poi-plugin-akashic-records/SET_STATISTICS_RULE_NUMERATOR': | ||
case '@@poi-plugin-akashic-records/SET_STATISTICS_RULE_DENOMINATOR': | ||
return [...state.slice(0, action.index), statisticsRule(state[action.index], action), ...state.slice(action.index + 1)]; | ||
case 'DELETE_STATISTICS_RULE': | ||
case '@@poi-plugin-akashic-records/DELETE_STATISTICS_RULE': | ||
return [...state.slice(0, action.index), ...state.slice(action.index + 1)]; | ||
case 'DELETE_SEARCH_RULE': | ||
case '@@poi-plugin-akashic-records/DELETE_SEARCH_RULE': | ||
return state.map(item => { | ||
let { numeratorType, denominatorType } = item; | ||
const { numeratorType, denominatorType } = item; | ||
const { index } = action; | ||
@@ -70,0 +70,0 @@ return _extends({}, item, { |
@@ -36,3 +36,3 @@ 'use strict'; | ||
} | ||
if (action.type === 'SET_LANGUAGE') { | ||
if (action.type === '@@poi-plugin-akashic-records/SET_LANGUAGE') { | ||
state = getTabs(action.dataType); | ||
@@ -44,3 +44,3 @@ } | ||
function language(state = window.language, action) { | ||
if (action.type === 'SET_LANGUAGE') { | ||
if (action.type === '@@poi-plugin-akashic-records/SET_LANGUAGE') { | ||
return action.language; | ||
@@ -55,3 +55,3 @@ } | ||
} | ||
if (action.type === 'SET_TAB_VISIBILITY') { | ||
if (action.type === '@@poi-plugin-akashic-records/SET_TAB_VISIBILITY') { | ||
return [...state.slice(0, action.index), action.val, ...state.slice(action.index + 1)]; | ||
@@ -58,0 +58,0 @@ } else { |
@@ -22,3 +22,3 @@ "use strict"; | ||
function configList(state = getTabs(), action) { | ||
if (action.type === 'SET_LANGUAGE') return getTabs(); | ||
if (action.type === '@@poi-plugin-akashic-records/SET_LANGUAGE') return getTabs(); | ||
return state; | ||
@@ -31,3 +31,3 @@ } | ||
} | ||
if (action.type === 'SET_CONFIG_LIST') { | ||
if (action.type === '@@poi-plugin-akashic-records/SET_CONFIG_LIST') { | ||
let newState = state; | ||
@@ -59,5 +59,5 @@ if (state[action.index]) { | ||
switch (action.type) { | ||
case 'SHOW_CHECKBOX_PANEL': | ||
case '@@poi-plugin-akashic-records/SHOW_CHECKBOX_PANEL': | ||
return true; | ||
case 'HIDDEN_CHECKBOX_PANEL': | ||
case '@@poi-plugin-akashic-records/HIDDEN_CHECKBOX_PANEL': | ||
return false; | ||
@@ -74,5 +74,5 @@ default: | ||
switch (action.type) { | ||
case 'SHOW_STATISTICS_PANEL': | ||
case '@@poi-plugin-akashic-records/SHOW_STATISTICS_PANEL': | ||
return true; | ||
case 'HIDDEN_STATICTICS_PANEL': | ||
case '@@poi-plugin-akashic-records/HIDDEN_STATICTICS_PANEL': | ||
return false; | ||
@@ -88,3 +88,3 @@ default: | ||
} | ||
if (action.type === 'SET_TIME_SCALE') { | ||
if (action.type === '@@poi-plugin-akashic-records/SET_TIME_SCALE') { | ||
return action.val; | ||
@@ -91,0 +91,0 @@ } else { |
@@ -6,3 +6,3 @@ 'use strict'; | ||
}); | ||
exports.resourceFilter = exports.searchSelectors = exports.filterSelectors = undefined; | ||
exports.tableTabNameSelector = exports.resourceFilter = exports.searchSelectors = exports.filterSelectors = exports.pluginDataSelector = undefined; | ||
@@ -17,4 +17,10 @@ var _reselect = require('reselect'); | ||
var _selectors = require('views/utils/selectors'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
const empty = {}; | ||
const pluginDataSelector = exports.pluginDataSelector = (0, _reselect.createSelector)((0, _selectors.extensionSelectorFactory)('poi-plugin-akashic-records'), state => state || empty); | ||
const dateToDateString = datetime => { | ||
@@ -111,5 +117,6 @@ const date = new Date(datetime); | ||
const emptyArr = []; | ||
const logSelectorFactory = () => { | ||
const getLogs = state => state.data; | ||
const getFilterKeys = state => state.configListChecked[1] || state.configListChecked[2] || !state.configListChecked[3] ? state.filterKeys : []; | ||
const getFilterKeys = state => state.configListChecked[1] || state.configListChecked[2] || !state.configListChecked[3] ? state.filterKeys : emptyArr; | ||
return (0, _reselect.createSelector)([getLogs, getFilterKeys], filterWithIndex); | ||
@@ -128,3 +135,3 @@ }; | ||
let lastLogs = null; | ||
return (logs, filteredLogs, searchRules) => { | ||
return (0, _reselect.createSelector)([params => params.logs, params => params.filteredLogs, params => params.searchRules], (logs, filteredLogs, searchRules) => { | ||
if (selector == null || lastLogs !== logs) selector = logSearchSelectorBaseFactory([], searchRules.length); | ||
@@ -136,3 +143,3 @@ lastLogs = logs; | ||
return logsRes.map(logs => logs.length); | ||
}; | ||
}); | ||
}(); | ||
@@ -159,2 +166,11 @@ }; | ||
const resourceFilter = exports.resourceFilter = (0, _reselect.createSelector)([state => state.data, state => state.tabVisibility, state => state.filterKeys[0], state => state.showTimeScale], resourceApplyFilter); | ||
const resourceFilter = exports.resourceFilter = (0, _reselect.createSelector)([state => state.data, state => state.tabVisibility, state => state.filterKeys[0], state => state.showTimeScale], resourceApplyFilter); | ||
const tableTabNameSelector = exports.tableTabNameSelector = (0, _reselect.createSelector)([state => state[_constant2.default.typeList.attack].tabs, state => state[_constant2.default.typeList.mission].tabs, state => state[_constant2.default.typeList.createShip].tabs, state => state[_constant2.default.typeList.createItem].tabs, state => state[_constant2.default.typeList.retirement].tabs, state => state[_constant2.default.typeList.resource].tabs], (attack, mission, createShip, createItem, retirement, resource) => ({ | ||
[_constant2.default.typeList.attack]: attack, | ||
[_constant2.default.typeList.mission]: mission, | ||
[_constant2.default.typeList.createShip]: createShip, | ||
[_constant2.default.typeList.createItem]: createItem, | ||
[_constant2.default.typeList.retirement]: retirement, | ||
[_constant2.default.typeList.resource]: resource | ||
})); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
2753310
58718
98
2