major: startinblox-feature-requests#181
This commit is contained in:
14
src/components/getRoute.js
Normal file
14
src/components/getRoute.js
Normal file
@ -0,0 +1,14 @@
|
||||
window.hubl.getRoute = (type, returnFirst = false) => {
|
||||
let availables = window.hubl.components.filter(c => c.type == type);
|
||||
if (availables.length > 1) {
|
||||
if (returnFirst) {
|
||||
return availables[0].route;
|
||||
} else {
|
||||
console.error(`Too much components availables for route ${type}`);
|
||||
}
|
||||
} else if (availables.length < 1) {
|
||||
console.error(`No component found for route ${type}`);
|
||||
} else {
|
||||
return availables[0].route;
|
||||
}
|
||||
}
|
@ -1,15 +1,17 @@
|
||||
import { Sib } from 'https://cdn.skypack.dev/@startinblox/core@0.15';
|
||||
import {
|
||||
Sib
|
||||
} from 'https://cdn.skypack.dev/@startinblox/core@0.15';
|
||||
|
||||
export const HublAutoLogin = {
|
||||
name: 'hubl-auto-login',
|
||||
created() {
|
||||
document
|
||||
.querySelectorAll(".loggedIn-loader")
|
||||
.forEach(el => (el.style.display = "flex"));
|
||||
.querySelectorAll(".loggedIn-loader")
|
||||
.forEach(el => (el.style.display = "flex"));
|
||||
window.dispatchEvent(
|
||||
new CustomEvent('requestNavigation', {
|
||||
detail: {
|
||||
route: "dashboard"
|
||||
route: window.hubl.getRoute("dashboard", true)
|
||||
}
|
||||
}),
|
||||
);
|
||||
|
@ -1,4 +1,8 @@
|
||||
import { store, Sib, StoreMixin } from 'https://cdn.skypack.dev/@startinblox/core@0.15';
|
||||
import {
|
||||
store,
|
||||
Sib,
|
||||
StoreMixin
|
||||
} from 'https://cdn.skypack.dev/@startinblox/core@0.15';
|
||||
|
||||
export const HublReactivity = {
|
||||
name: 'hubl-reactivity',
|
||||
|
@ -1,4 +1,6 @@
|
||||
import { widgetFactory } from 'https://cdn.skypack.dev/@startinblox/core@0.15';
|
||||
import {
|
||||
widgetFactory
|
||||
} from 'https://cdn.skypack.dev/@startinblox/core@0.15';
|
||||
|
||||
const HublSearchUsers = widgetFactory(
|
||||
'hubl-search-users',
|
||||
@ -12,4 +14,6 @@ const HublSearchUsers = widgetFactory(
|
||||
>`
|
||||
);
|
||||
|
||||
export { HublSearchUsers }
|
||||
export {
|
||||
HublSearchUsers
|
||||
}
|
@ -1,4 +1,7 @@
|
||||
import { widgetFactory, Helpers } from 'https://cdn.skypack.dev/@startinblox/core@0.15';
|
||||
import {
|
||||
widgetFactory,
|
||||
Helpers
|
||||
} from 'https://cdn.skypack.dev/@startinblox/core@0.15';
|
||||
import SlimSelect from 'https://cdn.skypack.dev/slim-select@1.23';
|
||||
|
||||
const HublStatus = widgetFactory(
|
||||
@ -18,10 +21,14 @@ const HublStatus = widgetFactory(
|
||||
formWidget => {
|
||||
let select = formWidget.querySelector('select');
|
||||
if (!select) return;
|
||||
const slimSelect = new SlimSelect({select: select});
|
||||
const slimSelect = new SlimSelect({
|
||||
select: select
|
||||
});
|
||||
Helpers.importCSS('https://dev.jspm.io/slim-select/dist/slimselect.min.css');
|
||||
select.addEventListener('change', () => slimSelect.render());
|
||||
},
|
||||
);
|
||||
|
||||
export { HublStatus }
|
||||
export {
|
||||
HublStatus
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
if(typeof Sentry !== 'undefined') {
|
||||
if (typeof Sentry !== 'undefined') {
|
||||
Sentry.init({
|
||||
dsn: 'https://b4b29557689049a39168599577adb940@sentry.startinblox.com/4',
|
||||
integrations: [new Sentry.Integrations.BrowserTracing()],
|
||||
|
Reference in New Issue
Block a user