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
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
7444dae1
Commit
7444dae1
authored
4 years ago
by
Raul Almeida
Browse files
Options
Downloads
Patches
Plain Diff
WIP add iframe page
parent
e446ad42
No related branches found
No related tags found
4 merge requests
!57
Merge of develop into master
,
!56
Fixed buttons reportar, seguir, compartilhar, guardar and entrar (in comments...
,
!39
Update admin system
,
!32
Homologa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/App.js
+15
-4
15 additions, 4 deletions
src/App.js
src/Pages/FormationMaterialIframe.js
+57
-0
57 additions, 0 deletions
src/Pages/FormationMaterialIframe.js
with
72 additions
and
4 deletions
src/App.js
+
15
−
4
View file @
7444dae1
...
@@ -16,7 +16,7 @@ GNU Affero General Public License for more details.
...
@@ -16,7 +16,7 @@ GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
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/>.*/
along with Plataforma Integrada MEC. If not, see <http://www.gnu.org/licenses/>.*/
import
React
,
{
useContext
,
useEffect
}
from
'
react
'
;
import
React
,
{
useContext
,
useEffect
,
useState
}
from
'
react
'
;
import
Home
from
'
./Pages/Home
'
;
import
Home
from
'
./Pages/Home
'
;
import
Search
from
'
./Pages/Search
'
import
Search
from
'
./Pages/Search
'
import
Header
from
'
./Components/Header
'
import
Header
from
'
./Components/Header
'
...
@@ -35,7 +35,7 @@ import TabManageAc from './Pages/TabsHelp/TabManageAc';
...
@@ -35,7 +35,7 @@ import TabManageAc from './Pages/TabsHelp/TabManageAc';
import
PasswordRecoveryPage
from
'
./Pages/PasswordRecoveryPage.js
'
import
PasswordRecoveryPage
from
'
./Pages/PasswordRecoveryPage.js
'
import
PageProfessor
from
'
./Pages/PageProfessor.js
'
import
PageProfessor
from
'
./Pages/PageProfessor.js
'
import
ResourcePage
from
'
./Pages/ResourcePage
'
;
import
ResourcePage
from
'
./Pages/ResourcePage
'
;
import
{
BrowserRouter
,
Switch
,
Route
}
from
'
react-router-dom
'
;
import
{
BrowserRouter
,
Switch
,
Route
,
useLocation
}
from
'
react-router-dom
'
;
import
{
Store
}
from
'
./Store
'
import
{
Store
}
from
'
./Store
'
import
TermsPage
from
'
./Pages/TermsPage.js
'
import
TermsPage
from
'
./Pages/TermsPage.js
'
import
PublicationPermissionsPage
from
'
./Pages/PublicationPermissionsPage.js
'
import
PublicationPermissionsPage
from
'
./Pages/PublicationPermissionsPage.js
'
...
@@ -44,10 +44,16 @@ import ItemStore from './Pages/ItemStore.js'
...
@@ -44,10 +44,16 @@ import ItemStore from './Pages/ItemStore.js'
import
EditProfilePage
from
'
./Pages/EditProfilePage.js
'
import
EditProfilePage
from
'
./Pages/EditProfilePage.js
'
import
PublicUserPage
from
'
./Pages/PublicUserPage.js
'
import
PublicUserPage
from
'
./Pages/PublicUserPage.js
'
import
FormationMaterialPage
from
'
./Pages/FormationMaterialPage.js
'
;
import
FormationMaterialPage
from
'
./Pages/FormationMaterialPage.js
'
;
import
FormationMaterialIframe
from
'
./Pages/FormationMaterialIframe.js
'
;
export
default
function
App
(){
export
default
function
App
(){
// eslint-disable-next-line
// eslint-disable-next-line
const
{
state
,
dispatch
}
=
useContext
(
Store
)
const
{
state
,
dispatch
}
=
useContext
(
Store
)
const
[
hideFooter
,
setHideFooter
]
=
useState
(
false
);
useEffect
(()
=>
{
setHideFooter
(
String
(
window
.
location
.
href
).
includes
(
'
iframe-colecao
'
));
},
[
window
.
location
.
href
]);
useEffect
(()
=>
{
useEffect
(()
=>
{
dispatch
({
dispatch
({
...
@@ -104,9 +110,14 @@ export default function App(){
...
@@ -104,9 +110,14 @@ export default function App(){
<
Route
path
=
'
/loja
'
component
=
{
ItemStore
}
/
>
<
Route
path
=
'
/loja
'
component
=
{
ItemStore
}
/
>
<
Route
path
=
'
/colecao
'
component
=
{
FormationMaterialPage
}
/
>
<
Route
path
=
'
/colecao
'
component
=
{
FormationMaterialPage
}
/
>
<
Route
path
=
'
/topico
'
component
=
{
FormationMaterialPage
}
/
>
<
Route
path
=
'
/topico
'
component
=
{
FormationMaterialPage
}
/
>
<
Route
path
=
'
/iframe-colecao
'
component
=
{
FormationMaterialIframe
}
/
>
<
/Switch
>
<
/Switch
>
<
EcFooter
/>
{
!
hideFooter
&&
<
GNUAGPLfooter
/>
<
div
>
<
EcFooter
/>
<
GNUAGPLfooter
/>
<
/div
>
}
<
/BrowserRouter
>
<
/BrowserRouter
>
)
)
}
}
This diff is collapsed.
Click to expand it.
src/Pages/FormationMaterialIframe.js
0 → 100644
+
57
−
0
View file @
7444dae1
/*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
from
'
react
'
;
import
styled
from
'
styled-components
'
;
import
colecoes_obj
from
'
../Components/FormationMaterialsResources/formationMaterials.js
'
;
export
default
function
FormationMaterialIframe
(
props
)
{
const
colecao
=
props
.
location
.
pathname
==
"
/colecao
"
;
const
colecoes
=
colecoes_obj
();
const
colecao_id
=
Number
(
colecao
?
props
.
location
.
search
.
split
(
'
=
'
)[
1
]
:
props
.
location
.
search
.
split
(
'
&
'
)[
0
].
split
(
'
=
'
)[
1
]
);
const
topico_id
=
Number
(
colecao
?
0
:
props
.
location
.
search
.
split
(
'
&
'
)[
1
].
split
(
'
=
'
)[
1
]);
const
colecao_obj
=
((
id
)
=>
{
for
(
const
c
in
colecoes
)
{
if
(
id
==
colecoes
[
c
].
id
)
return
colecoes
[
c
];
}
})(
colecao_id
);
const
topico_obj
=
((
id
)
=>
{
for
(
const
t
in
colecao_obj
.
topics
)
{
if
(
id
==
colecao_obj
.
topics
[
t
].
id
)
return
colecao_obj
.
topics
[
t
];
}
})(
topico_id
);
return
(
<
StyledIframe
src
=
{
topico_obj
.
url
}
/
>
);
}
const
StyledIframe
=
styled
.
iframe
`
width: 98.vw;
height: 83.5vh;
min-height: 300px;
`
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