Skip to content

Commit

Permalink
feat(webpack): setup relative path redux
Browse files Browse the repository at this point in the history
  • Loading branch information
harryandriyan committed May 10, 2022
1 parent c22b691 commit b4eaba1
Show file tree
Hide file tree
Showing 72 changed files with 333 additions and 340 deletions.
2 changes: 1 addition & 1 deletion admin-ui/app/components/App/AppMain.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import { BrowserRouter as Router } from 'react-router-dom'
import { Provider } from 'react-redux'
import { configureStore } from '../../redux/store'
import { configureStore } from 'Redux/store'
import { PersistGate } from 'redux-persist/integration/react'
import AuthenticatedRouteSelector from './AuthenticatedRouteSelector'
const basePath = process.env.BASE_PATH || '/admin'
Expand Down
2 changes: 1 addition & 1 deletion admin-ui/app/redux/reducers/LicenseDetailsReducer.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { GET_LICENSE_DETAILS, GET_LICENSE_DETAILS_RESPONSE, UPDATE_LICENSE_DETAILS, UPDATE_LICENSE_DETAILS_RESPONSE } from '../actions/types'
import reducerRegistry from '../../redux/reducers/ReducerRegistry'
import reducerRegistry from 'Redux/reducers/ReducerRegistry'
const INIT_STATE = {
item: {},
loading: true,
Expand Down
13 changes: 5 additions & 8 deletions admin-ui/app/redux/sagas/LicenseDetailsSaga.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,13 @@ import {
getLicenseDetailsResponse,
updateLicenseDetailsResponse,
} from '../actions/LicenseDetailsActions'
import { getClient } from '../../redux/api/base'
import { getClient } from 'Redux/api/base'
import LicenseDetailsApi from '../api/LicenseDetailsApi'
const JansConfigApi = require('jans_config_api')
import { initAudit } from '../../redux/sagas/SagaUtils'
import { postUserAction } from '../../redux/api/backend-api'
import {
isFourZeroOneError,
addAdditionalData,
} from '../../utils/TokenController'
import { getAPIAccessToken } from '../../redux/actions/AuthActions'
import { initAudit } from 'Redux/sagas/SagaUtils'
import { postUserAction } from 'Redux/api/backend-api'
import { isFourZeroOneError } from '../../utils/TokenController'
import { getAPIAccessToken } from 'Redux/actions/AuthActions'

function* newFunction() {
const token = yield select((state) => state.authReducer.token.access_token)
Expand Down
4 changes: 2 additions & 2 deletions admin-ui/app/routes/Apps/Configuration/Fido2Page.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useEffect, useState } from 'react'
import { hasPermission, FIDO_WRITE } from '../../../utils/PermChecker'
import { hasPermission, FIDO_WRITE } from 'Utils/PermChecker'
import {
Form,
FormGroup,
Expand All @@ -21,7 +21,7 @@ import { Formik } from 'formik'
import {
getFidoConfig,
editFidoConfig,
} from '../../../redux/actions/FidoActions'
} from 'Redux/actions/FidoActions'
import GluuNameValuesProperty from '../Gluu/GluuNameValuesProperty'

function Fido2Page({ fido, permissions, dispatch }) {
Expand Down
8 changes: 4 additions & 4 deletions admin-ui/app/routes/Dashboards/DashboardPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import DatePicker from 'react-datepicker'
import 'react-datepicker/dist/react-datepicker.css'
import GluuLoader from '../Apps/Gluu/GluuLoader'
import GluuViewWrapper from '../Apps/Gluu/GluuViewWrapper'
import { getMau } from '../../redux/actions/MauActions'
import { getClients } from '../../redux/actions/InitActions'
import { getMau } from 'Redux/actions/MauActions'
import { getClients } from 'Redux/actions/InitActions'
import applicationstyle from '../Apps/Gluu/styles/applicationstyle'
import GluuLabel from '../Apps/Gluu/GluuLabel'
import GluuRibbon from '../Apps/Gluu/GluuRibbon'
Expand All @@ -20,13 +20,13 @@ import {
FormGroup,
Col,
Row,
} from '../../../app/components'
} from 'Components'
import {
hasBoth,
buildPayload,
STAT_READ,
STAT_JANS_READ,
} from '../../utils/PermChecker'
} from 'Utils/PermChecker'
import { useTranslation } from 'react-i18next'
import { connect } from 'react-redux'

