@kalisio/kdk 1.3.5 → 1.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (535) hide show
  1. package/.nyc_output/2c5b7c8e-81db-4d2c-a7a4-02dc640d301f.json +1 -0
  2. package/.nyc_output/{0b8aa700-8daa-49ce-85e7-a8f8965d55f0.json → 2e74ca23-8cf0-4161-9536-f71c2a1a74bb.json} +0 -0
  3. package/.nyc_output/{20df4355-911a-4b16-a8ab-d3392e9f0a7f.json → 81d21e46-766a-46bc-b1b7-143ca577347a.json} +0 -0
  4. package/.nyc_output/a762cb58-70dc-4d39-ab69-928635affa98.json +1 -0
  5. package/.nyc_output/{257af0bb-96c3-465a-b5ef-a1df60078d5f.json → aaf3ebbb-f895-4d7b-9255-bc5dee832570.json} +0 -0
  6. package/.nyc_output/{284aebfa-23fd-425f-9d72-e4b8904dc224.json → dbeb2602-0ac2-4e66-978b-0d29548359ca.json} +0 -0
  7. package/.nyc_output/{5cbee06e-be6e-468a-bd78-4793ee785fe4.json → e47d1e4c-2fff-4dcb-908f-d3081162547c.json} +0 -0
  8. package/.nyc_output/processinfo/{2bece194-92f7-4971-a688-10604044a7fa.json → 2c5b7c8e-81db-4d2c-a7a4-02dc640d301f.json} +1 -1
  9. package/.nyc_output/processinfo/2e74ca23-8cf0-4161-9536-f71c2a1a74bb.json +1 -0
  10. package/.nyc_output/processinfo/81d21e46-766a-46bc-b1b7-143ca577347a.json +1 -0
  11. package/.nyc_output/processinfo/a762cb58-70dc-4d39-ab69-928635affa98.json +1 -0
  12. package/.nyc_output/processinfo/aaf3ebbb-f895-4d7b-9255-bc5dee832570.json +1 -0
  13. package/.nyc_output/processinfo/dbeb2602-0ac2-4e66-978b-0d29548359ca.json +1 -0
  14. package/.nyc_output/processinfo/e47d1e4c-2fff-4dcb-908f-d3081162547c.json +1 -0
  15. package/.nyc_output/processinfo/index.json +1 -1
  16. package/CHANGELOG.md +189 -67
  17. package/README.md +1 -1
  18. package/coverage/core/api/application.js.html +145 -145
  19. package/coverage/core/api/authentication.js.html +37 -37
  20. package/coverage/core/api/db.js.html +74 -74
  21. package/coverage/core/api/hooks/hooks.account.js.html +15 -15
  22. package/coverage/core/api/hooks/hooks.authentication.js.html +16 -16
  23. package/coverage/core/api/hooks/hooks.authorisations.js.html +112 -121
  24. package/coverage/core/api/hooks/hooks.devices.js.html +5 -5
  25. package/coverage/core/api/hooks/hooks.groups.js.html +3 -3
  26. package/coverage/core/api/hooks/hooks.logger.js.html +7 -7
  27. package/coverage/core/api/hooks/hooks.model.js.html +149 -149
  28. package/coverage/core/api/hooks/hooks.organisations.js.html +13 -61
  29. package/coverage/core/api/hooks/hooks.pusher.js.html +7 -7
  30. package/coverage/core/api/hooks/hooks.query.js.html +68 -32
  31. package/coverage/core/api/hooks/hooks.service.js.html +15 -15
  32. package/coverage/core/api/hooks/hooks.storage.js.html +5 -5
  33. package/coverage/core/api/hooks/hooks.tags.js.html +7 -7
  34. package/coverage/core/api/hooks/hooks.users.js.html +111 -63
  35. package/coverage/core/api/hooks/index.html +72 -72
  36. package/coverage/core/api/hooks/index.js.html +15 -15
  37. package/coverage/core/api/index.html +35 -35
  38. package/coverage/core/api/index.js.html +13 -13
  39. package/coverage/core/api/marshall.js.html +81 -81
  40. package/coverage/core/api/models/groups.model.mongodb.js.html +1 -1
  41. package/coverage/core/api/models/index.html +1 -1
  42. package/coverage/core/api/models/organisations.model.mongodb.js.html +1 -1
  43. package/coverage/core/api/models/tags.model.mongodb.js.html +1 -1
  44. package/coverage/core/api/models/users.model.mongodb.js.html +7 -7
  45. package/coverage/core/api/oauth2-handler.js.html +3 -3
  46. package/coverage/core/api/oauth2-verifier.js.html +5 -5
  47. package/coverage/core/api/services/account/account.hooks.js.html +1 -1
  48. package/coverage/core/api/services/account/account.service.js.html +34 -34
  49. package/coverage/core/api/services/account/index.html +17 -17
  50. package/coverage/core/api/services/authorisations/authorisations.hooks.js.html +3 -3
  51. package/coverage/core/api/services/authorisations/authorisations.service.js.html +40 -37
  52. package/coverage/core/api/services/authorisations/index.html +17 -17
  53. package/coverage/core/api/services/databases/databases.hooks.js.html +1 -1
  54. package/coverage/core/api/services/databases/databases.service.js.html +1 -1
  55. package/coverage/core/api/services/databases/index.html +1 -1
  56. package/coverage/core/api/services/devices/devices.hooks.js.html +1 -1
  57. package/coverage/core/api/services/devices/devices.service.js.html +1 -1
  58. package/coverage/core/api/services/devices/index.html +1 -1
  59. package/coverage/core/api/services/groups/groups.hooks.js.html +1 -1
  60. package/coverage/core/api/services/groups/index.html +1 -1
  61. package/coverage/core/api/services/index.html +5 -5
  62. package/coverage/core/api/services/index.js.html +40 -40
  63. package/coverage/core/api/services/mailer/index.html +1 -1
  64. package/coverage/core/api/services/mailer/mailer.hooks.js.html +1 -1
  65. package/coverage/core/api/services/mailer/mailer.service.js.html +1 -1
  66. package/coverage/core/api/services/organisations/index.html +1 -1
  67. package/coverage/core/api/services/organisations/organisations.hooks.js.html +1 -1
  68. package/coverage/core/api/services/organisations/organisations.service.js.html +1 -1
  69. package/coverage/core/api/services/pusher/index.html +1 -1
  70. package/coverage/core/api/services/pusher/pusher.channels.js.html +1 -1
  71. package/coverage/core/api/services/pusher/pusher.hooks.js.html +1 -1
  72. package/coverage/core/api/services/pusher/pusher.service.js.html +1 -1
  73. package/coverage/core/api/services/storage/index.html +1 -1
  74. package/coverage/core/api/services/storage/storage.hooks.js.html +4 -4
  75. package/coverage/core/api/services/tags/index.html +1 -1
  76. package/coverage/core/api/services/tags/tags.hooks.js.html +1 -1
  77. package/coverage/core/api/services/users/index.html +1 -1
  78. package/coverage/core/api/services/users/users.hooks.js.html +12 -12
  79. package/coverage/core/common/index.html +32 -32
  80. package/coverage/core/common/index.js.html +27 -27
  81. package/coverage/core/common/permissions.js.html +135 -75
  82. package/coverage/index.html +157 -157
  83. package/coverage/lcov-report/core/api/application.js.html +145 -145
  84. package/coverage/lcov-report/core/api/authentication.js.html +37 -37
  85. package/coverage/lcov-report/core/api/db.js.html +74 -74
  86. package/coverage/lcov-report/core/api/hooks/hooks.account.js.html +15 -15
  87. package/coverage/lcov-report/core/api/hooks/hooks.authentication.js.html +16 -16
  88. package/coverage/lcov-report/core/api/hooks/hooks.authorisations.js.html +112 -121
  89. package/coverage/lcov-report/core/api/hooks/hooks.devices.js.html +5 -5
  90. package/coverage/lcov-report/core/api/hooks/hooks.groups.js.html +3 -3
  91. package/coverage/lcov-report/core/api/hooks/hooks.logger.js.html +7 -7
  92. package/coverage/lcov-report/core/api/hooks/hooks.model.js.html +149 -149
  93. package/coverage/lcov-report/core/api/hooks/hooks.organisations.js.html +13 -61
  94. package/coverage/lcov-report/core/api/hooks/hooks.pusher.js.html +7 -7
  95. package/coverage/lcov-report/core/api/hooks/hooks.query.js.html +68 -32
  96. package/coverage/lcov-report/core/api/hooks/hooks.service.js.html +15 -15
  97. package/coverage/lcov-report/core/api/hooks/hooks.storage.js.html +5 -5
  98. package/coverage/lcov-report/core/api/hooks/hooks.tags.js.html +7 -7
  99. package/coverage/lcov-report/core/api/hooks/hooks.users.js.html +111 -63
  100. package/coverage/lcov-report/core/api/hooks/index.html +72 -72
  101. package/coverage/lcov-report/core/api/hooks/index.js.html +15 -15
  102. package/coverage/lcov-report/core/api/index.html +35 -35
  103. package/coverage/lcov-report/core/api/index.js.html +13 -13
  104. package/coverage/lcov-report/core/api/marshall.js.html +81 -81
  105. package/coverage/lcov-report/core/api/models/groups.model.mongodb.js.html +1 -1
  106. package/coverage/lcov-report/core/api/models/index.html +1 -1
  107. package/coverage/lcov-report/core/api/models/organisations.model.mongodb.js.html +1 -1
  108. package/coverage/lcov-report/core/api/models/tags.model.mongodb.js.html +1 -1
  109. package/coverage/lcov-report/core/api/models/users.model.mongodb.js.html +7 -7
  110. package/coverage/lcov-report/core/api/oauth2-handler.js.html +3 -3
  111. package/coverage/lcov-report/core/api/oauth2-verifier.js.html +5 -5
  112. package/coverage/lcov-report/core/api/services/account/account.hooks.js.html +1 -1
  113. package/coverage/lcov-report/core/api/services/account/account.service.js.html +34 -34
  114. package/coverage/lcov-report/core/api/services/account/index.html +17 -17
  115. package/coverage/lcov-report/core/api/services/authorisations/authorisations.hooks.js.html +3 -3
  116. package/coverage/lcov-report/core/api/services/authorisations/authorisations.service.js.html +40 -37
  117. package/coverage/lcov-report/core/api/services/authorisations/index.html +17 -17
  118. package/coverage/lcov-report/core/api/services/databases/databases.hooks.js.html +1 -1
  119. package/coverage/lcov-report/core/api/services/databases/databases.service.js.html +1 -1
  120. package/coverage/lcov-report/core/api/services/databases/index.html +1 -1
  121. package/coverage/lcov-report/core/api/services/devices/devices.hooks.js.html +1 -1
  122. package/coverage/lcov-report/core/api/services/devices/devices.service.js.html +1 -1
  123. package/coverage/lcov-report/core/api/services/devices/index.html +1 -1
  124. package/coverage/lcov-report/core/api/services/groups/groups.hooks.js.html +1 -1
  125. package/coverage/lcov-report/core/api/services/groups/index.html +1 -1
  126. package/coverage/lcov-report/core/api/services/index.html +5 -5
  127. package/coverage/lcov-report/core/api/services/index.js.html +40 -40
  128. package/coverage/lcov-report/core/api/services/mailer/index.html +1 -1
  129. package/coverage/lcov-report/core/api/services/mailer/mailer.hooks.js.html +1 -1
  130. package/coverage/lcov-report/core/api/services/mailer/mailer.service.js.html +1 -1
  131. package/coverage/lcov-report/core/api/services/organisations/index.html +1 -1
  132. package/coverage/lcov-report/core/api/services/organisations/organisations.hooks.js.html +1 -1
  133. package/coverage/lcov-report/core/api/services/organisations/organisations.service.js.html +1 -1
  134. package/coverage/lcov-report/core/api/services/pusher/index.html +1 -1
  135. package/coverage/lcov-report/core/api/services/pusher/pusher.channels.js.html +1 -1
  136. package/coverage/lcov-report/core/api/services/pusher/pusher.hooks.js.html +1 -1
  137. package/coverage/lcov-report/core/api/services/pusher/pusher.service.js.html +1 -1
  138. package/coverage/lcov-report/core/api/services/storage/index.html +1 -1
  139. package/coverage/lcov-report/core/api/services/storage/storage.hooks.js.html +4 -4
  140. package/coverage/lcov-report/core/api/services/tags/index.html +1 -1
  141. package/coverage/lcov-report/core/api/services/tags/tags.hooks.js.html +1 -1
  142. package/coverage/lcov-report/core/api/services/users/index.html +1 -1
  143. package/coverage/lcov-report/core/api/services/users/users.hooks.js.html +12 -12
  144. package/coverage/lcov-report/core/common/index.html +32 -32
  145. package/coverage/lcov-report/core/common/index.js.html +27 -27
  146. package/coverage/lcov-report/core/common/permissions.js.html +135 -75
  147. package/coverage/lcov-report/index.html +157 -157
  148. package/coverage/lcov-report/map/api/hooks/hooks.catalog.js.html +55 -55
  149. package/coverage/lcov-report/map/api/hooks/hooks.query.js.html +337 -274
  150. package/coverage/lcov-report/map/api/hooks/index.html +43 -43
  151. package/coverage/lcov-report/map/api/hooks/index.js.html +12 -12
  152. package/coverage/lcov-report/map/api/index.html +31 -31
  153. package/coverage/lcov-report/map/api/index.js.html +24 -24
  154. package/coverage/lcov-report/map/api/marshall.js.html +39 -39
  155. package/coverage/lcov-report/map/api/models/alerts.model.mongodb.js.html +20 -20
  156. package/coverage/lcov-report/map/api/models/catalog.model.mongodb.js.html +22 -22
  157. package/coverage/lcov-report/map/api/models/features.model.mongodb.js.html +24 -24
  158. package/coverage/lcov-report/map/api/models/index.html +43 -43
  159. package/coverage/lcov-report/map/api/services/alerts/alerts.hooks.js.html +21 -21
  160. package/coverage/lcov-report/map/api/services/alerts/alerts.service.js.html +156 -156
  161. package/coverage/lcov-report/map/api/services/alerts/index.html +30 -30
  162. package/coverage/lcov-report/map/api/services/catalog/catalog.hooks.js.html +19 -19
  163. package/coverage/lcov-report/map/api/services/catalog/index.html +17 -17
  164. package/coverage/lcov-report/map/api/services/daptiles/daptiles.service.js.html +1 -1
  165. package/coverage/lcov-report/map/api/services/daptiles/index.html +1 -1
  166. package/coverage/lcov-report/map/api/services/features/features.hooks.js.html +20 -20
  167. package/coverage/lcov-report/map/api/services/features/index.html +21 -21
  168. package/coverage/lcov-report/map/api/services/geocoder/geocoder.hooks.js.html +8 -8
  169. package/coverage/lcov-report/map/api/services/geocoder/geocoder.service.js.html +99 -99
  170. package/coverage/lcov-report/map/api/services/geocoder/index.html +28 -28
  171. package/coverage/lcov-report/map/api/services/index.html +21 -21
  172. package/coverage/lcov-report/map/api/services/index.js.html +71 -71
  173. package/coverage/lcov-report/map/common/dynamic-grid-source.js.html +68 -68
  174. package/coverage/lcov-report/map/common/errors.js.html +9 -9
  175. package/coverage/lcov-report/map/common/geotiff-grid-source.js.html +120 -120
  176. package/coverage/lcov-report/map/common/grid.js.html +268 -268
  177. package/coverage/lcov-report/map/common/index.html +149 -149
  178. package/coverage/lcov-report/map/common/index.js.html +31 -31
  179. package/coverage/lcov-report/map/common/meteo-model-grid-source.js.html +71 -71
  180. package/coverage/lcov-report/map/common/moment-utils.js.html +14 -14
  181. package/coverage/lcov-report/map/common/opendap-grid-source.js.html +280 -280
  182. package/coverage/lcov-report/map/common/opendap-utils.js.html +220 -220
  183. package/coverage/lcov-report/map/common/permissions.js.html +21 -21
  184. package/coverage/lcov-report/map/common/time-based-grid-source.js.html +51 -51
  185. package/coverage/lcov-report/map/common/tms-utils.js.html +1 -1
  186. package/coverage/lcov-report/map/common/wcs-grid-source.js.html +99 -99
  187. package/coverage/lcov-report/map/common/wcs-utils.js.html +66 -66
  188. package/coverage/lcov-report/map/common/weacast-grid-source.js.html +196 -196
  189. package/coverage/lcov-report/map/common/wfs-utils.js.html +8 -5
  190. package/coverage/lcov-report/map/common/wms-utils.js.html +1 -1
  191. package/coverage/lcov-report/map/common/wmts-utils.js.html +71 -11
  192. package/coverage/lcov.info +3588 -3659
  193. package/coverage/map/api/hooks/hooks.catalog.js.html +55 -55
  194. package/coverage/map/api/hooks/hooks.query.js.html +337 -274
  195. package/coverage/map/api/hooks/index.html +43 -43
  196. package/coverage/map/api/hooks/index.js.html +12 -12
  197. package/coverage/map/api/index.html +31 -31
  198. package/coverage/map/api/index.js.html +24 -24
  199. package/coverage/map/api/marshall.js.html +39 -39
  200. package/coverage/map/api/models/alerts.model.mongodb.js.html +20 -20
  201. package/coverage/map/api/models/catalog.model.mongodb.js.html +22 -22
  202. package/coverage/map/api/models/features.model.mongodb.js.html +24 -24
  203. package/coverage/map/api/models/index.html +43 -43
  204. package/coverage/map/api/services/alerts/alerts.hooks.js.html +21 -21
  205. package/coverage/map/api/services/alerts/alerts.service.js.html +156 -156
  206. package/coverage/map/api/services/alerts/index.html +30 -30
  207. package/coverage/map/api/services/catalog/catalog.hooks.js.html +19 -19
  208. package/coverage/map/api/services/catalog/index.html +17 -17
  209. package/coverage/map/api/services/daptiles/daptiles.service.js.html +1 -1
  210. package/coverage/map/api/services/daptiles/index.html +1 -1
  211. package/coverage/map/api/services/features/features.hooks.js.html +20 -20
  212. package/coverage/map/api/services/features/index.html +21 -21
  213. package/coverage/map/api/services/geocoder/geocoder.hooks.js.html +8 -8
  214. package/coverage/map/api/services/geocoder/geocoder.service.js.html +99 -99
  215. package/coverage/map/api/services/geocoder/index.html +28 -28
  216. package/coverage/map/api/services/index.html +21 -21
  217. package/coverage/map/api/services/index.js.html +71 -71
  218. package/coverage/map/common/dynamic-grid-source.js.html +68 -68
  219. package/coverage/map/common/errors.js.html +9 -9
  220. package/coverage/map/common/geotiff-grid-source.js.html +120 -120
  221. package/coverage/map/common/grid.js.html +268 -268
  222. package/coverage/map/common/index.html +149 -149
  223. package/coverage/map/common/index.js.html +31 -31
  224. package/coverage/map/common/meteo-model-grid-source.js.html +71 -71
  225. package/coverage/map/common/moment-utils.js.html +14 -14
  226. package/coverage/map/common/opendap-grid-source.js.html +280 -280
  227. package/coverage/map/common/opendap-utils.js.html +220 -220
  228. package/coverage/map/common/permissions.js.html +21 -21
  229. package/coverage/map/common/time-based-grid-source.js.html +51 -51
  230. package/coverage/map/common/tms-utils.js.html +1 -1
  231. package/coverage/map/common/wcs-grid-source.js.html +99 -99
  232. package/coverage/map/common/wcs-utils.js.html +66 -66
  233. package/coverage/map/common/weacast-grid-source.js.html +196 -196
  234. package/coverage/map/common/wfs-utils.js.html +8 -5
  235. package/coverage/map/common/wms-utils.js.html +1 -1
  236. package/coverage/map/common/wmts-utils.js.html +71 -11
  237. package/extras/icons/kanban.png +0 -0
  238. package/extras/testcafe/page-models/map/catalog.js +2 -2
  239. package/extras/tours/core/add-member.js +10 -1
  240. package/extras/tours/core/{tag-member.js → edit-member-tags.js} +4 -3
  241. package/extras/tours/core/groups.js +8 -2
  242. package/extras/tours/core/members.js +11 -21
  243. package/extras/tours/core/tags.js +7 -1
  244. package/extras/tours/map/catalog-categories.js +4 -4
  245. package/extras/tours/map/catalog-panel.js +16 -16
  246. package/extras/tours/map/favorite-views.js +3 -3
  247. package/lib/core/api/hooks/hooks.authorisations.js +149 -140
  248. package/lib/core/api/hooks/hooks.authorisations.js.map +1 -1
  249. package/lib/core/api/hooks/hooks.organisations.js +1 -23
  250. package/lib/core/api/hooks/hooks.organisations.js.map +1 -1
  251. package/lib/core/api/hooks/hooks.query.js +22 -0
  252. package/lib/core/api/hooks/hooks.query.js.map +1 -1
  253. package/lib/core/api/hooks/hooks.users.js +34 -18
  254. package/lib/core/api/hooks/hooks.users.js.map +1 -1
  255. package/lib/core/api/services/authorisations/authorisations.service.js +34 -25
  256. package/lib/core/api/services/authorisations/authorisations.service.js.map +1 -1
  257. package/lib/core/client/api.js +1 -0
  258. package/lib/core/client/api.js.map +1 -1
  259. package/lib/core/client/components/account/KAccountDZ.vue +3 -4
  260. package/lib/core/client/components/account/KAccountDevices.vue +5 -6
  261. package/lib/core/client/components/account/KDeviceCard.vue +2 -1
  262. package/lib/core/client/components/account/KIdentityPanel.vue +1 -7
  263. package/lib/core/client/components/collection/KBoard.vue +26 -155
  264. package/lib/core/client/components/collection/KCard.vue +144 -42
  265. package/lib/core/client/components/collection/KCardSection.vue +52 -0
  266. package/lib/core/client/components/collection/KColumn.vue +181 -0
  267. package/lib/core/client/components/collection/KGrid.vue +13 -18
  268. package/lib/core/client/components/collection/KHistory.vue +61 -89
  269. package/lib/core/client/components/collection/KHistoryEntry.vue +90 -66
  270. package/lib/core/client/components/collection/KItem.vue +21 -2
  271. package/lib/core/client/components/collection/KList.vue +9 -12
  272. package/lib/core/client/components/collection/KTable.vue +33 -39
  273. package/lib/core/client/components/collection/index.js +6 -1
  274. package/lib/core/client/components/collection/index.js.map +1 -1
  275. package/lib/core/client/components/editor/KEditor.vue +0 -6
  276. package/lib/core/client/components/editor/KModalEditor.vue +4 -4
  277. package/lib/core/client/components/editor/KSettingsEditor.vue +49 -0
  278. package/lib/core/client/components/form/KAttachmentField.vue +10 -10
  279. package/lib/core/client/components/form/KChipsField.vue +28 -23
  280. package/lib/core/client/components/form/KColorField.vue +30 -25
  281. package/lib/core/client/components/form/KForm.vue +0 -12
  282. package/lib/core/client/components/form/KIconField.vue +1 -0
  283. package/lib/core/client/components/form/KItemField.vue +8 -4
  284. package/lib/core/client/components/form/KRoleField.vue +56 -0
  285. package/lib/core/client/components/form/KSelectField.vue +16 -1
  286. package/lib/core/client/components/form/KView.vue +5 -14
  287. package/lib/core/client/components/frame/KAction.vue +18 -12
  288. package/lib/core/client/components/frame/KAvatar.vue +3 -3
  289. package/lib/core/client/components/frame/KChart.vue +60 -0
  290. package/lib/core/client/components/frame/KChipsPane.vue +80 -0
  291. package/lib/core/client/components/frame/KContent.vue +1 -1
  292. package/lib/core/client/components/frame/KModal.vue +30 -44
  293. package/lib/core/client/components/frame/KPanel.vue +1 -1
  294. package/lib/core/client/components/frame/{KMenu.vue → KPopupAction.vue} +6 -7
  295. package/lib/core/client/components/frame/KSpot.vue +31 -0
  296. package/lib/core/client/components/frame/KStamp.vue +62 -0
  297. package/lib/core/client/components/frame/index.js +56 -1
  298. package/lib/core/client/components/frame/index.js.map +1 -1
  299. package/lib/core/client/components/input/KColorChooser.vue +16 -8
  300. package/lib/core/client/components/input/KIconChooser.vue +2 -1
  301. package/lib/core/client/components/input/KUploader.vue +14 -5
  302. package/lib/core/client/components/layout/KAbout.vue +9 -3
  303. package/lib/core/client/components/layout/KFab.vue +1 -1
  304. package/lib/core/client/components/layout/KPage.vue +44 -19
  305. package/lib/core/client/components/layout/KTour.vue +2 -2
  306. package/lib/core/client/components/layout/KWelcome.vue +13 -12
  307. package/lib/core/client/components/layout/KWindow.vue +1 -1
  308. package/lib/core/client/components/media/KImageViewer.vue +9 -7
  309. package/lib/core/client/components/media/KMediaBrowser.vue +12 -8
  310. package/lib/core/client/components/menu/KMenu.vue +103 -0
  311. package/lib/core/client/components/team/KAddMember.vue +17 -9
  312. package/lib/core/client/components/team/KChangeRole.vue +5 -7
  313. package/lib/core/client/components/team/KGroupCard.vue +34 -51
  314. package/lib/core/client/components/team/KGroupsActivity.vue +9 -2
  315. package/lib/core/client/components/team/KJoinGroup.vue +5 -7
  316. package/lib/core/client/components/team/KMemberCard.vue +104 -63
  317. package/lib/core/client/components/team/KMembersActivity.vue +9 -2
  318. package/lib/core/client/components/team/KOrganisationsActivity.vue +8 -1
  319. package/lib/core/client/components/team/KTagCard.vue +26 -26
  320. package/lib/core/client/components/team/KTagsActivity.vue +9 -2
  321. package/lib/core/client/components/time/KTimeRange.vue +144 -0
  322. package/lib/core/client/components/viewer/KModalViewer.vue +6 -0
  323. package/lib/core/client/components/viewer/KViewer.vue +0 -6
  324. package/lib/core/client/i18n/core_en.json +133 -93
  325. package/lib/core/client/i18n/core_fr.json +56 -16
  326. package/lib/core/client/index.js +28 -14
  327. package/lib/core/client/index.js.map +1 -1
  328. package/lib/core/client/mixins/mixin.authorisation.js +28 -18
  329. package/lib/core/client/mixins/mixin.authorisation.js.map +1 -1
  330. package/lib/core/client/mixins/mixin.base-collection.js +57 -9
  331. package/lib/core/client/mixins/mixin.base-collection.js.map +1 -1
  332. package/lib/core/client/mixins/mixin.base-context.js +1 -1
  333. package/lib/core/client/mixins/mixin.base-context.js.map +1 -1
  334. package/lib/core/client/mixins/mixin.base-editor.js +26 -16
  335. package/lib/core/client/mixins/mixin.base-editor.js.map +1 -1
  336. package/lib/core/client/mixins/mixin.base-field.js +0 -4
  337. package/lib/core/client/mixins/mixin.base-field.js.map +1 -1
  338. package/lib/core/client/mixins/mixin.base-item.js +29 -14
  339. package/lib/core/client/mixins/mixin.base-item.js.map +1 -1
  340. package/lib/core/client/mixins/mixin.base-viewer.js +0 -2
  341. package/lib/core/client/mixins/mixin.base-viewer.js.map +1 -1
  342. package/lib/core/client/mixins/mixin.object-proxy.js +17 -3
  343. package/lib/core/client/mixins/mixin.object-proxy.js.map +1 -1
  344. package/lib/core/client/mixins/mixin.schema-proxy.js +31 -0
  345. package/lib/core/client/mixins/mixin.schema-proxy.js.map +1 -1
  346. package/lib/core/client/mixins/mixin.service.js +5 -33
  347. package/lib/core/client/mixins/mixin.service.js.map +1 -1
  348. package/lib/core/client/services/index.js +23 -0
  349. package/lib/core/client/services/index.js.map +1 -1
  350. package/lib/core/client/services/local-settings.service.js +4 -0
  351. package/lib/core/client/services/local-settings.service.js.map +1 -1
  352. package/lib/core/client/time.js +131 -0
  353. package/lib/core/client/time.js.map +1 -0
  354. package/lib/core/common/permissions.js +65 -23
  355. package/lib/core/common/permissions.js.map +1 -1
  356. package/lib/core/common/schemas/groups.create.json +1 -1
  357. package/lib/core/common/schemas/groups.update.json +1 -1
  358. package/lib/core/common/schemas/organisations.create.json +1 -1
  359. package/lib/core/common/schemas/organisations.update.json +2 -2
  360. package/lib/core/common/schemas/settings.update.json +139 -0
  361. package/lib/core/common/schemas/tags.update.json +9 -1
  362. package/lib/map/api/hooks/hooks.query.js +48 -27
  363. package/lib/map/api/hooks/hooks.query.js.map +1 -1
  364. package/lib/map/api/services/features/features.hooks.js +1 -1
  365. package/lib/map/api/services/features/features.hooks.js.map +1 -1
  366. package/lib/map/client/components/KColorLegend.vue +25 -23
  367. package/lib/map/client/components/KFavoriteViews.vue +71 -35
  368. package/lib/map/client/components/KFeaturesChart.vue +11 -9
  369. package/lib/map/client/components/KFeaturesFilter.vue +15 -7
  370. package/lib/map/client/components/KFeaturesTable.vue +27 -2
  371. package/lib/map/client/components/KLayerEditionToolbar.vue +43 -0
  372. package/lib/map/client/components/KLayerStyleEditor.vue +10 -4
  373. package/lib/map/client/components/KLayerStyleForm.vue +14 -11
  374. package/lib/map/client/components/KLocationInput.vue +126 -65
  375. package/lib/map/client/components/KLocationMap.vue +199 -84
  376. package/lib/map/client/components/KPositionIndicator.vue +1 -0
  377. package/lib/map/client/components/KTimeline.vue +41 -36
  378. package/lib/map/client/components/KUrlLegend.vue +21 -19
  379. package/lib/map/client/components/catalog/KBaseLayersSelector.vue +105 -0
  380. package/lib/map/client/components/catalog/KCatalog.vue +14 -2
  381. package/lib/map/client/components/catalog/KConnectLayer.vue +31 -11
  382. package/lib/map/client/components/catalog/KCreateLayer.vue +37 -14
  383. package/lib/map/client/components/catalog/KImportLayer.vue +28 -8
  384. package/lib/map/client/components/catalog/KLayerCategories.vue +86 -62
  385. package/lib/map/client/components/catalog/KLayersSelector.vue +42 -42
  386. package/lib/map/client/components/catalog/KWeatherLayersSelector.vue +3 -3
  387. package/lib/map/client/components/form/KLocationField.vue +1 -1
  388. package/lib/map/client/components/form/KOwsLayerField.vue +21 -2
  389. package/lib/map/client/components/form/KOwsServiceField.vue +1 -0
  390. package/lib/map/client/components/widget/KInformationBox.vue +10 -16
  391. package/lib/map/client/components/widget/KMapillaryViewer.vue +59 -49
  392. package/lib/map/client/components/widget/KTimeSeries.vue +39 -29
  393. package/lib/map/client/i18n/map_en.json +65 -17
  394. package/lib/map/client/i18n/map_fr.json +67 -20
  395. package/lib/map/client/init.js +18 -6
  396. package/lib/map/client/init.js.map +1 -1
  397. package/lib/map/client/leaflet/GSMaPLayer.js +4 -9
  398. package/lib/map/client/leaflet/GSMaPLayer.js.map +1 -1
  399. package/lib/map/client/leaflet/GradientPath.js.map +1 -1
  400. package/lib/map/client/leaflet/MaskLayer.js +64 -0
  401. package/lib/map/client/leaflet/MaskLayer.js.map +1 -0
  402. package/lib/map/client/mixins/globe/mixin.base-globe.js +4 -1
  403. package/lib/map/client/mixins/globe/mixin.base-globe.js.map +1 -1
  404. package/lib/map/client/mixins/globe/mixin.geojson-layers.js +7 -9
  405. package/lib/map/client/mixins/globe/mixin.geojson-layers.js.map +1 -1
  406. package/lib/map/client/mixins/index.js +8 -13
  407. package/lib/map/client/mixins/index.js.map +1 -1
  408. package/lib/map/client/mixins/map/mixin.base-map.js +30 -6
  409. package/lib/map/client/mixins/map/mixin.base-map.js.map +1 -1
  410. package/lib/map/client/mixins/map/mixin.canvas-layers.js +274 -51
  411. package/lib/map/client/mixins/map/mixin.canvas-layers.js.map +1 -1
  412. package/lib/map/client/mixins/map/mixin.edit-layers.js +218 -121
  413. package/lib/map/client/mixins/map/mixin.edit-layers.js.map +1 -1
  414. package/lib/map/client/mixins/map/mixin.file-layers.js +25 -18
  415. package/lib/map/client/mixins/map/mixin.file-layers.js.map +1 -1
  416. package/lib/map/client/mixins/map/mixin.geojson-layers.js +18 -10
  417. package/lib/map/client/mixins/map/mixin.geojson-layers.js.map +1 -1
  418. package/lib/map/client/mixins/map/mixin.georaster-layers.js +7 -4
  419. package/lib/map/client/mixins/map/mixin.georaster-layers.js.map +1 -1
  420. package/lib/map/client/mixins/map/mixin.gsmap-layers.js +3 -3
  421. package/lib/map/client/mixins/map/mixin.gsmap-layers.js.map +1 -1
  422. package/lib/map/client/mixins/map/mixin.heatmap-layers.js +8 -10
  423. package/lib/map/client/mixins/map/mixin.heatmap-layers.js.map +1 -1
  424. package/lib/map/client/mixins/map/mixin.mapillary-layers.js +25 -40
  425. package/lib/map/client/mixins/map/mixin.mapillary-layers.js.map +1 -1
  426. package/lib/map/client/mixins/map/mixin.tiled-mesh-layers.js +5 -3
  427. package/lib/map/client/mixins/map/mixin.tiled-mesh-layers.js.map +1 -1
  428. package/lib/map/client/mixins/map/mixin.tiled-wind-layers.js +5 -3
  429. package/lib/map/client/mixins/map/mixin.tiled-wind-layers.js.map +1 -1
  430. package/lib/map/client/mixins/mixin.activity.js +60 -68
  431. package/lib/map/client/mixins/mixin.activity.js.map +1 -1
  432. package/lib/map/client/mixins/mixin.feature-selection.js +8 -10
  433. package/lib/map/client/mixins/mixin.feature-selection.js.map +1 -1
  434. package/lib/map/client/mixins/mixin.feature-service.js +7 -5
  435. package/lib/map/client/mixins/mixin.feature-service.js.map +1 -1
  436. package/lib/map/client/mixins/mixin.weacast.js +6 -4
  437. package/lib/map/client/mixins/mixin.weacast.js.map +1 -1
  438. package/lib/map/client/pixi-utils.js +9 -0
  439. package/lib/map/client/pixi-utils.js.map +1 -1
  440. package/lib/map/client/utils.js +50 -0
  441. package/lib/map/client/utils.js.map +1 -1
  442. package/lib/map/common/wfs-utils.js +1 -1
  443. package/lib/map/common/wfs-utils.js.map +1 -1
  444. package/lib/map/common/wmts-utils.js +31 -7
  445. package/lib/map/common/wmts-utils.js.map +1 -1
  446. package/lib/test/client/core/account.js +100 -0
  447. package/lib/test/client/core/account.js.map +1 -0
  448. package/lib/test/client/core/api.js +400 -0
  449. package/lib/test/client/core/api.js.map +1 -0
  450. package/lib/test/client/core/collection.js +109 -0
  451. package/lib/test/client/core/collection.js.map +1 -0
  452. package/lib/test/client/core/index.js +90 -0
  453. package/lib/test/client/core/index.js.map +1 -0
  454. package/lib/test/client/core/layout.js +221 -0
  455. package/lib/test/client/core/layout.js.map +1 -0
  456. package/lib/test/client/core/runner.js +204 -0
  457. package/lib/test/client/core/runner.js.map +1 -0
  458. package/lib/test/client/core/screens.js +68 -0
  459. package/lib/test/client/core/screens.js.map +1 -0
  460. package/lib/test/client/core/utils.js +304 -0
  461. package/lib/test/client/core/utils.js.map +1 -0
  462. package/lib/test/client/index.js +20 -0
  463. package/lib/test/client/index.js.map +1 -0
  464. package/lib/test/client/map/catalog.js +191 -0
  465. package/lib/test/client/map/catalog.js.map +1 -0
  466. package/lib/test/client/map/controls.js +54 -0
  467. package/lib/test/client/map/controls.js.map +1 -0
  468. package/lib/test/client/map/index.js +30 -0
  469. package/lib/test/client/map/index.js.map +1 -0
  470. package/package.json +17 -9
  471. package/test.client.js +1 -0
  472. package/tests/core/test-log-2021-07-15.log +71 -0
  473. package/tests/core/test-log-2021-09-02.log +47 -0
  474. package/tests/map/test-log-%DATE%.logYYYY-07-DD +12 -0
  475. package/tests/map/test-log-%DATE%.logYYYY-09-DD +6 -0
  476. package/tests/map/test-log-2021-07-12.log +12 -0
  477. package/tests/map/test-log-2021-07-15.log +5 -0
  478. package/tests/map/test-log-2021-09-02.log +3 -0
  479. package/.nyc_output/11cd93d8-69cb-405c-98a3-d249ea35b6da.json +0 -1
  480. package/.nyc_output/2bece194-92f7-4971-a688-10604044a7fa.json +0 -1
  481. package/.nyc_output/5ddee33e-b658-4c8e-a247-54f575ac67e8.json +0 -1
  482. package/.nyc_output/78760ae4-555f-4d9c-a6a1-acf5e2f0fe45.json +0 -1
  483. package/.nyc_output/d0bb2559-084e-4c92-b9e6-29a9abd41f7c.json +0 -1
  484. package/.nyc_output/processinfo/0b8aa700-8daa-49ce-85e7-a8f8965d55f0.json +0 -1
  485. package/.nyc_output/processinfo/11cd93d8-69cb-405c-98a3-d249ea35b6da.json +0 -1
  486. package/.nyc_output/processinfo/20df4355-911a-4b16-a8ab-d3392e9f0a7f.json +0 -1
  487. package/.nyc_output/processinfo/257af0bb-96c3-465a-b5ef-a1df60078d5f.json +0 -1
  488. package/.nyc_output/processinfo/284aebfa-23fd-425f-9d72-e4b8904dc224.json +0 -1
  489. package/.nyc_output/processinfo/5cbee06e-be6e-468a-bd78-4793ee785fe4.json +0 -1
  490. package/.nyc_output/processinfo/5ddee33e-b658-4c8e-a247-54f575ac67e8.json +0 -1
  491. package/.nyc_output/processinfo/78760ae4-555f-4d9c-a6a1-acf5e2f0fe45.json +0 -1
  492. package/.nyc_output/processinfo/d0bb2559-084e-4c92-b9e6-29a9abd41f7c.json +0 -1
  493. package/lib/core/client/components/frame/KLabel.vue +0 -56
  494. package/lib/core/client/components/team/KTagsPane.vue +0 -35
  495. package/lib/map/client/leaflet/TiledMapillaryLayer.js +0 -137
  496. package/lib/map/client/leaflet/TiledMapillaryLayer.js.map +0 -1
  497. package/lib/map/client/mixins/mixin.time.js +0 -73
  498. package/lib/map/client/mixins/mixin.time.js.map +0 -1
  499. package/tests/core/account.test.js +0 -415
  500. package/tests/core/client.test.js.skip +0 -37
  501. package/tests/core/config/default.js +0 -97
  502. package/tests/core/config/email-templates/confirmInvitation/html.ejs +0 -18
  503. package/tests/core/config/email-templates/identityChange/html.ejs +0 -12
  504. package/tests/core/config/email-templates/newDevice/html.ejs +0 -7
  505. package/tests/core/config/email-templates/passwordChange/html.ejs +0 -5
  506. package/tests/core/config/email-templates/resendVerifySignup/html.ejs +0 -10
  507. package/tests/core/config/email-templates/resetPwd/html.ejs +0 -5
  508. package/tests/core/config/email-templates/sendResetPwd/html.ejs +0 -8
  509. package/tests/core/config/email-templates/verifySignup/html.ejs +0 -3
  510. package/tests/core/data/10k_most_common_passwords.txt +0 -10000
  511. package/tests/core/data/logo.png +0 -0
  512. package/tests/core/hooks.test.js +0 -175
  513. package/tests/core/index.test.js +0 -418
  514. package/tests/core/notifications.test.js +0 -465
  515. package/tests/core/storage.test.js +0 -134
  516. package/tests/core/team.test.js +0 -610
  517. package/tests/core/utils.js +0 -59
  518. package/tests/map/alerts.test.js +0 -554
  519. package/tests/map/config/default.js +0 -112
  520. package/tests/map/config/layers.json +0 -37
  521. package/tests/map/daptiles.test.js +0 -41
  522. package/tests/map/data/DescribeCoverage.xml +0 -55
  523. package/tests/map/data/GetCoverage.tif +0 -0
  524. package/tests/map/data/adsb.observations.json +0 -132
  525. package/tests/map/data/dataset.grb.das +0 -55
  526. package/tests/map/data/dataset.grb.dds +0 -17
  527. package/tests/map/data/dataset.grb.dods +0 -0
  528. package/tests/map/data/lat_lon_bounds.grb.dods +0 -0
  529. package/tests/map/data/subdataset.grb.dods +0 -0
  530. package/tests/map/data/vigicrues.observations.json +0 -47042
  531. package/tests/map/data/vigicrues.stations.json +0 -15422
  532. package/tests/map/data/zones.json +0 -1228
  533. package/tests/map/grid-sources.test.js +0 -304
  534. package/tests/map/hooks.test.js +0 -96
  535. package/tests/map/index.test.js +0 -333
