import scaffoldings

This commit is contained in:
Gani Georgiev
2022-08-05 06:00:38 +03:00
parent 95f9d685dc
commit f459dd8812
25 changed files with 1362 additions and 261 deletions
+16
View File
@@ -600,6 +600,22 @@ export default class CommonHelper {
})
}
/**
* Downloads a json file created from the provide object.
*
* @param {mixed} obj The JS object to download.
* @param {String} name The result file name.
*/
static downloadJson(obj, name) {
const encodedObj = "data:text/json;charset=utf-8," + encodeURIComponent(JSON.stringify(obj, null, 2));
const tempLink = document.createElement('a');
tempLink.setAttribute("href", encodedObj);
tempLink.setAttribute("download", name + ".json");
tempLink.click();
tempLink.remove();
}
/**
* Parses and returns the decoded jwt payload data.
*