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
f90344cb
Commit
f90344cb
authored
May 22, 2021
by
PDuarte
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
asset textual UI ok
parent
98f489d0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
19 deletions
+32
-19
index.js
src/views/assets/projectassets/card/index.js
+10
-14
textual.js
src/views/assets/projectassets/card/textual.js
+22
-5
No files found.
src/views/assets/projectassets/card/index.js
View file @
f90344cb
...
...
@@ -90,19 +90,12 @@ const handleError = (text) => {
}
},
handleAddBlock
=
()
=>
{
if
(
!
dataElement
)
return
const
newData
=
dataElement
newData
.
menu_page_layouts
.
push
({
id
:
'<generated>'
,
layout_id
:
null
,
order
:
1
,
page_id
:
dataElement
.
id
})
setElementData
(
newData
)
setActiveTab
(
newData
.
menu_page_layouts
.
length
-
1
)
console
.
log
(
newData
)
handleTextualChange
=
value
=>
{
const
newData
=
{
...
dataElement
,
textual
:
value
}
setElementData
(
newData
)
}
...
...
@@ -268,7 +261,10 @@ return (
>
<
TabPane
tabId
=
{
0
}
>
<
TextualBlock
dataElement
=
{
dataElement
&&
dataElement
.
textual
}
/
>
<
TextualBlock
dataElement
=
{
dataElement
&&
dataElement
.
textual
}
handleTextualChange
=
{
handleTextualChange
}
/
>
<
/TabPane
>
<
/TabContent>
<
/CardBody>
...
...
src/views/assets/projectassets/card/textual.js
View file @
f90344cb
...
...
@@ -6,7 +6,12 @@ import {getProject} from '../../../settings/store/actions'
import
{
Card
,
CardBody
,
Row
,
Col
,
CardHeader
,
CardTitle
,
Label
,
Input
,
FormGroup
,
CardText
}
from
'reactstrap'
import
{
languages
}
from
'prismjs'
const
PlanLang
=
({
language
,
dataElement
})
=>
{
const
PlanLang
=
({
language
,
dataElement
,
LangChange
})
=>
{
const
handleInputChange
=
(
value
,
field
)
=>
{
dataElement
[
field
]
=
value
LangChange
(
dataElement
)
}
return
<
Fragment
>
<
CardTitle
tag
=
"h5"
>
{
language
.
name
}
Textual
<
/CardTitle
>
<
Col
md
=
'12'
sm
=
'12'
>
...
...
@@ -19,6 +24,7 @@ const PlanLang = ({language, dataElement}) => {
// innerRef={register({ required: true })}
placeholder
=
'title'
defaultValue
=
{
dataElement
&&
dataElement
.
title
}
onChange
=
{(
e
)
=>
handleInputChange
(
e
.
target
.
value
,
'title'
)}
// className={classnames({ 'is-invalid': errors['title'] })}
/
>
<
/FormGroup
>
...
...
@@ -33,6 +39,7 @@ const PlanLang = ({language, dataElement}) => {
// innerRef={register({ required: true })}
placeholder
=
'longdescription'
defaultValue
=
{
dataElement
&&
dataElement
.
longdescription
}
onChange
=
{(
e
)
=>
handleInputChange
(
e
.
target
.
value
,
'longdescription'
)}
// className={classnames({ 'is-invalid': errors['shortdescriptions'] })}
/
>
<
/FormGroup
>
...
...
@@ -47,6 +54,8 @@ const PlanLang = ({language, dataElement}) => {
// innerRef={register({ required: true })}
placeholder
=
'shortdescriptions'
defaultValue
=
{
dataElement
&&
dataElement
.
shortdescriptions
}
onChange
=
{(
e
)
=>
handleInputChange
(
e
.
target
.
value
,
'shortdescriptions'
)}
// className={classnames({ 'is-invalid': errors['shortdescriptions'] })}
/
>
<
/FormGroup
>
...
...
@@ -54,9 +63,12 @@ const PlanLang = ({language, dataElement}) => {
<
/Fragment
>
}
const
TextualBlock
=
({
dataElement
})
=>
{
const
TextualBlock
=
({
dataElement
,
handleTextualChange
})
=>
{
const
store
=
useSelector
(
state
=>
state
.
projectsettings
),
dispatch
=
useDispatch
()
dispatch
=
useDispatch
(),
handleLangChange
=
()
=>
{
handleTextualChange
(
dataElement
)
}
// populate layout menus
useEffect
(()
=>
{
...
...
@@ -84,9 +96,14 @@ const TextualBlock = ({dataElement}) => {
title
:
''
}
]
console
.
log
(
textuals
)
}
return
<
PlanLang
key
=
{
language
.
id
}
language
=
{
language
}
dataElement
=
{
textuals
[
0
]}
/
>
return
<
PlanLang
key
=
{
language
.
id
}
language
=
{
language
}
dataElement
=
{
textuals
[
0
]}
LangChange
=
{
handleLangChange
}
/
>
}
)}
...
...
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