Expand Down
2 changes: 1 addition & 1 deletion admin-ui/app/routes/Dashboards/Reports/Reports.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
getScripts,
getScopes,
getClients,
} from '../../../redux/actions/InitActions'
} from 'Redux/actions/InitActions'
import ReportCard from './ReportCard'
import { useTranslation } from 'react-i18next'

Expand Down
6 changes: 3 additions & 3 deletions admin-ui/app/routes/Pages/ByeBye.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, { useEffect } from 'react'
import { connect } from 'react-redux'
import { uuidv4 } from '../../utils/Util'
import { EmptyLayout, Label } from '../../../app/components'
import { logoutUser } from '../../redux/actions/LogoutActions'
import { uuidv4 } from 'Utils/Util'
import { EmptyLayout, Label } from 'Components'
import { logoutUser } from 'Redux/actions/LogoutActions'
import { useTranslation } from 'react-i18next'

function ByeBye({ config, dispatch }) {
Expand Down
2 changes: 1 addition & 1 deletion admin-ui/app/utils/LicenseScreens/ApiKey.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useEffect, useState } from 'react'
import { checkUserApi, checkUserLicenceKey } from '../../redux/actions'
import { checkUserApi, checkUserLicenceKey } from 'Redux/actions'
import logo from 'Images/logos/logo192.png'
import { useDispatch, useSelector } from 'react-redux'
import './style.css'
Expand Down
4 changes: 2 additions & 2 deletions admin-ui/plugins/PluginReducersResolver.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import plugins from '../plugins.config'
import reducerRegistry from '../app/redux/reducers/ReducerRegistry'
import reducerRegistry from 'Redux/reducers/ReducerRegistry'

