Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PortalMEC-React
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Harbor Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
PortalMEC
PortalMEC-React
Commits
3509ee27
Commit
3509ee27
authored
4 years ago
by
lfr20
Browse files
Options
Downloads
Patches
Plain Diff
FInish to build de activity section + finish to improve the navigation
parent
8f4559d5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
4 merge requests
!57
Merge of develop into master
,
!56
Fixed buttons reportar, seguir, compartilhar, guardar and entrar (in comments...
,
!40
merge admin into develop
,
!37
Merge sistema_admin into Update_Admin_System
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Admin/Components/Components/DataCards/ActivityCard.js
+141
-0
141 additions, 0 deletions
src/Admin/Components/Components/DataCards/ActivityCard.js
src/Admin/Pages/Pages/SubPages/Activity.js
+11
-11
11 additions, 11 deletions
src/Admin/Pages/Pages/SubPages/Activity.js
with
152 additions
and
11 deletions
src/Admin/Components/Components/DataCards/ActivityCard.js
0 → 100644
+
141
−
0
View file @
3509ee27
/*Copyright (C) 2019 Centro de Computacao Cientifica e Software Livre
Departamento de Informatica - Universidade Federal do Parana
This file is part of Plataforma Integrada MEC.
Plataforma Integrada MEC is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Plataforma Integrada MEC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Plataforma Integrada MEC. If not, see <http://www.gnu.org/licenses/>.*/
import
React
,
{
useState
,
useEffect
}
from
"
react
"
;
// Maerial ui components
import
Card
from
"
@material-ui/core/Card
"
;
import
CardContent
from
"
@material-ui/core/CardContent
"
;
import
Typography
from
"
@material-ui/core/Typography
"
;
import
Button
from
"
@material-ui/core/Button
"
;
import
ListRoundedIcon
from
"
@material-ui/icons/ListRounded
"
;
import
ButtonGroup
from
"
@material-ui/core/ButtonGroup
"
;
import
{
useStyles
}
from
"
../../Styles/DataCard
"
;
//imports from local files
import
{
GetAData
}
from
"
../../../Filters
"
;
import
{
GetSpecificData
}
from
'
../../../Services
'
;
import
{
Link
}
from
'
react-router-dom
'
const
ActivityCard
=
({
match
})
=>
{
console
.
log
(
match
);
const
classes
=
useStyles
();
const
[
error
,
setError
]
=
useState
(
null
);
//Necessary to consult the API, catch errors
const
[
isLoaded
,
setIsLoaded
]
=
useState
(
false
);
//Necessary to consult the API, wait until complete
const
[
item
,
setItem
]
=
useState
({});
//Necessary to consult the API, data
//getting data from server
useEffect
(()
=>
{
const
headers
=
{
Accept
:
"
application/json
"
,
"
Content-Type
"
:
"
application/json; charset=utf-8
"
,
"
access-token
"
:
sessionStorage
.
getItem
(
"
@portalmec/accessToken
"
),
client
:
sessionStorage
.
getItem
(
"
@portalmec/clientToken
"
),
uid
:
sessionStorage
.
getItem
(
"
@portalmec/uid
"
),
};
GetSpecificData
(
GetAData
(
"
activities
"
,
match
.
params
.
id
),
headers
).
then
(
(
res
)
=>
{
if
(
res
.
state
)
{
setItem
(
res
.
data
);
setIsLoaded
(
true
);
setError
(
false
);
}
else
{
setIsLoaded
(
true
);
setError
(
true
);
}
}
);
},
[]);
if
(
error
)
{
return
<
div
>
Houve
um
erro
<
/div>
;
}
else
if
(
!
isLoaded
)
{
return
<
div
>
Loading
...
<
/div>
;
}
else
{
console
.
log
(
item
)
const
DATA
=
[
{
subTitle
:
"
ID
"
,
prop
:
item
.
id
,
},
{
subTitle
:
"
DONO(A)
"
,
prop
:
item
.
owner
===
null
?
''
:
item
.
owner
.
name
},
{
subTitle
:
"
Trackable type
"
,
prop
:
item
[
"
trackable_type
"
],
},
{
subTitle
:
"
Atividade
"
,
prop
:
item
.
activity
,
},
{
subTitle
:
"
Privacidade
"
,
prop
:
item
.
privacy
,
},
{
subTitle
:
"
Criado em
"
,
prop
:
item
[
"
created_at
"
],
},
{
subTitle
:
"
Recipient type
"
,
prop
:
item
[
"
recipient_type
"
],
},
];
return
(
<
Card
className
=
{
classes
.
root
}
variant
=
"
outlined
"
>
<
CardContent
>
<
div
className
=
{
classes
.
displayRow
}
>
<
Typography
className
=
{
classes
.
title
}
color
=
"
inherit
"
gutterBottom
>
{
item
.
id
}
<
/Typography
>
<
ButtonGroup
color
=
"
primary
"
aria
-
label
=
"
outlined primary button group
"
>
<
Link
to
=
{
`/admin/activities`
}
>
<
Button
startIcon
=
{
<
ListRoundedIcon
/>
}
color
=
"
primary
"
variant
=
"
outlined
"
>
Listar
<
/Button
>
<
/Link
>
<
/ButtonGroup
>
<
/div
>
{
DATA
.
map
((
info
,
index
)
=>
(
<
div
className
=
{
classes
.
displayColumn
}
key
=
{
index
}
>
<
Typography
color
=
"
initial
"
className
=
{
classes
.
subTitle
}
>
{
info
.
subTitle
}
<
/Typography
>
<
Typography
color
=
"
textSecondary
"
>
{
info
.
prop
===
null
?
"
Sem dados
"
:
info
.
prop
}
<
/Typography
>
<
/div
>
))}
<
/CardContent
>
<
/Card
>
);
}
};
export
default
ActivityCard
;
This diff is collapsed.
Click to expand it.
src/Admin/Pages/Pages/SubPages/Activity.js
+
11
−
11
View file @
3509ee27
...
...
@@ -37,6 +37,8 @@ import AddRoundedIcon from "@material-ui/icons/AddRounded";
import
UpdateRoundedIcon
from
"
@material-ui/icons/UpdateRounded
"
;
import
FilterListRoundedIcon
from
"
@material-ui/icons/FilterListRounded
"
;
import
VisibilityIcon
from
"
@material-ui/icons/Visibility
"
;
//routers
import
{
Link
}
from
'
react-router-dom
'
;
let
currPage
=
0
;
let
viewItem
=
{};
...
...
@@ -240,6 +242,7 @@ const Activity = () => {
}
else
if
(
!
isLoaded
)
{
return
<
div
>
Loading
...
<
/div>
;
}
else
{
return
showDataActivity
?
(
<
EditLanguage
editInfo
=
{
viewItem
}
...
...
@@ -344,7 +347,7 @@ const Activity = () => {
<
TableBody
>
{
items
.
map
((
row
,
index
)
=>
index
===
items
.
length
-
1
?
(
<
div
style
=
{{
padding
:
"
1em
"
}}
>
<
StyledTableRow
style
=
{{
padding
:
"
1em
"
}}
>
{
/* Button to load more data */
}
<
Button
color
=
"
primary
"
...
...
@@ -371,7 +374,7 @@ const Activity = () => {
"
Carregar mais itens
"
)}
<
/Button
>
<
/
div
>
<
/
StyledTableRow
>
)
:
(
<
StyledTableRow
key
=
{
index
}
>
<
StyledTableCell
component
=
"
th
"
scope
=
"
row
"
>
...
...
@@ -379,7 +382,7 @@ const Activity = () => {
<
/StyledTableCell
>
<
StyledTableCell
align
=
"
right
"
>
{
row
.
owner
.
name
===
null
?
''
:
row
.
owner
.
name
row
.
owner
===
null
?
''
:
row
.
owner
.
name
}
<
/StyledTableCell
>
<
StyledTableCell
align
=
"
right
"
>
...
...
@@ -387,14 +390,11 @@ const Activity = () => {
<
/StyledTableCell
>
<
StyledTableCell
align
=
"
right
"
>
{
row
.
privacy
}
<
/StyledTableCell
>
<
StyledTableCell
align
=
"
right
"
>
<
IconButton
onClick
=
{()
=>
{
currPage
=
0
;
HandleButtonViewClicked
(
index
);
}}
>
<
VisibilityIcon
style
=
{{
fill
:
"
#00bcd4
"
}}
/
>
<
/IconButton
>
<
Link
to
=
{
`/admin/activity/
${
row
.
id
}
`
}
>
<
IconButton
>
<
VisibilityIcon
style
=
{{
fill
:
"
#00bcd4
"
}}
/
>
<
/IconButton
>
<
/Link
>
<
/StyledTableCell
>
<
/StyledTableRow
>
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment