MCPcopy Create free account
hub / github.com/Rello/analytics / browse

Function browse

js/jsonPicker.js:238–253  ·  view source on GitHub ↗
(initial = false)

Source from the content-addressed store, hash-verified

236 try { json = picker.decode(result.content); }
237 catch (error) { throw new Error(t('analytics', 'The datasource did not return valid JSON.')); }
238 const browse = (initial = false) => {
239 rowPath = null;
240 selected = initial && !/[{}]/.test(extractionPath) ? extractionPath.split(',').filter(Boolean) : [];
241 tree.replaceChildren();
242 back.hidden = true;
243 if (Array.isArray(json) && json.some(picker.isContainer)) {
244 tree.appendChild(action(t('analytics', 'Use all entries and choose the relevant fields'), () => showFields(json, [])));
245 }
246 children([json], [], tree);
247 if (!picker.isContainer(json) || Object.keys(json).length === 0) {
248 const hint = document.createElement('p');
249 hint.className = 'userGuidance';
250 hint.textContent = t('analytics', 'No selectable fields found. You can still enter the Object path manually.');
251 tree.appendChild(hint);
252 }
253 };
254 browse(true);
255 const savedArray = extractionPath.match(/^([^{}]*)\{([^{}]+)\}$/);
256 if (savedArray) {

Callers 1

jsonPicker.jsFile · 0.85

Calls 5

actionFunction · 0.85
showFieldsFunction · 0.85
childrenFunction · 0.85
filterMethod · 0.80
tFunction · 0.50

Tested by

no test coverage detected