Fixed: Updates to commandExecutingSelector

This commit is contained in:
Qstick 2018-09-04 22:40:26 -04:00
parent 68aaa49e9f
commit e41f884153
16 changed files with 57 additions and 73 deletions

View file

@ -1,9 +1,8 @@
import _ from 'lodash';
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { createSelector } from 'reselect';
import createCommandsSelector from 'Store/Selectors/createCommandsSelector';
import createCommandExecutingSelector from 'Store/Selectors/createCommandExecutingSelector';
import { fetchBackups, deleteBackup } from 'Store/Actions/systemActions';
import { executeCommand } from 'Store/Actions/commandActions';
import * as commandNames from 'Commands/commandNames';
@ -12,8 +11,8 @@ import Backups from './Backups';
function createMapStateToProps() {
return createSelector(
(state) => state.system.backups,
createCommandsSelector(),
(backups, commands) => {
createCommandExecutingSelector(commandNames.BACKUP),
(backups, backupExecuting) => {
const {
isFetching,
isPopulated,
@ -21,8 +20,6 @@ function createMapStateToProps() {
items
} = backups;
const backupExecuting = _.some(commands, { name: commandNames.BACKUP });
return {
isFetching,
isPopulated,

View file

@ -1,9 +1,8 @@
import _ from 'lodash';
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { createSelector } from 'reselect';
import createCommandsSelector from 'Store/Selectors/createCommandsSelector';
import createCommandExecutingSelector from 'Store/Selectors/createCommandExecutingSelector';
import { executeCommand } from 'Store/Actions/commandActions';
import * as systemActions from 'Store/Actions/systemActions';
import * as commandNames from 'Commands/commandNames';
@ -12,10 +11,8 @@ import LogsTable from './LogsTable';
function createMapStateToProps() {
return createSelector(
(state) => state.system.logs,
createCommandsSelector(),
(logs, commands) => {
const clearLogExecuting = _.some(commands, { name: commandNames.CLEAR_LOGS });
createCommandExecutingSelector(commandNames.CLEAR_LOGS),
(logs, clearLogExecuting) => {
return {
clearLogExecuting,
...logs

View file

@ -1,10 +1,9 @@
import _ from 'lodash';
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { createSelector } from 'reselect';
import combinePath from 'Utilities/String/combinePath';
import createCommandsSelector from 'Store/Selectors/createCommandsSelector';
import createCommandExecutingSelector from 'Store/Selectors/createCommandExecutingSelector';
import { executeCommand } from 'Store/Actions/commandActions';
import { fetchLogFiles } from 'Store/Actions/systemActions';
import * as commandNames from 'Commands/commandNames';
@ -14,8 +13,8 @@ function createMapStateToProps() {
return createSelector(
(state) => state.system.logFiles,
(state) => state.system.status.item,
createCommandsSelector(),
(logFiles, status, commands) => {
createCommandExecutingSelector(commandNames.DELETE_LOG_FILES),
(logFiles, status, deleteFilesExecuting) => {
const {
isFetching,
items
@ -26,8 +25,6 @@ function createMapStateToProps() {
isWindows
} = status;
const deleteFilesExecuting = _.some(commands, { name: commandNames.DELETE_LOG_FILES });
return {
isFetching,
items,

View file

@ -1,10 +1,9 @@
import _ from 'lodash';
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { createSelector } from 'reselect';
import combinePath from 'Utilities/String/combinePath';
import createCommandsSelector from 'Store/Selectors/createCommandsSelector';
import createCommandExecutingSelector from 'Store/Selectors/createCommandExecutingSelector';
import { executeCommand } from 'Store/Actions/commandActions';
import { fetchUpdateLogFiles } from 'Store/Actions/systemActions';
import * as commandNames from 'Commands/commandNames';
@ -14,15 +13,13 @@ function createMapStateToProps() {
return createSelector(
(state) => state.system.updateLogFiles,
(state) => state.system.status.item,
createCommandsSelector(),
(updateLogFiles, status, commands) => {
createCommandExecutingSelector(commandNames.DELETE_UPDATE_LOG_FILES),
(updateLogFiles, status, deleteFilesExecuting) => {
const {
isFetching,
items
} = updateLogFiles;
const deleteFilesExecuting = _.some(commands, { name: commandNames.DELETE_UPDATE_LOG_FILES });
const {
appData,
isWindows