@kalisio/kdk 2.0.1 → 2.1.0

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 (467) hide show
  1. package/.codeclimate.yml +0 -1
  2. package/.travis.test.sh +3 -0
  3. package/core/api/application.js +13 -9
  4. package/core/api/db.js +34 -30
  5. package/core/api/hooks/hooks.authentication.js +11 -0
  6. package/core/api/hooks/hooks.authorisations.js +7 -3
  7. package/core/api/hooks/hooks.model.js +32 -43
  8. package/core/api/hooks/hooks.organisations.js +26 -116
  9. package/core/api/hooks/{hooks.devices.js → hooks.push.js} +22 -10
  10. package/core/api/hooks/hooks.query.js +0 -5
  11. package/core/api/hooks/hooks.schemas.js +23 -3
  12. package/core/api/hooks/hooks.users.js +15 -22
  13. package/core/api/hooks/index.js +1 -4
  14. package/core/api/services/account/account.hooks.js +3 -3
  15. package/core/api/services/account/account.service.js +5 -6
  16. package/core/api/services/groups/groups.hooks.js +2 -4
  17. package/core/api/services/index.js +11 -16
  18. package/core/api/services/{devices/devices.hooks.js → push/push.hooks.js} +5 -5
  19. package/core/api/services/push/push.service.js +12 -0
  20. package/core/api/services/tags/tags.hooks.js +6 -20
  21. package/core/api/services/users/users.hooks.js +12 -13
  22. package/core/api/utils.js +11 -0
  23. package/core/client/api.js +6 -0
  24. package/core/client/capabilities.js +8 -12
  25. package/core/client/components/KAction.vue +10 -3
  26. package/core/client/components/KAvatar.vue +31 -35
  27. package/core/client/components/KChipsPane.vue +23 -0
  28. package/core/client/components/account/KAccount.vue +68 -0
  29. package/core/client/components/account/KDeleteAccountManager.vue +62 -0
  30. package/core/client/components/account/KEmailManager.vue +128 -0
  31. package/core/client/components/account/KPasswordManager.vue +90 -0
  32. package/core/client/components/account/KProfile.vue +109 -0
  33. package/core/client/components/account/KResetPassword.vue +100 -111
  34. package/core/client/components/account/KSendResetPassword.vue +71 -87
  35. package/core/client/components/account/KSubscription.vue +71 -0
  36. package/core/client/components/account/KSubscriptionsManager.vue +46 -0
  37. package/core/client/components/account/KVerifyEmailManager.vue +105 -0
  38. package/core/client/components/account/index.js +4 -2
  39. package/core/client/components/app/KAbout.vue +27 -14
  40. package/core/client/components/app/KPlatform.vue +2 -2
  41. package/core/client/components/app/KWelcome.vue +71 -45
  42. package/core/client/components/collection/KBoard.vue +50 -40
  43. package/core/client/components/collection/KCard.vue +16 -7
  44. package/core/client/components/collection/KColumn.vue +146 -111
  45. package/core/client/components/collection/KGrid.vue +77 -58
  46. package/core/client/components/collection/KHistory.vue +19 -3
  47. package/core/client/components/collection/KItem.vue +5 -1
  48. package/core/client/components/collection/KList.vue +80 -56
  49. package/core/client/components/collection/KTable.vue +181 -142
  50. package/core/client/components/editor/KEditor.vue +10 -3
  51. package/core/client/components/form/KFileField.vue +22 -8
  52. package/core/client/components/form/KForm.vue +27 -14
  53. package/core/client/components/form/KItemField.vue +2 -2
  54. package/core/client/components/form/KOptionsField.vue +11 -2
  55. package/core/client/components/form/KSelectField.vue +12 -3
  56. package/core/client/components/form/KTextField.vue +6 -0
  57. package/core/client/components/form/KTokenField.vue +80 -0
  58. package/core/client/components/layout/KOpener.vue +8 -8
  59. package/core/client/components/layout/KPage.vue +8 -4
  60. package/core/client/components/layout/KWindow.vue +172 -141
  61. package/core/client/components/media/KMediaBrowser.vue +28 -12
  62. package/core/client/components/media/KShape.vue +58 -56
  63. package/core/client/components/menu/KMenu.vue +22 -13
  64. package/core/client/components/menu/KRadialFab.vue +83 -56
  65. package/core/client/components/menu/KRadialFabItem.vue +39 -19
  66. package/core/client/components/screen/KLoginScreen.vue +0 -17
  67. package/core/client/components/screen/KScreen.vue +3 -3
  68. package/core/client/components/screen/KScreenFooter.vue +0 -3
  69. package/core/client/components/team/KAddMember.vue +1 -1
  70. package/core/client/components/team/KAddTag.vue +121 -0
  71. package/core/client/components/team/KMemberCard.vue +42 -13
  72. package/core/client/components/team/KMembersActivity.vue +9 -3
  73. package/core/client/components/team/KTagCard.vue +16 -1
  74. package/core/client/composables/collection.js +181 -0
  75. package/core/client/composables/index.js +2 -0
  76. package/core/client/composables/pwa.js +71 -0
  77. package/core/client/composables/session.js +6 -9
  78. package/core/client/composables/version.js +1 -22
  79. package/core/client/i18n/core_en.json +124 -153
  80. package/core/client/i18n/core_fr.json +124 -155
  81. package/core/client/index.js +37 -110
  82. package/core/client/layout.js +37 -14
  83. package/core/client/local-storage.js +4 -3
  84. package/core/client/mixins/mixin.account.js +9 -5
  85. package/core/client/mixins/mixin.base-editor.js +19 -3
  86. package/core/client/mixins/mixin.base-item.js +3 -3
  87. package/core/client/mixins/mixin.base-viewer.js +14 -0
  88. package/core/client/mixins/mixin.object-proxy.js +2 -21
  89. package/core/client/services/index.js +0 -1
  90. package/core/client/storage.js +19 -16
  91. package/core/client/theme.js +11 -5
  92. package/core/client/utils/index.js +5 -13
  93. package/core/client/utils/utils.account.js +47 -0
  94. package/core/client/utils/utils.colors.js +6 -2
  95. package/core/client/utils/utils.content.js +7 -5
  96. package/core/client/utils/utils.platform.js +1 -20
  97. package/core/client/utils/utils.push.js +53 -0
  98. package/core/client/utils/utils.pwa.js +63 -0
  99. package/core/client/utils/utils.session.js +27 -12
  100. package/core/common/permissions.js +12 -4
  101. package/core/common/schemas/tags.create.json +35 -0
  102. package/core/common/schemas/users.update-profile.json +1 -1
  103. package/coverage/base.css +224 -0
  104. package/coverage/block-navigation.js +87 -0
  105. package/coverage/core/api/application.js.html +1849 -0
  106. package/coverage/core/api/authentication.js.html +694 -0
  107. package/coverage/core/api/db.js.html +763 -0
  108. package/coverage/core/api/hooks/hooks.account.js.html +169 -0
  109. package/coverage/core/api/hooks/hooks.authentication.js.html +274 -0
  110. package/coverage/core/api/hooks/hooks.authorisations.js.html +1213 -0
  111. package/coverage/core/api/hooks/hooks.groups.js.html +229 -0
  112. package/coverage/core/api/hooks/hooks.logger.js.html +163 -0
  113. package/coverage/core/api/hooks/hooks.model.js.html +994 -0
  114. package/coverage/core/api/hooks/hooks.organisations.js.html +553 -0
  115. package/coverage/core/api/hooks/hooks.push.js.html +232 -0
  116. package/coverage/core/api/hooks/hooks.query.js.html +838 -0
  117. package/coverage/core/api/hooks/hooks.schemas.js.html +304 -0
  118. package/coverage/core/api/hooks/hooks.service.js.html +319 -0
  119. package/coverage/core/api/hooks/hooks.storage.js.html +193 -0
  120. package/coverage/core/api/hooks/hooks.tags.js.html +850 -0
  121. package/coverage/core/api/hooks/hooks.users.js.html +826 -0
  122. package/coverage/core/api/hooks/index.html +296 -0
  123. package/coverage/core/api/hooks/index.js.html +121 -0
  124. package/coverage/core/api/index.html +191 -0
  125. package/coverage/core/api/index.js.html +148 -0
  126. package/coverage/core/api/marshall.js.html +355 -0
  127. package/coverage/core/api/models/groups.model.mongodb.js.html +109 -0
  128. package/coverage/core/api/models/index.html +161 -0
  129. package/coverage/core/api/models/organisations.model.mongodb.js.html +94 -0
  130. package/coverage/core/api/models/tags.model.mongodb.js.html +115 -0
  131. package/coverage/core/api/models/users.model.mongodb.js.html +115 -0
  132. package/coverage/core/api/services/account/account.hooks.js.html +196 -0
  133. package/coverage/core/api/services/account/account.service.js.html +445 -0
  134. package/coverage/core/api/services/account/index.html +131 -0
  135. package/coverage/core/api/services/authorisations/authorisations.hooks.js.html +184 -0
  136. package/coverage/core/api/services/authorisations/authorisations.service.js.html +502 -0
  137. package/coverage/core/api/services/authorisations/index.html +131 -0
  138. package/coverage/core/api/services/databases/databases.hooks.js.html +193 -0
  139. package/coverage/core/api/services/databases/databases.service.js.html +100 -0
  140. package/coverage/core/api/services/databases/index.html +131 -0
  141. package/coverage/core/api/services/groups/groups.hooks.js.html +178 -0
  142. package/coverage/core/api/services/groups/index.html +116 -0
  143. package/coverage/core/api/services/index.html +116 -0
  144. package/coverage/core/api/services/index.js.html +475 -0
  145. package/coverage/core/api/services/mailer/index.html +131 -0
  146. package/coverage/core/api/services/mailer/mailer.hooks.js.html +190 -0
  147. package/coverage/core/api/services/mailer/mailer.service.js.html +118 -0
  148. package/coverage/core/api/services/organisations/index.html +131 -0
  149. package/coverage/core/api/services/organisations/organisations.hooks.js.html +178 -0
  150. package/coverage/core/api/services/organisations/organisations.service.js.html +343 -0
  151. package/coverage/core/api/services/push/index.html +131 -0
  152. package/coverage/core/api/services/push/push.hooks.js.html +193 -0
  153. package/coverage/core/api/services/push/push.service.js.html +121 -0
  154. package/coverage/core/api/services/storage/index.html +131 -0
  155. package/coverage/core/api/services/storage/storage.hooks.js.html +190 -0
  156. package/coverage/core/api/services/storage/storage.service.js.html +172 -0
  157. package/coverage/core/api/services/tags/index.html +116 -0
  158. package/coverage/core/api/services/tags/tags.hooks.js.html +178 -0
  159. package/coverage/core/api/services/users/index.html +116 -0
  160. package/coverage/core/api/services/users/users.hooks.js.html +313 -0
  161. package/coverage/core/api/utils.js.html +118 -0
  162. package/coverage/core/common/errors.js.html +88 -0
  163. package/coverage/core/common/index.html +176 -0
  164. package/coverage/core/common/index.js.html +115 -0
  165. package/coverage/core/common/permissions.js.html +1039 -0
  166. package/coverage/core/common/schema.js.html +190 -0
  167. package/coverage/core/common/utils.js.html +220 -0
  168. package/coverage/favicon.png +0 -0
  169. package/coverage/index.html +476 -0
  170. package/coverage/lcov-report/base.css +224 -0
  171. package/coverage/lcov-report/block-navigation.js +87 -0
  172. package/coverage/lcov-report/core/api/application.js.html +1849 -0
  173. package/coverage/lcov-report/core/api/authentication.js.html +694 -0
  174. package/coverage/lcov-report/core/api/db.js.html +763 -0
  175. package/coverage/lcov-report/core/api/hooks/hooks.account.js.html +169 -0
  176. package/coverage/lcov-report/core/api/hooks/hooks.authentication.js.html +274 -0
  177. package/coverage/lcov-report/core/api/hooks/hooks.authorisations.js.html +1213 -0
  178. package/coverage/lcov-report/core/api/hooks/hooks.groups.js.html +229 -0
  179. package/coverage/lcov-report/core/api/hooks/hooks.logger.js.html +163 -0
  180. package/coverage/lcov-report/core/api/hooks/hooks.model.js.html +994 -0
  181. package/coverage/lcov-report/core/api/hooks/hooks.organisations.js.html +553 -0
  182. package/coverage/lcov-report/core/api/hooks/hooks.push.js.html +232 -0
  183. package/coverage/lcov-report/core/api/hooks/hooks.query.js.html +838 -0
  184. package/coverage/lcov-report/core/api/hooks/hooks.schemas.js.html +304 -0
  185. package/coverage/lcov-report/core/api/hooks/hooks.service.js.html +319 -0
  186. package/coverage/lcov-report/core/api/hooks/hooks.storage.js.html +193 -0
  187. package/coverage/lcov-report/core/api/hooks/hooks.tags.js.html +850 -0
  188. package/coverage/lcov-report/core/api/hooks/hooks.users.js.html +826 -0
  189. package/coverage/lcov-report/core/api/hooks/index.html +296 -0
  190. package/coverage/lcov-report/core/api/hooks/index.js.html +121 -0
  191. package/coverage/lcov-report/core/api/index.html +191 -0
  192. package/coverage/lcov-report/core/api/index.js.html +148 -0
  193. package/coverage/lcov-report/core/api/marshall.js.html +355 -0
  194. package/coverage/lcov-report/core/api/models/groups.model.mongodb.js.html +109 -0
  195. package/coverage/lcov-report/core/api/models/index.html +161 -0
  196. package/coverage/lcov-report/core/api/models/organisations.model.mongodb.js.html +94 -0
  197. package/coverage/lcov-report/core/api/models/tags.model.mongodb.js.html +115 -0
  198. package/coverage/lcov-report/core/api/models/users.model.mongodb.js.html +115 -0
  199. package/coverage/lcov-report/core/api/services/account/account.hooks.js.html +196 -0
  200. package/coverage/lcov-report/core/api/services/account/account.service.js.html +445 -0
  201. package/coverage/lcov-report/core/api/services/account/index.html +131 -0
  202. package/coverage/lcov-report/core/api/services/authorisations/authorisations.hooks.js.html +184 -0
  203. package/coverage/lcov-report/core/api/services/authorisations/authorisations.service.js.html +502 -0
  204. package/coverage/lcov-report/core/api/services/authorisations/index.html +131 -0
  205. package/coverage/lcov-report/core/api/services/databases/databases.hooks.js.html +193 -0
  206. package/coverage/lcov-report/core/api/services/databases/databases.service.js.html +100 -0
  207. package/coverage/lcov-report/core/api/services/databases/index.html +131 -0
  208. package/coverage/lcov-report/core/api/services/groups/groups.hooks.js.html +178 -0
  209. package/coverage/lcov-report/core/api/services/groups/index.html +116 -0
  210. package/coverage/lcov-report/core/api/services/index.html +116 -0
  211. package/coverage/lcov-report/core/api/services/index.js.html +475 -0
  212. package/coverage/lcov-report/core/api/services/mailer/index.html +131 -0
  213. package/coverage/lcov-report/core/api/services/mailer/mailer.hooks.js.html +190 -0
  214. package/coverage/lcov-report/core/api/services/mailer/mailer.service.js.html +118 -0
  215. package/coverage/lcov-report/core/api/services/organisations/index.html +131 -0
  216. package/coverage/lcov-report/core/api/services/organisations/organisations.hooks.js.html +178 -0
  217. package/coverage/lcov-report/core/api/services/organisations/organisations.service.js.html +343 -0
  218. package/coverage/lcov-report/core/api/services/push/index.html +131 -0
  219. package/coverage/lcov-report/core/api/services/push/push.hooks.js.html +193 -0
  220. package/coverage/lcov-report/core/api/services/push/push.service.js.html +121 -0
  221. package/coverage/lcov-report/core/api/services/storage/index.html +131 -0
  222. package/coverage/lcov-report/core/api/services/storage/storage.hooks.js.html +190 -0
  223. package/coverage/lcov-report/core/api/services/storage/storage.service.js.html +172 -0
  224. package/coverage/lcov-report/core/api/services/tags/index.html +116 -0
  225. package/coverage/lcov-report/core/api/services/tags/tags.hooks.js.html +178 -0
  226. package/coverage/lcov-report/core/api/services/users/index.html +116 -0
  227. package/coverage/lcov-report/core/api/services/users/users.hooks.js.html +313 -0
  228. package/coverage/lcov-report/core/api/utils.js.html +118 -0
  229. package/coverage/lcov-report/core/common/errors.js.html +88 -0
  230. package/coverage/lcov-report/core/common/index.html +176 -0
  231. package/coverage/lcov-report/core/common/index.js.html +115 -0
  232. package/coverage/lcov-report/core/common/permissions.js.html +1039 -0
  233. package/coverage/lcov-report/core/common/schema.js.html +190 -0
  234. package/coverage/lcov-report/core/common/utils.js.html +220 -0
  235. package/coverage/lcov-report/favicon.png +0 -0
  236. package/coverage/lcov-report/index.html +476 -0
  237. package/coverage/lcov-report/map/api/hooks/hooks.catalog.js.html +340 -0
  238. package/coverage/lcov-report/map/api/hooks/hooks.features.js.html +337 -0
  239. package/coverage/lcov-report/map/api/hooks/hooks.query.js.html +1168 -0
  240. package/coverage/lcov-report/map/api/hooks/index.html +161 -0
  241. package/coverage/lcov-report/map/api/hooks/index.js.html +94 -0
  242. package/coverage/lcov-report/map/api/index.html +131 -0
  243. package/coverage/lcov-report/map/api/index.js.html +139 -0
  244. package/coverage/lcov-report/map/api/marshall.js.html +178 -0
  245. package/coverage/lcov-report/map/api/models/alerts.model.mongodb.js.html +106 -0
  246. package/coverage/lcov-report/map/api/models/catalog.model.mongodb.js.html +127 -0
  247. package/coverage/lcov-report/map/api/models/features.model.mongodb.js.html +196 -0
  248. package/coverage/lcov-report/map/api/models/index.html +146 -0
  249. package/coverage/lcov-report/map/api/services/alerts/alerts.hooks.js.html +274 -0
  250. package/coverage/lcov-report/map/api/services/alerts/alerts.service.js.html +610 -0
  251. package/coverage/lcov-report/map/api/services/alerts/index.html +131 -0
  252. package/coverage/lcov-report/map/api/services/catalog/catalog.hooks.js.html +313 -0
  253. package/coverage/lcov-report/map/api/services/catalog/index.html +116 -0
  254. package/coverage/lcov-report/map/api/services/daptiles/daptiles.service.js.html +1510 -0
  255. package/coverage/lcov-report/map/api/services/daptiles/index.html +116 -0
  256. package/coverage/lcov-report/map/api/services/features/features.hooks.js.html +205 -0
  257. package/coverage/lcov-report/map/api/services/features/features.service.js.html +241 -0
  258. package/coverage/lcov-report/map/api/services/features/index.html +131 -0
  259. package/coverage/lcov-report/map/api/services/geocoder/geocoder.hooks.js.html +178 -0
  260. package/coverage/lcov-report/map/api/services/geocoder/geocoder.service.js.html +322 -0
  261. package/coverage/lcov-report/map/api/services/geocoder/index.html +131 -0
  262. package/coverage/lcov-report/map/api/services/index.html +116 -0
  263. package/coverage/lcov-report/map/api/services/index.js.html +769 -0
  264. package/coverage/lcov-report/map/common/dynamic-grid-source.js.html +466 -0
  265. package/coverage/lcov-report/map/common/errors.js.html +94 -0
  266. package/coverage/lcov-report/map/common/geotiff-grid-source.js.html +535 -0
  267. package/coverage/lcov-report/map/common/grid.js.html +1612 -0
  268. package/coverage/lcov-report/map/common/index.html +371 -0
  269. package/coverage/lcov-report/map/common/index.js.html +172 -0
  270. package/coverage/lcov-report/map/common/meteo-model-grid-source.js.html +556 -0
  271. package/coverage/lcov-report/map/common/moment-utils.js.html +157 -0
  272. package/coverage/lcov-report/map/common/opendap-grid-source.js.html +868 -0
  273. package/coverage/lcov-report/map/common/opendap-utils.js.html +826 -0
  274. package/coverage/lcov-report/map/common/permissions.js.html +118 -0
  275. package/coverage/lcov-report/map/common/time-based-grid-source.js.html +418 -0
  276. package/coverage/lcov-report/map/common/tms-utils.js.html +274 -0
  277. package/coverage/lcov-report/map/common/wcs-grid-source.js.html +364 -0
  278. package/coverage/lcov-report/map/common/wcs-utils.js.html +586 -0
  279. package/coverage/lcov-report/map/common/weacast-grid-source.js.html +1033 -0
  280. package/coverage/lcov-report/map/common/wfs-utils.js.html +574 -0
  281. package/coverage/lcov-report/map/common/wms-utils.js.html +436 -0
  282. package/coverage/lcov-report/map/common/wmts-utils.js.html +547 -0
  283. package/coverage/lcov-report/prettify.css +1 -0
  284. package/coverage/lcov-report/prettify.js +2 -0
  285. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  286. package/coverage/lcov-report/sorter.js +196 -0
  287. package/coverage/lcov.info +10742 -0
  288. package/coverage/map/api/hooks/hooks.catalog.js.html +340 -0
  289. package/coverage/map/api/hooks/hooks.features.js.html +337 -0
  290. package/coverage/map/api/hooks/hooks.query.js.html +1168 -0
  291. package/coverage/map/api/hooks/index.html +161 -0
  292. package/coverage/map/api/hooks/index.js.html +94 -0
  293. package/coverage/map/api/index.html +131 -0
  294. package/coverage/map/api/index.js.html +139 -0
  295. package/coverage/map/api/marshall.js.html +178 -0
  296. package/coverage/map/api/models/alerts.model.mongodb.js.html +106 -0
  297. package/coverage/map/api/models/catalog.model.mongodb.js.html +127 -0
  298. package/coverage/map/api/models/features.model.mongodb.js.html +196 -0
  299. package/coverage/map/api/models/index.html +146 -0
  300. package/coverage/map/api/services/alerts/alerts.hooks.js.html +274 -0
  301. package/coverage/map/api/services/alerts/alerts.service.js.html +610 -0
  302. package/coverage/map/api/services/alerts/index.html +131 -0
  303. package/coverage/map/api/services/catalog/catalog.hooks.js.html +313 -0
  304. package/coverage/map/api/services/catalog/index.html +116 -0
  305. package/coverage/map/api/services/daptiles/daptiles.service.js.html +1510 -0
  306. package/coverage/map/api/services/daptiles/index.html +116 -0
  307. package/coverage/map/api/services/features/features.hooks.js.html +205 -0
  308. package/coverage/map/api/services/features/features.service.js.html +241 -0
  309. package/coverage/map/api/services/features/index.html +131 -0
  310. package/coverage/map/api/services/geocoder/geocoder.hooks.js.html +178 -0
  311. package/coverage/map/api/services/geocoder/geocoder.service.js.html +322 -0
  312. package/coverage/map/api/services/geocoder/index.html +131 -0
  313. package/coverage/map/api/services/index.html +116 -0
  314. package/coverage/map/api/services/index.js.html +769 -0
  315. package/coverage/map/common/dynamic-grid-source.js.html +466 -0
  316. package/coverage/map/common/errors.js.html +94 -0
  317. package/coverage/map/common/geotiff-grid-source.js.html +535 -0
  318. package/coverage/map/common/grid.js.html +1612 -0
  319. package/coverage/map/common/index.html +371 -0
  320. package/coverage/map/common/index.js.html +172 -0
  321. package/coverage/map/common/meteo-model-grid-source.js.html +556 -0
  322. package/coverage/map/common/moment-utils.js.html +157 -0
  323. package/coverage/map/common/opendap-grid-source.js.html +868 -0
  324. package/coverage/map/common/opendap-utils.js.html +826 -0
  325. package/coverage/map/common/permissions.js.html +118 -0
  326. package/coverage/map/common/time-based-grid-source.js.html +418 -0
  327. package/coverage/map/common/tms-utils.js.html +274 -0
  328. package/coverage/map/common/wcs-grid-source.js.html +364 -0
  329. package/coverage/map/common/wcs-utils.js.html +586 -0
  330. package/coverage/map/common/weacast-grid-source.js.html +1033 -0
  331. package/coverage/map/common/wfs-utils.js.html +574 -0
  332. package/coverage/map/common/wms-utils.js.html +436 -0
  333. package/coverage/map/common/wmts-utils.js.html +547 -0
  334. package/coverage/prettify.css +1 -0
  335. package/coverage/prettify.js +2 -0
  336. package/coverage/sort-arrow-sprite.png +0 -0
  337. package/coverage/sorter.js +196 -0
  338. package/coverage/tmp/coverage-59096-1692631696256-0.json +1 -0
  339. package/coverage/tmp/coverage-59108-1692631696233-0.json +1 -0
  340. package/coverage/tmp/coverage-59119-1692631696222-0.json +1 -0
  341. package/coverage/tmp/coverage-59131-1692631696200-0.json +1 -0
  342. package/coverage/tmp/coverage-59138-1692631696175-0.json +1 -0
  343. package/extras/css/core.variables.scss +5 -1
  344. package/extras/tours/core/account-profile.js +14 -31
  345. package/extras/tours/core/account.js +143 -0
  346. package/extras/tours/core/add-member.js +7 -6
  347. package/extras/tours/core/add-tag.js +13 -0
  348. package/extras/tours/core/create-tag.js +26 -0
  349. package/extras/tours/core/edit-member-role.js +13 -0
  350. package/extras/tours/core/join-group.js +0 -12
  351. package/extras/tours/core/login.js +0 -7
  352. package/extras/tours/core/members.js +13 -26
  353. package/extras/tours/core/send-reset-password.js +1 -1
  354. package/extras/tours/core/tags.js +17 -4
  355. package/extras/tours/map/navigation-bar.js +1 -1
  356. package/extras/tours/map/side-nav.js +3 -2
  357. package/map/api/hooks/hooks.query.js +5 -3
  358. package/map/client/cesium/utils.js +68 -0
  359. package/map/client/components/KFeatureActionButton.vue +27 -27
  360. package/map/client/components/KFeaturesChart.vue +1 -1
  361. package/map/client/components/KFeaturesTable.vue +2 -2
  362. package/map/client/components/KLayerEditionToolbar.vue +1 -0
  363. package/map/client/components/KPositionIndicator.vue +1 -1
  364. package/map/client/components/catalog/KViewSelector.vue +1 -2
  365. package/map/client/components/catalog/KViewsPanel.vue +17 -15
  366. package/map/client/components/form/KDirectionField.vue +0 -1
  367. package/map/client/components/form/KLocationField.vue +16 -29
  368. package/map/client/components/legend/KSymbolsLegend.vue +2 -1
  369. package/map/client/components/location/KLocationCardSection.vue +61 -0
  370. package/map/client/components/location/KLocationMap.vue +24 -13
  371. package/map/client/components/location/KLocationSearch.vue +144 -0
  372. package/map/client/components/location/KLocationTip.vue +29 -0
  373. package/map/client/components/tools/KGeolocateTool.vue +46 -0
  374. package/map/client/components/tools/KSearchTool.vue +93 -0
  375. package/map/client/components/widget/KElevationProfile.vue +2 -2
  376. package/map/client/components/widget/KInformationBox.vue +3 -3
  377. package/map/client/composables/location.js +35 -43
  378. package/map/client/geolocation.js +65 -8
  379. package/map/client/i18n/map_en.json +15 -13
  380. package/map/client/i18n/map_fr.json +15 -13
  381. package/map/client/init.js +10 -18
  382. package/map/client/leaflet/GradientPath.js +2 -1
  383. package/map/client/leaflet/utils.js +61 -0
  384. package/map/client/mixins/globe/mixin.base-globe.js +6 -5
  385. package/map/client/mixins/globe/mixin.popup.js +3 -0
  386. package/map/client/mixins/globe/mixin.style.js +9 -64
  387. package/map/client/mixins/globe/mixin.tooltip.js +3 -0
  388. package/map/client/mixins/index.js +0 -1
  389. package/map/client/mixins/map/mixin.base-map.js +13 -9
  390. package/map/client/mixins/map/mixin.edit-layers.js +82 -15
  391. package/map/client/mixins/map/mixin.geojson-layers.js +8 -1
  392. package/map/client/mixins/map/mixin.style.js +8 -56
  393. package/map/client/mixins/mixin.activity.js +20 -12
  394. package/map/client/mixins/mixin.feature-service.js +34 -1
  395. package/map/client/readers/reader.geojson.js +1 -1
  396. package/map/client/utils/utils.location.js +45 -0
  397. package/package.json +13 -14
  398. package/test/api/core/account.test.js +112 -126
  399. package/test/api/core/config/default.cjs +7 -11
  400. package/test/api/core/config/email-templates/confirmInvitation/html.ejs +1 -1
  401. package/test/api/core/config/email-templates/identityChange/html.ejs +6 -4
  402. package/test/api/core/config/email-templates/newDevice/html.ejs +1 -1
  403. package/test/api/core/config/email-templates/newSubscription/html.ejs +7 -0
  404. package/test/api/core/config/email-templates/passwordChange/html.ejs +1 -1
  405. package/test/api/core/config/email-templates/resendVerifySignup/html.ejs +6 -4
  406. package/test/api/core/config/email-templates/resetPwd/html.ejs +1 -1
  407. package/test/api/core/config/email-templates/sendResetPwd/html.ejs +8 -4
  408. package/test/api/core/hooks.test.js +166 -18
  409. package/test/api/core/index.test.js +32 -70
  410. package/test/api/core/push.test.js +191 -0
  411. package/test/api/core/team.test.js +38 -32
  412. package/test/api/core/test-log-2023-07-04.log +0 -0
  413. package/test/api/core/test-log-2023-07-10.log +2 -0
  414. package/test/api/core/test-log-2023-07-12.log +0 -0
  415. package/test/api/core/test-log-2023-07-18.log +78 -0
  416. package/test/api/core/test-log-2023-07-19.log +44 -0
  417. package/test/api/core/test-log-2023-08-01.log +162 -0
  418. package/test/api/core/test-log-2023-08-21.log +66 -0
  419. package/test/api/core/test-log-2023-08-22.log +96 -0
  420. package/test/api/core/test-log-2023-08-23.log +22 -0
  421. package/test/api/core/test-log-2023-09-20.log +22 -0
  422. package/test/api/map/alerts.test.js +1 -1
  423. package/test/api/map/test-log-2023-07-18.log +62 -0
  424. package/test/api/map/test-log-2023-07-19.log +13 -0
  425. package/test/api/map/test-log-2023-08-21.log +65 -0
  426. package/test/api/map/test-log-2023-09-20.log +60 -0
  427. package/test/client/core/account.js +15 -32
  428. package/test/client/core/api.js +99 -44
  429. package/test/client/core/layout.js +4 -0
  430. package/test/client/core/runner.js +66 -14
  431. package/test/client/core/time.js +1 -1
  432. package/test/client/map/controls.js +17 -3
  433. package/core/api/hooks/hooks.account.js +0 -28
  434. package/core/api/hooks/hooks.pusher.js +0 -215
  435. package/core/api/hooks/hooks.tags.js +0 -255
  436. package/core/api/services/devices/devices.service.js +0 -99
  437. package/core/api/services/pusher/pusher.channels.js +0 -3
  438. package/core/api/services/pusher/pusher.hooks.js +0 -36
  439. package/core/api/services/pusher/pusher.service.js +0 -449
  440. package/core/client/components/KInstallApp.vue +0 -43
  441. package/core/client/components/account/KAccountActivity.vue +0 -58
  442. package/core/client/components/account/KAccountDZ.vue +0 -66
  443. package/core/client/components/account/KAccountDevices.vue +0 -56
  444. package/core/client/components/account/KAccountSecurity.vue +0 -87
  445. package/core/client/components/account/KChangeIdentity.vue +0 -102
  446. package/core/client/components/account/KChangePassword.vue +0 -132
  447. package/core/client/components/account/KDeviceCard.vue +0 -75
  448. package/core/client/components/account/KIdentityPanel.vue +0 -34
  449. package/core/client/components/account/KResendVerifySignup.vue +0 -108
  450. package/core/client/components/account/KSendChangeIdentity.vue +0 -115
  451. package/core/client/components/account/KSignupAlert.vue +0 -63
  452. package/core/client/components/account/KVerifySignup.vue +0 -102
  453. package/core/client/components/form/KTagField.vue +0 -148
  454. package/core/common/schemas/members.update.json +0 -18
  455. package/extras/tours/core/account-dz.js +0 -37
  456. package/extras/tours/core/account-security.js +0 -52
  457. package/extras/tours/core/change-password.js +0 -34
  458. package/extras/tours/core/edit-member-tags.js +0 -18
  459. package/extras/tours/core/send-change-identity.js +0 -28
  460. package/map/client/components/KLocateUser.vue +0 -36
  461. package/map/client/components/KLocationInput.vue +0 -217
  462. package/map/client/components/KLocationMap.vue +0 -301
  463. package/map/client/components/KSearchLocation.vue +0 -88
  464. package/map/client/components/input/KPlaceChooser.vue +0 -78
  465. package/map/client/components/location/KLocation.vue +0 -24
  466. package/map/client/mixins/mixin.navigator.js +0 -36
  467. package/test/api/core/notifications.test.js +0 -502
