mirror of
https://github.com/open5gs/open5gs.git
synced 2025-11-02 04:53:37 +00:00
client directory structure is changed
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import PropTypes from 'prop-types';
|
||||
import withRedux from 'next-redux-wrapper';
|
||||
|
||||
import { initStore } from 'store.js';
|
||||
import { initStore } from 'modules/store.js';
|
||||
import withSession from 'helpers/with-session';
|
||||
|
||||
import Auth from 'containers/Auth';
|
||||
|
||||
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
||||
import { connect } from 'react-redux';
|
||||
import { bindActionCreators, compose } from 'redux';
|
||||
|
||||
import * as uiActions from 'actions/ui';
|
||||
import * as uiActions from 'modules/ui';
|
||||
import withWidth, { SMALL } from 'helpers/with-width';
|
||||
|
||||
import { Layout } from 'components';
|
||||
|
||||
@@ -4,7 +4,7 @@ import PropTypes from 'prop-types';
|
||||
import { connect } from 'react-redux';
|
||||
import { bindActionCreators } from 'redux';
|
||||
|
||||
import * as uiActions from 'actions/ui';
|
||||
import * as uiActions from 'modules/ui';
|
||||
|
||||
import Session from 'services/session';
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import { connect } from 'react-redux';
|
||||
import { bindActionCreators, compose } from 'redux';
|
||||
|
||||
import withWidth, { SMALL } from 'helpers/with-width';
|
||||
import * as uiActions from 'actions/ui';
|
||||
import * as uiActions from 'modules/ui';
|
||||
|
||||
import { Sidebar } from 'components';
|
||||
|
||||
|
||||
@@ -2,8 +2,7 @@ import { Component } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { connect } from 'react-redux';
|
||||
|
||||
import { fetchSubscribers } from 'actions/subscriber';
|
||||
import { fetchCollection } from 'actions/crud';
|
||||
import { fetchSubscribers } from 'modules/crud/subscriber';
|
||||
|
||||
class SubscriberContainer extends Component {
|
||||
componentWillMount() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { AUTH } from 'actions/auth';
|
||||
import { AUTH } from './actions';
|
||||
|
||||
const initialState = {
|
||||
isAuthenticating: false,
|
||||
@@ -1,7 +1,7 @@
|
||||
import { take, fork, cancel, call, put } from 'redux-saga/effects';
|
||||
|
||||
import Session from 'services/session';
|
||||
import { AUTH, loginSuccess } from 'actions/auth';
|
||||
import { AUTH, loginSuccess } from './actions';
|
||||
|
||||
function* authorize(username, password) {
|
||||
try {
|
||||
@@ -1,4 +1,4 @@
|
||||
import { CRUD } from 'actions/crud';
|
||||
import { CRUD } from './actions';
|
||||
import { fromJS, toJS } from 'immutable';
|
||||
import { isEqual } from 'lodash/lang';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import axios from 'axios';
|
||||
import { all, takeEvery, put, call, take, fork } from 'redux-saga/effects';
|
||||
import { CRUD } from 'actions/crud';
|
||||
import { CRUD } from './actions';
|
||||
|
||||
const crudApi = (method, url, { params, data } = {} ) => {
|
||||
return axios({ baseURL: '/api/db', method, url, params, data });
|
||||
@@ -1,6 +1,6 @@
|
||||
import {
|
||||
fetchCollection
|
||||
} from 'actions/crud'
|
||||
} from './actions'
|
||||
|
||||
const MODEL = 'subscribers';
|
||||
const ID = 'imsi';
|
||||
@@ -8,4 +8,4 @@ const URL = '/Subscriber';
|
||||
|
||||
export const fetchSubscribers = (params = {}) => {
|
||||
return fetchCollection(MODEL, ID, URL, params)
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
import { combineReducers } from 'redux';
|
||||
|
||||
import auth from './auth';
|
||||
import crud from './crud';
|
||||
import auth from './auth/reducers';
|
||||
import crud from './crud/reducers';
|
||||
import ui from './ui';
|
||||
|
||||
export default combineReducers({
|
||||
auth,
|
||||
crud,
|
||||
ui
|
||||
});
|
||||
});
|
||||
@@ -1,10 +1,10 @@
|
||||
import { all, fork } from 'redux-saga/effects';
|
||||
import auth from './auth';
|
||||
import crud from './crud';
|
||||
import auth from './auth/sagas';
|
||||
import crud from './crud/sagas';
|
||||
|
||||
export default function* rootSaga() {
|
||||
yield all([
|
||||
fork(auth),
|
||||
fork(crud)
|
||||
])
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
import { createAction } from 'redux-actions';
|
||||
import { handleActions } from 'redux-actions';
|
||||
|
||||
export const UI = {
|
||||
TOGGLE_SIDEBAR: 'ui/TOGGLE_SIDEBAR',
|
||||
@@ -25,3 +26,34 @@ export const toggleSidebar = createAction(UI.TOGGLE_SIDEBAR);
|
||||
export const setSidebarVisibility = createAction(UI.SET_SIDEBAR_VISIBILITY);
|
||||
export const selectView = createAction(UI.SELECT_VIEW);
|
||||
export const testUI = ({type:UI.TEST_UI, argu:true})
|
||||
|
||||
const initialState = {
|
||||
sidebar: {
|
||||
isOpen: false,
|
||||
view: "subscriber"
|
||||
}
|
||||
}
|
||||
|
||||
export default handleActions({
|
||||
[UI.TOGGLE_SIDEBAR]: (state, action) => ({
|
||||
...state,
|
||||
sidebar: {
|
||||
...state.sidebar,
|
||||
isOpen: !state.sidebar.isOpen
|
||||
}
|
||||
}),
|
||||
[UI.SET_SIDEBAR_VISIBILITY]: (state, action) => ({
|
||||
...state,
|
||||
sidebar: {
|
||||
...state.sidebar,
|
||||
isOpen: action.payload
|
||||
}
|
||||
}),
|
||||
[UI.SELECT_VIEW]: (state, action) => ({
|
||||
...state,
|
||||
sidebar: {
|
||||
...state.sidebar,
|
||||
view: action.payload
|
||||
}
|
||||
})
|
||||
}, initialState);
|
||||
@@ -1,33 +0,0 @@
|
||||
import { handleActions } from 'redux-actions';
|
||||
import { UI } from 'actions/ui';
|
||||
|
||||
const initialState = {
|
||||
sidebar: {
|
||||
isOpen: false,
|
||||
view: "subscriber"
|
||||
}
|
||||
}
|
||||
|
||||
export default handleActions({
|
||||
[UI.TOGGLE_SIDEBAR]: (state, action) => ({
|
||||
...state,
|
||||
sidebar: {
|
||||
...state.sidebar,
|
||||
isOpen: !state.sidebar.isOpen
|
||||
}
|
||||
}),
|
||||
[UI.SET_SIDEBAR_VISIBILITY]: (state, action) => ({
|
||||
...state,
|
||||
sidebar: {
|
||||
...state.sidebar,
|
||||
isOpen: action.payload
|
||||
}
|
||||
}),
|
||||
[UI.SELECT_VIEW]: (state, action) => ({
|
||||
...state,
|
||||
sidebar: {
|
||||
...state.sidebar,
|
||||
view: action.payload
|
||||
}
|
||||
})
|
||||
}, initialState);
|
||||
Reference in New Issue
Block a user