@bexis2/bexis2-core-ui 0.4.51 → 0.4.53
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/README.md
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
# bexis-core-ui
|
|
2
|
+
## 0.4.49 -> 0.4.53
|
|
3
|
+
- Api
|
|
4
|
+
- remove __RequestVerificationToken from header
|
|
5
|
+
- change post request to 'application/x-www-form-urlencoded'
|
|
6
|
+
- add __RequestVerificationToken to data
|
|
7
|
+
|
|
2
8
|
## 0.4.48
|
|
3
9
|
- Api
|
|
4
10
|
- add __RequestVerificationToken if exist
|
|
@@ -23,6 +23,7 @@ export let footer = true;
|
|
|
23
23
|
export let help = false;
|
|
24
24
|
export let contentLayoutType = pageContentLayoutType.center;
|
|
25
25
|
export let fixLeft = true;
|
|
26
|
+
let aftIsReady = false;
|
|
26
27
|
errorStore.subscribe((error) => {
|
|
27
28
|
console.log("\u{1F680} ~ errorStore.subscribe ~ value:", error.error);
|
|
28
29
|
notificationStore.showNotification({
|
|
@@ -37,6 +38,11 @@ onMount(async () => {
|
|
|
37
38
|
const data = await getAntiForgeryToken();
|
|
38
39
|
csrfTokenStore.set(data.csrfToken);
|
|
39
40
|
});
|
|
41
|
+
csrfTokenStore.subscribe((value) => {
|
|
42
|
+
if (value.length > 0) {
|
|
43
|
+
aftIsReady = true;
|
|
44
|
+
}
|
|
45
|
+
});
|
|
40
46
|
let app;
|
|
41
47
|
function scrollToTop() {
|
|
42
48
|
app.scrollIntoView();
|
|
@@ -64,6 +70,8 @@ function scrollToTop() {
|
|
|
64
70
|
|
|
65
71
|
<slot name="description" />
|
|
66
72
|
|
|
73
|
+
{#if aftIsReady}
|
|
74
|
+
|
|
67
75
|
<div class="flex flex-initial space-x-5">
|
|
68
76
|
{#if $$slots.left}
|
|
69
77
|
<div class="p-5 flex-shrink-0 w-96 w-min-96 border-y border-solid border-surface-500">
|
|
@@ -92,7 +100,7 @@ function scrollToTop() {
|
|
|
92
100
|
{/if}
|
|
93
101
|
</div>
|
|
94
102
|
|
|
95
|
-
|
|
103
|
+
{/if}
|
|
96
104
|
|
|
97
105
|
<GoToTop/>
|
|
98
106
|
<HelpPopUp active={help} />
|
package/dist/services/Api.js
CHANGED
|
@@ -13,8 +13,8 @@ const apiRequest = (method, url, request) => {
|
|
|
13
13
|
authorization: 'Basic ' + btoa(username + ':' + password)
|
|
14
14
|
};
|
|
15
15
|
const requestVerificationToken = csrfToken;
|
|
16
|
-
if (method
|
|
17
|
-
headers['__RequestVerificationToken'] = requestVerificationToken;
|
|
16
|
+
if (method == "post" && requestVerificationToken) {
|
|
17
|
+
// headers['__RequestVerificationToken'] = requestVerificationToken;
|
|
18
18
|
headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
19
19
|
request = { ...request, __RequestVerificationToken: requestVerificationToken };
|
|
20
20
|
}
|
package/package.json
CHANGED
|
@@ -29,6 +29,7 @@ import type { helpItemType, helpStoreType } from '$models/Models';
|
|
|
29
29
|
import GoToTop from './GoToTop.svelte';
|
|
30
30
|
import { getAntiForgeryToken } from './PageCaller';
|
|
31
31
|
|
|
32
|
+
|
|
32
33
|
export let title = '';
|
|
33
34
|
export let note = '';
|
|
34
35
|
export let links: linkType[] = [];
|
|
@@ -40,6 +41,8 @@ import type { helpItemType, helpStoreType } from '$models/Models';
|
|
|
40
41
|
export let contentLayoutType: pageContentLayoutType = pageContentLayoutType.center;
|
|
41
42
|
export let fixLeft: boolean = true;
|
|
42
43
|
|
|
44
|
+
let aftIsReady = false;
|
|
45
|
+
|
|
43
46
|
errorStore.subscribe((error:errorType) => {
|
|
44
47
|
console.log("🚀 ~ errorStore.subscribe ~ value:", error.error)
|
|
45
48
|
notificationStore.showNotification({
|
|
@@ -52,11 +55,18 @@ import type { helpItemType, helpStoreType } from '$models/Models';
|
|
|
52
55
|
console.log('page');
|
|
53
56
|
breadcrumbStore.clean();
|
|
54
57
|
breadcrumbStore.addItem({ label: title, link: window.location.pathname });
|
|
55
|
-
|
|
56
58
|
const data = await getAntiForgeryToken();
|
|
57
59
|
csrfTokenStore.set(data.csrfToken);
|
|
58
60
|
});
|
|
59
61
|
|
|
62
|
+
|
|
63
|
+
csrfTokenStore.subscribe(value => {
|
|
64
|
+
if(value.length>0){
|
|
65
|
+
aftIsReady = true;
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
|
|
60
70
|
let app;
|
|
61
71
|
function scrollToTop() {
|
|
62
72
|
app.scrollIntoView();
|
|
@@ -85,6 +95,8 @@ import type { helpItemType, helpStoreType } from '$models/Models';
|
|
|
85
95
|
|
|
86
96
|
<slot name="description" />
|
|
87
97
|
|
|
98
|
+
{#if aftIsReady}
|
|
99
|
+
|
|
88
100
|
<div class="flex flex-initial space-x-5">
|
|
89
101
|
{#if $$slots.left}
|
|
90
102
|
<div class="p-5 flex-shrink-0 w-96 w-min-96 border-y border-solid border-surface-500">
|
|
@@ -113,7 +125,7 @@ import type { helpItemType, helpStoreType } from '$models/Models';
|
|
|
113
125
|
{/if}
|
|
114
126
|
</div>
|
|
115
127
|
|
|
116
|
-
|
|
128
|
+
{/if}
|
|
117
129
|
|
|
118
130
|
<GoToTop/>
|
|
119
131
|
<HelpPopUp active={help} />
|
package/src/lib/services/Api.ts
CHANGED
|
@@ -19,8 +19,8 @@ const apiRequest = (method, url, request) => {
|
|
|
19
19
|
|
|
20
20
|
const requestVerificationToken = csrfToken;
|
|
21
21
|
|
|
22
|
-
if (method
|
|
23
|
-
headers['__RequestVerificationToken'] = requestVerificationToken;
|
|
22
|
+
if (method == "post" && requestVerificationToken) {
|
|
23
|
+
// headers['__RequestVerificationToken'] = requestVerificationToken;
|
|
24
24
|
headers['Content-Type']='application/x-www-form-urlencoded';
|
|
25
25
|
request = {...request, __RequestVerificationToken: requestVerificationToken};
|
|
26
26
|
}
|