@@ -1,38 +1,51 @@
1
1
  <template>
2
- <q-card class="q-pa-none" :style="cardStyle">
3
- <q-card-section class="fit q-pa-none">
4
- <div class="fit column">
5
- <div class="col-auto">
6
- <q-toolbar class="q-pa-sm bg-accent text-white">
7
- <k-text-area :text="location.name" />
8
- <q-space />
9
- <q-btn v-if="editable" icon="las la-home" flat round dense @click="refreshLocation">
10
- <q-tooltip>
11
- {{ $t('KLocationMap.RESTORE_BUTTON') }}
12
- </q-tooltip>
13
- </q-btn>
14
- <q-btn icon="las la-search-location" flat round dense @click="centerMap">
15
- <q-tooltip>
16
- {{ $t('KLocationMap.RECENTER_BUTTON') }}
17
- </q-tooltip>
18
- </q-btn>
19
- </q-toolbar>
20
- </div>
21
- <div ref="map" class="col" style="fontWeight: normal; zIndex: 0; position: relative">
22
- <q-resize-observer @resize="onMapResized" />
23
- </div>
24
- </div>
25
- </q-card-section>
26
- </q-card>
2
+ <div class="fit column">
3
+ <div v-if="toolbar" class="full-width row">
4
+ <q-toolbar class="q-pl-sm q-pr-sm bg-accent text-white">
5
+ <k-text-area :text="locationName" />
6
+ <q-space />
7
+ <q-btn v-if="drawable" icon="las la-road" flat round dense @click="onStartLine">
8
+ <q-tooltip>
9
+ {{ $t('KLocationMap.DRAW_LINE') }}
10
+ </q-tooltip>
11
+ </q-btn>
12
+ <q-btn v-if="drawable" icon="las la-draw-polygon" flat round dense @click="onStartPolygon">
13
+ <q-tooltip>
14
+ {{ $t('KLocationMap.DRAW_POLYGON') }}
15
+ </q-tooltip>
16
+ </q-btn>
17
+ <q-btn v-if="editable" icon="las la-crosshairs" flat round dense @click="onGeolocate">
18
+ <q-tooltip>
19
+ {{ $t('KLocationMap.LOCATE_BUTTON') }}
20
+ </q-tooltip>
21
+ </q-btn>
22
+ <q-btn icon="las la-search-location" flat round dense @click="centerMap">
23
+ <q-tooltip>
24
+ {{ $t('KLocationMap.RECENTER_BUTTON') }}
25
+ </q-tooltip>
26
+ </q-btn>
27
+ <q-btn v-if="closable" icon="las la-times" flat round dense @click="closeMap">
28
+ <q-tooltip>
29
+ {{ $t('KLocationMap.CLOSE_BUTTON') }}
30
+ </q-tooltip>
31
+ </q-btn>
32
+ </q-toolbar>
33
+ </div>
34
+ <div ref="map" class="col" style="fontWeight: normal; zIndex: 0; position: relative">
35
+ <q-resize-observer @resize="onMapResized" />
36
+ </div>
37
+ </div>
27
38
  </template>
