From 92f9fdc50ec5aacdcc1d21f4c5f252c0b8b096a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivar=20Conradi=20=C3=98sthus?= Date: Wed, 6 Jan 2021 22:05:11 +0100 Subject: [PATCH] fix: move feature-toggle store into folder --- .../src/component/feature/create/add-feature-container.jsx | 2 +- .../src/component/feature/create/copy-feature-container.jsx | 2 +- frontend/src/component/feature/list/list-container.jsx | 2 +- .../component/feature/variant/update-variant-container.jsx | 2 +- .../component/feature/view/update-strategies-container.jsx | 2 +- frontend/src/component/feature/view/view-container.jsx | 2 +- .../src/component/strategies/strategy-details-container.js | 2 +- frontend/src/store/error/index.js | 2 +- .../store/{feature-actions.js => feature-toggle/actions.js} | 6 +++--- .../src/store/{feature-store.js => feature-toggle/index.js} | 4 ++-- frontend/src/store/index.js | 2 +- 11 files changed, 14 insertions(+), 14 deletions(-) rename frontend/src/store/{feature-actions.js => feature-toggle/actions.js} (98%) rename frontend/src/store/{feature-store.js => feature-toggle/index.js} (96%) diff --git a/frontend/src/component/feature/create/add-feature-container.jsx b/frontend/src/component/feature/create/add-feature-container.jsx index b1e861efa9..7330ec6d94 100644 --- a/frontend/src/component/feature/create/add-feature-container.jsx +++ b/frontend/src/component/feature/create/add-feature-container.jsx @@ -1,7 +1,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; -import { createFeatureToggles, validateName } from '../../../store/feature-actions'; +import { createFeatureToggles, validateName } from '../../../store/feature-toggle/actions'; import AddFeatureComponent from './add-feature-component'; import { loadNameFromHash } from '../../common/util'; diff --git a/frontend/src/component/feature/create/copy-feature-container.jsx b/frontend/src/component/feature/create/copy-feature-container.jsx index af970dabfc..8a54bdee02 100644 --- a/frontend/src/component/feature/create/copy-feature-container.jsx +++ b/frontend/src/component/feature/create/copy-feature-container.jsx @@ -1,6 +1,6 @@ import { connect } from 'react-redux'; import CopyFeatureComponent from './copy-feature-component'; -import { createFeatureToggles, validateName, fetchFeatureToggles } from '../../../store/feature-actions'; +import { createFeatureToggles, validateName, fetchFeatureToggles } from '../../../store/feature-toggle/actions'; const mapStateToProps = (state, props) => ({ history: props.history, diff --git a/frontend/src/component/feature/list/list-container.jsx b/frontend/src/component/feature/list/list-container.jsx index 90a57e88e3..3ada7dd8dd 100644 --- a/frontend/src/component/feature/list/list-container.jsx +++ b/frontend/src/component/feature/list/list-container.jsx @@ -1,5 +1,5 @@ import { connect } from 'react-redux'; -import { toggleFeature, fetchFeatureToggles } from '../../../store/feature-actions'; +import { toggleFeature, fetchFeatureToggles } from '../../../store/feature-toggle/actions'; import { updateSettingForGroup } from '../../../store/settings/actions'; import FeatureListComponent from './list-component'; diff --git a/frontend/src/component/feature/variant/update-variant-container.jsx b/frontend/src/component/feature/variant/update-variant-container.jsx index 4b91b20f3a..9bc12c92d8 100644 --- a/frontend/src/component/feature/variant/update-variant-container.jsx +++ b/frontend/src/component/feature/variant/update-variant-container.jsx @@ -1,6 +1,6 @@ import { connect } from 'react-redux'; -import { requestUpdateFeatureToggleVariants } from '../../../store/feature-actions'; +import { requestUpdateFeatureToggleVariants } from '../../../store/feature-toggle/actions'; import UpdateFeatureToggleComponent from './update-variant-component'; import { updateWeight } from '../../common/util'; diff --git a/frontend/src/component/feature/view/update-strategies-container.jsx b/frontend/src/component/feature/view/update-strategies-container.jsx index f48665b8ed..3e4fc80c6f 100644 --- a/frontend/src/component/feature/view/update-strategies-container.jsx +++ b/frontend/src/component/feature/view/update-strategies-container.jsx @@ -2,7 +2,7 @@ import { connect } from 'react-redux'; import arrayMove from 'array-move'; -import { requestUpdateFeatureToggleStrategies } from '../../../store/feature-actions'; +import { requestUpdateFeatureToggleStrategies } from '../../../store/feature-toggle/actions'; import UpdateStrategiesComponent from './update-strategies-component'; const mapStateToProps = (state, ownProps) => ({ diff --git a/frontend/src/component/feature/view/view-container.jsx b/frontend/src/component/feature/view/view-container.jsx index 8c7f7a588b..d5ac8998e1 100644 --- a/frontend/src/component/feature/view/view-container.jsx +++ b/frontend/src/component/feature/view/view-container.jsx @@ -7,7 +7,7 @@ import { setStale, removeFeatureToggle, editFeatureToggle, -} from './../../../store/feature-actions'; +} from './../../../store/feature-toggle/actions'; import ViewToggleComponent from './view-component'; import { hasPermission } from '../../../permissions'; diff --git a/frontend/src/component/strategies/strategy-details-container.js b/frontend/src/component/strategies/strategy-details-container.js index 95087ba166..b93771c694 100644 --- a/frontend/src/component/strategies/strategy-details-container.js +++ b/frontend/src/component/strategies/strategy-details-container.js @@ -2,7 +2,7 @@ import { connect } from 'react-redux'; import ShowStrategy from './strategy-details-component'; import { fetchStrategies } from './../../store/strategy/actions'; import { fetchAll } from './../../store/application/actions'; -import { fetchFeatureToggles } from './../../store/feature-actions'; +import { fetchFeatureToggles } from './../../store/feature-toggle/actions'; import { hasPermission } from '../../permissions'; const mapStateToProps = (state, props) => { diff --git a/frontend/src/store/error/index.js b/frontend/src/store/error/index.js index 731b18d36a..aaecb20201 100644 --- a/frontend/src/store/error/index.js +++ b/frontend/src/store/error/index.js @@ -7,7 +7,7 @@ import { ERROR_UPDATE_FEATURE_TOGGLE, UPDATE_FEATURE_TOGGLE_STRATEGIES, UPDATE_FEATURE_TOGGLE, -} from '../feature-actions'; +} from '../feature-toggle/actions'; import { ERROR_UPDATING_STRATEGY, ERROR_CREATING_STRATEGY, ERROR_RECEIVE_STRATEGIES } from '../strategy/actions'; diff --git a/frontend/src/store/feature-actions.js b/frontend/src/store/feature-toggle/actions.js similarity index 98% rename from frontend/src/store/feature-actions.js rename to frontend/src/store/feature-toggle/actions.js index 9ac0745fc6..9d20905235 100644 --- a/frontend/src/store/feature-actions.js +++ b/frontend/src/store/feature-toggle/actions.js @@ -1,7 +1,7 @@ -import api from '../data/feature-api'; +import api from '../../data/feature-api'; const debug = require('debug')('unleash:feature-actions'); -import { dispatchAndThrow } from './util'; -import { MUTE_ERROR } from './error/actions'; +import { dispatchAndThrow } from '../util'; +import { MUTE_ERROR } from '../error/actions'; export const ADD_FEATURE_TOGGLE = 'ADD_FEATURE_TOGGLE'; export const COPY_FEATURE_TOGGLE = 'COPY_FEATURE_TOGGLE'; diff --git a/frontend/src/store/feature-store.js b/frontend/src/store/feature-toggle/index.js similarity index 96% rename from frontend/src/store/feature-store.js rename to frontend/src/store/feature-toggle/index.js index 950cd26c04..45df59f2c9 100644 --- a/frontend/src/store/feature-store.js +++ b/frontend/src/store/feature-toggle/index.js @@ -9,9 +9,9 @@ import { UPDATE_FEATURE_TOGGLE_STRATEGIES, REMOVE_FEATURE_TOGGLE, TOGGLE_FEATURE_TOGGLE, -} from './feature-actions'; +} from './actions'; -import { USER_LOGOUT, USER_LOGIN } from './user/actions'; +import { USER_LOGOUT, USER_LOGIN } from '../user/actions'; const features = (state = new List([]), action) => { switch (action.type) { diff --git a/frontend/src/store/index.js b/frontend/src/store/index.js index c0d5f2985d..60ed618d90 100644 --- a/frontend/src/store/index.js +++ b/frontend/src/store/index.js @@ -1,5 +1,5 @@ import { combineReducers } from 'redux'; -import features from './feature-store'; +import features from './feature-toggle'; import featureTypes from './feature-type'; import featureMetrics from './feature-metrics-store'; import strategies from './strategy';