@abi-software/gallery 0.3.0-beta.4 → 0.3.0-beta.5

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/gallery",
3
- "version": "0.3.0-beta.4",
3
+ "version": "0.3.0-beta.5",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/hsorby/mapcore-gallery.git"
@@ -133,6 +133,10 @@ export default {
133
133
  },
134
134
  },
135
135
  methods: {
136
+ /**
137
+ * Open a new link if link is provide.
138
+ * Fire an event if userData is provide.
139
+ */
136
140
  cardClicked: function () {
137
141
  if (this.data.link) {
138
142
  const link = document.createElement('a')
@@ -146,6 +150,9 @@ export default {
146
150
  this.$emit('card-clicked', this.data.userData)
147
151
  }
148
152
  },
153
+ /**
154
+ * handle thumbnail downloading,, it will use a default svg image if fails
155
+ */
149
156
  downloadThumbnail: function (url, info) {
150
157
  getRequest(url, {}, 11000).then(
151
158
  (response) => {
@@ -121,7 +121,6 @@ export default {
121
121
  currentIndex: 0,
122
122
  controlHeight: 2,
123
123
  controlWidth: 2,
124
- visibleIndecies: [],
125
124
  }
126
125
  },
127
126
  computed: {
@@ -149,6 +148,7 @@ export default {
149
148
  const buttonPx = convertRemToPixels(2)
150
149
  const cardWidthPx = convertRemToPixels(this.cardWidth)
151
150
  const cardItems = (this.maxWidth - 2 * buttonPx - 2 * cardSpacingPx) / (1.1 * cardWidthPx)
151
+ //Display at least one item
152
152
  return Math.max(1, Math.floor(cardItems))
153
153
  },
154
154
  canShowIndicatorBar() {
@@ -182,9 +182,6 @@ export default {
182
182
  isActive(index) {
183
183
  return this.currentIndex - this.valueAdjustment === index && this.highlightActive
184
184
  },
185
- isVisible(index) {
186
- return this.visibleIndecies.includes(index)
187
- },
188
185
  goNext() {
189
186
  this.currentIndex += 1
190
187
  },
@@ -197,9 +194,6 @@ export default {
197
194
  }
198
195
  },
199
196
  },
200
- created() {
201
- this._visibleIndecies = []
202
- },
203
197
  watch: {
204
198
  currentIndex: {
205
199
  handler: function () {
@@ -217,16 +211,6 @@ export default {
217
211
  if (!oddImagesVisible) {
218
212
  rawIndicies.pop()
219
213
  }
220
- this.visibleIndecies = []
221
- for (let v of rawIndicies) {
222
- if (v < 0) {
223
- this.visibleIndecies.push(v + this.numberOfItemsVisible)
224
- } else if (v >= this.itemCount) {
225
- this.visibleIndecies.push(v - this.numberOfItemsVisible)
226
- } else {
227
- this.visibleIndecies.push(v)
228
- }
229
- }
230
214
  },
231
215
  immediate: true,
232
216
  },
@@ -10,6 +10,8 @@ const getRequest = async (url, params, timeout) => {
10
10
  }
11
11
 
12
12
  export default {
13
+ //this mixin is not used by this code base but it can be used by other
14
+ //projects to get a handle to various resources
13
15
  data() {
14
16
  return {
15
17
  defaultImg: require('../assets/logo-sparc-wave-primary.svg'),
@@ -27,6 +29,9 @@ export default {
27
29
  const encoded_file_path = encodeURIComponent(file_path)
28
30
  return `${dataset_id}/${dataset_version}/files/${encoded_file_path}`
29
31
  },
32
+ /**
33
+ * Find data path in the array that matches the provide path
34
+ */
30
35
  findEntryWithPathInArray(array, path) {
31
36
  if (path && array) {
32
37
  for (let i = 0; i < array.length; i++) {
@@ -42,6 +47,10 @@ export default {
42
47
  }
43
48
  return undefined;
44
49
  },
50
+ /**
51
+ * Use the scaffoldViews to help with finding the correct thumbnails.
52
+ * Use the index if the workflow stated above fails.
53
+ */
45
54
  getThumbnailForScaffold(scaffold, scaffoldViews, thumbnails, index) {
46
55
  if (thumbnails && (thumbnails.length > 0)) {
47
56
  let thumbnail = undefined;
package/vue.config.js CHANGED
@@ -1,12 +1,11 @@
1
1
  // vue.config.js
2
2
  module.exports = {
3
3
  chainWebpack: config => {
4
- // GraphQL Loader
4
+ // vue svg inline loader for default svg
5
5
  config.module
6
6
  .rule('vue')
7
7
  .use('vue-svg-inline-loader')
8
8
  .loader('vue-svg-inline-loader')
9
9
  .end()
10
10
  },
11
- css: { extract: false },
12
11
  }