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
330411df
Commit
330411df
authored
Apr 25, 2021
by
PDuarte
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
platforms adding
parent
7d8b3476
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
73 additions
and
48 deletions
+73
-48
Settings.js
src/router/routes/Settings.js
+5
-0
index.js
src/views/settings/platforms/add/index.js
+9
-12
index.js
src/views/settings/platforms/card/index.js
+23
-28
index.js
src/views/settings/platforms/edit/index.js
+3
-3
main.js
src/views/settings/platforms/edit/main.js
+2
-2
index.js
src/views/settings/platforms/index.js
+1
-1
table.js
src/views/settings/platforms/table.js
+1
-0
table.js
src/views/settings/projects/table.js
+2
-1
index.js
src/views/settings/store/actions/index.js
+22
-1
index.js
src/views/settings/store/reducer/index.js
+5
-0
No files found.
src/router/routes/Settings.js
View file @
330411df
...
@@ -32,6 +32,11 @@ const SettingsRoutes = [
...
@@ -32,6 +32,11 @@ const SettingsRoutes = [
component
:
lazy
(()
=>
import
(
'../../views/settings/platforms'
)),
component
:
lazy
(()
=>
import
(
'../../views/settings/platforms'
)),
exact
:
true
exact
:
true
},
},
{
path
:
'/settings/platforms/add'
,
component
:
lazy
(()
=>
import
(
'../../views/settings/platforms/add'
)),
exact
:
true
},
{
{
path
:
'/settings/locations'
,
path
:
'/settings/locations'
,
component
:
lazy
(()
=>
import
(
'../../views/settings/locations'
)),
component
:
lazy
(()
=>
import
(
'../../views/settings/locations'
)),
...
...
src/views/settings/platforms/add/index.js
View file @
330411df
...
@@ -3,7 +3,7 @@ import { Fragment } from 'react'
...
@@ -3,7 +3,7 @@ import { Fragment } from 'react'
import
{
Link
}
from
'react-router-dom'
import
{
Link
}
from
'react-router-dom'
// ** Store & Actions
// ** Store & Actions
import
{
addP
roject
}
from
'../../store/actions'
import
{
addP
latform
}
from
'../../store/actions'
import
{
useDispatch
}
from
'react-redux'
import
{
useDispatch
}
from
'react-redux'
// ** Custom Components
// ** Custom Components
...
@@ -11,11 +11,10 @@ import Breadcrumbs from '@components/breadcrumbs'
...
@@ -11,11 +11,10 @@ import Breadcrumbs from '@components/breadcrumbs'
// ** Third Party Components
// ** Third Party Components
import
{
Row
,
Col
}
from
'reactstrap'
import
{
Row
,
Col
}
from
'reactstrap'
import
{
isObjEmpty
}
from
'@utils'
// ** Tables
// ** Tables
import
ProjectCard
from
'../edit/projectC
ard'
import
ElementCard
from
'../c
ard'
// ** Styles
// ** Styles
import
'@styles/react/libs/tables/react-dataTable-component.scss'
import
'@styles/react/libs/tables/react-dataTable-component.scss'
...
@@ -23,10 +22,9 @@ const Tables = () => {
...
@@ -23,10 +22,9 @@ const Tables = () => {
const
dispatch
=
useDispatch
()
const
dispatch
=
useDispatch
()
const
onSubmitHandler
=
values
=>
{
const
onSubmitHandler
=
values
=>
{
dispatch
(
dispatch
(
addProject
({
addPlatform
({
id
:
values
.
id
,
id
:
values
.
id
,
app_name
:
values
.
app_name
,
name
:
values
.
name
customer_name
:
values
.
customer_name
})
})
)
)
...
@@ -34,23 +32,22 @@ const Tables = () => {
...
@@ -34,23 +32,22 @@ const Tables = () => {
return
(
return
(
<
Fragment
>
<
Fragment
>
<
Breadcrumbs
breadCrumbTitle
=
'Settings'
breadCrumbParent
=
'Settings'
breadCrumbActive
=
'P
roject
s'
/>
<
Breadcrumbs
breadCrumbTitle
=
'Settings'
breadCrumbParent
=
'Settings'
breadCrumbActive
=
'P
latform
s'
/>
<
Row
>
<
Row
>
<
Col
sm
=
'12'
>
<
Col
sm
=
'12'
>
<
Link
to
=
"/settings/p
rojects"
>
Back
to
Project
s
<
/Link
>
<
Link
to
=
"/settings/p
latforms"
>
Back
to
Platform
s
<
/Link
>
<
/Col
>
<
/Col
>
<
/Row
>
<
/Row
>
<
Row
>
<
Row
>
<
Col
sm
=
'12'
>
<
Col
sm
=
'12'
>
<
div
class
=
"card"
>
<
div
class
=
"card"
>
<
div
class
=
"card-header"
>
<
div
class
=
"card-header"
>
<
h4
class
=
"card-title"
>
New
P
roject
<
/h4
>
<
h4
class
=
"card-title"
>
New
P
latform
<
/h4
>
<
/div
>
<
/div
>
<
div
class
=
"card-body"
>
<
div
class
=
"card-body"
>
<
Projec
tCard
selectedProject
=
{{
<
Elemen
tCard
selectedProject
=
{{
id
:
'<generate>'
,
id
:
'<generate>'
,
app_name
:
''
,
name
:
''
customer_name
:
''
}}
}}
onSubmitHandler
=
{
onSubmitHandler
}
onSubmitHandler
=
{
onSubmitHandler
}
/
>
/
>
...
...
src/views/settings/platforms/
edit/projectCard
.js
→
src/views/settings/platforms/
card/index
.js
View file @
330411df
...
@@ -12,13 +12,11 @@ import { Bell, Check, X, AlertTriangle, Info } from 'react-feather'
...
@@ -12,13 +12,11 @@ import { Bell, Check, X, AlertTriangle, Info } from 'react-feather'
// ** Store & Actions
// ** Store & Actions
import
{
updateProject
,
resetResults
,
getP
roject
}
from
'../../store/actions'
import
{
updateProject
,
resetResults
,
getP
latform
}
from
'../../store/actions'
import
{
useForm
}
from
'react-hook-form'
import
{
useForm
}
from
'react-hook-form'
import
classnames
from
'classnames'
import
classnames
from
'classnames'
import
ProjectPlatform
from
'./plataform'
import
Swal
from
'sweetalert2'
import
Swal
from
'sweetalert2'
import
withReactContent
from
'sweetalert2-react-content'
import
withReactContent
from
'sweetalert2-react-content'
...
@@ -41,8 +39,9 @@ const SuccessProgressToast = () => (
...
@@ -41,8 +39,9 @@ const SuccessProgressToast = () => (
)
)
const
Projec
tCard
=
({
selectedProject
,
onSubmitHandler
})
=>
{
const
Elemen
tCard
=
({
selectedProject
,
onSubmitHandler
})
=>
{
const
store
=
useSelector
(
state
=>
state
.
projectsettings
)
const
store
=
useSelector
(
state
=>
state
.
projectsettings
)
const
[
PlatformName
,
setPlatformName
]
=
useState
(
'Web'
)
const
MySwal
=
withReactContent
(
Swal
)
const
MySwal
=
withReactContent
(
Swal
)
...
@@ -65,14 +64,10 @@ const handleError = (text) => {
...
@@ -65,14 +64,10 @@ const handleError = (text) => {
notifySuccessProgress
=
()
=>
toast
.
success
(
<
SuccessProgressToast
/>
),
notifySuccessProgress
=
()
=>
toast
.
success
(
<
SuccessProgressToast
/>
),
onSubmit
=
values
=>
{
onSubmit
=
values
=>
{
if
(
isObjEmpty
(
errors
))
{
if
(
isObjEmpty
(
errors
))
{
// dispatch(
onSubmitHandler
({
// updateProject({
id
:
null
,
// id: values.id,
name
:
PlatformName
// app_name: values.app_name,
})
// customer_name: values.customer_name
// })
// )
onSubmitHandler
(
values
)
}
}
}
}
...
@@ -118,7 +113,7 @@ return (
...
@@ -118,7 +113,7 @@ return (
/
>
/
>
<
/FormGroup
>
<
/FormGroup
>
<
/Col
>
<
/Col
>
<
Col
md
=
'4'
sm
=
'12'
>
{
/*
<Col md='4' sm='12'>
<FormGroup>
<FormGroup>
<Label for='app_name'>Project Name</Label>
<Label for='app_name'>Project Name</Label>
<Input
<Input
...
@@ -131,8 +126,8 @@ return (
...
@@ -131,8 +126,8 @@ return (
className={classnames({ 'is-invalid': errors['app_name'] })}
className={classnames({ 'is-invalid': errors['app_name'] })}
/>
/>
</FormGroup>
</FormGroup>
<
/Col
>
</Col>
*/
}
<
Col
md
=
'4'
sm
=
'12'
>
{
/*
<Col md='4' sm='12'>
<FormGroup>
<FormGroup>
<Label for='customer_name'>Client Name</Label>
<Label for='customer_name'>Client Name</Label>
<Input
<Input
...
@@ -145,32 +140,32 @@ return (
...
@@ -145,32 +140,32 @@ return (
className={classnames({ 'is-invalid': errors['customer_name'] })}
className={classnames({ 'is-invalid': errors['customer_name'] })}
/>
/>
</FormGroup>
</FormGroup>
<
/Col
>
</Col>
*/
}
{
/* <Col md='4' sm='12'>
{
/* <Col md='4' sm='12'>
<FormGroup>
<FormGroup>
<Label for='email'>Email</Label>
<Label for='email'>Email</Label>
<Input disabled='disabled' type='text' id='email' placeholder='Email' defaultValue={ProjectData && ProjectData.email} />
<Input disabled='disabled' type='text' id='email' placeholder='Email' defaultValue={ProjectData && ProjectData.email} />
</FormGroup>
</FormGroup>
</Col> */
}
</Col> */
}
{
/*
<Col md='4' sm='12'>
<
Col
md
=
'4'
sm
=
'12'
>
<
FormGroup
>
<
FormGroup
>
<Label for='status'>Status</Label>
<
Label
for
=
'name'
>
Name
<
/Label
>
<Input type='select' name='status' id='status' defaultValue={ProjectData && ProjectData.status}>
<
Input
type
=
'select'
name
=
'name'
id
=
'name'
defaultValue
=
{
dataProject
&&
dataProject
.
name
}
onChange
=
{
e
=>
setPlatformName
(
e
.
target
.
value
)}
>
<option value='pending'>Pending</option>
<
option
value
=
'Web'
>
Web
<
/option
>
<option value='active'>Active</option>
<
option
value
=
'iOS Phone'
>
iOS
Phone
<
/option
>
<option value='inactive'>Inactive</option>
<
option
value
=
'iOS Tablet'
>
iOS
Tablet
<
/option
>
<
option
value
=
'Android Phone'
>
Android
Phone
<
/option
>
<
option
value
=
'Android Tablet'
>
Android
Tablet
<
/option
>
<
/Input
>
<
/Input
>
<
/FormGroup
>
<
/FormGroup
>
</Col> */
}
<
Col
sm
=
'6'
>
<
ProjectPlatform
/>
<
/Col>
<
/Col>
<
Col
className
=
'd-flex flex-sm-row flex-column mt-2'
sm
=
'12'
>
<
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'
>
<
Button
.
Ripple
className
=
'mb-1 mb-sm-0 mr-0 mr-sm-1'
type
=
'submit'
color
=
'primary'
>
Save
Changes
Save
Changes
<
/Button.Ripple
>
<
/Button.Ripple
>
{
/* <Button.Ripple color='secondary' outline onClick={() => dispatch(getP
roject
(selectedProject.id))} >
{
/* <Button.Ripple color='secondary' outline onClick={() => dispatch(getP
latform
(selectedProject.id))} >
Reset
Reset
</Button.Ripple> */
}
</Button.Ripple> */
}
<
/Col
>
<
/Col
>
...
@@ -181,4 +176,4 @@ return (
...
@@ -181,4 +176,4 @@ return (
}
}
export
default
ProjectCard
export
default
ElementCard
\ No newline at end of file
\ No newline at end of file
src/views/settings/platforms/edit/index.js
View file @
330411df
...
@@ -16,17 +16,17 @@ import '@styles/react/libs/tables/react-dataTable-component.scss'
...
@@ -16,17 +16,17 @@ import '@styles/react/libs/tables/react-dataTable-component.scss'
const
Tables
=
()
=>
{
const
Tables
=
()
=>
{
return
(
return
(
<
Fragment
>
<
Fragment
>
<
Breadcrumbs
breadCrumbTitle
=
'Settings'
breadCrumbParent
=
'Settings'
breadCrumbActive
=
'P
roject
s'
/>
<
Breadcrumbs
breadCrumbTitle
=
'Settings'
breadCrumbParent
=
'Settings'
breadCrumbActive
=
'P
latform
s'
/>
<
Row
>
<
Row
>
<
Col
sm
=
'12'
>
<
Col
sm
=
'12'
>
<
Link
to
=
"/settings/p
rojects"
>
Back
to
Project
s
<
/Link
>
<
Link
to
=
"/settings/p
latforms"
>
Back
to
Platform
s
<
/Link
>
<
/Col
>
<
/Col
>
<
/Row
>
<
/Row
>
<
Row
>
<
Row
>
<
Col
sm
=
'12'
>
<
Col
sm
=
'12'
>
<
div
class
=
"card"
>
<
div
class
=
"card"
>
<
div
class
=
"card-header"
>
<
div
class
=
"card-header"
>
<
h4
class
=
"card-title"
>
P
roject
<
/h4
>
<
h4
class
=
"card-title"
>
P
latform
<
/h4
>
<
/div
>
<
/div
>
<
div
class
=
"card-body"
>
<
div
class
=
"card-body"
>
<
ProjectsEdit
/>
<
ProjectsEdit
/>
...
...
src/views/settings/platforms/edit/main.js
View file @
330411df
...
@@ -8,7 +8,7 @@ import { useSelector, useDispatch } from 'react-redux'
...
@@ -8,7 +8,7 @@ import { useSelector, useDispatch } from 'react-redux'
import
{
Alert
}
from
'reactstrap'
import
{
Alert
}
from
'reactstrap'
import
ProjectCard
from
'./projectC
ard'
import
ElementCard
from
'../c
ard'
const
ProjectsEdit
=
()
=>
{
const
ProjectsEdit
=
()
=>
{
// ** States & Vars
// ** States & Vars
...
@@ -43,7 +43,7 @@ const ProjectsEdit = () => {
...
@@ -43,7 +43,7 @@ const ProjectsEdit = () => {
return
store
.
selectedProject
!==
null
&&
store
.
selectedProject
!==
undefined
?
(
return
store
.
selectedProject
!==
null
&&
store
.
selectedProject
!==
undefined
?
(
<
Projec
tCard
<
Elemen
tCard
selectedProject
=
{
store
.
selectedProject
}
selectedProject
=
{
store
.
selectedProject
}
onSubmitHandler
=
{
onSubmitHandler
}
onSubmitHandler
=
{
onSubmitHandler
}
/>
/>
...
...
src/views/settings/platforms/index.js
View file @
330411df
...
@@ -15,7 +15,7 @@ import '@styles/react/libs/tables/react-dataTable-component.scss'
...
@@ -15,7 +15,7 @@ import '@styles/react/libs/tables/react-dataTable-component.scss'
const
Tables
=
()
=>
{
const
Tables
=
()
=>
{
return
(
return
(
<
Fragment
>
<
Fragment
>
<
Breadcrumbs
breadCrumbTitle
=
'Settings'
breadCrumbParent
=
'Settings'
breadCrumbActive
=
'P
roject
s'
/>
<
Breadcrumbs
breadCrumbTitle
=
'Settings'
breadCrumbParent
=
'Settings'
breadCrumbActive
=
'P
latform
s'
/>
<
Row
>
<
Row
>
<
Col
sm
=
'12'
>
<
Col
sm
=
'12'
>
<
DataTable
/>
<
DataTable
/>
...
...
src/views/settings/platforms/table.js
View file @
330411df
...
@@ -15,6 +15,7 @@ const DataTable = () => {
...
@@ -15,6 +15,7 @@ const DataTable = () => {
return
(
return
(
<
DataTableServerSide
<
DataTableServerSide
cardTitle
=
'Platforms'
allData
=
{
store
.
allDataPlatforms
}
allData
=
{
store
.
allDataPlatforms
}
getData
=
{
getData_platforms
}
getData
=
{
getData_platforms
}
serverSideColumns
=
{
serverSideColumns
}
serverSideColumns
=
{
serverSideColumns
}
...
...
src/views/settings/projects/table.js
View file @
330411df
...
@@ -15,6 +15,7 @@ const DataTable = () => {
...
@@ -15,6 +15,7 @@ const DataTable = () => {
return
(
return
(
<
DataTableServerSide
<
DataTableServerSide
cardTitle
=
'Projects'
allData
=
{
store
.
allDataProjects
}
allData
=
{
store
.
allDataProjects
}
getData
=
{
getData_projects
}
getData
=
{
getData_projects
}
serverSideColumns
=
{
serverSideColumns
}
serverSideColumns
=
{
serverSideColumns
}
...
...
src/views/settings/store/actions/index.js
View file @
330411df
import
axios
from
'axios'
import
axios
from
'axios'
import
{
platform
}
from
'chart.js'
// ** Get table Data ///api/datatables/data
// ** Get table Data ///api/datatables/data
...
@@ -140,7 +141,7 @@ export const addProject = project => {
...
@@ -140,7 +141,7 @@ export const addProject = project => {
// ** Get table Data platforms
// ** Get table Data platforms
export
const
getData_platforms
=
params
=>
{
export
const
getData_platforms
=
params
=>
{
return
async
dispatch
=>
{
return
async
dispatch
=>
{
await
axios
.
get
(
`
${
process
.
env
.
REACT_APP_API
}
/api/platforms`
,
params
await
axios
.
get
(
`
${
process
.
env
.
REACT_APP_API
}
/api/platforms`
,
{
params
}
).
then
(
response
=>
{
).
then
(
response
=>
{
dispatch
({
dispatch
({
type
:
'GET_DATA_PLATFORMS'
,
type
:
'GET_DATA_PLATFORMS'
,
...
@@ -152,3 +153,23 @@ export const getData_platforms = params => {
...
@@ -152,3 +153,23 @@ export const getData_platforms = params => {
})
})
}
}
}
}
export
const
addPlatform
=
platform
=>
{
return
(
dispatch
,
getState
)
=>
{
axios
.
post
(
`
${
process
.
env
.
REACT_APP_API
}
/api/platforms`
,
platform
)
.
then
(
response
=>
{
dispatch
({
type
:
'ADD_PLATFORM'
,
platform
})
})
.
then
(()
=>
{
dispatch
(
setSaveSatus
(
true
))
})
.
catch
(
err
=>
{
dispatch
(
setErrorMsg
(
err
.
response
.
data
.
message
))
console
.
log
(
err
.
response
.
data
)
})
}
}
src/views/settings/store/reducer/index.js
View file @
330411df
...
@@ -78,6 +78,11 @@ const settings = (state = initialState, action) => {
...
@@ -78,6 +78,11 @@ const settings = (state = initialState, action) => {
totalPlatforms
:
action
.
totalPages
,
totalPlatforms
:
action
.
totalPages
,
paramsPlatforms
:
action
.
params
paramsPlatforms
:
action
.
params
}
}
case
'ADD_PLATFORM'
:
return
{
...
state
}
default
:
default
:
return
state
return
state
}
}
...
...
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