Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Géocontrib Frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Contributor 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
externe Matthieu
Géocontrib Frontend
Commits
d517222e
Commit
d517222e
authored
2 years ago
by
Timothee P
Browse files
Options
Downloads
Patches
Plain Diff
display info message if offline
parent
a2539c88
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/views/Project/FeaturesListAndMap.vue
+22
-3
22 additions, 3 deletions
src/views/Project/FeaturesListAndMap.vue
with
22 additions
and
3 deletions
src/views/Project/FeaturesListAndMap.vue
+
22
−
3
View file @
d517222e
...
...
@@ -180,6 +180,17 @@ export default {
},
},
watch
:
{
isOnline
(
newValue
,
oldValue
)
{
if
(
newValue
!=
oldValue
&&
!
newValue
)
{
this
.
DISPLAY_MESSAGE
({
comment
:
'
Les signalements du projet non mis en cache ne sont pas accessibles en mode déconnecté
'
,
});
}
},
},
mounted
()
{
if
(
!
this
.
project
)
{
// Chargements des features et infos projet en cas d'arrivée directe sur la page ou de refresh
...
...
@@ -199,6 +210,9 @@ export default {
},
methods
:
{
...
mapMutations
([
'
DISPLAY_MESSAGE
'
,
]),
...
mapActions
(
'
feature
'
,
[
'
DELETE_FEATURE
'
,
]),
...
...
@@ -246,7 +260,7 @@ export default {
this
.
UPDATE_CHECKED_FEATURES
(
newCheckedFeatures
);
this
.
modifyStatus
(
newStatus
);
}
else
{
this
.
$store
.
commit
(
'
DISPLAY_MESSAGE
'
,
{
this
.
DISPLAY_MESSAGE
(
{
comment
:
`Le signalement
${
feature
.
title
}
n'a pas pu être modifié`
,
level
:
'
negative
'
});
...
...
@@ -256,7 +270,7 @@ export default {
}
}
else
{
this
.
fetchPagedFeatures
();
this
.
$store
.
commit
(
'
DISPLAY_MESSAGE
'
,
{
this
.
DISPLAY_MESSAGE
(
{
comment
:
'
Tous les signalements ont été modifié avec succès.
'
,
level
:
'
positive
'
});
...
...
@@ -387,7 +401,12 @@ export default {
},
fetchPagedFeatures
(
newUrl
)
{
if
(
!
this
.
isOnline
)
return
;
if
(
!
navigator
.
onLine
)
{
this
.
DISPLAY_MESSAGE
({
comment
:
'
Les signalements du projet non mis en cache ne sont pas accessibles en mode déconnecté
'
,
});
return
;
}
let
url
=
`
${
this
.
API_BASE_URL
}
projects/
${
this
.
projectSlug
}
/feature-paginated/?limit=
${
this
.
pagination
.
pagesize
}
&offset=
${
this
.
pagination
.
start
}
`
;
//* if receiving next & previous url (// todo : might be not used anymore, to check)
if
(
newUrl
&&
typeof
newUrl
===
'
string
'
)
{
...
...
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