|
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 | + const hiddenFormFields = new URLSearchParams({ |
| 105 | + language: currentLanguage, |
| 106 | + kolibriVersion: window.kolibriCoreAppGlobal.version, |
| 107 | + kolibriProject: plugin_data.kolibriProject || 'Unknown', |
| 108 | + }); |
| 109 | +
|
| 110 | + if (this.buildInfo) { |
| 111 | + hiddenFormFields[ |
| 112 | + 'endlessKeyRelease' |
| 113 | + ] = `${this.buildInfo.version_name} ${this.buildInfo.last_release}`; |
| 114 | + } |
| 115 | +
|
102 | 116 | switch (languageIdToCode(currentLanguage)) { |
103 | 117 | case 'es': |
104 | | - return plugin_data.feedbackUrlEs; |
| 118 | + return plugin_data.feedbackUrlEs + '#' + hiddenFormFields.toString(); |
105 | 119 | default: |
106 | | - return plugin_data.feedbackUrl; |
| 120 | + return plugin_data.feedbackUrl + '#' + hiddenFormFields.toString(); |
107 | 121 | } |
108 | 122 | }, |
109 | 123 | showFeedbackButton() { |
|
116 | 130 | return !!plugin_data.androidApplicationId && !!plugin_data.windowsApplicationId; |
117 | 131 | }, |
118 | 132 | }, |
| 133 | + mounted() { |
| 134 | + this.getBuildInfo(); |
| 135 | + }, |
119 | 136 | created() { |
120 | 137 | this.isOffline = !navigator.onLine; |
121 | 138 | window.addEventListener('offline', this.onOffline); |
|
169 | 186 | this.$store.commit('topicsRoot/SET_SHOW_SIDE_NAV', true); |
170 | 187 | } |
171 | 188 | }, |
| 189 | + getBuildInfo() { |
| 190 | + const buildInfo = urls.static(`build-info.json`); |
| 191 | + fetch(buildInfo) |
| 192 | + .then(response => response.json()) |
| 193 | + .then(data => { |
| 194 | + this.buildInfo = data; |
| 195 | + }) |
| 196 | + .catch(error => { |
| 197 | + console.error(error); |
| 198 | + }); |
| 199 | + }, |
172 | 200 | }, |
173 | 201 | $trs: { |
174 | 202 | feedbackLabel: 'Feedback', |
|
0 commit comments