Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
C
cms
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Pedro-dev_2
cms
Commits
6c0e4a98
Commit
6c0e4a98
authored
May 23, 2021
by
PDuarte
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
project - languages based UI
parent
1e9f9147
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
66 additions
and
12 deletions
+66
-12
index.js
src/views/playlists/projectplaylists/card/index.js
+4
-3
index.js
src/views/settings/projects/edit/index.js
+4
-4
plataform.js
src/views/settings/projects/edit/plataform.js
+1
-1
projectCard.js
src/views/settings/projects/edit/projectCard.js
+57
-4
No files found.
src/views/playlists/projectplaylists/card/index.js
View file @
6c0e4a98
...
...
@@ -5,7 +5,7 @@ import { useSelector, useDispatch } from 'react-redux'
import
{
toast
}
from
'react-toastify'
import
Avatar
from
'@components/avatar'
import
{
Media
,
Button
,
Label
,
Form
,
FormGroup
,
Input
,
Table
,
CustomInput
,
Card
,
CardBody
,
Row
,
Col
,
Nav
,
NavItem
,
NavLink
,
TabContent
,
TabPane
,
Alert
,
CardHeader
,
CardTitle
,
CardText
}
from
'reactstrap'
import
{
Spinner
,
Media
,
Button
,
Label
,
Form
,
FormGroup
,
Input
,
Table
,
CustomInput
,
Card
,
CardBody
,
Row
,
Col
,
Nav
,
NavItem
,
NavLink
,
TabContent
,
TabPane
,
Alert
,
CardHeader
,
CardTitle
,
CardText
}
from
'reactstrap'
import
{
isObjEmpty
}
from
'@utils'
...
...
@@ -236,6 +236,7 @@ return (
value
=
{
option
.
id
}
>
{
option
.
name
}
<
/option
>
})
:
<
option
>
Loading
<
/option>
}
<
/Input>
<
/FormGroup
>
<
/Col
>
<
Col
md
=
'4'
sm
=
'12'
>
...
...
src/views/settings/projects/edit/index.js
View file @
6c0e4a98
...
...
@@ -24,11 +24,11 @@ const Tables = () => {
<
/Row
>
<
Row
>
<
Col
sm
=
'12'
>
<
div
class
=
"card"
>
<
div
class
=
"card-header"
>
<
h4
class
=
"card-title"
>
Project
<
/h4
>
<
div
class
Name
=
"card"
>
<
div
class
Name
=
"card-header"
>
<
h4
class
Name
=
"card-title"
>
Project
<
/h4
>
<
/div
>
<
div
class
=
"card-body"
>
<
div
class
Name
=
"card-body"
>
<
ProjectsEdit
/>
<
/div
>
<
/div
>
...
...
src/views/settings/projects/edit/plataform.js
View file @
6c0e4a98
...
...
@@ -57,7 +57,7 @@ const ProjectPlatform = ({dataElement, setElement, store}) => {
}
return
!!
dataElement
?
(
<
div
clssName
=
'permissions border mt-1'
>
<
div
cl
a
ssName
=
'permissions border mt-1'
>
<
h6
className
=
'py-1 mx-1 mb-0 font-medium-2'
>
<
Lock
size
=
{
18
}
className
=
'mr-25'
/>
<
span
className
=
'align-middle'
>
Platforms
<
/span
>
...
...
src/views/settings/projects/edit/projectCard.js
View file @
6c0e4a98
...
...
@@ -4,11 +4,13 @@ import { useSelector, useDispatch } from 'react-redux'
import
{
toast
}
from
'react-toastify'
import
Avatar
from
'@components/avatar'
import
Select
,
{
components
}
from
'react-select'
import
{
Media
,
Button
,
Label
,
Form
,
FormGroup
,
Input
,
Table
,
CustomInput
,
Card
,
CardBody
,
Row
,
Col
,
Nav
,
NavItem
,
NavLink
,
TabContent
,
TabPane
,
Alert
,
CardHeader
,
CardTitle
,
CardText
}
from
'reactstrap'
import
{
isObjEmpty
}
from
'@utils'
import
{
isObjEmpty
,
selectThemeColors
}
from
'@utils'
import
{
Bell
,
Check
,
X
,
AlertTriangle
,
Info
}
from
'react-feather'
import
{
Bell
,
Check
,
X
,
AlertTriangle
,
Info
,
Flag
}
from
'react-feather'
// ** Store & Actions
...
...
@@ -60,6 +62,7 @@ const handleError = (text) => {
}
const
[
dataProject
,
setProjectData
]
=
useState
(
null
),
[
projectLang
,
setProjectLang
]
=
useState
(
null
),
{
register
,
errors
,
handleSubmit
}
=
useForm
(),
dispatch
=
useDispatch
(),
notifySuccessProgress
=
()
=>
toast
.
success
(
<
SuccessProgressToast
/>
),
...
...
@@ -80,10 +83,41 @@ const handleError = (text) => {
onSubmitHandler
(
submitProject
)
}
}
const
langOptions
=
[
{
value
:
'English'
,
label
:
'English'
},
{
value
:
'Spanish'
,
label
:
'Spanish'
},
{
value
:
'German'
,
label
:
'German'
}
]
const
langOnChange
=
(
value
,
{
action
,
removedValue
})
=>
{
switch
(
action
)
{
case
'remove-value'
:
case
'pop-value'
:
if
(
removedValue
.
isFixed
)
{
return
}
setProjectLang
(
value
)
break
case
'clear'
:
value
=
langOptions
.
filter
(
v
=>
v
.
isFixed
)
setProjectLang
(
value
)
break
default
:
setProjectLang
(
value
)
break
}
}
useEffect
(()
=>
{
if
(
selectedProject
!==
null
||
(
selectedProject
!==
null
&&
dataProject
!==
null
&&
selectedProject
.
id
!==
dataProject
.
id
))
{
const
langActive
=
langOptions
.
filter
(
lang
=>
{
return
selectedProject
.
languages
.
filter
(
elm
=>
{
return
elm
.
name
===
lang
.
value
}).
length
>
0
})
console
.
log
(
langActive
)
setProjectLang
(
langActive
)
return
setProjectData
(
selectedProject
)
}
},
[
selectedProject
])
...
...
@@ -102,7 +136,6 @@ const handleError = (text) => {
}
},
[
store
.
saveSucces
])
return
(
<
Fragment
>
<
Form
...
...
@@ -168,6 +201,26 @@ return (
</FormGroup>
</Col> */
}
<
Col
sm
=
'12'
>
<
/Col
>
<
Col
className
=
'mb-1'
md
=
'12'
sm
=
'12'
>
<
h6
className
=
"py-1 mx-1 mb-0 font-medium-2"
><
Flag
/>
Languages
<
/h6
>
<
Select
isClearable
=
{
false
}
theme
=
{
selectThemeColors
}
value
=
{
projectLang
}
isMulti
name
=
'languages'
options
=
{
langOptions
}
onChange
=
{
langOnChange
}
className
=
'react-select'
classNamePrefix
=
'select'
/>
<
/Col
>
<
Col
sm
=
'12'
>
<
/Col>
<
Col
sm
=
'12'
>
<
ProjectPlatform
dataElement
=
{
dataProject
}
setElement
=
{
setProjectData
}
store
=
{
store
}
/
>
<
/Col
>
...
...
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