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
c25fb3a9
Commit
c25fb3a9
authored
May 11, 2021
by
Paul Kaplan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add empty states for curators and projects
parent
a9d70b2c
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
136 additions
and
44 deletions
+136
-44
src/views/studio/l10n.json
src/views/studio/l10n.json
+7
-0
src/views/studio/studio-curators.jsx
src/views/studio/studio-curators.jsx
+42
-15
src/views/studio/studio-managers.jsx
src/views/studio/studio-managers.jsx
+13
-9
src/views/studio/studio-projects.jsx
src/views/studio/studio-projects.jsx
+58
-20
src/views/studio/studio.scss
src/views/studio/studio.scss
+16
-0
static/images/studios/curators-empty.png
static/images/studios/curators-empty.png
+0
-0
static/images/studios/projects-empty-can-add.png
static/images/studios/projects-empty-can-add.png
+0
-0
static/images/studios/projects-empty.png
static/images/studios/projects-empty.png
+0
-0
No files found.
src/views/studio/l10n.json
View file @
c25fb3a9
...
@@ -11,6 +11,10 @@
...
@@ -11,6 +11,10 @@
"studio.projectsHeader"
:
"Projects"
,
"studio.projectsHeader"
:
"Projects"
,
"studio.addProjectsHeader"
:
"Add Projects"
,
"studio.addProjectsHeader"
:
"Add Projects"
,
"studio.addProject"
:
"Add"
,
"studio.addProject"
:
"Add"
,
"studio.projectsEmptyCanAdd1"
:
"Your studio is looking a little empty."
,
"studio.projectsEmptyCanAdd2"
:
"Add your first project!"
,
"studio.projectsEmpty1"
:
"This studio has no projects yet."
,
"studio.projectsEmpty2"
:
"Suggest projects you want to add in the comments!"
,
"studio.creatorRole"
:
"Studio Creator"
,
"studio.creatorRole"
:
"Studio Creator"
,
...
@@ -23,6 +27,9 @@
...
@@ -23,6 +27,9 @@
"studio.inviteCuratorsHeader"
:
"Invite Curators"
,
"studio.inviteCuratorsHeader"
:
"Invite Curators"
,
"studio.inviteCurator"
:
"Invite"
,
"studio.inviteCurator"
:
"Invite"
,
"studio.curatorAcceptInvite"
:
"Accept Invite"
,
"studio.curatorAcceptInvite"
:
"Accept Invite"
,
"studio.curatorsEmptyCanAdd1"
:
"You don’t have curators right now."
,
"studio.curatorsEmptyCanAdd2"
:
"Add some curators to collaborate with!"
,
"studio.curatorsEmpty1"
:
"This studio has no curators right now."
,
"studio.commentsHeader"
:
"Comments"
"studio.commentsHeader"
:
"Comments"
}
}
\ No newline at end of file
src/views/studio/studio-curators.jsx
View file @
c25fb3a9
...
@@ -2,6 +2,7 @@ import React, {useEffect} from 'react';
...
@@ -2,6 +2,7 @@ import React, {useEffect} from 'react';
import
PropTypes
from
'
prop-types
'
;
import
PropTypes
from
'
prop-types
'
;
import
{
connect
}
from
'
react-redux
'
;
import
{
connect
}
from
'
react-redux
'
;
import
{
FormattedMessage
}
from
'
react-intl
'
;
import
{
FormattedMessage
}
from
'
react-intl
'
;
import
classNames
from
'
classnames
'
;
import
{
curators
}
from
'
./lib/redux-modules
'
;
import
{
curators
}
from
'
./lib/redux-modules
'
;
import
Debug
from
'
./debug.jsx
'
;
import
Debug
from
'
./debug.jsx
'
;
...
@@ -27,6 +28,27 @@ const StudioCurators = ({
...
@@ -27,6 +28,27 @@ const StudioCurators = ({
data=
{
error
}
data=
{
error
}
/>
}
/>
}
<
div
className=
"studio-members-grid"
>
<
div
className=
"studio-members-grid"
>
{
items
.
length
===
0
&&
!
loading
?
(
<
div
className=
"studio-empty"
>
<
img
width=
"179"
height=
"111"
className=
"studio-empty-img"
src=
"/images/studios/curators-empty.png"
/>
{
canInviteCurators
?
(
<
div
className=
"studio-empty-msg"
>
<
div
><
FormattedMessage
id=
"studio.curatorsEmptyCanAdd1"
/></
div
>
<
div
><
FormattedMessage
id=
"studio.curatorsEmptyCanAdd2"
/></
div
>
</
div
>
)
:
(
<
div
className=
"studio-empty-msg"
>
<
div
><
FormattedMessage
id=
"studio.curatorsEmpty1"
/></
div
>
</
div
>
)
}
</
div
>
)
:
(
<
React
.
Fragment
>
{
items
.
map
(
item
=>
{
items
.
map
(
item
=>
(<
CuratorTile
(<
CuratorTile
key=
{
item
.
username
}
key=
{
item
.
username
}
...
@@ -34,15 +56,20 @@ const StudioCurators = ({
...
@@ -34,15 +56,20 @@ const StudioCurators = ({
image=
{
item
.
profile
.
images
[
'
90x90
'
]
}
image=
{
item
.
profile
.
images
[
'
90x90
'
]
}
/>)
/>)
)
}
)
}
{
moreToLoad
&&
<
div
className=
"studio-members-load-more"
>
<
div
className=
"studio-members-load-more"
>
{
loading
?
<
small
>
Loading...
</
small
>
:
(
<
button
moreToLoad
?
className=
{
classNames
(
'
button
'
,
{
<
button
onClick=
{
onLoadMore
}
>
'
mod-mutating
'
:
loading
})
}
onClick=
{
onLoadMore
}
>
<
FormattedMessage
id=
"general.loadMore"
/>
<
FormattedMessage
id=
"general.loadMore"
/>
</
button
>
:
</
button
>
<
small
>
No more to load
</
small
>
)
}
</
div
>
</
div
>
}
</
React
.
Fragment
>
)
}
</
div
>
</
div
>
</
div
>);
</
div
>);
};
};
...
...
src/views/studio/studio-managers.jsx
View file @
c25fb3a9
...
@@ -2,6 +2,7 @@ import React, {useEffect} from 'react';
...
@@ -2,6 +2,7 @@ import React, {useEffect} from 'react';
import
PropTypes
from
'
prop-types
'
;
import
PropTypes
from
'
prop-types
'
;
import
{
connect
}
from
'
react-redux
'
;
import
{
connect
}
from
'
react-redux
'
;
import
{
FormattedMessage
}
from
'
react-intl
'
;
import
{
FormattedMessage
}
from
'
react-intl
'
;
import
classNames
from
'
classnames
'
;
import
{
managers
}
from
'
./lib/redux-modules
'
;
import
{
managers
}
from
'
./lib/redux-modules
'
;
import
{
loadManagers
}
from
'
./lib/studio-member-actions
'
;
import
{
loadManagers
}
from
'
./lib/studio-member-actions
'
;
...
@@ -30,15 +31,18 @@ const StudioManagers = ({items, error, loading, moreToLoad, onLoadMore}) => {
...
@@ -30,15 +31,18 @@ const StudioManagers = ({items, error, loading, moreToLoad, onLoadMore}) => {
image=
{
item
.
profile
.
images
[
'
90x90
'
]
}
image=
{
item
.
profile
.
images
[
'
90x90
'
]
}
/>)
/>)
)
}
)
}
{
moreToLoad
&&
<
div
className=
"studio-members-load-more"
>
<
div
className=
"studio-members-load-more"
>
{
loading
?
<
small
>
Loading...
</
small
>
:
(
<
button
moreToLoad
?
className=
{
classNames
(
'
button
'
,
{
<
button
onClick=
{
onLoadMore
}
>
'
mod-mutating
'
:
loading
})
}
onClick=
{
onLoadMore
}
>
<
FormattedMessage
id=
"general.loadMore"
/>
<
FormattedMessage
id=
"general.loadMore"
/>
</
button
>
:
</
button
>
<
small
>
No more to load
</
small
>
)
}
</
div
>
</
div
>
}
</
div
>
</
div
>
</
div
>
</
div
>
);
);
...
...
src/views/studio/studio-projects.jsx
View file @
c25fb3a9
...
@@ -10,6 +10,7 @@ import Debug from './debug.jsx';
...
@@ -10,6 +10,7 @@ import Debug from './debug.jsx';
import
StudioProjectAdder
from
'
./studio-project-adder.jsx
'
;
import
StudioProjectAdder
from
'
./studio-project-adder.jsx
'
;
import
StudioProjectTile
from
'
./studio-project-tile.jsx
'
;
import
StudioProjectTile
from
'
./studio-project-tile.jsx
'
;
import
{
loadProjects
}
from
'
./lib/studio-project-actions.js
'
;
import
{
loadProjects
}
from
'
./lib/studio-project-actions.js
'
;
import
classNames
from
'
classnames
'
;
const
StudioProjects
=
({
const
StudioProjects
=
({
canAddProjects
,
canEditOpenToAll
,
items
,
error
,
loading
,
moreToLoad
,
onLoadMore
canAddProjects
,
canEditOpenToAll
,
items
,
error
,
loading
,
moreToLoad
,
onLoadMore
...
@@ -28,6 +29,38 @@ const StudioProjects = ({
...
@@ -28,6 +29,38 @@ const StudioProjects = ({
data=
{
error
}
data=
{
error
}
/>
}
/>
}
<
div
className=
"studio-projects-grid"
>
<
div
className=
"studio-projects-grid"
>
{
items
.
length
===
0
&&
!
loading
?
(
<
div
className=
"studio-empty"
>
{
canAddProjects
?
(
<
React
.
Fragment
>
<
img
width=
"388"
height=
"265"
className=
"studio-empty-img"
src=
"/images/studios/projects-empty-can-add.png"
/>
<
div
className=
"studio-empty-msg"
>
<
div
><
FormattedMessage
id=
"studio.projectsEmptyCanAdd1"
/></
div
>
<
div
><
FormattedMessage
id=
"studio.projectsEmptyCanAdd2"
/></
div
>
</
div
>
</
React
.
Fragment
>
)
:
(
<
React
.
Fragment
>
<
img
width=
"186"
height=
"138"
className=
"studio-empty-img"
src=
"/images/studios/projects-empty.png"
/>
<
div
className=
"studio-empty-msg"
>
<
div
><
FormattedMessage
id=
"studio.projectsEmpty1"
/></
div
>
<
div
><
FormattedMessage
id=
"studio.projectsEmpty2"
/></
div
>
</
div
>
</
React
.
Fragment
>
)
}
</
div
>
)
:
(
<
React
.
Fragment
>
{
items
.
map
(
item
=>
{
items
.
map
(
item
=>
(<
StudioProjectTile
(<
StudioProjectTile
fetching=
{
loading
}
fetching=
{
loading
}
...
@@ -40,15 +73,20 @@ const StudioProjects = ({
...
@@ -40,15 +73,20 @@ const StudioProjects = ({
addedBy=
{
item
.
actor_id
}
addedBy=
{
item
.
actor_id
}
/>)
/>)
)
}
)
}
{
moreToLoad
&&
<
div
className=
"studio-projects-load-more"
>
<
div
className=
"studio-projects-load-more"
>
{
loading
?
<
small
>
Loading...
</
small
>
:
(
<
button
moreToLoad
?
className=
{
classNames
(
'
button
'
,
{
<
button
onClick=
{
onLoadMore
}
>
'
mod-mutating
'
:
loading
})
}
onClick=
{
onLoadMore
}
>
<
FormattedMessage
id=
"general.loadMore"
/>
<
FormattedMessage
id=
"general.loadMore"
/>
</
button
>
:
</
button
>
<
small
>
No more to load
</
small
>
)
}
</
div
>
</
div
>
}
</
React
.
Fragment
>
)
}
</
div
>
</
div
>
</
div
>
</
div
>
);
);
...
...
src/views/studio/studio.scss
View file @
c25fb3a9
...
@@ -236,6 +236,22 @@ $radius: 8px;
...
@@ -236,6 +236,22 @@ $radius: 8px;
}
}
}
}
.studio-empty
{
grid-column
:
1
/
-1
;
/* take up all columns */
text-align
:
center
;
.studio-empty-img
{
margin-top
:
45px
;
margin-bottom
:
25px
;
}
.studio-empty-msg
{
font-size
:
20px
;
line-height
:
30px
;
font-style
:
italic
;
}
}
/* Modification classes for different interaction states */
/* Modification classes for different interaction states */
.mod-fetching
{
/* When a field has no content to display yet */
.mod-fetching
{
/* When a field has no content to display yet */
position
:
relative
;
position
:
relative
;
...
...
static/images/studios/curators-empty.png
0 → 100644
View file @
c25fb3a9
14.9 KB
static/images/studios/projects-empty-can-add.png
0 → 100644
View file @
c25fb3a9
35.4 KB
static/images/studios/projects-empty.png
0 → 100644
View file @
c25fb3a9
7.72 KB
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