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
Show 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) => {
...
@@ -90,19 +90,12 @@ const handleError = (text) => {
}
}
},
},
handleAddBlock
=
()
=>
{
handleTextualChange
=
value
=>
{
if
(
!
dataElement
)
return
const
newData
=
{
...
dataElement
,
const
newData
=
dataElement
textual
:
value
newData
.
menu_page_layouts
.
push
({
}
id
:
'<generated>'
,
layout_id
:
null
,
order
:
1
,
page_id
:
dataElement
.
id
})
setElementData
(
newData
)
setElementData
(
newData
)
setActiveTab
(
newData
.
menu_page_layouts
.
length
-
1
)
console
.
log
(
newData
)
}
}
...
@@ -268,7 +261,10 @@ return (
...
@@ -268,7 +261,10 @@ return (
>
>
<
TabPane
tabId
=
{
0
}
>
<
TabPane
tabId
=
{
0
}
>
<
TextualBlock
dataElement
=
{
dataElement
&&
dataElement
.
textual
}
/
>
<
TextualBlock
dataElement
=
{
dataElement
&&
dataElement
.
textual
}
handleTextualChange
=
{
handleTextualChange
}
/
>
<
/TabPane
>
<
/TabPane
>
<
/TabContent>
<
/TabContent>
<
/CardBody>
<
/CardBody>
...
...
src/views/assets/projectassets/card/textual.js
View file @
f90344cb
...
@@ -6,7 +6,12 @@ import {getProject} from '../../../settings/store/actions'
...
@@ -6,7 +6,12 @@ import {getProject} from '../../../settings/store/actions'
import
{
Card
,
CardBody
,
Row
,
Col
,
CardHeader
,
CardTitle
,
Label
,
Input
,
FormGroup
,
CardText
}
from
'reactstrap'
import
{
Card
,
CardBody
,
Row
,
Col
,
CardHeader
,
CardTitle
,
Label
,
Input
,
FormGroup
,
CardText
}
from
'reactstrap'
import
{
languages
}
from
'prismjs'
import
{
languages
}
from
'prismjs'
const
PlanLang
=
({
language
,
dataElement
})
=>
{
const
PlanLang
=
({
language
,
dataElement
,
LangChange
})
=>
{
const
handleInputChange
=
(
value
,
field
)
=>
{
dataElement
[
field
]
=
value
LangChange
(
dataElement
)
}
return
<
Fragment
>
return
<
Fragment
>
<
CardTitle
tag
=
"h5"
>
{
language
.
name
}
Textual
<
/CardTitle
>
<
CardTitle
tag
=
"h5"
>
{
language
.
name
}
Textual
<
/CardTitle
>
<
Col
md
=
'12'
sm
=
'12'
>
<
Col
md
=
'12'
sm
=
'12'
>
...
@@ -19,6 +24,7 @@ const PlanLang = ({language, dataElement}) => {
...
@@ -19,6 +24,7 @@ const PlanLang = ({language, dataElement}) => {
// innerRef={register({ required: true })}
// innerRef={register({ required: true })}
placeholder
=
'title'
placeholder
=
'title'
defaultValue
=
{
dataElement
&&
dataElement
.
title
}
defaultValue
=
{
dataElement
&&
dataElement
.
title
}
onChange
=
{(
e
)
=>
handleInputChange
(
e
.
target
.
value
,
'title'
)}
// className={classnames({ 'is-invalid': errors['title'] })}
// className={classnames({ 'is-invalid': errors['title'] })}
/
>
/
>
<
/FormGroup
>
<
/FormGroup
>
...
@@ -33,6 +39,7 @@ const PlanLang = ({language, dataElement}) => {
...
@@ -33,6 +39,7 @@ const PlanLang = ({language, dataElement}) => {
// innerRef={register({ required: true })}
// innerRef={register({ required: true })}
placeholder
=
'longdescription'
placeholder
=
'longdescription'
defaultValue
=
{
dataElement
&&
dataElement
.
longdescription
}
defaultValue
=
{
dataElement
&&
dataElement
.
longdescription
}
onChange
=
{(
e
)
=>
handleInputChange
(
e
.
target
.
value
,
'longdescription'
)}
// className={classnames({ 'is-invalid': errors['shortdescriptions'] })}
// className={classnames({ 'is-invalid': errors['shortdescriptions'] })}
/
>
/
>
<
/FormGroup
>
<
/FormGroup
>
...
@@ -47,6 +54,8 @@ const PlanLang = ({language, dataElement}) => {
...
@@ -47,6 +54,8 @@ const PlanLang = ({language, dataElement}) => {
// innerRef={register({ required: true })}
// innerRef={register({ required: true })}
placeholder
=
'shortdescriptions'
placeholder
=
'shortdescriptions'
defaultValue
=
{
dataElement
&&
dataElement
.
shortdescriptions
}
defaultValue
=
{
dataElement
&&
dataElement
.
shortdescriptions
}
onChange
=
{(
e
)
=>
handleInputChange
(
e
.
target
.
value
,
'shortdescriptions'
)}
// className={classnames({ 'is-invalid': errors['shortdescriptions'] })}
// className={classnames({ 'is-invalid': errors['shortdescriptions'] })}
/
>
/
>
<
/FormGroup
>
<
/FormGroup
>
...
@@ -54,9 +63,12 @@ const PlanLang = ({language, dataElement}) => {
...
@@ -54,9 +63,12 @@ const PlanLang = ({language, dataElement}) => {
<
/Fragment
>
<
/Fragment
>
}
}
const
TextualBlock
=
({
dataElement
})
=>
{
const
TextualBlock
=
({
dataElement
,
handleTextualChange
})
=>
{
const
store
=
useSelector
(
state
=>
state
.
projectsettings
),
const
store
=
useSelector
(
state
=>
state
.
projectsettings
),
dispatch
=
useDispatch
()
dispatch
=
useDispatch
(),
handleLangChange
=
()
=>
{
handleTextualChange
(
dataElement
)
}
// populate layout menus
// populate layout menus
useEffect
(()
=>
{
useEffect
(()
=>
{
...
@@ -84,9 +96,14 @@ const TextualBlock = ({dataElement}) => {
...
@@ -84,9 +96,14 @@ const TextualBlock = ({dataElement}) => {
title
:
''
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