Skip to content

Commit

Permalink
remove site user actions and reducers
Browse files Browse the repository at this point in the history
  • Loading branch information
drewbo committed Nov 25, 2024
1 parent fc97fb7 commit 05451c5
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 49 deletions.
16 changes: 0 additions & 16 deletions frontend/actions/actionCreators/siteActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ const sitesReceivedType = 'SITES_RECEIVED';
const siteAddedType = 'SITE_ADDED';
const siteUpdatedType = 'SITE_UPDATED';
const siteDeletedType = 'SITE_DELETED';
const siteUserAddedType = 'SITE_USER_ADDED';
const siteUserRemovedType = 'SITE_USER_REMOVED';
const siteBranchesReceivedType = 'SITE_BRANCHES_RECIEVED';
const siteBasicAuthSavedType = 'SITE_BASIC_AUTH_SAVED';
const siteBasicAuthRemovedType = 'SITE_BASIC_AUTH_REMOVED';
Expand Down Expand Up @@ -34,16 +32,6 @@ const siteDeleted = (siteId) => ({
siteId,
});

const siteUserAdded = (site) => ({
type: siteUserAddedType,
site,
});

const siteUserRemoved = (site) => ({
type: siteUserRemovedType,
site,
});

const siteBasicAuthSaved = (site) => ({
type: siteBasicAuthSavedType,
siteId: site.id,
Expand All @@ -67,10 +55,6 @@ export {
siteUpdatedType,
siteDeleted,
siteDeletedType,
siteUserAdded,
siteUserAddedType,
siteUserRemoved,
siteUserRemovedType,
siteBranchesReceivedType,
siteBasicAuthSaved,
siteBasicAuthSavedType,
Expand Down
12 changes: 0 additions & 12 deletions frontend/actions/dispatchActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import {
siteAdded as createSiteAddedAction,
siteUpdated as createSiteUpdatedAction,
siteDeleted as createSiteDeletedAction,
siteUserAdded as createSiteUserAddedAction,
siteUserRemoved as siteUserRemovedAction,
siteBasicAuthSaved as createSiteBasicAuthSavedAction,
siteBasicAuthRemoved as createSiteBasicAuthRemovedAction,
} from './actionCreators/siteActions';
Expand Down Expand Up @@ -36,14 +34,6 @@ const dispatchSiteDeletedAction = (siteId) => {
dispatch(createSiteDeletedAction(siteId));
};

const dispatchUserAddedToSiteAction = (site) => {
dispatch(createSiteUserAddedAction(site));
};

const dispatchUserRemovedFromSiteAction = (site) => {
dispatch(siteUserRemovedAction(site));
};

const dispatchShowAddNewSiteFieldsAction = () => {
dispatch(createShowAddNewSiteFieldsAction());
};
Expand All @@ -66,8 +56,6 @@ export {
dispatchSiteAddedAction,
dispatchSiteUpdatedAction,
dispatchSiteDeletedAction,
dispatchUserAddedToSiteAction,
dispatchUserRemovedFromSiteAction,
dispatchShowAddNewSiteFieldsAction,
dispatchHideAddNewSiteFieldsAction,
dispatchResetFormAction,
Expand Down
5 changes: 0 additions & 5 deletions frontend/actions/siteActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,12 @@ import {
dispatchSiteAddedAction,
dispatchSiteUpdatedAction,
dispatchSiteDeletedAction,
dispatchUserAddedToSiteAction,
dispatchUserRemovedFromSiteAction,
dispatchShowAddNewSiteFieldsAction,
dispatchHideAddNewSiteFieldsAction,
dispatchResetFormAction,
dispatchSiteBasicAuthRemovedAction,
dispatchSiteBasicAuthSavedAction,
} from './dispatchActions';

import userActions from './userActions';

const alertError = (error) => {
window.scrollTo(0, 0);
alertActions.httpError(error.message);
Expand Down
16 changes: 0 additions & 16 deletions frontend/reducers/sites.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import {
siteUpdatedType as SITE_UPDATED,
siteDeletedType as SITE_DELETED,
siteBranchesReceivedType as SITE_BRANCHES_RECEIVED,
siteUserAddedType as SITE_USER_ADDED,
siteUserRemovedType as SITE_USER_REMOVED,
siteBasicAuthSavedType as SITE_BASIC_AUTH_SAVED,
siteBasicAuthRemovedType as SITE_BASIC_AUTH_REMOVED,
} from '../actions/actionCreators/siteActions';
Expand Down Expand Up @@ -78,20 +76,6 @@ export default function sites(state = initialState, action) {
isLoading: false,
data: state.data.filter((site) => site.id !== action.siteId),
};

case SITE_USER_ADDED:
return action.site
? {
isLoading: false,
data: state.data.concat(action.site),
}
: state;

case SITE_USER_REMOVED: {
return {
isLoading: false,
data: [action.site, ...state.data.filter((site) => site.id !== action.site.id)],
};
}

default:
Expand Down

0 comments on commit 05451c5

Please sign in to comment.