|
67 | 67 |
|
68 | 68 | <script> |
69 | 69 |
|
| 70 | + import urls from 'kolibri.urls'; |
70 | 71 | import { currentLanguage, languageIdToCode } from 'kolibri.utils.i18n'; |
71 | 72 | import ViewDashboardOutlineIcon from 'vue-material-design-icons/ViewDashboardOutline.vue'; |
72 | 73 | import MagnifyIcon from 'vue-material-design-icons/Magnify.vue'; |
|
91 | 92 | mixins: [commonExploreStrings], |
92 | 93 | data() { |
93 | 94 | return { |
| 95 | + buildInfo: null, |
94 | 96 | isOffline: false, |
95 | 97 | }; |
96 | 98 | }, |
|
99 | 101 | return assets.EndlessLogo; |
100 | 102 | }, |
101 | 103 | feedbackUrl() { |
| 104 | + // FIXME add language=currentLanguage and platform= |
| 105 | + const hiddenFormFields = new URLSearchParams({ |
| 106 | + language: currentLanguage, |
| 107 | + platform: 'unknown', |
| 108 | + kolibriVersion: window.kolibriCoreAppGlobal.version, |
| 109 | + }); |
| 110 | +
|
| 111 | + if (this.buildInfo) { |
| 112 | + hiddenFormFields[ |
| 113 | + 'endlessKeyRelease' |
| 114 | + ] = `${this.buildInfo.version_name} ${this.buildInfo.last_release}`; |
| 115 | + } |
| 116 | +
|
102 | 117 | switch (languageIdToCode(currentLanguage)) { |
103 | 118 | case 'es': |
104 | | - return plugin_data.feedbackUrlEs; |
| 119 | + return plugin_data.feedbackUrlEs + '#' + hiddenFormFields.toString(); |
105 | 120 | default: |
106 | | - return plugin_data.feedbackUrl; |
| 121 | + return plugin_data.feedbackUrl + '#' + hiddenFormFields.toString(); |
107 | 122 | } |
108 | 123 | }, |
109 | 124 | showFeedbackButton() { |
|
116 | 131 | return !!plugin_data.androidApplicationId && !!plugin_data.windowsApplicationId; |
117 | 132 | }, |
118 | 133 | }, |
| 134 | + mounted() { |
| 135 | + this.getBuildInfo(); |
| 136 | + }, |
119 | 137 | created() { |
120 | 138 | this.isOffline = !navigator.onLine; |
121 | 139 | window.addEventListener('offline', this.onOffline); |
|
169 | 187 | this.$store.commit('topicsRoot/SET_SHOW_SIDE_NAV', true); |
170 | 188 | } |
171 | 189 | }, |
| 190 | + getBuildInfo() { |
| 191 | + const buildInfo = urls.static(`build-info.json`); |
| 192 | + fetch(buildInfo) |
| 193 | + .then(response => response.json()) |
| 194 | + .then(data => { |
| 195 | + this.buildInfo = data; |
| 196 | + }) |
| 197 | + .catch(error => { |
| 198 | + console.error(error); |
| 199 | + }); |
| 200 | + }, |
172 | 201 | }, |
173 | 202 | $trs: { |
174 | 203 | feedbackLabel: 'Feedback', |
|
0 commit comments