Mercurial > gemma
annotate client/src/lib/errors.js @ 5095:e21cbb9768a2
Prevent duplicate fairway areas
In principal, there can be only one or no fairway area at each point
on the map. Since polygons from real data will often be topologically
inexact, just disallow equal geometries. This will also help to
avoid importing duplicates with concurrent imports, once the history
of fairway dimensions will be preserved.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Wed, 25 Mar 2020 18:10:02 +0100 |
parents | a6eea3002e6e |
children |
rev | line source |
---|---|
1362
ca33ad696594
remove the first empyty lines
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1361
diff
changeset
|
1 /* This is Free Software under GNU Affero General Public License v >= 3.0 |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
2 * without warranty, see README.md and license for details. |
1361
ea3a89a1813a
remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1272
diff
changeset
|
3 * |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
4 * SPDX-License-Identifier: AGPL-3.0-or-later |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
5 * License-Filename: LICENSES/AGPL-3.0.txt |
1361
ea3a89a1813a
remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1272
diff
changeset
|
6 * |
ea3a89a1813a
remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1272
diff
changeset
|
7 * Copyright (C) 2018 by via donau |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
8 * – Österreichische Wasserstraßen-Gesellschaft mbH |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
9 * Software engineering by Intevation GmbH |
1361
ea3a89a1813a
remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1272
diff
changeset
|
10 * |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
11 * Author(s): |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
12 * Thomas Junk <thomas.junk@intevation.de> |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
13 */ |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
14 |
2947
a6eea3002e6e
client: cleanup import paths
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1724
diff
changeset
|
15 import app from "@/main"; |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
16 |
1475
2365acde39dc
Staging area: Dealing with backend response.
Thomas Junk <thomas.junk@intevation.de>
parents:
1368
diff
changeset
|
17 let displayOptions = { |
2365acde39dc
Staging area: Dealing with backend response.
Thomas Junk <thomas.junk@intevation.de>
parents:
1368
diff
changeset
|
18 timeout: 2500, |
1368
d1d8c7bd16a1
switched from vue2-toastr to vue-snotify
Thomas Junk <thomas.junk@intevation.de>
parents:
1362
diff
changeset
|
19 showProgressBar: false, |
1475
2365acde39dc
Staging area: Dealing with backend response.
Thomas Junk <thomas.junk@intevation.de>
parents:
1368
diff
changeset
|
20 closeOnClick: true, |
1368
d1d8c7bd16a1
switched from vue2-toastr to vue-snotify
Thomas Junk <thomas.junk@intevation.de>
parents:
1362
diff
changeset
|
21 pauseOnHover: true, |
d1d8c7bd16a1
switched from vue2-toastr to vue-snotify
Thomas Junk <thomas.junk@intevation.de>
parents:
1362
diff
changeset
|
22 oneAtTime: true, |
1475
2365acde39dc
Staging area: Dealing with backend response.
Thomas Junk <thomas.junk@intevation.de>
parents:
1368
diff
changeset
|
23 bodyMaxLength: 1024 |
1368
d1d8c7bd16a1
switched from vue2-toastr to vue-snotify
Thomas Junk <thomas.junk@intevation.de>
parents:
1362
diff
changeset
|
24 }; |
d1d8c7bd16a1
switched from vue2-toastr to vue-snotify
Thomas Junk <thomas.junk@intevation.de>
parents:
1362
diff
changeset
|
25 |
1475
2365acde39dc
Staging area: Dealing with backend response.
Thomas Junk <thomas.junk@intevation.de>
parents:
1368
diff
changeset
|
26 const displayError = ({ title, message, options }) => { |
2365acde39dc
Staging area: Dealing with backend response.
Thomas Junk <thomas.junk@intevation.de>
parents:
1368
diff
changeset
|
27 if (!options) options = {}; |
2365acde39dc
Staging area: Dealing with backend response.
Thomas Junk <thomas.junk@intevation.de>
parents:
1368
diff
changeset
|
28 const mergedOptions = { ...displayOptions, ...options }; |
1724
79a18eb1672b
import: POC import saveable
Thomas Junk <thomas.junk@intevation.de>
parents:
1475
diff
changeset
|
29 app.$snotify.error(message, title, mergedOptions); |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
30 }; |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
31 |
1475
2365acde39dc
Staging area: Dealing with backend response.
Thomas Junk <thomas.junk@intevation.de>
parents:
1368
diff
changeset
|
32 const displayInfo = ({ title, message, options }) => { |
2365acde39dc
Staging area: Dealing with backend response.
Thomas Junk <thomas.junk@intevation.de>
parents:
1368
diff
changeset
|
33 if (!options) options = {}; |
2365acde39dc
Staging area: Dealing with backend response.
Thomas Junk <thomas.junk@intevation.de>
parents:
1368
diff
changeset
|
34 const mergedOptions = { ...displayOptions, ...options }; |
2365acde39dc
Staging area: Dealing with backend response.
Thomas Junk <thomas.junk@intevation.de>
parents:
1368
diff
changeset
|
35 app.$snotify.info(message, title, mergedOptions); |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
36 }; |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
37 |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
38 export { displayError, displayInfo }; |