MCPcopy Create free account
hub / github.com/apache/echarts / mounted

Function mounted

test/runTest/client/client.js:218–296  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

216 },
217
218 async mounted() {
219 socket.on('userMeta', meta => {
220 this.userMeta = meta;
221 });
222 socket.emit('getUserMeta');
223
224 socket.on('updateTestsList', testsList => {
225 this.updateTestsList(testsList);
226 });
227
228 // Add call to fetch branches
229 await this.fetchBranchVersions();
230
231 // Sync config from server when first time open
232 // or switching back
233 socket.emit('syncRunConfig', {
234 runConfig: this.runConfig,
235 // Override server config from URL.
236 forceSet: Object.keys(urlRunConfig).length > 0
237 });
238 socket.on('syncRunConfig_return', res => {
239 this.versions = res.versions || [];
240 this.nightlyVersions = res.nightlyVersions || [];
241 this.prVersions = res.prVersions || [];
242
243 // Only set versions if they haven't been manually set
244 handlingSourceChange = true;
245 this.$nextTick(() => {
246 if (!this.runConfig.expectedVersion) {
247 this.runConfig.expectedVersion = getVersionFromSource(
248 this.runConfig.expectedSource,
249 this.versions,
250 this.nightlyVersions
251 );
252 }
253
254 if (!this.runConfig.actualVersion) {
255 this.runConfig.actualVersion = getVersionFromSource(
256 this.runConfig.actualSource,
257 this.versions,
258 this.nightlyVersions
259 );
260 }
261
262 // Only apply other config changes from server
263 const configWithoutVersions = { ...res.runConfig };
264 delete configWithoutVersions.expectedVersion;
265 delete configWithoutVersions.actualVersion;
266 Object.assign(this.runConfig, getChangedObject(this.runConfig, configWithoutVersions));
267
268 handlingSourceChange = false;
269 updateUrl();
270 });
271 });
272
273 setTimeout(() => {
274 this.scrollToCurrent();
275 }, 500);

Callers

nothing calls this directly

Calls 4

getVersionFromSourceFunction · 0.85
getChangedObjectFunction · 0.85
updateUrlFunction · 0.85
addEventListenerMethod · 0.80

Tested by

no test coverage detected