@cortezaproject/corteza-vue 2022.3.0 → 2022.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +50 -27
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +50 -27
- package/dist/index.js.map +1 -1
- package/dist/plugins/auth.d.ts +2 -0
- package/package.json +2 -2
package/dist/index.es.js
CHANGED
|
@@ -2006,8 +2006,6 @@ class Auth {
|
|
|
2006
2006
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2007
2007
|
this.log.info('handling authentication');
|
|
2008
2008
|
// State management
|
|
2009
|
-
// - duplication checking
|
|
2010
|
-
// - management handlers
|
|
2011
2009
|
const dup = this.handleStateManagement();
|
|
2012
2010
|
if (dup) {
|
|
2013
2011
|
this.log.debug('duplicate tab: unauthorized');
|
|
@@ -2044,14 +2042,25 @@ class Auth {
|
|
|
2044
2042
|
handleStateManagement() {
|
|
2045
2043
|
// See if this is a duplicate
|
|
2046
2044
|
const dup = this.sessionStorage.getItem(storeKeyFinalState) !== null;
|
|
2047
|
-
|
|
2048
|
-
this.registerEventListener('beforeunload', function () {
|
|
2049
|
-
this.sessionStorage.removeItem(storeKeyFinalState);
|
|
2050
|
-
});
|
|
2051
|
-
// Set state
|
|
2052
|
-
this.sessionStorage.setItem(storeKeyFinalState, Date.now().toString());
|
|
2045
|
+
window.sessionStorage.setItem(storeKeyFinalState, Date.now().toString());
|
|
2053
2046
|
return dup;
|
|
2054
2047
|
}
|
|
2048
|
+
bindListeners() {
|
|
2049
|
+
// binding multiple listeners for cases where some browser refuser
|
|
2050
|
+
// to emit one of them.
|
|
2051
|
+
this.registerEventListener('pagehide', () => {
|
|
2052
|
+
this.cleanFlags();
|
|
2053
|
+
});
|
|
2054
|
+
this.registerEventListener('unload', () => {
|
|
2055
|
+
this.cleanFlags();
|
|
2056
|
+
});
|
|
2057
|
+
this.registerEventListener('beforeunload', () => {
|
|
2058
|
+
this.cleanFlags();
|
|
2059
|
+
});
|
|
2060
|
+
}
|
|
2061
|
+
cleanFlags() {
|
|
2062
|
+
this.sessionStorage.removeItem(storeKeyFinalState);
|
|
2063
|
+
}
|
|
2055
2064
|
/**
|
|
2056
2065
|
* Called when refresh token is re-fetched.
|
|
2057
2066
|
*
|
|
@@ -2097,6 +2106,7 @@ class Auth {
|
|
|
2097
2106
|
this.log.info('authorization code received', code);
|
|
2098
2107
|
const rsp = yield this.exchangeCode(code);
|
|
2099
2108
|
this.log.info('redirecting back to final destination', finalLocation);
|
|
2109
|
+
this.cleanFlags();
|
|
2100
2110
|
this.location.assign(finalLocation);
|
|
2101
2111
|
return rsp;
|
|
2102
2112
|
});
|
|
@@ -2132,6 +2142,7 @@ class Auth {
|
|
|
2132
2142
|
authUser.meta.preferredLanguage = data.preferred_language || 'en';
|
|
2133
2143
|
}
|
|
2134
2144
|
this[user] = authUser;
|
|
2145
|
+
this.bindListeners();
|
|
2135
2146
|
return data;
|
|
2136
2147
|
}).catch((error) => {
|
|
2137
2148
|
this.log.error('data fetch form info endpoint failed', { oauth2InfoURL, headers, error });
|
|
@@ -2154,7 +2165,11 @@ class Auth {
|
|
|
2154
2165
|
* Refresh token found in the storage,
|
|
2155
2166
|
* let's use it to get new access token
|
|
2156
2167
|
*/
|
|
2157
|
-
return this.exchangeRefresh(refreshToken)
|
|
2168
|
+
return this.exchangeRefresh(refreshToken)
|
|
2169
|
+
.then(r => {
|
|
2170
|
+
this.bindListeners();
|
|
2171
|
+
return r;
|
|
2172
|
+
});
|
|
2158
2173
|
}
|
|
2159
2174
|
throw new Error('Unauthenticated');
|
|
2160
2175
|
});
|
|
@@ -2174,6 +2189,7 @@ class Auth {
|
|
|
2174
2189
|
*/
|
|
2175
2190
|
startAuthenticationFlow() {
|
|
2176
2191
|
this.log.debug('starting new authentication flow');
|
|
2192
|
+
this.cleanFlags();
|
|
2177
2193
|
this.incFlowCounter();
|
|
2178
2194
|
const state = Math.random().toString(36).substring(2);
|
|
2179
2195
|
this.sessionStorage.setItem(`auth.state.${state}.location`, this.getRedirect(this.location.toString()));
|
|
@@ -71253,13 +71269,13 @@ var script$a = {
|
|
|
71253
71269
|
const __vue_script__$a = script$a;
|
|
71254
71270
|
|
|
71255
71271
|
/* template */
|
|
71256
|
-
var __vue_render__$9 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b-input-
|
|
71272
|
+
var __vue_render__$9 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b-row',{staticClass:"c-input-date-time",attrs:{"align-v":"stretch","no-gutters":""}},[_c('b-col',{staticClass:"position-static overflow-hidden",attrs:{"lg":_vm.noTime ? 12 : 6}},[(!_vm.noDate)?_c('b-form-datepicker',{staticClass:"h-100 overflow-hidden",attrs:{"placeholder":_vm.labels.none,"date-format-options":{ year: 'numeric', month: 'numeric', day: 'numeric' },"min":_vm.minDate,"max":_vm.maxDate,"label-reset-button":_vm.labels.clear,"label-today-button":_vm.labels.today,"label-help":"","today-variant":"info","selected-variant":"secondary","boundary":"window","hide-header":"","reset-button":"","today-button":""},model:{value:(_vm.date),callback:function ($$v) {_vm.date=$$v;},expression:"date"}}):_vm._e()],1),_vm._v(" "),_c('b-col',{staticClass:"position-static overflow-hidden",class:{ 'mt-1 mt-lg-0 pl-lg-1': !_vm.noDate },attrs:{"lg":_vm.noDate ? 12 : 6}},[(!_vm.noTime)?_c('b-form-timepicker',{staticClass:"h-100 overflow-hidden",attrs:{"placeholder":_vm.labels.none,"label-reset-button":_vm.labels.clear,"label-now-button":_vm.labels.now,"boundary":"window","hide-header":"","no-close-button":"","reset-button":"","now-button":""},model:{value:(_vm.time),callback:function ($$v) {_vm.time=$$v;},expression:"time"}}):_vm._e()],1)],1)};
|
|
71257
71273
|
var __vue_staticRenderFns__$9 = [];
|
|
71258
71274
|
|
|
71259
71275
|
/* style */
|
|
71260
71276
|
const __vue_inject_styles__$b = function (inject) {
|
|
71261
71277
|
if (!inject) return
|
|
71262
|
-
inject("data-v-
|
|
71278
|
+
inject("data-v-1bc6bb72_0", { source: ".c-input-date-time{min-width:120px}.c-input-date-time .btn{padding:.25rem .5rem}.c-input-date-time label{font-family:Poppins-Regular;color:#495057!important}.b-calendar-inner{background-color:#fff}@media (min-width:992px){.c-input-date-time{min-width:250px}}", map: undefined, media: undefined });
|
|
71263
71279
|
|
|
71264
71280
|
};
|
|
71265
71281
|
/* scoped */
|
|
@@ -82152,12 +82168,20 @@ var script$G = {
|
|
|
82152
82168
|
|
|
82153
82169
|
watch: {
|
|
82154
82170
|
items: {
|
|
82155
|
-
|
|
82156
|
-
|
|
82157
|
-
|
|
82158
|
-
|
|
82159
|
-
|
|
82160
|
-
|
|
82171
|
+
immediate: true,
|
|
82172
|
+
|
|
82173
|
+
handler(items = []) {
|
|
82174
|
+
items.forEach(({
|
|
82175
|
+
page
|
|
82176
|
+
}) => {
|
|
82177
|
+
const px = this.pageIndex(page); // Apply startExpanded only if page isn't currently expanded
|
|
82178
|
+
|
|
82179
|
+
if (!this.collapses[px]) {
|
|
82180
|
+
this.$set(this.collapses, px, this.startExpanded);
|
|
82181
|
+
}
|
|
82182
|
+
});
|
|
82183
|
+
}
|
|
82184
|
+
|
|
82161
82185
|
}
|
|
82162
82186
|
},
|
|
82163
82187
|
methods: {
|
|
@@ -82176,11 +82200,6 @@ var script$G = {
|
|
|
82176
82200
|
this.$set(this.collapses, px, !this.collapses[px]);
|
|
82177
82201
|
},
|
|
82178
82202
|
|
|
82179
|
-
setState(p, state = false) {
|
|
82180
|
-
const px = this.pageIndex(p);
|
|
82181
|
-
this.$set(this.collapses, px, state);
|
|
82182
|
-
},
|
|
82183
|
-
|
|
82184
82203
|
// Recursively check for child pages that are open, so that parents can open aswell
|
|
82185
82204
|
showChildren({
|
|
82186
82205
|
params = {},
|
|
@@ -82204,21 +82223,21 @@ var script$G = {
|
|
|
82204
82223
|
const __vue_script__$G = script$G;
|
|
82205
82224
|
|
|
82206
82225
|
/* template */
|
|
82207
|
-
var __vue_render__$C = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"nav-sidebar"},_vm._l((_vm.items),function(ref
|
|
82226
|
+
var __vue_render__$C = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"nav-sidebar"},_vm._l((_vm.items),function(ref){
|
|
82208
82227
|
var page = ref.page; if ( page === void 0 ) page = {};
|
|
82209
82228
|
var params = ref.params; if ( params === void 0 ) params = {};
|
|
82210
82229
|
var children = ref.children; if ( children === void 0 ) children = [];
|
|
82211
|
-
return _c('b-button',{key:
|
|
82230
|
+
return _c('b-button',{key:_vm.pageIndex(page),staticClass:"w-100 text-dark text-decoration-none p-0 pt-2 nav-item",attrs:{"variant":"link","active-class":"nav-active","exact-active-class":"nav-active","to":{ name: page.name || _vm.defaultRouteName, params: params }}},[_c('span',{staticClass:"d-inline-block w-75 text-nowrap text-truncate",on:{"click":function($event){return _vm.closeSidebar()}}},[(page.icon)?_c('font-awesome-icon',{staticClass:"icon",attrs:{"icon":page.icon}}):_vm._e(),_vm._v(" "),_c('span',{staticClass:"title"},[_vm._v("\n "+_vm._s(page.title)+"\n ")])],1),_vm._v(" "),(children.length)?[_c('b-button',{staticClass:"p-0 float-right",attrs:{"variant":"link","disabled":_vm.showChildren({ params: params, children: children })},on:{"click":function($event){if($event.target !== $event.currentTarget){ return null; }$event.stopPropagation();$event.preventDefault();return _vm.toggle(page)}}},[(!_vm.collapses[_vm.pageIndex(page)])?_c('font-awesome-icon',{staticClass:"pointer-none",attrs:{"icon":['fas', 'chevron-down']}}):_c('font-awesome-icon',{staticClass:"pointer-none",attrs:{"icon":['fas', 'chevron-up']}})],1),_vm._v(" "),_c('b-collapse',{attrs:{"visible":_vm.collapses[_vm.pageIndex(page)] || _vm.showChildren({ params: params, children: children })},on:{"click":function($event){$event.stopPropagation();$event.preventDefault();}}},[_c('c-sidebar-nav-items',_vm._g({staticClass:"ml-2",attrs:{"items":children,"start-expanded":_vm.startExpanded,"default-route-name":_vm.defaultRouteName}},_vm.$listeners))],1)]:_vm._e()],2)}),1)};
|
|
82212
82231
|
var __vue_staticRenderFns__$C = [];
|
|
82213
82232
|
|
|
82214
82233
|
/* style */
|
|
82215
82234
|
const __vue_inject_styles__$H = function (inject) {
|
|
82216
82235
|
if (!inject) return
|
|
82217
|
-
inject("data-v-
|
|
82236
|
+
inject("data-v-bae441da_0", { source: ".pointer-none[data-v-bae441da]{pointer-events:none}.svg-inline--fa[data-v-bae441da]{width:30px}.nav-item>span>.title[data-v-bae441da]{font-family:Poppins-Regular}.nav-active>span>.icon[data-v-bae441da]{color:#4d7281}.nav-active>span>.title[data-v-bae441da]{font-family:Poppins-SemiBold}.nav-item[data-v-bae441da]{text-align:left}[dir=rtl] .nav-item[data-v-bae441da]{text-align:right}", map: undefined, media: undefined });
|
|
82218
82237
|
|
|
82219
82238
|
};
|
|
82220
82239
|
/* scoped */
|
|
82221
|
-
const __vue_scope_id__$H = "data-v-
|
|
82240
|
+
const __vue_scope_id__$H = "data-v-bae441da";
|
|
82222
82241
|
/* module identifier */
|
|
82223
82242
|
const __vue_module_identifier__$H = undefined;
|
|
82224
82243
|
/* functional template */
|
|
@@ -83215,7 +83234,11 @@ var script$R = {
|
|
|
83215
83234
|
if (this.disabledSorting) {
|
|
83216
83235
|
this.selected = this.frozen().filter(i => !this.available.includes(i));
|
|
83217
83236
|
} else {
|
|
83218
|
-
this.selected.
|
|
83237
|
+
if (!this.selected.some(({
|
|
83238
|
+
value = ''
|
|
83239
|
+
}) => value === item.value)) {
|
|
83240
|
+
this.selected.push(item);
|
|
83241
|
+
}
|
|
83219
83242
|
}
|
|
83220
83243
|
}, 300),
|
|
83221
83244
|
|