async function process() {
const metadataFilePath = plugins
.map((item) => item.metadataFile)
.map((item) => item.metadataFile)
let pluginReducers = []
await metadataFilePath.forEach(async (path) => {
pluginReducers = await [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React, { useEffect } from 'react'
import { connect } from 'react-redux'
import { useHistory } from 'react-router-dom'
import { Container, CardBody, Card } from '../../../../app/components'
import { Container, CardBody, Card } from 'Components'
import CustomScriptForm from './CustomScriptForm'
import { addCustomScript } from '../../redux/actions/CustomScriptActions'
import { buildPayload } from '../../../../app/utils/PermChecker'
import GluuAlert from '../../../../app/routes/Apps/Gluu/GluuAlert'
import { addCustomScript } from 'Plugins/admin/redux/actions/CustomScriptActions'
import { buildPayload } from 'Utils/PermChecker'
import GluuAlert from 'Routes/Apps/Gluu/GluuAlert'
import { useTranslation } from 'react-i18next'

function CustomScriptAddPage({ scripts, dispatch, saveOperationFlag, errorInSaveOperationFlag }) {
Expand All @@ -18,10 +18,9 @@ function CustomScriptAddPage({ scripts, dispatch, saveOperationFlag, errorInSave
history.push('/adm/scripts')
}, [saveOperationFlag])


function handleSubmit(data) {
if (data) {
let message = data.customScript.action_message
const message = data.customScript.action_message
delete data.customScript.action_message
buildPayload(userAction, message, data)
dispatch(addCustomScript(userAction))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React, { useEffect } from 'react'
import { connect } from 'react-redux'
import { useHistory } from 'react-router-dom'
import { CardBody, Card } from '../../../../app/components'
import GluuLoader from '../../../../app/routes/Apps/Gluu/GluuLoader'
import { CardBody, Card } from 'Components'
import GluuLoader from 'Routes/Apps/Gluu/GluuLoader'
import CustomScriptForm from './CustomScriptForm'
import { editCustomScript } from '../../redux/actions/CustomScriptActions'
import { buildPayload } from '../../../../app/utils/PermChecker'
import GluuAlert from '../../../../app/routes/Apps/Gluu/GluuAlert'
import { editCustomScript } from 'Plugins/admin/redux/actions/CustomScriptActions'
import { buildPayload } from 'Utils/PermChecker'
import GluuAlert from 'Routes/Apps/Gluu/GluuAlert'
import { useTranslation } from 'react-i18next'

function CustomScriptEditPage({ item, scripts, loading, dispatch, saveOperationFlag, errorInSaveOperationFlag }) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,26 @@ import { useHistory } from 'react-router-dom'
import { Paper } from '@material-ui/core'
import { Badge } from 'reactstrap'
import { connect } from 'react-redux'
import GluuDialog from '../../../../app/routes/Apps/Gluu/GluuDialog'
import { Card, CardBody, FormGroup } from '../../../../app/components'
import GluuRibbon from '../../../../app/routes/Apps/Gluu/GluuRibbon'
import GluuDialog from 'Routes/Apps/Gluu/GluuDialog'
import { Card, CardBody, FormGroup } from 'Components'
import GluuRibbon from 'Routes/Apps/Gluu/GluuRibbon'
import CustomScriptDetailPage from './CustomScriptDetailPage'
import GluuCustomScriptSearch from '../../../../app/routes/Apps/Gluu/GluuCustomScriptSearch'
import GluuViewWrapper from '../../../../app/routes/Apps/Gluu/GluuViewWrapper'
import applicationStyle from '../../../../app/routes/Apps/Gluu/styles/applicationstyle'
import GluuCustomScriptSearch from 'Routes/Apps/Gluu/GluuCustomScriptSearch'
import GluuViewWrapper from 'Routes/Apps/Gluu/GluuViewWrapper'
import applicationStyle from 'Routes/Apps/Gluu/styles/applicationstyle'
import {
deleteCustomScript,
getCustomScriptByType,
setCurrentItem,
getCustomScripts,
} from '../../redux/actions/CustomScriptActions'
} from 'Plugins/admin/redux/actions/CustomScriptActions'
import {
hasPermission,
buildPayload,
SCRIPT_READ,
SCRIPT_WRITE,
SCRIPT_DELETE,
} from '../../../../app/utils/PermChecker'
} from 'Utils/PermChecker'
import {
LIMIT_ID,
LIMIT,
Expand Down
17 changes: 8 additions & 9 deletions admin-ui/plugins/admin/components/MAU/MauGraph.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
import React, { useState, useEffect } from 'react'
import { subMonths } from 'date-fns'
import moment from 'moment'
import CustomPieGraph from '../../../../app/routes/Dashboards/Grapths/CustomPieGraph'
import ActiveUsersGraph from '../../../../app/routes/Dashboards/Grapths/ActiveUsersGraph'
import ActiveUsersGraph from 'Routes/Dashboards/Grapths/ActiveUsersGraph'
import DatePicker from 'react-datepicker'
import 'react-datepicker/dist/react-datepicker.css'
import GluuLoader from '../../../../app/routes/Apps/Gluu/GluuLoader'
import GluuViewWrapper from '../../../../app/routes/Apps/Gluu/GluuViewWrapper'
import { getMau } from '../../../../app/redux/actions/MauActions'
import { getClients } from '../../../../app/redux/actions/InitActions'
import applicationstyle from '../../../../app/routes/Apps/Gluu/styles/applicationstyle'
import GluuLabel from '../../../../app/routes/Apps/Gluu/GluuLabel'
import GluuRibbon from '../../../../app/routes/Apps/Gluu/GluuRibbon'
import GluuLoader from 'Routes/Apps/Gluu/GluuLoader'
import GluuViewWrapper from 'Routes/Apps/Gluu/GluuViewWrapper'
import { getMau } from 'Redux/actions/MauActions'
import { getClients } from 'Redux/actions/InitActions'
import applicationstyle from 'Routes/Apps/Gluu/styles/applicationstyle'
import GluuLabel from 'Routes/Apps/Gluu/GluuLabel'
import GluuRibbon from 'Routes/Apps/Gluu/GluuRibbon'
import {
Button,
Card,
Expand Down
8 changes: 4 additions & 4 deletions admin-ui/plugins/admin/components/Mapping/MappingItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
FormGroup,
Accordion,
Form,
} from '../../../../app/components'
} from 'Components'
import { useDispatch, useSelector } from 'react-redux'
import { DeleteOutlined } from '@material-ui/icons'
import {
Expand All @@ -16,9 +16,9 @@ import {
updatePermissionsToServer,
updatePermissionsServerResponse,
deleteMapping,
} from '../../redux/actions/MappingActions'
import GluuTypeAhead from '../../../../app/routes/Apps/Gluu/GluuTypeAhead'
import applicationStyle from '../../../../app/routes/Apps/Gluu/styles/applicationstyle'
} from 'Plugins/admin/redux/actions/MappingActions'
import GluuTypeAhead from 'Routes/Apps/Gluu/GluuTypeAhead'
import applicationStyle from 'Routes/Apps/Gluu/styles/applicationstyle'

import { Formik } from 'formik'

Expand Down
18 changes: 9 additions & 9 deletions admin-ui/plugins/admin/components/Mapping/MappingPage.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
import React, { useEffect, useState } from 'react'
import { connect } from 'react-redux'
import { useTranslation } from 'react-i18next'
import applicationStyle from '../../../../app/routes/Apps/Gluu/styles/applicationstyle'
import applicationStyle from 'Routes/Apps/Gluu/styles/applicationstyle'
import MappingAddDialogForm from './MappingAddDialogForm'
import {
Card,
Col,
CardBody,
FormGroup,
Button,
} from '../../../../app/components'
import GluuViewWrapper from '../../../../app/routes/Apps/Gluu/GluuViewWrapper'
import GluuRibbon from '../../../../app/routes/Apps/Gluu/GluuRibbon'
import GluuLoader from '../../../../app/routes/Apps/Gluu/GluuLoader'
} from 'Components'
import GluuViewWrapper from 'Routes/Apps/Gluu/GluuViewWrapper'
import GluuRibbon from 'Routes/Apps/Gluu/GluuRibbon'
import GluuLoader from 'Routes/Apps/Gluu/GluuLoader'
import {
getMapping,
addNewRolePermissions,
} from '../../redux/actions/MappingActions'
import { getRoles } from '../../redux/actions/ApiRoleActions'
import { getPermissions } from '../../redux/actions/ApiPermissionActions'
} from 'Plugins/admin/redux/actions/MappingActions'
import { getRoles } from 'Plugins/admin/redux/actions/ApiRoleActions'
import { getPermissions } from 'Plugins/admin/redux/actions/ApiPermissionActions'
import MappingItem from './MappingItem'
import {
hasPermission,
buildPayload,
ROLE_READ,
} from '../../../../app/utils/PermChecker'
} from 'Utils/PermChecker'

function MappingPage({
mapping,
Expand Down
12 changes: 6 additions & 6 deletions admin-ui/plugins/admin/components/Permissions/UiPermListPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,24 @@ import { Paper } from '@material-ui/core'
import UiPermDetailPage from './UiPermDetailPage'
import { Badge } from 'reactstrap'
import { connect } from 'react-redux'
import { Card, CardBody, FormGroup } from '../../../../app/components'
import { Card, CardBody, FormGroup } from 'Components'
import { useTranslation } from 'react-i18next'
import GluuViewWrapper from '../../../../app/routes/Apps/Gluu/GluuViewWrapper'
import GluuRibbon from '../../../../app/routes/Apps/Gluu/GluuRibbon'
import applicationStyle from '../../../../app/routes/Apps/Gluu/styles/applicationstyle'
import GluuViewWrapper from 'Routes/Apps/Gluu/GluuViewWrapper'
import GluuRibbon from 'Routes/Apps/Gluu/GluuRibbon'
import applicationStyle from 'Routes/Apps/Gluu/styles/applicationstyle'
import PermissionAddDialogForm from './PermissionAddDialogForm'
import {
getPermissions,
deletePermission,
editPermission,
addPermission,
} from '../../redux/actions/ApiPermissionActions'
} from 'Plugins/admin/redux/actions/ApiPermissionActions'
import {
hasPermission,
buildPayload,
PERMISSION_READ,
PERMISSION_WRITE,
} from '../../../../app/utils/PermChecker'
} from 'Utils/PermChecker'

function UiPermListPage({ apiPerms, permissions, loading, dispatch }) {
const { t } = useTranslation()
Expand Down
12 changes: 6 additions & 6 deletions admin-ui/plugins/admin/components/Roles/UiRoleListPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@ import UiRoleDetailPage from './UiRoleDetailPage'
import RoleAddDialogForm from './RoleAddDialogForm'
import { Badge } from 'reactstrap'
import { connect } from 'react-redux'
import { Card, CardBody, FormGroup } from '../../../../app/components'
import { Card, CardBody, FormGroup } from 'Components'
import { useTranslation } from 'react-i18next'
import GluuViewWrapper from '../../../../app/routes/Apps/Gluu/GluuViewWrapper'
import GluuRibbon from '../../../../app/routes/Apps/Gluu/GluuRibbon'
import applicationStyle from '../../../../app/routes/Apps/Gluu/styles/applicationstyle'
import GluuViewWrapper from 'Routes/Apps/Gluu/GluuViewWrapper'
import GluuRibbon from 'Routes/Apps/Gluu/GluuRibbon'
import applicationStyle from 'Routes/Apps/Gluu/styles/applicationstyle'
import {
getRoles,
addRole,
editRole,
deleteRole,
} from '../../redux/actions/ApiRoleActions'
} from 'Plugins/admin/redux/actions/ApiRoleActions'
import {
hasPermission,
buildPayload,
ROLE_READ,
ROLE_WRITE,
} from '../../../../app/utils/PermChecker'
} from 'Utils/PermChecker'

function UiRoleListPage({ apiRoles, permissions, loading, dispatch }) {
const { t } = useTranslation()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
SET_PERMISSION_ITEM,
RESET,
} from '../actions/types'
import reducerRegistry from '../../../../app/redux/reducers/ReducerRegistry'
import reducerRegistry from 'Redux/reducers/ReducerRegistry'
const INIT_STATE = {
items: [],
loading: true,
Expand Down
2 changes: 1 addition & 1 deletion admin-ui/plugins/admin/redux/reducers/ApiRoleReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
SET_ROLE_ITEM,
RESET,
} from '../actions/types'
import reducerRegistry from '../../../../app/redux/reducers/ReducerRegistry'
import reducerRegistry from 'Redux/reducers/ReducerRegistry'

const INIT_STATE = {
items: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
DELETE_CUSTOM_SCRIPT_RESPONSE,
RESET,
} from '../actions/types'
import reducerRegistry from '../../../../app/redux/reducers/ReducerRegistry'
import reducerRegistry from 'Redux/reducers/ReducerRegistry'
const INIT_STATE = {
items: [],
loading: true,
Expand Down
2 changes: 1 addition & 1 deletion admin-ui/plugins/admin/redux/reducers/MappingReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
RESET,
UPDATE_PERMISSIONS_SERVER_RESPONSE,
} from '../actions/types'
import reducerRegistry from '../../../../app/redux/reducers/ReducerRegistry'
import reducerRegistry from 'Redux/reducers/ReducerRegistry'

const INIT_STATE = {
items: [],
Expand Down
Loading

0 comments on commit b4eaba1

Please sign in to comment.