Skip to content
Snippets Groups Projects
Commit c6758bfc authored by Neuber, Eugen Ramon's avatar Neuber, Eugen Ramon :speech_balloon: Committed by Reiter, Christoph
Browse files

Fix build, output still empty

parent 5bd923af
No related branches found
No related tags found
No related merge requests found
......@@ -30,7 +30,8 @@
"i18next": "^17.0.3",
"lit-element": "^2.1.0",
"lit-html": "^1.1.1",
"jquery": "^3.4.1"
"jquery": "^3.4.1",
"datatables.net-dt": "^1.10.19"
},
"scripts": {
"clean": "rm dist/*",
......
import 'vpu-auth';
import './vpu-data-table-view.js';
import './data-table-view.js';
import {setting, getAPiUrl} from './utils.js';
import {i18n} from './i18n';
import {html, LitElement} from 'lit-element';
......
import i18next from 'i18next';
import de from './i18n/de/translation.json';
import en from './i18n/en/translation.json';
const i18n = i18next.createInstance();
i18n.init({
lng: 'de',
fallbackLng: ['de'],
debug: false,
initImmediate: false, // Don't init async
resources: {
en: {translation: en},
de: {translation: de}
},
});
console.assert(i18n.isInitialized);
function dateTimeFormat(date, options) {
return new Intl.DateTimeFormat(i18n.languages, options).format(date);
}
function numberFormat(number, options) {
return new Intl.NumberFormat(i18n.languages, options).format(number);
}
export {i18n, dateTimeFormat, numberFormat};
{
}
\ No newline at end of file
{
}
\ No newline at end of file
import vars from './vars.js';
export const getAssetURL = (path) => {
const elm = document.getElementById('vpu-library-shelving-wc-src');
if (!elm)
return path;
const url = elm.src;
// newer browsers only
//var url = import.meta.url;
return new URL(path, url).href;
}
export const getAPiUrl = function(path = "", withPrefix = true) {
return vars.apiBaseUrl + (withPrefix ? vars.apiUrlPrefix : "") + path;
}
/**
* Finds an object in a JSON result by identifier
*
* @param identifier
* @param results
* @param identifierAttribute
*/
export const findObjectInApiResults = (identifier, results, identifierAttribute = "@id") => {
const members = results["hydra:member"];
if (members === undefined) {
return;
}
for (const object of members){
if (object[identifierAttribute] === identifier) {
return object;
}
}
}
/**
* Reads a setting
*
* @param key
* @returns {*}
*/
export const setting = (key) => vars[key];
var config;
switch(process.env.BUILD) {
case "development":
config = {
apiBaseUrl: 'https://mw-dev.tugraz.at',
apiUrlPrefix: '',
keyCloakClientId: 'auth-dev-mw-frontend',
};
break;
case "production":
config = {
apiBaseUrl: 'https://mw.tugraz.at',
apiUrlPrefix: '',
keyCloakClientId: 'auth-prod-mw-frontend',
};
break;
case "demo":
config = {
apiBaseUrl: 'https://api-demo.tugraz.at',
apiUrlPrefix: '',
keyCloakClientId: 'auth-dev-mw-frontend',
};
break;
case "local":
default:
config = {
apiBaseUrl: 'http://127.0.0.1:8000',
apiUrlPrefix: '',
keyCloakClientId: 'auth-dev-mw-frontend-local',
};
}
export default config;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment