Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
scratch-www
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
scratch-www
Commits
a8ed7410
Commit
a8ed7410
authored
Jun 23, 2021
by
Paul Kaplan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Separate studio reducers and initial state into a helper
parent
8a3e6155
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
32 deletions
+41
-32
src/views/studio/studio-redux.js
src/views/studio/studio-redux.js
+37
-0
src/views/studio/studio.jsx
src/views/studio/studio.jsx
+4
-32
No files found.
src/views/studio/studio-redux.js
0 → 100644
View file @
a8ed7410
import
{
projects
,
curators
,
managers
,
activity
,
userProjects
}
from
'
./lib/redux-modules
'
;
const
{
getInitialState
,
studioReducer
}
=
require
(
'
../../redux/studio
'
);
const
{
studioReportReducer
}
=
require
(
'
../../redux/studio-report
'
);
const
{
commentsReducer
}
=
require
(
'
../../redux/comments
'
);
const
{
studioMutationsReducer
}
=
require
(
'
../../redux/studio-mutations
'
);
const
reducers
=
{
[
projects
.
key
]:
projects
.
reducer
,
[
curators
.
key
]:
curators
.
reducer
,
[
managers
.
key
]:
managers
.
reducer
,
[
activity
.
key
]:
activity
.
reducer
,
[
userProjects
.
key
]:
userProjects
.
reducer
,
comments
:
commentsReducer
,
studio
:
studioReducer
,
studioMutations
:
studioMutationsReducer
,
studioReport
:
studioReportReducer
};
const
initialState
=
{
studio
:
{
...
getInitialState
(),
// Include the studio id in the initial state to allow us
// to stop passing around the studio id in components
// when it is only needed for data fetching, not for rendering.
id
:
window
.
location
.
pathname
.
split
(
'
/
'
)[
2
]
}
};
export
{
reducers
,
initialState
};
src/views/studio/studio.jsx
View file @
a8ed7410
...
...
@@ -27,18 +27,8 @@ import StudioMeta from './studio-meta.jsx';
import
StudioAdminPanel
from
'
./studio-admin-panel.jsx
'
;
import
StudioDeleted
from
'
./studio-deleted.jsx
'
;
import
{
projects
,
curators
,
managers
,
activity
,
userProjects
}
from
'
./lib/redux-modules
'
;
const
{
getInitialState
,
studioReducer
,
selectStudioLoadFailed
,
getInfo
}
=
require
(
'
../../redux/studio
'
);
const
{
studioReportReducer
}
=
require
(
'
../../redux/studio-report
'
);
const
{
commentsReducer
}
=
require
(
'
../../redux/comments
'
);
const
{
studioMutationsReducer
}
=
require
(
'
../../redux/studio-mutations
'
);
import
{
reducers
,
initialState
}
from
'
./studio-redux.js
'
;
import
{
selectStudioLoadFailed
,
getInfo
}
from
'
../../redux/studio
'
;
import
'
./studio.scss
'
;
import
{
selectIsAdmin
,
selectMuteStatus
}
from
'
../../redux/session.js
'
;
...
...
@@ -140,24 +130,6 @@ render(
</
Router
>
</
Page
>,
document
.
getElementById
(
'
app
'
),
{
[
projects
.
key
]:
projects
.
reducer
,
[
curators
.
key
]:
curators
.
reducer
,
[
managers
.
key
]:
managers
.
reducer
,
[
activity
.
key
]:
activity
.
reducer
,
[
userProjects
.
key
]:
userProjects
.
reducer
,
comments
:
commentsReducer
,
studio
:
studioReducer
,
studioMutations
:
studioMutationsReducer
,
studioReport
:
studioReportReducer
},
{
studio
:
{
...
getInitialState
(),
// Include the studio id in the initial state to allow us
// to stop passing around the studio id in components
// when it is only needed for data fetching, not for rendering.
id
:
window
.
location
.
pathname
.
split
(
'
/
'
)[
2
]
}
}
reducers
,
initialState
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment