@abi-software/map-side-bar 1.1.16 → 1.1.17

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/map-side-bar",
3
- "version": "1.1.16",
3
+ "version": "1.1.17",
4
4
  "main": "./dist/map-side-bar.common.js",
5
5
  "files": [
6
6
  "dist/*",
@@ -1,18 +1,20 @@
1
1
  <template>
2
2
  <div class="context-card-container" ref="container">
3
- <div v-show="showDetails" class="hide" @click="showDetails = !showDetails">Hide information<i class="el-icon-arrow-up"></i></div>
4
- <div v-show="!showDetails" class="hide" @click="showDetails = !showDetails">Show information<i class="el-icon-arrow-down"></i></div>
5
- <el-card v-if="showDetails && Object.keys(contextData).length !== 0" class="context-card card" :body-style="{ padding: '0px', 'background-color': 'white', display: 'flex', width: '516px'}">
6
- <img :src="entry.banner" class="context-image card-left">
7
- <div class="card-right">
8
- <div class="title">{{contextData.heading}}</div>
9
- <div>{{contextData.description}}</div>
10
- <template v-for="(view, i) in contextData.views">
11
- <br v-bind:key="i"/>
12
- <span v-bind:key="i+'_1'" @click="openViewFile(view)" style="cursor:pointer;"><img :src="getFileFromPath(view.thumbnail)" style="height: 25px;"> {{view.description}}</span>
13
- </template>
14
- </div>
15
- </el-card>
3
+ <div v-show="showContextCard">
4
+ <div v-show="showDetails" class="hide" @click="showDetails = !showDetails">Hide information<i class="el-icon-arrow-up"></i></div>
5
+ <div v-show="!showDetails" class="hide" @click="showDetails = !showDetails">Show information<i class="el-icon-arrow-down"></i></div>
6
+ <el-card v-if="showDetails && Object.keys(contextData).length !== 0" class="context-card card" >
7
+ <img :src="entry.banner" class="context-image card-left">
8
+ <div class="card-right">
9
+ <div class="title">{{contextData.heading}}</div>
10
+ <div>{{contextData.description}}</div>
11
+ <template v-for="(view, i) in contextData.views">
12
+ <br v-bind:key="i"/>
13
+ <span v-bind:key="i+'_1'" @click="openViewFile(view)" class="scaffold-view"><img :src="getFileFromPath(view.thumbnail)"> {{view.description}}</span>
14
+ </template>
15
+ </div>
16
+ </el-card>
17
+ </div>
16
18
  </div>
17
19
  </template>
18
20
 
@@ -47,12 +49,21 @@ export default {
47
49
  data: function () {
48
50
  return {
49
51
  contextData: {},
50
- showDetails: true
52
+ showDetails: true,
53
+ showContextCard: true
51
54
  };
52
55
  },
53
56
  watch: {
54
- 'entry.contextCardUrl'(val){
55
- this.getContextFile(val)
57
+ 'entry.contextCardUrl': {
58
+ handler(val){
59
+ if (val) {
60
+ this.getContextFile(val)
61
+ this.showContextCard = true
62
+ } else {
63
+ this.showContextCard = false
64
+ }
65
+ },
66
+ immediate: true
56
67
  }
57
68
  },
58
69
  methods: {
@@ -67,7 +78,6 @@ export default {
67
78
  })
68
79
  .then((data) => {
69
80
  this.contextData = data
70
- console.log(this.contextData)
71
81
  })
72
82
  .catch(() => {
73
83
  //set defaults if we hit an error
@@ -75,7 +85,15 @@ export default {
75
85
  this.discoverId = undefined
76
86
  });
77
87
  },
88
+ removeDoubleFilesPath: function(path){
89
+ if (path.includes('files/files/')){
90
+ return path.replace('files/files/', 'files/')
91
+ } else {
92
+ return path
93
+ }
94
+ },
78
95
  getFileFromPath: function(path){
96
+ path = this.removeDoubleFilesPath(path)
79
97
  return `${this.entry.apiLocation}s3-resource/${this.entry.discoverId}/${this.entry.version}/files/${path}`
80
98
  },
81
99
  openViewFile: function(view){
@@ -85,10 +103,6 @@ export default {
85
103
  this.entry.type = 'Scaffold View'
86
104
  EventBus.$emit("PopoverActionClick", this.entry)
87
105
  }
88
-
89
- },
90
- mounted: function(){
91
- this.getContextFile(this.entry.contextCardUrl)
92
106
  }
93
107
  };
94
108
  </script>
@@ -105,6 +119,12 @@ export default {
105
119
  background-color: white;
106
120
  }
107
121
 
122
+ .context-card >>> .el-card__body {
123
+ padding: 0px;
124
+ display: flex;
125
+ width: 516px;
126
+ }
127
+
108
128
  .context-image{
109
129
  width: 250px
110
130
  }
@@ -126,6 +146,11 @@ export default {
126
146
  padding-left: 6px;
127
147
  }
128
148
 
149
+ .cursor-pointer {
150
+ cursor: pointer;
151
+ height: 25px;
152
+ }
153
+
129
154
  .title{
130
155
  font-weight: bold;
131
156
  }
@@ -17,9 +17,6 @@
17
17
  <div>
18
18
  <el-button v-if="entry.scaffolds" @click="openScaffold" size="mini" class="button" icon="el-icon-view">View scaffold</el-button>
19
19
  </div>
20
- <div>
21
- <el-button v-if="entry.contextualInformation" @click="openContext" size="mini" class="button" icon="el-icon-view">View context data</el-button>
22
- </div>
23
20
  <div>
24
21
  <el-button v-if="hasCSVFile" @click="openPlot" size="mini" class="button" icon="el-icon-view">View plot</el-button>
25
22
  </div>
@@ -149,20 +146,6 @@ export default {
149
146
  }
150
147
  this.propogateCardAction(action)
151
148
  },
152
- openContext: function(){
153
- let action = {
154
- label: capitalise(this.label),
155
- resource: 'not used',
156
- title: "View 3D scaffold",
157
- type: "Scaffold",
158
- discoverId: this.discoverId,
159
- apiLocation: this.envVars.API_LOCATION,
160
- version: this.version,
161
- contextCardUrl: this.entry.contextualInformation ? this.getFileFromPath(this.discoverId, this.version,this.entry.contextualInformation) : undefined,
162
- banner: this.thumbnail
163
- }
164
- this.propogateCardAction(action)
165
- },
166
149
  openPlot: function(){
167
150
  let action = {
168
151
  label: capitalise(this.label),
@@ -23,7 +23,7 @@
23
23
  <el-popover
24
24
  title="How do filters work?"
25
25
  width="250"
26
- trigger="click"
26
+ trigger="hover"
27
27
  :append-to-body=false
28
28
  popper-class="popover"
29
29
  >
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <el-card :body-style="bodyStyle" class="content-card">
3
3
  <div slot="header" class="header">
4
- <context-card v-if="contextCardEntry" :entry="contextCardEntry" />
4
+ <context-card v-if="contextCardEntry && contextCardEnabled" :entry="contextCardEntry" />
5
5
  <el-input
6
6
  class="search-input"
7
7
  placeholder="Search"
@@ -102,7 +102,8 @@ var initial_state = {
102
102
  start: 0,
103
103
  hasSearched: false,
104
104
  sciCrunchError: false,
105
- contextCardEntry: undefined
105
+ contextCardEntry: undefined,
106
+ contextCardEnabled: false
106
107
  };
107
108
 
108
109
  export default {