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
3d1bd376
Commit
3d1bd376
authored
May 13, 2021
by
DD Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace checkbox with toggle for whether studio is open to all
parent
cccc3abd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
12 deletions
+17
-12
src/views/studio/l10n.json
src/views/studio/l10n.json
+2
-0
src/views/studio/studio-open-to-all.jsx
src/views/studio/studio-open-to-all.jsx
+11
-10
src/views/studio/studio-projects.jsx
src/views/studio/studio-projects.jsx
+4
-2
No files found.
src/views/studio/l10n.json
View file @
3d1bd376
...
...
@@ -12,6 +12,8 @@
"studio.addProjectsHeader"
:
"Add Projects"
,
"studio.addProject"
:
"Add"
,
"studio.openToAll"
:
"Anyone can add projects"
,
"studio.projectsEmptyCanAdd1"
:
"Your studio is looking a little empty."
,
"studio.projectsEmptyCanAdd2"
:
"Add your first project!"
,
"studio.projectsEmpty1"
:
"This studio has no projects yet."
,
...
...
src/views/studio/studio-open-to-all.jsx
View file @
3d1bd376
...
...
@@ -2,12 +2,15 @@
import
React
from
'
react
'
;
import
PropTypes
from
'
prop-types
'
;
import
{
connect
}
from
'
react-redux
'
;
import
{
FormattedMessage
}
from
'
react-intl
'
;
import
{
selectStudioOpenToAll
,
selectIsFetchingInfo
}
from
'
../../redux/studio
'
;
import
{
mutateStudioOpenToAll
,
selectIsMutatingOpenToAll
,
selectOpenToAllMutationError
}
from
'
../../redux/studio-mutations
'
;
const
ToggleSlider
=
require
(
'
../../components/forms/toggle-slider.jsx
'
);
const
StudioOpenToAll
=
({
openToAllError
,
isFetching
,
isMutating
,
openToAll
,
handleUpdate
})
=>
(
...
...
@@ -16,16 +19,14 @@ const StudioOpenToAll = ({
<
h4
>
Fetching...
</
h4
>
)
:
(
<
div
>
<
label
>
<
input
disabled=
{
isMutating
}
type=
"checkbox"
checked=
{
openToAll
}
onChange=
{
e
=>
handleUpdate
(
e
.
target
.
checked
)
}
/>
<
span
>
{
openToAll
?
'
Open to all
'
:
'
Not open to all
'
}
</
span
>
{
openToAllError
&&
<
div
>
Error mutating openToAll:
{
openToAllError
}
</
div
>
}
</
label
>
<
FormattedMessage
id=
"studio.openToAll"
/>
<
ToggleSlider
disabled=
{
isMutating
}
checked=
{
openToAll
}
className=
"open-to-all-input"
onChange=
{
e
=>
handleUpdate
(
e
.
target
.
checked
)
}
/>
{
openToAllError
&&
<
div
>
Error mutating openToAll:
{
openToAllError
}
</
div
>
}
</
div
>
)
}
</
div
>
...
...
src/views/studio/studio-projects.jsx
View file @
3d1bd376
...
...
@@ -21,8 +21,10 @@ const StudioProjects = ({
return
(
<
div
className=
"studio-projects"
>
<
h2
><
FormattedMessage
id=
"studio.projectsHeader"
/></
h2
>
{
canEditOpenToAll
&&
<
StudioOpenToAll
/>
}
<
div
className=
"studio-header-container"
>
<
h2
><
FormattedMessage
id=
"studio.projectsHeader"
/></
h2
>
{
canEditOpenToAll
&&
<
StudioOpenToAll
/>
}
</
div
>
{
canAddProjects
&&
<
StudioProjectAdder
/>
}
{
error
&&
<
Debug
label=
"Error"
...
...
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