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
38aa7fd8
Commit
38aa7fd8
authored
Apr 22, 2021
by
PDuarte
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improvemens
parent
6ee4cc5f
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
405 additions
and
182 deletions
+405
-182
.env
.env
+3
-3
.env.production
.env.production
+0
-4
package.json
package.json
+1
-1
rootReducer.js
src/redux/reducers/rootReducer.js
+2
-2
TableServerSide.js
src/views/settings/projects/TableServerSide.js
+1
-1
data.js
src/views/settings/projects/data.js
+1
-1
index.js
src/views/settings/projects/edit/index.js
+151
-162
plataform.js
src/views/settings/projects/edit/plataform.js
+60
-0
projectCard.js
src/views/settings/projects/edit/projectCard.js
+178
-0
index.js
src/views/settings/store/actions/index.js
+3
-5
index.js
src/views/settings/store/reducer/index.js
+5
-3
No files found.
.env
View file @
38aa7fd8
SKIP_PREFLIGHT_CHECK=true
SKIP_PREFLIGHT_CHECK=true
REACT_APP_BASENAME=
"/cms/"
REACT_APP_BASENAME=
/cms
REACT_APP_API
2
="http://192.168.99.100:8001/cms"
REACT_APP_API="http://192.168.99.100:8001/cms"
REACT_APP_API="http://134.209.18.22/cmsapi"
REACT_APP_API
1
="http://134.209.18.22/cmsapi"
.env.production
deleted
100644 → 0
View file @
6ee4cc5f
SKIP_PREFLIGHT_CHECK=true
REACT_APP_BASENAME= "/cms/"
REACT_APP_API2="http://192.168.99.100:8001/cms"
REACT_APP_API="http://134.209.18.22/cmsapi"
package.json
View file @
38aa7fd8
...
@@ -92,7 +92,7 @@
...
@@ -92,7 +92,7 @@
},
},
"scripts"
:
{
"scripts"
:
{
"start"
:
"react-app-rewired start"
,
"start"
:
"react-app-rewired start"
,
"build"
:
"env-cmd -f .env.production react-app-rewired build"
,
"build"
:
"env-cmd -f .env.production
.local
react-app-rewired build"
,
"test"
:
"react-app-rewired test"
,
"test"
:
"react-app-rewired test"
,
"eject"
:
"react-app-rewired eject"
,
"eject"
:
"react-app-rewired eject"
,
"lint"
:
"eslint src/**/*.js src/**/*.jsx"
,
"lint"
:
"eslint src/**/*.js src/**/*.jsx"
,
...
...
src/redux/reducers/rootReducer.js
View file @
38aa7fd8
...
@@ -14,7 +14,7 @@ import calendar from '@src/views/apps/calendar/store/reducer'
...
@@ -14,7 +14,7 @@ import calendar from '@src/views/apps/calendar/store/reducer'
import
ecommerce
from
'@src/views/apps/ecommerce/store/reducer'
import
ecommerce
from
'@src/views/apps/ecommerce/store/reducer'
import
dataTables
from
'@src/views/tables/data-tables/store/reducer'
import
dataTables
from
'@src/views/tables/data-tables/store/reducer'
import
S
ettings
from
'@src/views/settings/store/reducer'
import
s
ettings
from
'@src/views/settings/store/reducer'
const
rootReducer
=
combineReducers
({
const
rootReducer
=
combineReducers
({
auth
,
auth
,
...
@@ -28,7 +28,7 @@ const rootReducer = combineReducers({
...
@@ -28,7 +28,7 @@ const rootReducer = combineReducers({
calendar
,
calendar
,
ecommerce
,
ecommerce
,
dataTables
,
dataTables
,
S
ettings
s
ettings
})
})
export
default
rootReducer
export
default
rootReducer
src/views/settings/projects/TableServerSide.js
View file @
38aa7fd8
...
@@ -17,7 +17,7 @@ import { Card, CardHeader, CardTitle, Input, Label, Row, Col } from 'reactstrap'
...
@@ -17,7 +17,7 @@ import { Card, CardHeader, CardTitle, Input, Label, Row, Col } from 'reactstrap'
const
DataTableServerSide
=
()
=>
{
const
DataTableServerSide
=
()
=>
{
// ** Store Vars
// ** Store Vars
const
dispatch
=
useDispatch
()
const
dispatch
=
useDispatch
()
const
store
=
useSelector
(
state
=>
state
.
S
ettings
)
const
store
=
useSelector
(
state
=>
state
.
s
ettings
)
// ** States
// ** States
const
[
currentPage
,
setCurrentPage
]
=
useState
(
1
)
const
[
currentPage
,
setCurrentPage
]
=
useState
(
1
)
...
...
src/views/settings/projects/data.js
View file @
38aa7fd8
...
@@ -259,7 +259,7 @@ export const serverSideColumns = [
...
@@ -259,7 +259,7 @@ export const serverSideColumns = [
<
Link
<
Link
to
=
{
`/settings/projects/edit/
${
row
.
id
}
`
}
to
=
{
`/settings/projects/edit/
${
row
.
id
}
`
}
className
=
'user-name text-truncate mb-0'
className
=
'user-name text-truncate mb-0'
onClick
=
{()
=>
store
.
dispatch
(
getProject
(
row
.
id
))}
//
onClick={() => store.dispatch(getProject(row.id))}
>
>
<
span
className
=
'font-weight-bold'
>
{
row
.
app_name
}
<
/span
>
<
span
className
=
'font-weight-bold'
>
{
row
.
app_name
}
<
/span
>
<
/Link
>
<
/Link
>
...
...
src/views/settings/projects/edit/index.js
View file @
38aa7fd8
...
@@ -3,12 +3,8 @@ import { useParams, Link } from 'react-router-dom'
...
@@ -3,12 +3,8 @@ import { useParams, Link } from 'react-router-dom'
// ** Store & Actions
// ** Store & Actions
import
{
getProject
,
updateProject
}
from
'../../store/actions'
import
{
getProject
,
updateProject
}
from
'../../store/actions'
import
{
store
}
from
'@store/storeConfig/store'
import
{
useSelector
,
useDispatch
}
from
'react-redux'
import
{
useSelector
,
useDispatch
}
from
'react-redux'
import
{
useForm
}
from
'react-hook-form'
import
classnames
from
'classnames'
// ** Utils
// ** Utils
import
{
isObjEmpty
}
from
'@utils'
import
{
isObjEmpty
}
from
'@utils'
...
@@ -16,183 +12,176 @@ import { isObjEmpty } from '@utils'
...
@@ -16,183 +12,176 @@ import { isObjEmpty } from '@utils'
import
{
Lock
,
Edit
,
Trash2
}
from
'react-feather'
import
{
Lock
,
Edit
,
Trash2
}
from
'react-feather'
import
{
Media
,
Button
,
Label
,
Form
,
FormGroup
,
Input
,
Table
,
CustomInput
,
Card
,
CardBody
,
Row
,
Col
,
Nav
,
NavItem
,
NavLink
,
TabContent
,
TabPane
,
Alert
}
from
'reactstrap'
import
{
Media
,
Button
,
Label
,
Form
,
FormGroup
,
Input
,
Table
,
CustomInput
,
Card
,
CardBody
,
Row
,
Col
,
Nav
,
NavItem
,
NavLink
,
TabContent
,
TabPane
,
Alert
}
from
'reactstrap'
import
{
isEmptyObject
}
from
'jquery'
import
ProjectCard
from
'./projectCard'
import
ProjectPlatform
from
'./plataform'
import
{
useForm
}
from
'react-hook-form'
import
classnames
from
'classnames'
const
ProjectsEdit
=
()
=>
{
const
ProjectsEdit
=
()
=>
{
// ** States & Vars
// ** States & Vars
const
[
activeTab
,
setActiveTab
]
=
useState
(
'1'
),
const
store
=
useSelector
(
state
=>
state
.
settings
),
storeSettings
=
useSelector
(
state
=>
state
.
Settings
),
[
dataProject
,
setProjectData
]
=
useState
(
null
),
[
ProjectData
,
setProjectData
]
=
useState
(
null
),
{
register
,
errors
,
handleSubmit
}
=
useForm
(),
dispatch
=
useDispatch
(),
dispatch
=
useDispatch
(),
{
id
}
=
useParams
()
{
id
}
=
useParams
()
// ** Function to toggle tabs
const
toggle
=
tab
=>
setActiveTab
(
tab
)
// ** Vars
const
{
register
,
errors
,
handleSubmit
}
=
useForm
()
// ** Function to handle form submit
const
onSubmit
=
values
=>
{
if
(
isObjEmpty
(
errors
))
{
dispatch
(
updateProject
({
id
:
values
.
id
,
app_name
:
values
.
app_name
,
customer_name
:
values
.
customer_name
})
)
}
}
// ** Function to get user on mount
// ** Function to get user on mount
useEffect
(()
=>
{
useEffect
(()
=>
{
console
.
log
(
'eff'
)
// console.log('eff')
console
.
log
(
storeSettings
.
selectedProject
)
// console.log(store.selectedProject)
// if (storeSettings.selectedProject === null && storeSettings.selectedProject !== undefined)
dispatch
(
getProject
(
id
))
store
.
dispatch
(
getProject
(
parseInt
(
id
)))
},
[
dispatch
])
},
[
dispatch
])
// ** Update user image on mount or change
useEffect
(()
=>
{
if
(
store
.
selectedProject
!==
null
||
(
store
.
selectedProject
!==
null
&&
dataProject
!==
null
&&
store
.
selectedProject
.
id
!==
dataProject
.
id
))
{
return
setProjectData
(
store
.
selectedProject
)
}
},
[
store
.
selectedProject
])
return
store
Settings
.
selectedProject
!==
null
&&
storeSettings
.
selectedProject
!==
undefined
?
(
return
store
.
selectedProject
!==
null
&&
store
.
selectedProject
!==
undefined
?
(
<
Row
>
<
Row
>
<
Col
sm
=
'12'
>
<
Col
sm
=
'12'
>
<
Form
onSubmit
=
{
handleSubmit
(
onSubmit
)}
>
<
Form
<
Row
>
// onSubmit={handleSubmit(onSubmit)}
<
Col
md
=
'4'
sm
=
'12'
>
>
<
FormGroup
>
<
Row
>
<
Label
for
=
'email'
>
ID
<
/Label
>
<
Col
md
=
'4'
sm
=
'12'
>
<
Input
<
FormGroup
>
readOnly
=
{
true
}
<
Label
for
=
'email'
>
ID
<
/Label
>
type
=
'text'
<
Input
name
=
'id'
readOnly
=
{
true
}
id
=
'id'
type
=
'text'
innerRef
=
{
register
({
required
:
true
})}
name
=
'id'
placeholder
=
''
id
=
'id'
defaultValue
=
{
id
}
innerRef
=
{
register
({
required
:
true
})}
/
>
placeholder
=
'id'
<
/FormGroup
>
defaultValue
=
{
id
}
<
/Col
>
/
>
<
Col
md
=
'4'
sm
=
'12'
>
<
/FormGroup
>
<
FormGroup
>
<
/Col
>
<
Label
for
=
'app_name'
>
Project
Name
<
/Label
>
<
Col
md
=
'4'
sm
=
'12'
>
<
Input
<
FormGroup
>
type
=
'text'
<
Label
for
=
'app_name'
>
Project
Name
<
/Label
>
name
=
'app_name'
<
Input
id
=
'app_name'
type
=
'text'
innerRef
=
{
register
({
required
:
true
})}
name
=
'app_name'
placeholder
=
'Project Name'
id
=
'app_name'
defaultValue
=
{
storeSettings
.
selectedProject
&&
storeSettings
.
selectedProject
.
data
.
app_name
}
innerRef
=
{
register
({
required
:
true
})}
className
=
{
classnames
({
'is-invalid'
:
errors
[
'app_name'
]
})}
placeholder
=
'Project Name'
/
>
defaultValue
=
{
dataProject
&&
dataProject
.
app_name
}
<
/FormGroup
>
className
=
{
classnames
({
'is-invalid'
:
errors
[
'app_name'
]
})}
<
/Col
>
/
>
<
Col
md
=
'4'
sm
=
'12'
>
<
/FormGroup
>
<
FormGroup
>
<
/Col
>
<
Label
for
=
'customer_name'
>
Client
Name
<
/Label
>
<
Col
md
=
'4'
sm
=
'12'
>
<
Input
<
FormGroup
>
type
=
'text'
<
Label
for
=
'customer_name'
>
Client
Name
<
/Label
>
name
=
'customer_name'
<
Input
id
=
'customer_name'
type
=
'text'
innerRef
=
{
register
({
required
:
true
})}
name
=
'customer_name'
placeholder
=
'Client Name'
id
=
'customer_name'
defaultValue
=
{
storeSettings
.
selectedProject
&&
storeSettings
.
selectedProject
.
data
.
customer_name
}
innerRef
=
{
register
({
required
:
true
})}
className
=
{
classnames
({
'is-invalid'
:
errors
[
'customer_name'
]
})}
placeholder
=
'Client Name'
/
>
defaultValue
=
{
dataProject
&&
dataProject
.
customer_name
}
<
/FormGroup
>
className
=
{
classnames
({
'is-invalid'
:
errors
[
'customer_name'
]
})}
<
/Col
>
/
>
{
/* <Col md='4' sm='12'>
<
/FormGroup
>
<FormGroup>
<
/Col
>
<Label for='email'>Email</Label>
{
/* <Col md='4' sm='12'>
<Input disabled='disabled' type='text' id='email' placeholder='Email' defaultValue={ProjectData && ProjectData.email} />
<FormGroup>
</FormGroup>
<Label for='email'>Email</Label>
</Col> */
}
<Input disabled='disabled' type='text' id='email' placeholder='Email' defaultValue={ProjectData && ProjectData.email} />
{
/* <Col md='4' sm='12'>
</FormGroup>
<FormGroup>
</Col> */
}
<Label for='status'>Status</Label>
{
/* <Col md='4' sm='12'>
<Input type='select' name='status' id='status' defaultValue={ProjectData && ProjectData.status}>
<FormGroup>
<option value='pending'>Pending</option>
<Label for='status'>Status</Label>
<option value='active'>Active</option>
<Input type='select' name='status' id='status' defaultValue={ProjectData && ProjectData.status}>
<option value='inactive'>Inactive</option>
<option value='pending'>Pending</option>
</Input>
<option value='active'>Active</option>
</FormGroup>
<option value='inactive'>Inactive</option>
</Col> */
}
</Input>
</FormGroup>
</Col> */
}
<
Col
sm
=
'6'
>
<
Col
sm
=
'6'
>
<
div
className
=
'permissions border mt-1'
>
<
div
className
=
'permissions border mt-1'
>
<
h6
className
=
'py-1 mx-1 mb-0 font-medium-2'
>
<
h6
className
=
'py-1 mx-1 mb-0 font-medium-2'
>
<
Lock
size
=
{
18
}
className
=
'mr-25'
/>
<
Lock
size
=
{
18
}
className
=
'mr-25'
/>
<
span
className
=
'align-middle'
>
Platforms
<
/span
>
<
span
className
=
'align-middle'
>
Platforms
<
/span
>
<
/h6
>
<
/h6
>
<
Table
borderless
striped
responsive
>
<
Table
borderless
striped
responsive
>
<
thead
className
=
'thead-light'
>
<
thead
className
=
'thead-light'
>
<
tr
>
<
tr
>
<
th
>
Platforms
<
/th>
<
th
>
Platforms
<
/th>
<
th
>
Active
<
/th>
<
th
>
Active
<
/th>
<
/tr
>
<
/tr
>
<
/thead
>
<
/thead
>
<
tbody
>
<
tbody
>
<
tr
>
<
tr
>
<
td
>
IOS
<
/td
>
<
td
>
IOS
<
/td
>
<
td
>
<
td
>
<
CustomInput
type
=
'checkbox'
id
=
'admin-1'
label
=
''
defaultChecked
/>
<
CustomInput
type
=
'checkbox'
id
=
'admin-1'
label
=
''
defaultChecked
/>
<
/td
>
<
/td
>
<
/tr
>
<
/tr
>
<
tr
>
<
tr
>
<
td
>
Android
<
/td
>
<
td
>
Android
<
/td
>
<
td
>
<
td
>
<
CustomInput
type
=
'checkbox'
id
=
'staff-1'
label
=
''
/>
<
CustomInput
type
=
'checkbox'
id
=
'staff-1'
label
=
''
/>
<
/td
>
<
/td
>
<
/tr
>
<
/tr
>
<
tr
>
<
tr
>
<
td
>
Android
Tv
<
/td
>
<
td
>
Android
Tv
<
/td
>
<
td
>
<
td
>
<
CustomInput
type
=
'checkbox'
id
=
'author-1'
label
=
''
defaultChecked
/>
<
CustomInput
type
=
'checkbox'
id
=
'author-1'
label
=
''
defaultChecked
/>
<
/td
>
<
/td
>
<
/tr
>
<
/tr
>
<
tr
>
<
tr
>
<
td
>
Roku
<
/td
>
<
td
>
Roku
<
/td
>
<
td
>
<
td
>
<
CustomInput
type
=
'checkbox'
id
=
'contributor-1'
label
=
''
/>
<
CustomInput
type
=
'checkbox'
id
=
'contributor-1'
label
=
''
/>
<
/td
>
<
/td
>
<
/tr
>
<
/tr
>
<
tr
>
<
tr
>
<
td
>
STV
<
/td
>
<
td
>
STV
<
/td
>
<
td
>
<
td
>
<
CustomInput
type
=
'checkbox'
id
=
'user-1'
label
=
''
/>
<
CustomInput
type
=
'checkbox'
id
=
'user-1'
label
=
''
/>
<
/td
>
<
/td
>
<
/tr
>
<
/tr
>
<
/tbody
>
<
/tbody
>
<
/Table
>
<
/Table
>
<
/div
>
<
/div
>
<
/Col
>
{
/* <ProjectPlatform /> */
}
<
Col
className
=
'd-flex flex-sm-row flex-column mt-2'
sm
=
'12'
>
<
/Col
>
<
Button
.
Ripple
className
=
'mb-1 mb-sm-0 mr-0 mr-sm-1'
type
=
'submit'
color
=
'primary'
>
<
Col
className
=
'd-flex flex-sm-row flex-column mt-2'
sm
=
'12'
>
Save
Changes
<
Button
.
Ripple
className
=
'mb-1 mb-sm-0 mr-0 mr-sm-1'
type
=
'submit'
color
=
'primary'
>
<
/Button.Ripple
>
Save
Changes
<
Button
.
Ripple
color
=
'secondary'
outline
>
<
/Button.Ripple
>
Reset
<
Button
.
Ripple
color
=
'secondary'
outline
>
<
/Button.Ripple
>
Reset
{
storeSettings
.
saveSucces
?
'sim'
:
'nao'
}
<
/Button.Ripple
>
{
storeSettings
.
errorMsg
}
<
/Col
>
<
/Col
>
<
/Row
>
<
/Row
>
<
/Form
>
<
/Form
>
{
/* <ProjectCard selectedProject={dataProject} /> */
}
<
/Col
>
{
/* {saveSucces ? 'sim' : 'nao'}
<
/Row
>
{errorMsg} */
}
<
/Col>
<
/Row
>
)
:
(
)
:
(
<
Alert
color
=
'danger'
>
<
Alert
color
=
'danger'
>
<
h4
className
=
'alert-heading'
>
Project
not
found
<
/h4
>
<
h4
className
=
'alert-heading'
>
Project
not
found
<
/h4
>
<
div
className
=
'alert-body'
>
<
div
className
=
'alert-body'
>
User
with
id
:
{
id
}
doesn
't exist. Check list of all Projects: <Link to='
/
settings
/
projects
'>Projects List</Link>
User
with
id
:
{
id
}
doesn
't exist. Check list of all Projects: <Link to='
/
settings
/
projects
'>Projects List</Link>
{store.Settings}
</div>
</div>
</Alert>
</Alert>
)
)
...
...
src/views/settings/projects/edit/plataform.js
0 → 100644
View file @
38aa7fd8
import
{
Media
,
Button
,
Label
,
Form
,
FormGroup
,
Input
,
Table
,
CustomInput
,
Card
,
CardBody
,
Row
,
Col
,
Nav
,
NavItem
,
NavLink
,
TabContent
,
TabPane
,
Alert
}
from
'reactstrap'
// ** Styles
import
'@styles/react/apps/app-users.scss'
const
ProjectPlatform
=
()
=>
{
return
(
<
div
clssName
=
'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
>
<
/h6
>
<
Table
borderless
striped
responsive
>
<
thead
className
=
'thead-light'
>
<
tr
>
<
th
>
Platforms
<
/th>
<
th
>
Active
<
/th>
<
/tr
>
<
/thead
>
<
tbody
>
<
tr
>
<
td
>
IOS
<
/td
>
<
td
>
<
CustomInput
type
=
'checkbox'
id
=
'admin-1'
label
=
''
defaultChecked
/>
<
/td
>
<
/tr
>
<
tr
>
<
td
>
Android
<
/td
>
<
td
>
<
CustomInput
type
=
'checkbox'
id
=
'staff-1'
label
=
''
/>
<
/td
>
<
/tr
>
<
tr
>
<
td
>
Android
Tv
<
/td
>
<
td
>
<
CustomInput
type
=
'checkbox'
id
=
'author-1'
label
=
''
defaultChecked
/>
<
/td
>
<
/tr
>
<
tr
>
<
td
>
Roku
<
/td
>
<
td
>
<
CustomInput
type
=
'checkbox'
id
=
'contributor-1'
label
=
''
/>
<
/td
>
<
/tr
>
<
tr
>
<
td
>
STV
<
/td
>
<
td
>
<
CustomInput
type
=
'checkbox'
id
=
'user-1'
label
=
''
/>
<
/td
>
<
/tr
>
<
/tbody
>
<
/Table
>
<
/div
>
)
}
export
default
ProjectPlatform
src/views/settings/projects/edit/projectCard.js
0 → 100644
View file @
38aa7fd8
// ** React Imports
import
{
useState
,
useEffect
,
Fragment
}
from
'react'
import
{
Media
,
Button
,
Label
,
Form
,
FormGroup
,
Input
,
Table
,
CustomInput
,
Card
,
CardBody
,
Row
,
Col
,
Nav
,
NavItem
,
NavLink
,
TabContent
,
TabPane
,
Alert
}
from
'reactstrap'
import
{
isEmptyObject
}
from
'jquery'
// ** Store & Actions
import
{
updateProject
}
from
'../../store/actions'
import
{
useForm
}
from
'react-hook-form'
import
classnames
from
'classnames'
// ** Function to handle form submit
const
onSubmit
=
values
=>
{
// if (isObjEmpty(errors)) {
// dispatch(
// updateProject({
// id: values.id,
// app_name: values.app_name,
// customer_name: values.customer_name
// })
// )
// }
}
const
ProjectCard
=
({
selectedProject
})
=>
{
const
[
dataProject
,
setProjectData
]
=
useState
(
null
)
// const { register, errors, handleSubmit } = useForm()
// const [dataProject, setProjectData] = useState(null)
// // ** Update user image on mount or change
// useEffect(() => {
// if (selectedProject !== null || (selectedProject !== null && dataProject !== null && selectedProject.id !== dataProject.id)) {
// return setProjectData(selectedProject)
// }
// }, [selectedProject])
useEffect
(()
=>
{
if
(
selectedProject
!==
null
||
(
selectedProject
!==
null
&&
dataProject
!==
null
&&
selectedProject
.
id
!==
dataProject
.
id
))
{
return
setProjectData
(
selectedProject
)
}
},
[
selectedProject
])
return
(
<
Fragment
>
<
Form
// onSubmit={handleSubmit(onSubmit)}
>
<
Row
>
<
Col
md
=
'4'
sm
=
'12'
>
<
FormGroup
>
<
Label
for
=
'email'
>
ID
<
/Label
>
<
Input
readOnly
=
{
true
}
type
=
'text'
name
=
'id'
id
=
'id'
// innerRef={register({ required: true })}
placeholder
=
'id'
defaultValue
=
'1'
/>
<
/FormGroup
>
<
/Col
>
<
Col
md
=
'4'
sm
=
'12'
>
<
FormGroup
>
<
Label
for
=
'app_name'
>
Project
Name
<
/Label
>
<
Input
type
=
'text'
name
=
'app_name'
id
=
'app_name'
// innerRef={register({ required: true })}
placeholder
=
'Project Name'
defaultValue
=
{
dataProject
&&
dataProject
.
app_name
}
// className={classnames({ 'is-invalid': errors['app_name'] })}
/
>
<
/FormGroup
>
<
/Col
>
<
Col
md
=
'4'
sm
=
'12'
>
<
FormGroup
>
<
Label
for
=
'customer_name'
>
Client
Name
<
/Label
>
<
Input
type
=
'text'
name
=
'customer_name'
id
=
'customer_name'
// innerRef={register({ required: true })}
placeholder
=
'Client Name'
defaultValue
=
{
dataProject
&&
dataProject
.
customer_name
}
// className={classnames({ 'is-invalid': errors['customer_name'] })}
/
>
<
/FormGroup
>
<
/Col
>
{
/* <Col md='4' sm='12'>
<FormGroup>
<Label for='email'>Email</Label>
<Input disabled='disabled' type='text' id='email' placeholder='Email' defaultValue={ProjectData && ProjectData.email} />
</FormGroup>
</Col> */
}
{
/* <Col md='4' sm='12'>
<FormGroup>
<Label for='status'>Status</Label>
<Input type='select' name='status' id='status' defaultValue={ProjectData && ProjectData.status}>
<option value='pending'>Pending</option>
<option value='active'>Active</option>
<option value='inactive'>Inactive</option>
</Input>
</FormGroup>
</Col> */
}
<
Col
sm
=
'6'
>
<
div
className
=
'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
>
<
/h6
>
<
Table
borderless
striped
responsive
>
<
thead
className
=
'thead-light'
>
<
tr
>
<
th
>
Platforms
<
/th>
<
th
>
Active
<
/th>
<
/tr
>
<
/thead
>
<
tbody
>
<
tr
>
<
td
>
IOS
<
/td
>
<
td
>
<
CustomInput
type
=
'checkbox'
id
=
'admin-1'
label
=
''
defaultChecked
/>
<
/td
>
<
/tr
>
<
tr
>
<
td
>
Android
<
/td
>
<
td
>
<
CustomInput
type
=
'checkbox'
id
=
'staff-1'
label
=
''
/>
<
/td
>
<
/tr
>
<
tr
>
<
td
>
Android
Tv
<
/td
>
<
td
>
<
CustomInput
type
=
'checkbox'
id
=
'author-1'
label
=
''
defaultChecked
/>
<
/td
>
<
/tr
>
<
tr
>
<
td
>
Roku
<
/td
>
<
td
>
<
CustomInput
type
=
'checkbox'
id
=
'contributor-1'
label
=
''
/>
<
/td
>
<
/tr
>
<
tr
>
<
td
>
STV
<
/td
>
<
td
>
<
CustomInput
type
=
'checkbox'
id
=
'user-1'
label
=
''
/>
<
/td
>
<
/tr
>
<
/tbody
>
<
/Table
>
<
/div
>
<
/Col
>
<
Col
className
=
'd-flex flex-sm-row flex-column mt-2'
sm
=
'12'
>
<
Button
.
Ripple
className
=
'mb-1 mb-sm-0 mr-0 mr-sm-1'
type
=
'submit'
color
=
'primary'
>
Save
Changes
<
/Button.Ripple
>
<
Button
.
Ripple
color
=
'secondary'
outline
>
Reset
<
/Button.Ripple
>
<
/Col
>
<
/Row
>
<
/Form
>
<
/Fragment
>
)
}
export
default
ProjectCard
\ No newline at end of file
src/views/settings/store/actions/index.js
View file @
38aa7fd8
...
@@ -20,7 +20,6 @@ export const getData = params => {
...
@@ -20,7 +20,6 @@ export const getData = params => {
export
const
setSaveSatus
=
params
=>
{
export
const
setSaveSatus
=
params
=>
{
return
async
dispatch
=>
{
return
async
dispatch
=>
{
dispatch
({
dispatch
({
type
:
'SAVE_STATUS'
,
type
:
'SAVE_STATUS'
,
status
:
params
status
:
params
...
@@ -48,8 +47,7 @@ export const getData_projects = params => {
...
@@ -48,8 +47,7 @@ export const getData_projects = params => {
type
:
'GET_DATA_PROJECTS'
,
type
:
'GET_DATA_PROJECTS'
,
allData
:
response
.
data
.
allData
,
allData
:
response
.
data
.
allData
,
// dataProjects: response.data.invoices,
// dataProjects: response.data.invoices,
totalPages
:
response
.
data
.
total
,
totalPages
:
response
.
data
.
total
,
selectedProject
:
null
,
params
:
response
.
data
.
params
params
:
response
.
data
.
params
})
})
})
})
...
@@ -63,10 +61,10 @@ export const getProject = id => {
...
@@ -63,10 +61,10 @@ export const getProject = id => {
.
get
(
`
${
process
.
env
.
REACT_APP_API
}
/api/projects/
${
id
}
`
)
.
get
(
`
${
process
.
env
.
REACT_APP_API
}
/api/projects/
${
id
}
`
)
.
then
(
response
=>
{
.
then
(
response
=>
{
// console.log('leu')
// console.log('leu')
// console.log(response)
//
console.log(response)
dispatch
({
dispatch
({
type
:
'GET_PROJECT'
,
type
:
'GET_PROJECT'
,
selectedProject
:
response
.
data
data
:
response
.
data
.
data
})
})
})
})
.
catch
(
err
=>
console
.
log
(
err
))
.
catch
(
err
=>
console
.
log
(
err
))
...
...
src/views/settings/store/reducer/index.js
View file @
38aa7fd8
...
@@ -20,7 +20,7 @@ const initialState = {
...
@@ -20,7 +20,7 @@ const initialState = {
selectedPlatform
:
null
selectedPlatform
:
null
}
}
const
S
ettings
=
(
state
=
initialState
,
action
)
=>
{
const
s
ettings
=
(
state
=
initialState
,
action
)
=>
{
switch
(
action
.
type
)
{
switch
(
action
.
type
)
{
case
'GET_DATA'
:
case
'GET_DATA'
:
return
{
return
{
...
@@ -50,12 +50,14 @@ const Settings = (state = initialState, action) => {
...
@@ -50,12 +50,14 @@ const Settings = (state = initialState, action) => {
allDataProjects
:
action
.
allData
,
allDataProjects
:
action
.
allData
,
dataProjects
:
action
.
data
,
dataProjects
:
action
.
data
,
totalProjects
:
action
.
totalPages
,
totalProjects
:
action
.
totalPages
,
selectedProject
:
null
,
paramsProjects
:
action
.
params
paramsProjects
:
action
.
params
}
}
case
'GET_PROJECT'
:
case
'GET_PROJECT'
:
return
{
...
state
,
return
{
...
state
,
selectedProject
:
action
.
selectedProject
selectedProject
:
action
.
data
}
}
case
'UPDATE_PROJECT'
:
case
'UPDATE_PROJECT'
:
...
@@ -74,4 +76,4 @@ const Settings = (state = initialState, action) => {
...
@@ -74,4 +76,4 @@ const Settings = (state = initialState, action) => {
}
}
}
}
export
default
S
ettings
export
default
s
ettings
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