@@ -21,7 +21,7 @@
21
21
  v-model="currentPage"
22
22
  :max="nbPages"
23
23
  :input="true"
24
- @update:model-value="onPageChanged"
24
+ @update:model-value="refreshCollection"
25
25
  />
26
26
  </div>
27
27
  </div>
@@ -39,73 +39,97 @@
39
39
  </div>
40
40
  </template>
41
41
 
42
- <script>
42
+ <script setup>
43
+ import { computed, watch, toRefs, onBeforeMount, onBeforeUnmount } from 'vue'
43
44
  import KStamp from '../KStamp.vue'
44
- import { service, baseCollection } from '../../mixins'
45
+ import { Events } from '../../events.js'
46
+ import { useCollection } from '../../composables'
45
47
  import { loadComponent } from '../../utils'
46
48
 
47
- export default {
48
- components: {
49
- KStamp
50
- },
51
- mixins: [
52
- service,
53
- baseCollection
54
- ],
55
- props: {
56
- renderer: {
57
- type: Object,
58
- default: () => {
59
- return {
60
- component: 'collection/KItem'
61
- }
62
- }
63
- },
64
- baseQuery: {
65
- type: Object,
66
- default: function () {
67
- return {}
68
- }
69
- },
70
- filterQuery: {
71
- type: Object,
72
- default: function () {
73
- return {}
49
+ const emit = defineEmits(['selection-changed', 'collection-refreshed'])
50
+
51
+ // Props
52
+ const props = defineProps({
53
+ renderer: {
54
+ type: Object,
55
+ default: () => {
56
+ return {
57
+ component: 'collection/KItem'
74
58
  }
75
- },
76
- listStrategy: {
77
- type: String
78
59
  }
79
60
  },
80
- computed: {
81
- rendererComponent () {
82
- return loadComponent(this.renderer.component)
83
- }
61
+ contextId: {
62
+ type: String,
63
+ default: undefined
84
64
  },
85
- watch: {
86
- baseQuery: function () {
87
- this.resetCollection()
88
- },
89
- filterQuery: function () {
90
- this.resetCollection()
65
+ service: {
66
+ type: String,
67
+ required: true
68
+ },
69
+ baseQuery: {
70
+ type: Object,
71
+ default: function () {
72
+ return {}
91
73
  }
92
74
  },
93
- methods: {
94
- getCollectionBaseQuery () {
95
- return this.baseQuery
96
- },
97
- getCollectionFilterQuery () {
98
- return this.filterQuery
75
+ filterQuery: {
76
+ type: Object,
77
+ default: function () {
78
+ return {}
99
79
  }
100
80
  },
101
- created () {
102
- // Force the collection to be refreshed
103
- this.refreshCollection()
104
- // Whenever the user abilities are updated, update collection as well
105
- this.$events.on('user-abilities-changed', this.refreshCollection)
81
+ listStrategy: {
82
+ type: String,
83
+ default: 'smart'
84
+ },
85
+ nbItemsPerPage: {
86
+ type: Number,
87
+ default: 12
106
88
  },
107
- beforeUnmount () {
108
- this.$events.off('user-abilities-changed', this.refreshCollection)
89
+ processor: {
90
+ type: Function,
91
+ default: undefined
109
92
  }
93
+ })
94
+
95
+ // Computed
96
+ const rendererComponent = computed(() => loadComponent(props.renderer.component))
97
+
98
+ // Functions
99
+ function onItemToggled (item, toggled) {
100
+ emit('item-toggled', item, toggled)
110
101
  }
102
+ function onItemSelected (item, section) {
103
+ emit('selection-changed', item, section)
104
+ }
105
+ function onCollectionRefreshed () {
106
+ emit('collection-refreshed', items.value)
107
+ }
108
+
109
+ const { items, nbTotalItems, nbPages, currentPage, refreshCollection, resetCollection } = useCollection(toRefs(props))
110
+
111
+ // Lifecycle hooks
112
+
113
+ // Emit events so that embbeding components can be aware of it
114
+ watch(items, onCollectionRefreshed)
115
+
116
+ onBeforeMount(() => {
117
+ refreshCollection()
118
+ // Whenever the user abilities are updated, update collection as well
119
+ Events.on('user-abilities-changed', refreshCollection)
120
+ })
121
+
122
+ onBeforeUnmount(() => {
123
+ Events.off('user-abilities-changed', refreshCollection)
124
+ })
125
+
126
+ // Expose
127
+ defineExpose({
128
+ items,
129
+ nbTotalItems,
130
+ nbPages,
131
+ currentPage,
132
+ refreshCollection,
133
+ resetCollection
134
+ })
111
135
  </script>
@@ -38,162 +38,201 @@
38
38
  </div>
39
39
  </template>
40
40
 
41
- <script>
41
+ <script setup>
42
42
  import _ from 'lodash'
43
43
  import moment from 'moment'
44
+ import { ref, computed, watch, toRefs, onBeforeMount, onBeforeUnmount } from 'vue'
44
45
  import KPanel from '../KPanel.vue'
45
46
  import KStamp from '../KStamp.vue'
46
- import { service, schemaProxy, baseCollection } from '../../mixins'
47
+ import { Events } from '../../events.js'
48
+ import { i18n } from '../../i18n.js'
49
+ import { useCollection, useSchema } from '../../composables'
47
50
 
48
- export default {
49
- mixins: [
50
- service,
51
- schemaProxy,
52
- baseCollection
53
- ],
54
- components: {
55
- KStamp,
56
- KPanel
57
- },
58
- props: {
59
- itemActions: {
60
- type: [Object, Array],
61
- default: () => null
62
- },
63
- baseQuery: {
64
- type: Object,
65
- default: () => {}
66
- },
67
- filterQuery: {
68
- type: Object,
69
- default: () => {}
70
- },
71
- title: {
72
- type: String
73
- },
74
- selection: {
75
- type: String
76
- },
77
- listStrategy: {
78
- type: String
51
+ const emit = defineEmits(['selection-changed', 'collection-refreshed'])
52
+
53
+ // Props
54
+ const props = defineProps({
55
+ renderer: {
56
+ type: Object,
57
+ default: () => {
58
+ return {
59
+ component: 'collection/KItem'
60
+ }
79
61
  }
80
62
  },
81
- computed: {
82
- selectableColumns () {
83
- // Remove special column used for actions
84
- return this.columns.filter(column => column.name !== 'actions')
85
- }
63
+ itemActions: {
64
+ type: [Object, Array],
65
+ default: () => null
86
66
  },
87
- data () {
88
- return {
89
- tableQuery: {
90
- $sort: { _id: 1 } // Implicit default sort
91
- },
92
- columns: [],
93
- visibleColumns: [],
94
- selectedItems: [],
95
- pagination: {
96
- sortBy: '_id',
97
- descending: false,
98
- page: 1,
99
- rowsPerPage: this.nbItemsPerPage
100
- }
101
- }
67
+ title: {
68
+ type: String
102
69
  },
103
- watch: {
104
- baseQuery: function () {
105
- this.resetCollection()
106
- },
107
- filterQuery: function () {
108
- this.resetCollection()
109
- },
110
- schema: function (schema) {
111
- if (this.schema) {
112
- this.processSchema()
113
- this.resetCollection()
114
- }
70
+ selection: {
71
+ type: String
72
+ },
73
+ contextId: {
74
+ type: String,
75
+ default: undefined
76
+ },
77
+ service: {
78
+ type: String,
79
+ required: true
80
+ },
81
+ baseQuery: {
82
+ type: Object,
83
+ default: function () {
84
+ return {}
115
85
  }
116
86
  },
117
- methods: {
118
- getCollectionBaseQuery () {
119
- return this.baseQuery
120
- },
121
- getCollectionFilterQuery () {
122
- return Object.assign({}, this.tableQuery, this.filterQuery)
123
- },
124
- processSchema () {
125
- this.columns = [{
126
- name: 'actions',
127
- align: 'center'
128
- }]
129
- _.forOwn(this.schema.properties, (value, key) => {
130
- const type = _.get(value, 'type')
131
- // FIXME: allow for custom representation of complex objects
132
- if (type === 'object') return
133
- const label = _.get(value, 'field.label', _.get(value, 'field.helper', key))
134
- const options = _.get(value, 'field.options', [])
135
- const format = _.get(value, 'format')
136
- this.columns.push({
137
- name: key,
138
- // Check if we have a translation key or directly the label content
139
- label: this.$tie(label),
140
- // This will support GeoJson out-of-the-box
141
- field: row => _.get(row, key, _.get(row, `properties.${key}`)),
142
- align: 'center',
143
- sortable: true,
144
- format: (value) => {
145
- // Check if the corresponding value is mapped according to an option list
146
- const option = _.find(options, { value })
147
- if (option && option.label) value = option.label
148
- switch (type) {
149
- case 'number':
150
- return (value ? value.toFixed(2) : '')
151
- case 'integer':
152
- return (value ? value.toFixed(0) : '')
153
- case 'string':
154
- return (value ? (format === 'date-time' ? moment.utc(value).toISOString() : value) : '')
155
- default:
156
- return (value ? value.toString() : '')
157
- }
158
- }
159
- })
160
- })
161
- this.visibleColumns = this.columns.map(column => column.name)
162
- },
163
- onCollectionRefreshed () {
164
- baseCollection.methods.onCollectionRefreshed.call(this)
165
- // Update pagination for table
166
- this.pagination.rowsNumber = this.nbTotalItems
167
- },
168
- onRequest (props) {
169
- const { page, rowsPerPage, sortBy, descending } = props.pagination
170
- const geoJson = (_.get(this.items, '[0].type') === 'Feature')
171
- this.currentPage = page
172
- this.tableQuery.$sort = { [geoJson ? `properties.${sortBy}` : sortBy]: (descending ? -1 : 1) }
173
- this.refreshCollection()
174
- // don't forget to update local pagination object
175
- this.pagination.page = page
176
- this.pagination.rowsPerPage = rowsPerPage
177
- this.pagination.sortBy = sortBy
178
- this.pagination.descending = descending
179
- },
180
- onSelectionChanged (data) {
181
- if (this.selection === 'single') {
182
- if (data.added) this.onItemSelected(data.rows[0])
183
- else this.onItemSelected(null)
184
- } else {
185
- if (data.added) this.onItemsSelected(this.selectedItems.concat(data.rows))
186
- else this.onItemsSelected(this.selectedItems.filter(item => !_.find(data.rows, { _id: item._id })))
187
- }
87
+ filterQuery: {
88
+ type: Object,
89
+ default: function () {
90
+ return {}
188
91
  }
189
92
  },
190
- async created () {
191
- // Whenever the user abilities are updated, update collection as well
192
- this.$events.on('user-abilities-changed', this.refreshCollection)
193
- await this.loadSchema(this.service + '.get')
93
+ listStrategy: {
94
+ type: String,
95
+ default: 'smart'
194
96
  },
195
- beforeUnmount () {
196
- this.$events.off('user-abilities-changed', this.refreshCollection)
97
+ nbItemsPerPage: {
98
+ type: Number,
99
+ default: 12
100
+ },
101
+ schema: {
102
+ type: [String, Object],
103
+ default: null
104
+ },
105
+ processor: {
106
+ type: Function,
107
+ default: undefined
108
+ }
109
+ })
110
+
111
+ // Data
112
+ const tableQuery = ref({
113
+ $sort: { _id: 1 } // Implicit default sort
114
+ })
115
+ const columns = ref([])
116
+ const visibleColumns = ref([])
117
+ const selectedItems = ref([])
118
+ const pagination = ref({
119
+ sortBy: '_id',
120
+ descending: false,
121
+ page: 1,
122
+ rowsPerPage: props.nbItemsPerPage,
123
+ rowsNumber: 0
124
+ })
125
+
126
+ // Computed
127
+ // Remove special column used for actions
128
+ const selectableColumns = computed(() => columns.value.filter(column => column.name !== 'actions'))
129
+ const filterQuery = computed(() => Object.assign({}, props.filterQuery, tableQuery.value))
130
+
131
+ const { schema, compile } = useSchema()
132
+ // Add sort query into collection options
133
+ const options = Object.assign({ filterQuery }, _.omit(toRefs(props), ['filterQuery']))
134
+ const { items, nbTotalItems, nbPages, currentPage, refreshCollection, resetCollection } = useCollection(options)
135
+
136
+ // Functions
137
+ function processSchema () {
138
+ columns.value = [{
139
+ name: 'actions',
140
+ align: 'center'
141
+ }]
142
+ _.forOwn(schema.value.properties, (value, key) => {
143
+ const type = _.get(value, 'type')
144
+ // FIXME: allow for custom representation of complex objects
145
+ if (type === 'object') return
146
+ const label = _.get(value, 'field.label', _.get(value, 'field.helper', key))
147
+ const options = _.get(value, 'field.options', [])
148
+ const format = _.get(value, 'format')
149
+ columns.value.push({
150
+ name: key,
151
+ // Check if we have a translation key or directly the label content
152
+ label: i18n.tie(label),
153
+ // This will support GeoJson out-of-the-box
154
+ field: row => _.get(row, key, _.get(row, `properties.${key}`)),
155
+ align: 'center',
156
+ sortable: true,
157
+ format: (value) => {
158
+ // Check if the corresponding value is mapped according to an option list
159
+ const option = _.find(options, { value })
160
+ if (option && option.label) value = option.label
161
+ switch (type) {
162
+ case 'number':
163
+ return (value ? value.toFixed(2) : '')
164
+ case 'integer':
165
+ return (value ? value.toFixed(0) : '')
166
+ case 'string':
167
+ return (value ? (format === 'date-time' ? moment.utc(value).toISOString() : value) : '')
168
+ default:
169
+ return (value ? value.toString() : '')
170
+ }
171
+ }
172
+ })
173
+ })
174
+ visibleColumns.value = columns.value.map(column => column.name)
175
+ }
176
+ function onRequest (props) {
177
+ const { page, rowsPerPage, sortBy, descending } = props.pagination
178
+ const geoJson = (_.get(items.value, '[0].type') === 'Feature')
179
+ currentPage.value = page
180
+ tableQuery.value.$sort = { [geoJson ? `properties.${sortBy}` : sortBy]: (descending ? -1 : 1) }
181
+ // Don't forget to update local pagination object
182
+ pagination.value.page = page
183
+ pagination.value.rowsPerPage = rowsPerPage
184
+ pagination.value.sortBy = sortBy
185
+ pagination.value.descending = descending
186
+ // This will trigger a collection refresh, take care composable options are refs
187
+ options.filterQuery.value = Object.assign({}, props.filterQuery, tableQuery.value)
188
+ }
189
+ function onSelectionChanged (data) {
190
+ if (props.selection === 'single') {
191
+ if (data.added) emit('selection-changed', data.rows[0])
192
+ else emit('selection-changed', null)
193
+ } else {
194
+ if (data.added) emit('selection-changed', selectedItems.value.concat(data.rows))
195
+ else emit('selection-changed', selectedItems.value.filter(item => !_.find(data.rows, { _id: item._id })))
197
196
  }
198
197
  }
198
+ function onCollectionRefreshed () {
199
+ emit('collection-refreshed', items.value)
200
+ }
201
+
202
+ // Lifecycle hooks
203
+
204
+ // Emit events so that embbeding components can be aware of it
205
+ watch(items, onCollectionRefreshed)
206
+ watch(schema, () => {
207
+ processSchema()
208
+ resetCollection()
209
+ })
210
+ watch(() => props.schema, async (value) => {
211
+ await compile(props.schema || `${props.service}.get`)
212
+ })
213
+ watch(nbTotalItems, () => {
214
+ // Update pagination for table
215
+ pagination.value.rowsNumber = nbTotalItems.value
216
+ })
217
+
218
+ onBeforeMount(async () => {
219
+ // This will launch collection refresh
220
+ await compile(props.schema || `${props.service}.get`)
221
+ // Whenever the user abilities are updated, update collection as well
222
+ Events.on('user-abilities-changed', refreshCollection)
223
+ })
224
+
225
+ onBeforeUnmount(() => {
226
+ Events.off('user-abilities-changed', refreshCollection)
227
+ })
228
+
229
+ // Expose
230
+ defineExpose({
231
+ items,
232
+ nbTotalItems,
233
+ nbPages,
234
+ currentPage,
235
+ refreshCollection,
236
+ resetCollection
237
+ })
199
238
  </script>
@@ -9,13 +9,14 @@
9
9
  :ref="onFormReferenceCreated"
10
10
  :schema="schema"
11
11
  @form-ready="onFormReady"
12
+ class="q-pa-sm"
12
13
  />
13
14
  </div>
14
15
  <!--
15
16
  Buttons section
16
17
  -->
17
- <div>
18
- <div class="q-pt-md row justify-end">
18
+ <div v-if="!hideButtons">
19
+ <div class="row justify-end">
19
20
  <q-btn v-if="clearButton !== ''" id="clear-button" color="primary" :label="clearButton" @click="clearEditor"/>
20
21
  <q-btn v-if="resetButton !== ''" id="reset-button" color="primary" :label="resetButton" @click="resetEditor"/>
21
22
  <q-btn v-if="applyButton !== ''" id="apply-button" color="primary" :label="applyButton" @click="apply"/>
@@ -38,7 +39,13 @@ export default {
38
39
  objectProxy,
39
40
  schemaProxy
40
41
  ],
41
- async created () {
42
+ props: {
43
+ hideButtons: {
44
+ type: Boolean,
45
+ default: false
46
+ }
47
+ },
48
+ async mounted () {
42
49
  await this.refresh()
43
50
  }
44
51
  }
@@ -4,20 +4,29 @@
4
4
  {{ model.name }}
5
5
  </q-chip>
6
6
  </div>
7
+ <!-- -->
8
+ <q-field v-else-if="model"
9
+ :for="properties.name + '-field'"
10
+ v-model="model"
11
+ :label="label"
12
+ clearable
13
+ @clear="onFileCleared"
14
+ :disable="disabled"
15
+ >
16
+ <template v-slot:control>
17
+ {{ model.name }}
18
+ </template>
19
+ </q-field>
7
20
  <q-file v-else
8
21
  :for="properties.name + '-field'"
9
- :id="properties.name + '-field'"
10
22
  v-model="file"
11
23
  :label="label"
12
- clearable
13
- counter
14
24
  :accept="acceptedTypes"
15
25
  :filter="filterSelectedFiles"
16
26
  :error="hasError"
17
27
  :error-message="errorLabel"
18
28
  bottom-slots
19
29
  :disable="disabled"
20
- @clear="onFileCleared"
21
30
  @update:model-value="onFileChanged"
22
31
  @rejected="onFileRejected">
23
32
  <!-- Helper -->
@@ -40,7 +49,8 @@ export default {
40
49
  mixins: [baseField],
41
50
  data () {
42
51
  return {
43
- file: null
52
+ file: null,
53
+ changed: false
44
54
  }
45
55
  },
46
56
  computed: {
@@ -61,7 +71,7 @@ export default {
61
71
  return _.filter(files, file => { return file.name.includes(filter) })
62
72
  },
63
73
  onFileCleared () {
64
- this.model = this.emptyModel()
74
+ this.file = null
65
75
  this.error = ''
66
76
  this.onChanged()
67
77
  },
@@ -72,6 +82,8 @@ export default {
72
82
  // Check whether the file will be uploaded without being read
73
83
  if (!_.get(this.properties, 'field.readContent', true)) {
74
84
  this.model = { name: this.file.name, type: this.file.type }
85
+ this.onChanged()
86
+ this.changed = true
75
87
  return
76
88
  }
77
89
  // Check whether the file type is registered to be read by a reader
@@ -83,6 +95,7 @@ export default {
83
95
  // Avoid making file content reactive as it might be large and it is not used in UI
84
96
  this.model = { name: this.file.name, type: this.file.type, content: markRaw(content) }
85
97
  this.onChanged()
98
+ this.changed = true
86
99
  } catch (error) {
87
100
  this.error = error
88
101
  this.model = this.emptyModel()
@@ -113,10 +126,11 @@ export default {
113
126
  },
114
127
  async submitted (object, field) {
115
128
  // Check wether we need to upload file content
116
- if (_.get(this.model, 'key')) {
129
+ if (this.changed && _.get(this.model, 'key')) {
117
130
  // The template generates the final context for storage service
118
131
  let context = _.get(this.properties, 'field.storage.context')
119
132
  if (context) context = _.template(context)(Object.assign({}, { fileName: this.model.name }, object))
133
+ const query = _.get(this.properties, 'field.storage.uploadQuery')
120
134
  logger.debug(`Uploading file ${this.model.name} with key ${this.model.key}`)
121
135
  Storage.upload({
122
136
  file: this.model.name,
@@ -124,7 +138,7 @@ export default {
124
138
  key: this.model.key,
125
139
  blob: this.file,
126
140
  context
127
- })
141
+ }, { query })
128
142
  .then(() => {
129
143
  this.$notify({
130
144
  type: 'positive',