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
Hide 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 = [
component
:
lazy
(()
=>
import
(
'../../views/settings/platforms'
)),
exact
:
true
},
{
path
:
'/settings/platforms/add'
,
component
:
lazy
(()
=>
import
(
'../../views/settings/platforms/add'
)),
exact
:
true
},
{
path
:
'/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'
import
{
Link
}
from
'react-router-dom'
// ** Store & Actions
import
{
addP
roject
}
from
'../../store/actions'
import
{
addP
latform
}
from
'../../store/actions'
import
{
useDispatch
}
from
'react-redux'
// ** Custom Components
...
...
@@ -11,11 +11,10 @@ import Breadcrumbs from '@components/breadcrumbs'
// ** Third Party Components
import
{
Row
,
Col
}
from
'reactstrap'
import
{
isObjEmpty
}
from
'@utils'
// ** Tables
import
ProjectCard
from
'../edit/projectC
ard'
import
ElementCard
from
'../c
ard'
// ** Styles
import
'@styles/react/libs/tables/react-dataTable-component.scss'
...
...
@@ -23,10 +22,9 @@ const Tables = () => {
const
dispatch
=
useDispatch
()
const
onSubmitHandler
=
values
=>
{
dispatch
(
addProject
({
addPlatform
({
id
:
values
.
id
,
app_name
:
values
.
app_name
,
customer_name
:
values
.
customer_name
name
:
values
.
name
})
)
...
...
@@ -34,23 +32,22 @@ const Tables = () => {
return
(
<
Fragment
>
<
Breadcrumbs
breadCrumbTitle
=
'Settings'
breadCrumbParent
=
'Settings'
breadCrumbActive
=
'P
roject
s'
/>
<
Breadcrumbs
breadCrumbTitle
=
'Settings'
breadCrumbParent
=
'Settings'
breadCrumbActive
=
'P
latform
s'
/>
<
Row
>
<
Col
sm
=
'12'
>
<
Link
to
=
"/settings/p
rojects"
>
Back
to
Project
s
<
/Link
>
<
Link
to
=
"/settings/p
latforms"
>
Back
to
Platform
s
<
/Link
>
<
/Col
>
<
/Row
>
<
Row
>
<
Col
sm
=
'12'
>
<
div
class
=
"card"
>
<
div
class
=
"card-header"
>
<
h4
class
=
"card-title"
>
New
P
roject
<
/h4
>
<
h4
class
=
"card-title"
>
New
P
latform
<
/h4
>
<
/div
>
<
div
class
=
"card-body"
>
<
Projec
tCard
selectedProject
=
{{
<
Elemen
tCard
selectedProject
=
{{
id
:
'<generate>'
,
app_name
:
''
,
customer_name
:
''
name
:
''
}}
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'
// ** 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
classnames
from
'classnames'
import
ProjectPlatform
from
'./plataform'
import
Swal
from
'sweetalert2'
import
withReactContent
from
'sweetalert2-react-content'
...
...
@@ -41,8 +39,9 @@ const SuccessProgressToast = () => (
)
const
Projec
tCard
=
({
selectedProject
,
onSubmitHandler
})
=>
{
const
Elemen
tCard
=
({
selectedProject
,
onSubmitHandler
})
=>
{
const
store
=
useSelector
(
state
=>
state
.
projectsettings
)
const
[
PlatformName
,
setPlatformName
]
=
useState
(
'Web'
)
const
MySwal
=
withReactContent
(
Swal
)
...
...
@@ -65,14 +64,10 @@ const handleError = (text) => {
notifySuccessProgress
=
()
=>
toast
.
success
(
<
SuccessProgressToast
/>
),
onSubmit
=
values
=>
{
if
(
isObjEmpty
(
errors
))
{
// dispatch(
// updateProject({
// id: values.id,
// app_name: values.app_name,
// customer_name: values.customer_name
// })
// )
onSubmitHandler
(
values
)
onSubmitHandler
({
id
:
null
,
name
:
PlatformName
})
}
}
...
...
@@ -118,7 +113,7 @@ return (
/
>
<
/FormGroup
>
<
/Col
>
<
Col
md
=
'4'
sm
=
'12'
>
{
/*
<Col md='4' sm='12'>
<FormGroup>
<Label for='app_name'>Project Name</Label>
<Input
...
...
@@ -131,8 +126,8 @@ return (
className={classnames({ 'is-invalid': errors['app_name'] })}
/>
</FormGroup>
<
/Col
>
<
Col
md
=
'4'
sm
=
'12'
>
</Col>
*/
}
{
/*
<Col md='4' sm='12'>
<FormGroup>
<Label for='customer_name'>Client Name</Label>
<Input
...
...
@@ -145,32 +140,32 @@ return (
className={classnames({ 'is-invalid': errors['customer_name'] })}
/>
</FormGroup>
<
/Col
>
</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'>
<
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>
<
Label
for
=
'name'
>
Name
<
/Label
>
<
Input
type
=
'select'
name
=
'name'
id
=
'name'
defaultValue
=
{
dataProject
&&
dataProject
.
name
}
onChange
=
{
e
=>
setPlatformName
(
e
.
target
.
value
)}
>
<
option
value
=
'Web'
>
Web
<
/option
>
<
option
value
=
'iOS Phone'
>
iOS
Phone
<
/option
>
<
option
value
=
'iOS Tablet'
>
iOS
Tablet
<
/option
>
<
option
value
=
'Android Phone'
>
Android
Phone
<
/option
>
<
option
value
=
'Android Tablet'
>
Android
Tablet
<
/option
>
<
/Input
>
<
/FormGroup
>
</Col>
*/
}
<
/Col>
<
Col
sm
=
'6'
>
<
ProjectPlatform
/>
<
/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 onClick={() => dispatch(getP
roject
(selectedProject.id))} >
{
/* <Button.Ripple color='secondary' outline onClick={() => dispatch(getP
latform
(selectedProject.id))} >
Reset
</Button.Ripple> */
}
<
/Col
>
...
...
@@ -181,4 +176,4 @@ return (
}
export
default
ProjectCard
\ No newline at end of file
export
default
ElementCard
\ 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'
const
Tables
=
()
=>
{
return
(
<
Fragment
>
<
Breadcrumbs
breadCrumbTitle
=
'Settings'
breadCrumbParent
=
'Settings'
breadCrumbActive
=
'P
roject
s'
/>
<
Breadcrumbs
breadCrumbTitle
=
'Settings'
breadCrumbParent
=
'Settings'
breadCrumbActive
=
'P
latform
s'
/>
<
Row
>
<
Col
sm
=
'12'
>
<
Link
to
=
"/settings/p
rojects"
>
Back
to
Project
s
<
/Link
>
<
Link
to
=
"/settings/p
latforms"
>
Back
to
Platform
s
<
/Link
>
<
/Col
>
<
/Row
>
<
Row
>
<
Col
sm
=
'12'
>
<
div
class
=
"card"
>
<
div
class
=
"card-header"
>
<
h4
class
=
"card-title"
>
P
roject
<
/h4
>
<
h4
class
=
"card-title"
>
P
latform
<
/h4
>
<
/div
>
<
div
class
=
"card-body"
>
<
ProjectsEdit
/>
...
...
src/views/settings/platforms/edit/main.js
View file @
330411df
...
...
@@ -8,7 +8,7 @@ import { useSelector, useDispatch } from 'react-redux'
import
{
Alert
}
from
'reactstrap'
import
ProjectCard
from
'./projectC
ard'
import
ElementCard
from
'../c
ard'
const
ProjectsEdit
=
()
=>
{
// ** States & Vars
...
...
@@ -43,7 +43,7 @@ const ProjectsEdit = () => {
return
store
.
selectedProject
!==
null
&&
store
.
selectedProject
!==
undefined
?
(
<
Projec
tCard
<
Elemen
tCard
selectedProject
=
{
store
.
selectedProject
}
onSubmitHandler
=
{
onSubmitHandler
}
/>
...
...
src/views/settings/platforms/index.js
View file @
330411df
...
...
@@ -15,7 +15,7 @@ import '@styles/react/libs/tables/react-dataTable-component.scss'
const
Tables
=
()
=>
{
return
(
<
Fragment
>
<
Breadcrumbs
breadCrumbTitle
=
'Settings'
breadCrumbParent
=
'Settings'
breadCrumbActive
=
'P
roject
s'
/>
<
Breadcrumbs
breadCrumbTitle
=
'Settings'
breadCrumbParent
=
'Settings'
breadCrumbActive
=
'P
latform
s'
/>
<
Row
>
<
Col
sm
=
'12'
>
<
DataTable
/>
...
...
src/views/settings/platforms/table.js
View file @
330411df
...
...
@@ -15,6 +15,7 @@ const DataTable = () => {
return
(
<
DataTableServerSide
cardTitle
=
'Platforms'
allData
=
{
store
.
allDataPlatforms
}
getData
=
{
getData_platforms
}
serverSideColumns
=
{
serverSideColumns
}
...
...
src/views/settings/projects/table.js
View file @
330411df
...
...
@@ -14,7 +14,8 @@ const DataTable = () => {
const
store
=
useSelector
(
state
=>
state
.
projectsettings
)
return
(
<
DataTableServerSide
<
DataTableServerSide
cardTitle
=
'Projects'
allData
=
{
store
.
allDataProjects
}
getData
=
{
getData_projects
}
serverSideColumns
=
{
serverSideColumns
}
...
...
src/views/settings/store/actions/index.js
View file @
330411df
import
axios
from
'axios'
import
{
platform
}
from
'chart.js'
// ** Get table Data ///api/datatables/data
...
...
@@ -140,7 +141,7 @@ export const addProject = project => {
// ** Get table Data platforms
export
const
getData_platforms
=
params
=>
{
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
=>
{
dispatch
({
type
:
'GET_DATA_PLATFORMS'
,
...
...
@@ -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) => {
totalPlatforms
:
action
.
totalPages
,
paramsPlatforms
:
action
.
params
}
case
'ADD_PLATFORM'
:
return
{
...
state
}
default
:
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