@abi-software/mapintegratedvuer 0.7.1-auth.0 → 0.7.1-auth.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abi-software/mapintegratedvuer",
3
- "version": "0.7.1-auth.0",
3
+ "version": "0.7.1-auth.2",
4
4
  "license": "Apache-2.0",
5
5
  "scripts": {
6
6
  "serve": "vite --host --force",
@@ -42,12 +42,12 @@
42
42
  "*.js"
43
43
  ],
44
44
  "dependencies": {
45
- "@abi-software/flatmapvuer": "^0.6.1-auth.0",
45
+ "@abi-software/flatmapvuer": "^0.6.1-auth.2",
46
46
  "@abi-software/map-side-bar": "^1.7.0-vue3.4",
47
47
  "@abi-software/plotvuer": "^0.4.0-vue-3-alpha.10",
48
48
  "@abi-software/scaffoldvuer": "^0.4.0-vue3.6",
49
49
  "@abi-software/simulationvuer": "^0.7.0-vue-3-alpha.5",
50
- "@abi-software/svg-sprite": "^0.4.0-vue3.3",
50
+ "@abi-software/svg-sprite": "^0.4.0-vue3-beta.0",
51
51
  "@cypress/vite-dev-server": "^5.0.7",
52
52
  "@element-plus/icons-vue": "^2.3.1",
53
53
  "@pinia/testing": "^0.1.3",
package/src/App.vue CHANGED
@@ -85,7 +85,6 @@ export default {
85
85
  flatmapAPI: import.meta.env.VITE_FLATMAPAPI_LOCATION,
86
86
  nlLinkPrefix: import.meta.env.VITE_NL_LINK_PREFIX,
87
87
  rootUrl: import.meta.env.VITE_ROOT_URL,
88
- userToken: '',
89
88
  }
90
89
  }
91
90
  },
@@ -233,7 +233,6 @@ export default {
233
233
  this.options.flatmapAPI ? this.settingsStore.updateFlatmapAPI(this.options.flatmapAPI) : null,
234
234
  this.options.nlLinkPrefix ? this.settingsStore.updateNLLinkPrefix(this.options.nlLinkPrefix) : null
235
235
  this.options.rootUrl ? this.settingsStore.updateRootUrl(this.options.rootUrl) : null
236
- this.options.userToken ? this.settingsStore.updateUserToken(this.options.userToken) : null
237
236
  }
238
237
  },
239
238
  mounted: async function() {
@@ -21,6 +21,7 @@
21
21
  :view-u-r-l="entry.viewUrl"
22
22
  :markerLabels="markerLabels"
23
23
  :flatmapAPI="flatmapAPI"
24
+ :userApiKey="userApiKey"
24
25
  />
25
26
  </template>
26
27
 
@@ -9,6 +9,7 @@ import markerZoomLevels from "../components/markerZoomLevelsHardCoded.js";
9
9
  import { mapStores } from 'pinia';
10
10
  import { useSettingsStore } from '../stores/settings';
11
11
  import { useSplitFlowStore } from '../stores/splitFlow';
12
+ import { useMainStore } from '@/store/index';
12
13
 
13
14
  function capitalise(text) {
14
15
  return text[0].toUpperCase() + text.substring(1)
@@ -32,10 +33,13 @@ export default {
32
33
  },
33
34
  },
34
35
  computed: {
35
- ...mapStores(useSettingsStore, useSplitFlowStore),
36
+ ...mapStores(useSettingsStore, useSplitFlowStore, useMainStore),
36
37
  syncMode() {
37
38
  return this.splitFlowStore.syncMode;
38
39
  },
40
+ userApiKey() {
41
+ return this.mainStore.userToken;
42
+ }
39
43
  },
40
44
  mounted: function () {
41
45
  EventBus.on("startHelp", () => {
@@ -428,14 +432,12 @@ export default {
428
432
  };
429
433
  },
430
434
  created: function () {
435
+ console.log("🚀 ~ useMainStore:", useMainStore())
431
436
  this.flatmapAPI = undefined;
432
437
  this.apiLocation = undefined;
433
- this.userApiKey = undefined;
434
438
  if (this.settingsStore.flatmapAPI)
435
439
  this.flatmapAPI = this.settingsStore.flatmapAPI;
436
440
  if (this.settingsStore.sparcApi)
437
441
  this.apiLocation = this.settingsStore.sparcApi;
438
- if (this.settingsStore.userToken)
439
- this.userApiKey = this.settingsStore.userToken;
440
442
  },
441
443
  };
@@ -0,0 +1,20 @@
1
+ import { defineStore } from 'pinia'
2
+
3
+ export const useMainStore = defineStore('main', {
4
+ state: () => ({
5
+ userProfile: {
6
+ token: ''
7
+ }
8
+ }),
9
+ getters: {
10
+ userToken(state) {
11
+ return state.userProfile.token
12
+ },
13
+ },
14
+ actions: {
15
+
16
+ },
17
+ persist: {
18
+
19
+ }
20
+ })
@@ -14,7 +14,6 @@ export const useSettingsStore = defineStore('settings', {
14
14
  flatmapAPI: undefined,
15
15
  nlLinkPrefix: undefined,
16
16
  rootUrl: undefined,
17
- userToken: undefined,
18
17
  facets: { species: [], gender: [], organ: [] },
19
18
  facetLabels: [],
20
19
  markers: [],
@@ -65,9 +64,6 @@ export const useSettingsStore = defineStore('settings', {
65
64
  updateRootUrl(rootUrl) {
66
65
  this.rootUrl = rootUrl;
67
66
  },
68
- updateUserToken(userToken) {
69
- this.userToken = userToken;
70
- },
71
67
  updateMarkers(markers) {
72
68
  this.markers = markers;
73
69
  },
package/vite.config.js CHANGED
@@ -1,5 +1,4 @@
1
1
  import path from "path";
2
- const pathSrc = path.resolve(__dirname, "./src");
3
2
  import { defineConfig } from 'vite'
4
3
  import vue from '@vitejs/plugin-vue'
5
4
  import Components from 'unplugin-vue-components/vite'
@@ -33,6 +32,11 @@ export default defineConfig(({ command, mode }) => {
33
32
  // https://github.com/antfu/unocss
34
33
  // see unocss.config.ts for config
35
34
  ],
35
+ resolve: {
36
+ alias: {
37
+ '@': path.resolve(__dirname, './src'),
38
+ }
39
+ },
36
40
  build: {
37
41
  lib: {
38
42
  entry: path.resolve(__dirname, "./src/components/index.js"),