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
dec9f96e
Commit
dec9f96e
authored
Apr 27, 2021
by
Paul Kaplan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace loading with fetching in new components
parent
f9419ac8
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
41 additions
and
41 deletions
+41
-41
src/redux/studio.js
src/redux/studio.js
+4
-4
src/views/studio/studio-comments-allowed.jsx
src/views/studio/studio-comments-allowed.jsx
+6
-6
src/views/studio/studio-description.jsx
src/views/studio/studio-description.jsx
+6
-6
src/views/studio/studio-follow.jsx
src/views/studio/studio-follow.jsx
+7
-7
src/views/studio/studio-image.jsx
src/views/studio/studio-image.jsx
+6
-6
src/views/studio/studio-open-to-all.jsx
src/views/studio/studio-open-to-all.jsx
+6
-6
src/views/studio/studio-title.jsx
src/views/studio/studio-title.jsx
+6
-6
No files found.
src/redux/studio.js
View file @
dec9f96e
...
...
@@ -89,9 +89,9 @@ const selectStudioDescription = state => state.studio.description;
const
selectStudioImage
=
state
=>
state
.
studio
.
image
;
const
selectStudioOpenToAll
=
state
=>
state
.
studio
.
openToAll
;
const
selectStudioCommentsAllowed
=
state
=>
state
.
studio
.
commentsAllowed
;
const
selectIs
Load
ingInfo
=
state
=>
state
.
studio
.
infoStatus
===
Status
.
FETCHING
;
const
selectIs
Fetch
ingInfo
=
state
=>
state
.
studio
.
infoStatus
===
Status
.
FETCHING
;
const
selectIsFollowing
=
state
=>
state
.
studio
.
following
;
const
selectIs
Load
ingRoles
=
state
=>
state
.
studio
.
rolesStatus
===
Status
.
FETCHING
;
const
selectIs
Fetch
ingRoles
=
state
=>
state
.
studio
.
rolesStatus
===
Status
.
FETCHING
;
// Thunks
const
getInfo
=
()
=>
((
dispatch
,
getState
)
=>
{
...
...
@@ -157,7 +157,7 @@ module.exports = {
selectStudioImage
,
selectStudioOpenToAll
,
selectStudioCommentsAllowed
,
selectIs
Load
ingInfo
,
selectIs
Load
ingRoles
,
selectIs
Fetch
ingInfo
,
selectIs
Fetch
ingRoles
,
selectIsFollowing
};
src/views/studio/studio-comments-allowed.jsx
View file @
dec9f96e
...
...
@@ -3,17 +3,17 @@ import React from 'react';
import
PropTypes
from
'
prop-types
'
;
import
{
connect
}
from
'
react-redux
'
;
import
{
selectStudioCommentsAllowed
,
selectIs
Load
ingInfo
}
from
'
../../redux/studio
'
;
import
{
selectStudioCommentsAllowed
,
selectIs
Fetch
ingInfo
}
from
'
../../redux/studio
'
;
import
{
mutateStudioCommentsAllowed
,
selectIsMutatingCommentsAllowed
,
selectCommentsAllowedMutationError
}
from
'
../../redux/studio-mutations
'
;
const
StudioCommentsAllowed
=
({
commentsAllowedError
,
is
Load
ing
,
isMutating
,
commentsAllowed
,
handleUpdate
commentsAllowedError
,
is
Fetch
ing
,
isMutating
,
commentsAllowed
,
handleUpdate
})
=>
(
<
div
>
{
is
Load
ing
?
(
<
h4
>
Load
ing...
</
h4
>
{
is
Fetch
ing
?
(
<
h4
>
Fetch
ing...
</
h4
>
)
:
(
<
div
>
<
label
>
...
...
@@ -33,7 +33,7 @@ const StudioCommentsAllowed = ({
StudioCommentsAllowed
.
propTypes
=
{
commentsAllowedError
:
PropTypes
.
string
,
is
Load
ing
:
PropTypes
.
bool
,
is
Fetch
ing
:
PropTypes
.
bool
,
isMutating
:
PropTypes
.
bool
,
commentsAllowed
:
PropTypes
.
bool
,
handleUpdate
:
PropTypes
.
func
...
...
@@ -42,7 +42,7 @@ StudioCommentsAllowed.propTypes = {
export
default
connect
(
state
=>
({
commentsAllowed
:
selectStudioCommentsAllowed
(
state
),
is
Loading
:
selectIsLoad
ingInfo
(
state
),
is
Fetching
:
selectIsFetch
ingInfo
(
state
),
isMutating
:
selectIsMutatingCommentsAllowed
(
state
),
commentsAllowedError
:
selectCommentsAllowedMutationError
(
state
)
}),
...
...
src/views/studio/studio-description.jsx
View file @
dec9f96e
...
...
@@ -3,19 +3,19 @@ import React from 'react';
import
PropTypes
from
'
prop-types
'
;
import
{
connect
}
from
'
react-redux
'
;
import
{
selectStudioDescription
,
selectIs
Load
ingInfo
}
from
'
../../redux/studio
'
;
import
{
selectStudioDescription
,
selectIs
Fetch
ingInfo
}
from
'
../../redux/studio
'
;
import
{
selectCanEditInfo
}
from
'
../../redux/studio-permissions
'
;
import
{
mutateStudioDescription
,
selectIsMutatingDescription
,
selectDescriptionMutationError
}
from
'
../../redux/studio-mutations
'
;
const
StudioDescription
=
({
descriptionError
,
is
Load
ing
,
isMutating
,
description
,
canEditInfo
,
handleUpdate
descriptionError
,
is
Fetch
ing
,
isMutating
,
description
,
canEditInfo
,
handleUpdate
})
=>
(
<
div
>
<
h3
>
Description
</
h3
>
{
is
Load
ing
?
(
<
h4
>
Load
ing...
</
h4
>
{
is
Fetch
ing
?
(
<
h4
>
Fetch
ing...
</
h4
>
)
:
(
canEditInfo
?
(
<
label
>
<
textarea
...
...
@@ -37,7 +37,7 @@ const StudioDescription = ({
StudioDescription
.
propTypes
=
{
descriptionError
:
PropTypes
.
string
,
canEditInfo
:
PropTypes
.
bool
,
is
Load
ing
:
PropTypes
.
bool
,
is
Fetch
ing
:
PropTypes
.
bool
,
isMutating
:
PropTypes
.
bool
,
description
:
PropTypes
.
string
,
handleUpdate
:
PropTypes
.
func
...
...
@@ -47,7 +47,7 @@ export default connect(
state
=>
({
description
:
selectStudioDescription
(
state
),
canEditInfo
:
selectCanEditInfo
(
state
),
is
Loading
:
selectIsLoad
ingInfo
(
state
),
is
Fetching
:
selectIsFetch
ingInfo
(
state
),
isMutating
:
selectIsMutatingDescription
(
state
),
descriptionError
:
selectDescriptionMutationError
(
state
)
}),
...
...
src/views/studio/studio-follow.jsx
View file @
dec9f96e
...
...
@@ -2,7 +2,7 @@
import
React
from
'
react
'
;
import
PropTypes
from
'
prop-types
'
;
import
{
connect
}
from
'
react-redux
'
;
import
{
selectIsFollowing
,
selectIs
Load
ingRoles
}
from
'
../../redux/studio
'
;
import
{
selectIsFollowing
,
selectIs
Fetch
ingRoles
}
from
'
../../redux/studio
'
;
import
{
selectCanFollowStudio
}
from
'
../../redux/studio-permissions
'
;
import
{
mutateFollowingStudio
,
selectIsMutatingFollowing
,
selectFollowingMutationError
...
...
@@ -11,7 +11,7 @@ import {
const
StudioFollow
=
({
canFollow
,
is
Load
ing
,
is
Fetch
ing
,
isFollowing
,
isMutating
,
followingError
,
...
...
@@ -21,11 +21,11 @@ const StudioFollow = ({
<
h3
>
Following
</
h3
>
<
div
>
<
button
disabled=
{
is
Load
ing
||
isMutating
||
!
canFollow
}
disabled=
{
is
Fetch
ing
||
isMutating
||
!
canFollow
}
onClick=
{
()
=>
handleFollow
(
!
isFollowing
)
}
>
{
is
Load
ing
?
(
'
Load
ing...
'
{
is
Fetch
ing
?
(
'
Fetch
ing...
'
)
:
(
isFollowing
?
'
Unfollow
'
:
'
Follow
'
)
}
...
...
@@ -38,7 +38,7 @@ const StudioFollow = ({
StudioFollow
.
propTypes
=
{
canFollow
:
PropTypes
.
bool
,
is
Load
ing
:
PropTypes
.
bool
,
is
Fetch
ing
:
PropTypes
.
bool
,
isFollowing
:
PropTypes
.
bool
,
isMutating
:
PropTypes
.
bool
,
followingError
:
PropTypes
.
string
,
...
...
@@ -48,7 +48,7 @@ StudioFollow.propTypes = {
export
default
connect
(
state
=>
({
canFollow
:
selectCanFollowStudio
(
state
),
is
Loading
:
selectIsLoad
ingRoles
(
state
),
is
Fetching
:
selectIsFetch
ingRoles
(
state
),
isMutating
:
selectIsMutatingFollowing
(
state
),
isFollowing
:
selectIsFollowing
(
state
),
followingError
:
selectFollowingMutationError
(
state
)
...
...
src/views/studio/studio-image.jsx
View file @
dec9f96e
...
...
@@ -3,7 +3,7 @@ import React from 'react';
import
PropTypes
from
'
prop-types
'
;
import
{
connect
}
from
'
react-redux
'
;
import
{
selectStudioImage
,
selectIs
Load
ingInfo
}
from
'
../../redux/studio
'
;
import
{
selectStudioImage
,
selectIs
Fetch
ingInfo
}
from
'
../../redux/studio
'
;
import
{
selectCanEditInfo
}
from
'
../../redux/studio-permissions
'
;
import
{
mutateStudioImage
,
selectIsMutatingImage
,
selectImageMutationError
...
...
@@ -11,12 +11,12 @@ import {
import
Spinner
from
'
../../components/spinner/spinner.jsx
'
;
const
StudioImage
=
({
imageError
,
is
Load
ing
,
isMutating
,
image
,
canEditInfo
,
handleUpdate
imageError
,
is
Fetch
ing
,
isMutating
,
image
,
canEditInfo
,
handleUpdate
})
=>
(
<
div
>
<
h3
>
Image
</
h3
>
{
is
Load
ing
?
(
<
h4
>
Load
ing...
</
h4
>
{
is
Fetch
ing
?
(
<
h4
>
Fetch
ing...
</
h4
>
)
:
(
<
div
>
<
div
style=
{
{
width
:
'
200px
'
,
height
:
'
150px
'
,
border
:
'
1px solid green
'
}
}
>
...
...
@@ -49,7 +49,7 @@ const StudioImage = ({
StudioImage
.
propTypes
=
{
imageError
:
PropTypes
.
string
,
canEditInfo
:
PropTypes
.
bool
,
is
Load
ing
:
PropTypes
.
bool
,
is
Fetch
ing
:
PropTypes
.
bool
,
isMutating
:
PropTypes
.
bool
,
image
:
PropTypes
.
string
,
handleUpdate
:
PropTypes
.
func
...
...
@@ -59,7 +59,7 @@ export default connect(
state
=>
({
image
:
selectStudioImage
(
state
),
canEditInfo
:
selectCanEditInfo
(
state
),
is
Loading
:
selectIsLoad
ingInfo
(
state
),
is
Fetching
:
selectIsFetch
ingInfo
(
state
),
isMutating
:
selectIsMutatingImage
(
state
),
imageError
:
selectImageMutationError
(
state
)
}),
...
...
src/views/studio/studio-open-to-all.jsx
View file @
dec9f96e
...
...
@@ -3,17 +3,17 @@ import React from 'react';
import
PropTypes
from
'
prop-types
'
;
import
{
connect
}
from
'
react-redux
'
;
import
{
selectStudioOpenToAll
,
selectIs
Load
ingInfo
}
from
'
../../redux/studio
'
;
import
{
selectStudioOpenToAll
,
selectIs
Fetch
ingInfo
}
from
'
../../redux/studio
'
;
import
{
mutateStudioOpenToAll
,
selectIsMutatingOpenToAll
,
selectOpenToAllMutationError
}
from
'
../../redux/studio-mutations
'
;
const
StudioOpenToAll
=
({
openToAllError
,
is
Load
ing
,
isMutating
,
openToAll
,
handleUpdate
openToAllError
,
is
Fetch
ing
,
isMutating
,
openToAll
,
handleUpdate
})
=>
(
<
div
>
{
is
Load
ing
?
(
<
h4
>
Load
ing...
</
h4
>
{
is
Fetch
ing
?
(
<
h4
>
Fetch
ing...
</
h4
>
)
:
(
<
div
>
<
label
>
...
...
@@ -33,7 +33,7 @@ const StudioOpenToAll = ({
StudioOpenToAll
.
propTypes
=
{
openToAllError
:
PropTypes
.
string
,
is
Load
ing
:
PropTypes
.
bool
,
is
Fetch
ing
:
PropTypes
.
bool
,
isMutating
:
PropTypes
.
bool
,
openToAll
:
PropTypes
.
bool
,
handleUpdate
:
PropTypes
.
func
...
...
@@ -42,7 +42,7 @@ StudioOpenToAll.propTypes = {
export
default
connect
(
state
=>
({
openToAll
:
selectStudioOpenToAll
(
state
),
is
Loading
:
selectIsLoad
ingInfo
(
state
),
is
Fetching
:
selectIsFetch
ingInfo
(
state
),
isMutating
:
selectIsMutatingOpenToAll
(
state
),
openToAllError
:
selectOpenToAllMutationError
(
state
)
}),
...
...
src/views/studio/studio-title.jsx
View file @
dec9f96e
...
...
@@ -3,17 +3,17 @@ import React from 'react';
import
PropTypes
from
'
prop-types
'
;
import
{
connect
}
from
'
react-redux
'
;
import
{
selectStudioTitle
,
selectIs
Load
ingInfo
}
from
'
../../redux/studio
'
;
import
{
selectStudioTitle
,
selectIs
Fetch
ingInfo
}
from
'
../../redux/studio
'
;
import
{
selectCanEditInfo
}
from
'
../../redux/studio-permissions
'
;
import
{
mutateStudioTitle
,
selectIsMutatingTitle
,
selectTitleMutationError
}
from
'
../../redux/studio-mutations
'
;
const
StudioTitle
=
({
titleError
,
is
Load
ing
,
isMutating
,
title
,
canEditInfo
,
handleUpdate
titleError
,
is
Fetch
ing
,
isMutating
,
title
,
canEditInfo
,
handleUpdate
})
=>
(
<
div
>
<
h3
>
Title
</
h3
>
{
is
Load
ing
?
(
<
h4
>
Load
ing...
</
h4
>
{
is
Fetch
ing
?
(
<
h4
>
Fetch
ing...
</
h4
>
)
:
(
canEditInfo
?
(
<
label
>
<
input
...
...
@@ -33,7 +33,7 @@ const StudioTitle = ({
StudioTitle
.
propTypes
=
{
titleError
:
PropTypes
.
string
,
canEditInfo
:
PropTypes
.
bool
,
is
Load
ing
:
PropTypes
.
bool
,
is
Fetch
ing
:
PropTypes
.
bool
,
isMutating
:
PropTypes
.
bool
,
title
:
PropTypes
.
string
,
handleUpdate
:
PropTypes
.
func
...
...
@@ -43,7 +43,7 @@ export default connect(
state
=>
({
title
:
selectStudioTitle
(
state
),
canEditInfo
:
selectCanEditInfo
(
state
),
is
Loading
:
selectIsLoad
ingInfo
(
state
),
is
Fetching
:
selectIsFetch
ingInfo
(
state
),
isMutating
:
selectIsMutatingTitle
(
state
),
titleError
:
selectTitleMutationError
(
state
)
}),
...
...
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