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
Show 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 @@
...
@@ -12,6 +12,8 @@
"studio.addProjectsHeader"
:
"Add Projects"
,
"studio.addProjectsHeader"
:
"Add Projects"
,
"studio.addProject"
:
"Add"
,
"studio.addProject"
:
"Add"
,
"studio.openToAll"
:
"Anyone can add projects"
,
"studio.projectsEmptyCanAdd1"
:
"Your studio is looking a little empty."
,
"studio.projectsEmptyCanAdd1"
:
"Your studio is looking a little empty."
,
"studio.projectsEmptyCanAdd2"
:
"Add your first project!"
,
"studio.projectsEmptyCanAdd2"
:
"Add your first project!"
,
"studio.projectsEmpty1"
:
"This studio has no projects yet."
,
"studio.projectsEmpty1"
:
"This studio has no projects yet."
,
...
...
src/views/studio/studio-open-to-all.jsx
View file @
3d1bd376
...
@@ -2,12 +2,15 @@
...
@@ -2,12 +2,15 @@
import
React
from
'
react
'
;
import
React
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
{
selectStudioOpenToAll
,
selectIsFetchingInfo
}
from
'
../../redux/studio
'
;
import
{
selectStudioOpenToAll
,
selectIsFetchingInfo
}
from
'
../../redux/studio
'
;
import
{
import
{
mutateStudioOpenToAll
,
selectIsMutatingOpenToAll
,
selectOpenToAllMutationError
mutateStudioOpenToAll
,
selectIsMutatingOpenToAll
,
selectOpenToAllMutationError
}
from
'
../../redux/studio-mutations
'
;
}
from
'
../../redux/studio-mutations
'
;
const
ToggleSlider
=
require
(
'
../../components/forms/toggle-slider.jsx
'
);
const
StudioOpenToAll
=
({
const
StudioOpenToAll
=
({
openToAllError
,
isFetching
,
isMutating
,
openToAll
,
handleUpdate
openToAllError
,
isFetching
,
isMutating
,
openToAll
,
handleUpdate
})
=>
(
})
=>
(
...
@@ -16,16 +19,14 @@ const StudioOpenToAll = ({
...
@@ -16,16 +19,14 @@ const StudioOpenToAll = ({
<
h4
>
Fetching...
</
h4
>
<
h4
>
Fetching...
</
h4
>
)
:
(
)
:
(
<
div
>
<
div
>
<
label
>
<
FormattedMessage
id=
"studio.openToAll"
/
>
<
input
<
ToggleSlider
disabled=
{
isMutating
}
disabled=
{
isMutating
}
type=
"checkbox"
checked=
{
openToAll
}
checked=
{
openToAll
}
className=
"open-to-all-input"
onChange=
{
e
=>
handleUpdate
(
e
.
target
.
checked
)
}
onChange=
{
e
=>
handleUpdate
(
e
.
target
.
checked
)
}
/>
/>
<
span
>
{
openToAll
?
'
Open to all
'
:
'
Not open to all
'
}
</
span
>
{
openToAllError
&&
<
div
>
Error mutating openToAll:
{
openToAllError
}
</
div
>
}
{
openToAllError
&&
<
div
>
Error mutating openToAll:
{
openToAllError
}
</
div
>
}
</
label
>
</
div
>
</
div
>
)
}
)
}
</
div
>
</
div
>
...
...
src/views/studio/studio-projects.jsx
View file @
3d1bd376
...
@@ -21,8 +21,10 @@ const StudioProjects = ({
...
@@ -21,8 +21,10 @@ const StudioProjects = ({
return
(
return
(
<
div
className=
"studio-projects"
>
<
div
className=
"studio-projects"
>
<
div
className=
"studio-header-container"
>
<
h2
><
FormattedMessage
id=
"studio.projectsHeader"
/></
h2
>
<
h2
><
FormattedMessage
id=
"studio.projectsHeader"
/></
h2
>
{
canEditOpenToAll
&&
<
StudioOpenToAll
/>
}
{
canEditOpenToAll
&&
<
StudioOpenToAll
/>
}
</
div
>
{
canAddProjects
&&
<
StudioProjectAdder
/>
}
{
canAddProjects
&&
<
StudioProjectAdder
/>
}
{
error
&&
<
Debug
{
error
&&
<
Debug
label=
"Error"
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