Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Client
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
Container 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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
web-et-numerique
Factory
Resin
Client
Commits
9cbb1b10
Commit
9cbb1b10
authored
2 years ago
by
Hugo SUBTIL
Browse files
Options
Downloads
Patches
Plain Diff
feat: add loader for app in order to prevent render issue
parent
167feb5d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
4 merge requests
!418
V2.1.0
,
!400
V2.0
,
!281
feat: add loader for app in order to prevent render issue
,
!230
V2.0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/app/app.component.html
+5
-1
5 additions, 1 deletion
src/app/app.component.html
src/app/app.component.scss
+8
-9
8 additions, 9 deletions
src/app/app.component.scss
src/app/app.component.ts
+24
-2
24 additions, 2 deletions
src/app/app.component.ts
with
37 additions
and
12 deletions
src/app/app.component.html
+
5
−
1
View file @
9cbb1b10
<div
class=
"app-container"
>
<app-header></app-header>
<div
class=
"app-body"
>
<div
*ngIf=
"loading"
class=
"loader"
>
<img
class=
"loader-gif"
src=
"/assets/gif/loader_circle.gif"
alt
/>
</div>
<ng-container>
</ng-container>
<router-outlet
name=
"left-pane"
></router-outlet>
<router-outlet></router-outlet>
<router-outlet
name=
"print"
></router-outlet>
<router-outlet
name=
"footer"
></router-outlet>
<router-outlet
*ngIf=
"!loading"
name=
"footer"
></router-outlet>
</div>
</div>
This diff is collapsed.
Click to expand it.
src/app/app.component.scss
+
8
−
9
View file @
9cbb1b10
...
...
@@ -20,13 +20,12 @@
height
:
calc
(
100vh
-
#{
$header-height
}
);
}
.motif
{
background-color
:
$primary-color
;
background-size
:
58px
58px
;
background-position
:
0px
2px
,
4px
35px
,
29px
31px
,
33px
6px
,
0px
36px
,
4px
2px
,
29px
6px
,
33px
30px
;
background-image
:
linear-gradient
(
335deg
,
$white
23px
,
transparent
23px
)
,
linear-gradient
(
155deg
,
$white
23px
,
transparent
23px
)
,
linear-gradient
(
335deg
,
$white
23px
,
transparent
23px
)
,
linear-gradient
(
155deg
,
$white
23px
,
transparent
23px
)
,
linear-gradient
(
335deg
,
$white
10px
,
transparent
10px
)
,
linear-gradient
(
155deg
,
$white
10px
,
transparent
10px
)
,
linear-gradient
(
335deg
,
$white
10px
,
transparent
10px
)
,
linear-gradient
(
155deg
,
$white
10px
,
transparent
10px
);
.loader
{
height
:
100%
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
&
.loader-gif
{
max-height
:
185px
;
}
}
This diff is collapsed.
Click to expand it.
src/app/app.component.ts
+
24
−
2
View file @
9cbb1b10
import
{
Component
,
OnInit
}
from
'
@angular/core
'
;
import
{
Navigation
End
,
Router
}
from
'
@angular/router
'
;
import
{
Navigation
Cancel
,
NavigationEnd
,
NavigationError
,
NavigationStart
,
Router
}
from
'
@angular/router
'
;
import
{
ProfileService
}
from
'
./profile/services/profile.service
'
;
import
{
AuthService
}
from
'
./services/auth.service
'
;
import
{
RouterListenerService
}
from
'
./services/routerListener.service
'
;
...
...
@@ -12,7 +12,8 @@ import { PrintService } from './shared/service/print.service';
styleUrls
:
[
'
./app.component.scss
'
],
})
export
class
AppComponent
implements
OnInit
{
title
=
'
resin
'
;
public
title
=
'
resin
'
;
public
loading
=
true
;
constructor
(
public
printService
:
PrintService
,
...
...
@@ -32,6 +33,27 @@ export class AppComponent implements OnInit {
this
.
routerListener
.
loadRouting
();
// handle pwa update
this
.
updateService
.
subscribeUpdate
();
this
.
router
.
events
.
subscribe
((
event
)
=>
{
switch
(
true
)
{
case
event
instanceof
NavigationStart
:
{
this
.
loading
=
true
;
break
;
}
case
event
instanceof
NavigationEnd
:
case
event
instanceof
NavigationCancel
:
case
event
instanceof
NavigationError
:
{
setTimeout
(()
=>
{
this
.
loading
=
false
;
},
100
);
break
;
}
default
:
{
break
;
}
}
});
}
ngOnInit
():
void
{
...
...
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