Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SMPPIR-Checkin-Portal
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
SMPPIR
SMPPIR-Checkin-Portal
Commits
7fc02fb0
Commit
7fc02fb0
authored
6 years ago
by
Gustavo Hornig
Browse files
Options
Downloads
Patches
Plain Diff
Fix bugs
parent
a4573320
No related branches found
No related tags found
1 merge request
!2
Create category page
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
smppir-checkin-portal/src/App.js
+2
-0
2 additions, 0 deletions
smppir-checkin-portal/src/App.js
smppir-checkin-portal/src/Pages/Category.js
+68
-0
68 additions, 0 deletions
smppir-checkin-portal/src/Pages/Category.js
smppir-checkin-portal/src/env.js
+1
-1
1 addition, 1 deletion
smppir-checkin-portal/src/env.js
with
71 additions
and
1 deletion
smppir-checkin-portal/src/App.js
+
2
−
0
View file @
7fc02fb0
...
...
@@ -5,6 +5,7 @@ import MainPage from './Pages/MainPage'
import
Login
from
'
./Pages/Login
'
import
Welcome
from
'
./Pages/Welcome
'
import
Map
from
'
./Pages/Map
'
import
Category
from
'
./Pages/Category
'
class
App
extends
Component
{
constructor
(
props
)
{
...
...
@@ -23,6 +24,7 @@ class App extends Component {
<
Route
exact
=
{
true
}
path
=
"
/
"
component
=
{
MainPage
}
/
>
<
Route
exact
=
{
true
}
path
=
"
/login
"
render
=
{()
=><
Login
saveCredentials
=
{
this
.
saveCredentials
}
/>}/
>
<
Route
exact
=
{
true
}
path
=
"
/welcome
"
render
=
{()
=><
Welcome
credentials
=
{
this
.
state
.
credentials
}
/>}/
>
<
Route
exact
=
{
true
}
path
=
"
/category
"
render
=
{()
=><
Category
credentials
=
{
this
.
state
.
credentials
}
/>}/
>
<
Route
exact
=
{
true
}
path
=
"
/map
"
component
=
{
Map
}
/
>
<
/div
>
<
/Router
>
...
...
This diff is collapsed.
Click to expand it.
smppir-checkin-portal/src/Pages/Category.js
0 → 100644
+
68
−
0
View file @
7fc02fb0
import
React
,
{
Component
}
from
'
react
'
;
import
'
./Styles/MainPage.css
'
;
import
BarraBrasil
from
'
../Components/BarraBrasil
'
import
{
NavItem
,
Row
,
Col
,
Card
}
from
'
react-materialize
'
import
AppFooter
from
'
../Components/AppFooter
'
import
NavigationBar
from
'
../Components/NavigationBar
'
import
{
Redirect
}
from
'
react-router-dom
'
import
{
URL
,
ADMIN_FEATURES
}
from
'
../env
'
import
axios
from
'
axios
'
import
List
from
'
../Components/List
'
class
Welcome
extends
Component
{
constructor
(
props
)
{
console
.
log
(
"
DEBUG :
"
,
props
.
credentials
)
super
(
props
);
this
.
state
=
{
'
credentials
'
:
{},
'
currentUser
'
:
{}
}
}
componentWillMount
(){
console
.
log
(
"
DEBUG CREDENTIALS -> :
"
,
this
.
props
)
if
(
this
.
props
.
credentials
.
id
)
{
axios
.
get
(
`
${
URL
}
end_users/
${
this
.
props
.
credentials
.
userId
}
?access_token=
${
this
.
props
.
credentials
.
id
}
`
).
then
((
resp
)
=>
{
console
.
log
(
resp
)
this
.
setState
({
'
credentials
'
:
this
.
props
.
credentials
,
'
currentUser
'
:
resp
.
data
.
result
})
})
}
}
render
()
{
console
.
log
(
"
DEBUG 1:
"
,
this
.
props
.
credentials
.
id
);
console
.
log
(
"
DEBUG 2:
"
,
this
.
state
);
if
(
this
.
props
.
credentials
.
id
){
return
(
<
div
>
<
BarraBrasil
/>
<
NavigationBar
button
=
{
<
NavItem
id
=
{
'
login-btn
'
}
href
=
'
/login
'
>
Login
<
/NavItem>}/
>
<
Row
>
<
Col
s
=
{
12
}
m
=
{
6
}
offset
=
{
'
m3
'
}
>
<
Card
>
<
p
>
Bem
-
vindo
<
b
>
{
this
.
state
.
currentUser
.
name
}
<
/b>, o que faremos agora
?
</
p
>
<
Row
>
<
List
items
=
{
ADMIN_FEATURES
}
/
>
<
/Row
>
<
/Card
>
<
/Col
>
<
/Row
>
<
AppFooter
/>
<
/div
>
);
}
else
{
return
(
<
Redirect
to
=
'
/login
'
/>
);
}
}
}
export
default
Welcome
;
\ No newline at end of file
This diff is collapsed.
Click to expand it.
smppir-checkin-portal/src/env.js
+
1
−
1
View file @
7fc02fb0
...
...
@@ -2,7 +2,7 @@ export const URL = "http://seppirhomologa.c3sl.ufpr.br/mobileAPI/api/"
export
const
ADMIN_FEATURES
=
[
{
'
value
'
:
'
Gerar Relatório
'
,
'
active
'
:
false
},
{
'
value
'
:
'
Gerenciar Usuários
'
,
'
active
'
:
false
},
{
'
value
'
:
'
Gerenciar Categorias
'
,
'
active
'
:
false
},
{
'
value
'
:
'
Gerenciar Categorias
'
,
'
active
'
:
false
,
'
href
'
:
'
/category
'
},
{
'
value
'
:
'
Gerenciar Localizações
'
,
'
active
'
:
false
},
{
'
value
'
:
'
Visualizar Mapa
'
,
'
active
'
:
false
}
]
...
...
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