28
39
 
29
40
  <script>
41
+ import _ from 'lodash'
30
42
  import L from 'leaflet'
43
+ import centroid from '@turf/centroid'
31
44
  import { colors } from 'quasar'
32
45
  import { mixins as kCoreMixins } from '../../../core/client'
33
46
  import * as mapMixins from '../mixins/map'
34
47
  import { Geolocation } from '../geolocation'
35
- import { setGatewayJwt, formatUserCoordinates } from '../utils'
48
+ import { setGatewayJwt, formatUserCoordinates, bindLeafletEvents, unbindLeafletEvents } from '../utils'
36
49
 
37
50
  export default {
38
51
  name: 'k-location-map',
@@ -47,19 +60,6 @@ export default {
47
60
  return null
48
61
  }
49
62
  },
50
- editable: {
51
- type: Boolean,
52
- default: true
53
- },
54
- size: {
55
- type: Object,
56
- default: () => {
57
- return {
58
- width: 360,
59
- height: 400
60
- }
61
- }
62
- },
63
63
  mapOptions: {
64
64
  type: Object,
65
65
  default: () => {
@@ -76,72 +76,178 @@ export default {
76
76
  type: Object,
77
77
  default: () => {
78
78
  return {
79
- iconClasses: 'fas fa-circle 0.75rem',
79
+ iconClasses: 'fas fa-circle 0.5rem',
80
80
  markerColor: colors.getBrand('primary'),
81
81
  iconColor: '#FFFFFF',
82
82
  iconXOffset: 1,
83
83
  iconYOffset: 0
84
84
  }
85
85
  }
86
+ },
87
+ editable: {
88
+ type: Boolean,
89
+ default: false
90
+ },
91
+ drawable: {
92
+ type: Boolean,
93
+ default: false
94
+ },
95
+ closable: {
96
+ type: Boolean,
97
+ default: false
98
+ },
99
+ toolbar: {
100
+ type: Boolean,
101
+ default: false
102
+ }
103
+ },
104
+ data () {
105
+ return {
106
+ location: this.defaultLocation()
86
107
  }
87
108
  },
88
109
  computed: {
89
- cardStyle () {
90
- return 'width: ' + this.size.width + 'px; height:' + this.size.height + 'px;'
110
+ locationName () {
111
+ return this.location ? this.location.name : ''
91
112
  }
92
113
  },
93
- data () {
94
- return {
95
- location: this.defaultLocation(),
96
- isModified: false
114
+ watch: {
115
+ value: function () {
116
+ this.location = this.value
117
+ this.refresh()
118
+ },
119
+ editable: function () {
120
+ this.refresh()
121
+ },
122
+ drawable: function () {
123
+ this.refresh()
97
124
  }
98
125
  },
99
126
  methods: {
100
127
  defaultLocation () {
128
+ const latitude = this.$store.get('geolocation.position.latitude', 0)
129
+ const longitude = this.$store.get('geolocation.position.longitude', 0)
101
130
  return {
102
- name: '',
103
- latitude: this.$store.get('geolocation.position.latitude', 0),
104
- longitude: this.$store.get('geolocation.position.longitude', 0)
131
+ name: formatUserCoordinates(latitude, longitude, this.$store.get('locationFormat', 'FFf')),
132
+ latitude,
133
+ longitude
105
134
  }
106
135
  },
107
136
  centerMap () {
108
- this.center(this.location.longitude, this.location.latitude, this.mapOptions.zoom)
109
- },
110
- async refreshLocation () {
111
- // Updated the location
112
- if (this.value) {
113
- this.location = this.value
137
+ if (this.drawLayer) {
138
+ this.map.fitBounds(this.drawLayer.getBounds())
114
139
  } else {
115
- await Geolocation.update()
116
- const position = this.$store.get('geolocation.position')
117
- if (position) {
118
- this.location = {
119
- name: formatUserCoordinates(position.latitude, position.longitude, this.$store.get('locationFormat', 'FFf')),
120
- latitude: position.latitude,
121
- longitude: position.longitude
122
- }
140
+ const longitude = (_.has(this.location, 'longitude')
141
+ ? _.get(this.location, 'longitude') : _.get(this.location, 'coordinates[0]'))
142
+ const latitude = (_.has(this.location, 'latitude')
143
+ ? _.get(this.location, 'latitude') : _.get(this.location, 'coordinates[1]'))
144
+ this.center(longitude, latitude, this.mapOptions.zoom)
145
+ }
146
+ },
147
+ closeMap () {
148
+ this.$emit('close', this.location)
149
+ },
150
+ async geolocate () {
151
+ await Geolocation.update()
152
+ const position = this.$store.get('geolocation.position')
153
+ if (position) {
154
+ this.location = {
155
+ name: formatUserCoordinates(position.latitude, position.longitude, this.$store.get('locationFormat', 'FFf')),
156
+ latitude: position.latitude,
157
+ longitude: position.longitude
123
158
  }
124
159
  }
125
- // Center the map
126
- this.centerMap()
127
- // Updated the marker
128
- if (!this.marker) {
129
- this.marker = L.marker([this.location.latitude, this.location.longitude], {
130
- icon: L.icon.fontAwesome(this.markerStyle),
131
- draggable: this.editable
132
- })
133
- this.marker.addTo(this.map)
134
- if (this.editable) this.marker.on('drag', this.onLocationDragged)
135
- } else {
136
- this.marker.setLatLng([this.location.latitude, this.location.longitude])
160
+ },
161
+ clear () {
162
+ if (this.marker) {
163
+ this.marker.off('drag', this.onLocationDragged)
164
+ this.marker.removeFrom(this.map)
165
+ this.marker = null
137
166
  }
138
- this.isModified = false
167
+ if (this.drawLayer) {
168
+ this.map.removeLayer(this.drawLayer)
169
+ this.drawLayer = null
170
+ }
171
+ this.map.pm.disableDraw()
172
+ unbindLeafletEvents(this.map, ['pm:create'])
173
+ this.map.pm.setGlobalOptions({ layerGroup: null })
174
+ },
175
+ refresh () {
176
+ this.clear()
177
+ // No location ?
178
+ const hasLongitude = _.has(this.location, 'longitude')
179
+ const hasLatitude = _.has(this.location, 'latitude')
180
+ const hasGeometry = _.has(this.location, 'coordinates')
181
+ if (hasGeometry || (hasLongitude && hasLatitude)) {
182
+ // No default marker in draw mode
183
+ if (this.drawable && !hasGeometry) return
184
+ // GeoJson geometry or simple location ?
185
+ if (_.has(this.location, 'type') && (_.get(this.location, 'type') !== 'Point')) {
186
+ this.drawLayer = L.geoJson({ type: 'Feature', geometry: this.location })
187
+ this.map.addLayer(this.drawLayer)
188
+ } else {
189
+ const longitude = (hasLongitude
190
+ ? _.get(this.location, 'longitude') : _.get(this.location, 'coordinates[0]'))
191
+ const latitude = (hasLatitude
192
+ ? _.get(this.location, 'latitude') : _.get(this.location, 'coordinates[1]'))
193
+
194
+ this.marker = L.marker([latitude, longitude], {
195
+ icon: L.icon.fontAwesome(this.markerStyle),
196
+ draggable: this.editable,
197
+ pmIgnore: true
198
+ })
199
+ this.marker.addTo(this.map)
200
+ if (this.editable) this.marker.on('drag', this.onLocationDragged)
201
+ }
202
+
203
+ // Center the map
204
+ this.centerMap()
205
+ }
206
+ },
207
+ async onGeolocate () {
208
+ await this.geolocate()
209
+ this.refresh()
139
210
  },
140
211
  onLocationDragged () {
141
212
  this.location.name = formatUserCoordinates(this.marker.getLatLng().lat, this.marker.getLatLng().lng, this.$store.get('locationFormat', 'FFf'))
142
- this.location.latitude = this.marker.getLatLng().lat
143
- this.location.longitude = this.marker.getLatLng().lng
144
- this.isModified = true
213
+ if (_.has(this.location, 'type') && (_.get(this.location, 'type') === 'Point')) {
214
+ _.set(this.location, 'coordinates[0]', this.marker.getLatLng().lng)
215
+ _.set(this.location, 'coordinates[1]', this.marker.getLatLng().lat)
216
+ } else {
217
+ this.location.longitude = this.marker.getLatLng().lng
218
+ this.location.latitude = this.marker.getLatLng().lat
219
+ }
220
+ this.$emit('input', this.location)
221
+ },
222
+ startDraw (shape) {
223
+ // Clear any previous edition
224
+ this.clear()
225
+ this.drawLayer = L.geoJson()
226
+ this.map.addLayer(this.drawLayer)
227
+ this.map.pm.setGlobalOptions({ layerGroup: this.drawLayer })
228
+ this.map.pm.enableDraw(shape, {
229
+ snappable: true,
230
+ snapDistance: 20
231
+ })
232
+ bindLeafletEvents(this.map, ['pm:create'], this)
233
+ },
234
+ stopDraw () {
235
+ const geoJson = this.drawLayer.toGeoJSON()
236
+ // The location is the feature geometry
237
+ const feature = _.get(geoJson, 'features[0]', {})
238
+ this.location = feature.geometry
239
+ // Compatibility with GPS-based localization
240
+ const location = centroid(feature)
241
+ this.location.name = formatUserCoordinates(
242
+ _.get(location, 'geometry.coordinates[1]'), _.get(location, 'geometry.coordinates[0]'),
243
+ this.$store.get('locationFormat', 'FFf'))
244
+ this.$emit('input', this.location)
245
+ },
246
+ onStartLine () {
247
+ this.startDraw('Line')
248
+ },
249
+ onStartPolygon () {
250
+ this.startDraw('Polygon')
145
251
  },
146
252
  async refreshBaseLayer () {
147
253
  const catalogService = this.$api.getService('catalog', '')
@@ -159,25 +265,34 @@ export default {
159
265
  this.refreshMap()
160
266
  }
161
267
  },
162
- created () {
268
+ beforeCreate () {
163
269
  // Load the required components
164
270
  this.$options.components['k-text-area'] = this.$load('frame/KTextArea')
165
271
  },
166
272
  async mounted () {
273
+ // Initialize component
274
+ this.location = this.value
275
+ if (!this.location) await this.geolocate()
167
276
  await this.loadRefs()
168
277
  this.setupMap(this.$refs.map, this.mapOptions)
169
278
  await this.refreshBaseLayer()
170
- this.refreshLocation()
279
+ this.refresh()
171
280
  this.$events.$emit('map-ready')
281
+ this.$on('pm:create', this.stopDraw)
172
282
  },
173
- destroyed () {
174
- if (this.isModified) this.$emit('input', this.location)
283
+ beforeDestroy () {
284
+ this.$off('pm:create', this.stopDraw)
285
+ this.clear()
175
286
  }
176
287
  }
177
288
  </script>
178
289
 
179
290
  <style>
291
+ .leaflet-fa-markers {
292
+ width: 15px;
293
+ height: 25px;
294
+ }
180
295
  .leaflet-fa-markers .feature-icon {
181
- font-size: 14px;
296
+ font-size: 14px;
182
297
  }
183
298
  </style>
@@ -81,6 +81,7 @@ export default {
81
81
 
82
82
  <style lang="stylus">
83
83
  .position-indicator {
84
+ pointer-events: none;
84
85
  border-radius: 50%;
85
86
  background-color: #00000020
86
87
  }
@@ -13,7 +13,7 @@
13
13
  <q-date v-model="date" :mask="calendarDateMask" today-btn minimal />
14
14
  </q-popup-proxy>
15
15
  </q-btn>
16
- <q-chip :label="kActivity.formatTime('date.long', time) + ' ' + kActivity.formatTime('time.long', time)" color="primary" text-color="white" :dense="$q.screen.lt.sm" />
16
+ <q-chip :label="formatTime(time, 'date.long') + ' ' + formatTime(time, 'time.long')" color="primary" text-color="white" :dense="$q.screen.lt.sm" />
17
17
  <q-btn id="timeline-now" dense flat round icon="las la-clock" size="md" color="primary" @click="onNowClicked">
18
18
  <q-tooltip>{{$t('KTimeline.SET_NOW')}}</q-tooltip>
19
19
  <q-badge v-if="timer !== undefined" floating transparent color="green">
@@ -71,7 +71,7 @@
71
71
  :label="day.label"
72
72
  clickable @click="onDayClicked(index, days.length)" />
73
73
  </template>
74
- <q-btn id="timeline-next-day" dense flat round icon='las la-calendar-plus' color="primary" @click="onNextDayClicked">
74
+ <q-btn id="timeline-next-day" dense flat round icon='las la-calendar-plus' color="primary" @click="onNextDayClicked">
75
75
  <q-tooltip>{{$t('KTimeline.NEXT_DAY')}}</q-tooltip>
76
76
  </q-btn>
77
77
  </div>
@@ -82,26 +82,31 @@
82
82
  <script>
83
83
  import logger from 'loglevel'
84
84
  import moment from 'moment'
85
+ import { Time } from '../../../core/client/time'
85
86
 
86
87
  export default {
87
88
  name: 'k-timeline',
88
89
  inject: ['kActivity'],
89
90
  data () {
90
91
  return {
91
- timeline: this.$store.get('timeline'),
92
92
  timer: undefined,
93
93
  time: moment.utc(),
94
- calendarDateMask: 'YYYY-MM-DD'
94
+ calendarDateMask: 'YYYY-MM-DD',
95
+ // Make this reactive
96
+ timeSettings: Time.get()
95
97
  }
96
98
  },
97
99
  computed: {
100
+ step () {
101
+ // For now we do not handle step > 60 minutes
102
+ return Math.min(this.timeSettings.step, 60)
103
+ },
98
104
  minutes () {
99
105
  const minutes = []
100
- const step = this.getStep()
101
- if (step < 60) {
106
+ if (this.step < 60) {
102
107
  const start = moment.utc(this.time).minute(0)
103
108
  const end = moment.utc(this.time).minute(59)
104
- for (let m = moment.utc(start); m.isBefore(end); m.add(step, 'm')) {
109
+ for (let m = moment.utc(start); m.isBefore(end); m.add(this.step, 'm')) {
105
110
  minutes.push({
106
111
  label: m.minute().toString().padStart(2, 0),
107
112
  color: m.isSame(this.time, 'minute') ? 'primary' : 'grey-7',
@@ -122,7 +127,7 @@ export default {
122
127
  const end = moment.utc(this.time).add((size + 1), 'hour')
123
128
  for (let h = moment.utc(start); h.isBefore(end); h.add(1, 'h')) {
124
129
  hours.push({
125
- label: this.kActivity.formatTime('time.short', h),
130
+ label: Time.format(h, 'time.short'),
126
131
  class: 'col k-timeline-hour-frame text-caption ' + (h.isSame(this.time, 'hour') ? 'k-timeline-hour-selected' : '')
127
132
  })
128
133
  }
@@ -139,7 +144,7 @@ export default {
139
144
  const end = moment.utc(this.time).add(size + 1, 'day')
140
145
  for (let d = moment.utc(start); d.isBefore(end); d.add(1, 'd')) {
141
146
  days.push({
142
- label: this.kActivity.formatTime('date.short', d),
147
+ label: Time.format(d, 'date.short'),
143
148
  color: d.isSame(this.time, 'date') ? 'primary' : this.monthColors[d.month()],
144
149
  textColor: d.isSame(this.time, 'date') ? 'white' : 'black'
145
150
  })
@@ -148,13 +153,13 @@ export default {
148
153
  },
149
154
  date: {
150
155
  get: function () {
151
- return this.kActivity.currentTimeFormat.utc
156
+ return Time.getFormat().utc
152
157
  ? this.time.format(this.calendarDateMask)
153
158
  : moment(this.time).local().format(this.calendarDateMask)
154
159
  },
155
160
  set: function (value) {
156
161
  let time
157
- if (this.kActivity.currentTimeFormat.utc) {
162
+ if (Time.getFormat().utc) {
158
163
  time = moment.utc(value, this.calendarDateMask)
159
164
  time.hour(this.time.hour())
160
165
  time.minute(this.time.minute())
@@ -170,9 +175,8 @@ export default {
170
175
  }
171
176
  },
172
177
  methods: {
173
- getStep () {
174
- // For now we do not handle step > 60 minutes
175
- return Math.min(this.timeline.step, 60)
178
+ formatTime (time, format) {
179
+ return Time.format(time, format)
176
180
  },
177
181
  startTimeLoop () {
178
182
  this.setTime(moment.utc())
@@ -180,9 +184,9 @@ export default {
180
184
  const now = moment.utc()
181
185
  if (!this.time.isSame(now, 'minute')) {
182
186
  this.time = now
183
- this.kActivity.$off('current-time-changed', this.onTimeChanged)
184
- this.kActivity.setCurrentTime(this.time)
185
- this.kActivity.$on('current-time-changed', this.onTimeChanged)
187
+ this.$events.$off('time-current-time-changed', this.onTimeChanged)
188
+ Time.setCurrentTime(this.time)
189
+ this.$events.$on('time-current-time-changed', this.onTimeChanged)
186
190
  }
187
191
  }, 15 * 1000)
188
192
  },
@@ -201,28 +205,28 @@ export default {
201
205
  }
202
206
  if (this.timer) this.stopTimeLoop()
203
207
  this.time = time.clone()
204
- this.kActivity.$off('current-time-changed', this.onTimeChanged)
205
- if (propagate) this.kActivity.setCurrentTime(moment.utc(time))
206
- this.kActivity.$on('current-time-changed', this.onTimeChanged)
208
+ this.$events.$off('time-current-time-changed', this.onTimeChanged)
209
+ if (propagate) Time.setCurrentTime(moment.utc(time))
210
+ this.$events.$on('time-current-time-changed', this.onTimeChanged)
207
211
  },
208
212
  onPreviousStepClicked () {
209
- let minutesToSubtract = this.getStep()
210
- const remainder = (this.time.minute() + this.time.hour() * 60) % this.getStep()
213
+ let minutesToSubtract = this.step
214
+ const remainder = (this.time.minute() + this.time.hour() * 60) % this.step
211
215
  if (remainder > 0) {
212
216
  minutesToSubtract = remainder
213
217
  }
214
218
  this.setTime(this.time.subtract(minutesToSubtract, 'minute'))
215
219
  },
216
220
  onNextStepClicked () {
217
- let minutesToAdd = this.getStep()
218
- const remainder = (this.time.minute() + this.time.hour() * 60) % this.getStep()
221
+ let minutesToAdd = this.step
222
+ const remainder = (this.time.minute() + this.time.hour() * 60) % this.step
219
223
  if (remainder > 0) {
220
- minutesToAdd = this.getStep() - remainder
224
+ minutesToAdd = this.step - remainder
221
225
  }
222
226
  this.setTime(this.time.add(minutesToAdd, 'minute'))
223
227
  },
224
228
  onMinutesClicked (index) {
225
- this.setTime(this.time.minute(index * this.getStep()))
229
+ this.setTime(this.time.minute(index * this.step))
226
230
  },
227
231
  onHourClicked (index, length) {
228
232
  this.setTime(this.time.add((index - Math.trunc(length / 2)), 'hour'))
@@ -246,7 +250,8 @@ export default {
246
250
  this.startTimeLoop()
247
251
  },
248
252
  onTimeChanged (time) {
249
- this.setTime(time, false)
253
+ // When updating settings the root time object is sent instead of just the current time
254
+ this.setTime(time.currentTime || time, false)
250
255
  }
251
256
  },
252
257
  created () {
@@ -257,22 +262,22 @@ export default {
257
262
  // Define the actions
258
263
  this.actions = {
259
264
  mobile: [
260
- { id: 'previous-day', icon: 'las la-calendar-minus', label: this.$t('KTimeline.PREVIOUS_DAY'), handler: this.onPreviousDayClicked },
261
- { id: 'previous-hour', icon: 'las la-angle-left', label: this.$t('KTimeline.PREVIOUS_HOUR'), handler: this.onPreviousHourClicked },
262
- { id: 'previous-step', icon: 'las la-step-backward', label: this.$t('KTimeline.PREVIOUS_STEP'), handler: this.onPreviousStepClicked },
263
- { id: 'next-step', icon: 'las la-step-forward', label: this.$t('KTimeline.NEXT_STEP'), handler: this.onNextStepClicked },
264
- { id: 'next-hour', icon: 'las la-angle-right', label: this.$t('KTimeline.NEXT_HOUR'), handler: this.onNextHourClicked },
265
- { id: 'next-day', icon: 'las la-calendar-plus', label: this.$t('KTimeline.NEXT_DAY'), handler: this.onNextDayClicked }
265
+ { id: 'previous-day', icon: 'las la-calendar-minus', tooltip: this.$t('KTimeline.PREVIOUS_DAY'), handler: this.onPreviousDayClicked },
266
+ { id: 'previous-hour', icon: 'las la-angle-left', tooltip: this.$t('KTimeline.PREVIOUS_HOUR'), handler: this.onPreviousHourClicked },
267
+ { id: 'previous-step', icon: 'las la-step-backward', tooltip: this.$t('KTimeline.PREVIOUS_STEP'), handler: this.onPreviousStepClicked },
268
+ { id: 'next-step', icon: 'las la-step-forward', tooltip: this.$t('KTimeline.NEXT_STEP'), handler: this.onNextStepClicked },
269
+ { id: 'next-hour', icon: 'las la-angle-right', tooltip: this.$t('KTimeline.NEXT_HOUR'), handler: this.onNextHourClicked },
270
+ { id: 'next-day', icon: 'las la-calendar-plus', tooltip: this.$t('KTimeline.NEXT_DAY'), handler: this.onNextDayClicked }
266
271
  ]
267
272
  }
268
273
  },
269
274
  mounted () {
270
- this.kActivity.$on('current-time-changed', this.onTimeChanged)
275
+ this.$events.$on('time-current-time-changed', this.onTimeChanged)
271
276
  // Set the time
272
- this.setTime(this.kActivity.currentTime, false)
277
+ this.setTime(Time.getCurrentTime(), false)
273
278
  },
274
279
  beforeDestroy () {
275
- this.kActivity.$off('current-time-changed', this.onTimeChanged)
280
+ this.$events.$off('time-current-time-changed', this.onTimeChanged)
276
281
  }
277
282
  }
278
283
  </script>
@@ -25,7 +25,7 @@ export default {
25
25
  onLegendClick (index) {
26
26
  this.legends[index].visible = !this.legends[index].visible
27
27
  },
28
- async tryAddLegend (layer) {
28
+ async getLegend (layer) {
29
29
  let legendUrl = _.get(layer, 'legendUrl')
30
30
  if (!legendUrl) {
31
31
  // no legend on layer, try to fetch legend in case of WMS layer
@@ -49,32 +49,35 @@ export default {
49
49
 
50
50
  // make sure server answers the request before using it
51
51
  if (legendUrl) {
52
- let visible = false
53
52
  try {
54
53
  const response = await fetch(legendUrl)
55
- visible = response.ok
56
54
  // additional check for funny servers answering with empty body ...
57
- if (visible) {
55
+ if (response.ok) {
58
56
  const asBlob = await response.blob()
59
- visible = asBlob ? asBlob.size > 0 : false
60
- }
61
- if (visible) {
62
- // make sure layer is still visible since it may have been hidden in the meantime ...
63
- if (this.kActivity.isLayerVisible(layer.name)) {
64
- this.urlLegendLayers[layer._id] = legendUrl
65
- this.legends.push({
66
- src: legendUrl,
67
- layer: layer.name,
68
- visible: true
69
- })
70
- }
57
+ if (asBlob.size === 0) legendUrl = null
71
58
  }
72
59
  } catch (error) {
60
+ legendUrl = null
61
+ }
62
+ }
63
+
64
+ return legendUrl
65
+ },
66
+ async tryAddLegend (layer) {
67
+ const legendUrl = await this.getLegend(layer)
68
+ if (legendUrl) {
69
+ // make sure layer is still visible since it may have been hidden in the meantime ...
70
+ if (this.kActivity.isLayerVisible(layer.name)) {
71
+ this.legends.push({
72
+ src: legendUrl,
73
+ layer: layer.name,
74
+ visible: true
75
+ })
73
76
  }
74
77
  }
75
78
  },
76
- tryRemoveLegend (layer) {
77
- const legendUrl = this.urlLegendLayers[layer._id]
79
+ async tryRemoveLegend (layer) {
80
+ const legendUrl = await this.getLegend(layer)
78
81
  if (legendUrl) {
79
82
  const index = this.legends.findIndex((legend) => legend.src === legendUrl)
80
83
  this.legends.splice(index, 1)
@@ -88,7 +91,6 @@ export default {
88
91
  }
89
92
  },
90
93
  mounted () {
91
- this.urlLegendLayers = {}
92
94
  this.kActivity.$on('layer-shown', this.onShowLayer)
93
95
  this.kActivity.$on('layer-hidden', this.onHideLayer)
94
96