@budibase/frontend-core 2.2.12-alpha.6 → 2.2.12-alpha.60
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/assets/bg.png +0 -0
- package/assets/bulgaria.png +0 -0
- package/assets/covanta.png +0 -0
- package/assets/schnellecke.png +0 -0
- package/package.json +3 -3
- package/src/api/environmentVariables.js +36 -0
- package/src/api/events.js +13 -0
- package/src/api/index.js +4 -1
- package/src/api/rows.js +2 -1
- package/src/api/tables.js +22 -14
- package/src/api/user.js +15 -1
- package/src/components/SplitPage.svelte +61 -0
- package/src/components/TestimonialPage.svelte +79 -0
- package/src/components/index.js +2 -0
- package/src/constants.js +5 -0
- package/src/index.js +1 -0
- package/src/themes/midnight.css +1 -1
package/assets/bg.png
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@budibase/frontend-core",
|
|
3
|
-
"version": "2.2.12-alpha.
|
|
3
|
+
"version": "2.2.12-alpha.60",
|
|
4
4
|
"description": "Budibase frontend core libraries used in builder and client",
|
|
5
5
|
"author": "Budibase",
|
|
6
6
|
"license": "MPL-2.0",
|
|
7
7
|
"svelte": "src/index.js",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@budibase/bbui": "2.2.12-alpha.
|
|
9
|
+
"@budibase/bbui": "2.2.12-alpha.60",
|
|
10
10
|
"lodash": "^4.17.21",
|
|
11
11
|
"svelte": "^3.46.2"
|
|
12
12
|
},
|
|
13
|
-
"gitHead": "
|
|
13
|
+
"gitHead": "67b888c7fea58424bdd3763e83fde40bf7f7a6a2"
|
|
14
14
|
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export const buildEnvironmentVariableEndpoints = API => ({
|
|
2
|
+
checkEnvironmentVariableStatus: async () => {
|
|
3
|
+
return await API.get({
|
|
4
|
+
url: `/api/env/variables/status`,
|
|
5
|
+
})
|
|
6
|
+
},
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Fetches a list of environment variables
|
|
10
|
+
*/
|
|
11
|
+
fetchEnvironmentVariables: async () => {
|
|
12
|
+
return await API.get({
|
|
13
|
+
url: `/api/env/variables`,
|
|
14
|
+
json: false,
|
|
15
|
+
})
|
|
16
|
+
},
|
|
17
|
+
|
|
18
|
+
createEnvironmentVariable: async data => {
|
|
19
|
+
return await API.post({
|
|
20
|
+
url: `/api/env/variables`,
|
|
21
|
+
body: data,
|
|
22
|
+
})
|
|
23
|
+
},
|
|
24
|
+
deleteEnvironmentVariable: async varName => {
|
|
25
|
+
return await API.delete({
|
|
26
|
+
url: `/api/env/variables/${varName}`,
|
|
27
|
+
})
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
updateEnvironmentVariable: async data => {
|
|
31
|
+
return await API.patch({
|
|
32
|
+
url: `/api/env/variables/${data.name}`,
|
|
33
|
+
body: data,
|
|
34
|
+
})
|
|
35
|
+
},
|
|
36
|
+
})
|
package/src/api/index.js
CHANGED
|
@@ -26,7 +26,8 @@ import { buildLicensingEndpoints } from "./licensing"
|
|
|
26
26
|
import { buildGroupsEndpoints } from "./groups"
|
|
27
27
|
import { buildPluginEndpoints } from "./plugins"
|
|
28
28
|
import { buildBackupsEndpoints } from "./backups"
|
|
29
|
-
|
|
29
|
+
import { buildEnvironmentVariableEndpoints } from "./environmentVariables"
|
|
30
|
+
import { buildEventEndpoints } from "./events"
|
|
30
31
|
const defaultAPIClientConfig = {
|
|
31
32
|
/**
|
|
32
33
|
* Certain definitions can't change at runtime for client apps, such as the
|
|
@@ -247,5 +248,7 @@ export const createAPIClient = config => {
|
|
|
247
248
|
...buildGroupsEndpoints(API),
|
|
248
249
|
...buildPluginEndpoints(API),
|
|
249
250
|
...buildBackupsEndpoints(API),
|
|
251
|
+
...buildEnvironmentVariableEndpoints(API),
|
|
252
|
+
...buildEventEndpoints(API),
|
|
250
253
|
}
|
|
251
254
|
}
|
package/src/api/rows.js
CHANGED
|
@@ -67,12 +67,13 @@ export const buildRowEndpoints = API => ({
|
|
|
67
67
|
* @param format the format to export (csv or json)
|
|
68
68
|
* @param columns which columns to export (all if undefined)
|
|
69
69
|
*/
|
|
70
|
-
exportRows: async ({ tableId, rows, format, columns }) => {
|
|
70
|
+
exportRows: async ({ tableId, rows, format, columns, search }) => {
|
|
71
71
|
return await API.post({
|
|
72
72
|
url: `/api/${tableId}/rows/exportRows?format=${format}`,
|
|
73
73
|
body: {
|
|
74
74
|
rows,
|
|
75
75
|
columns,
|
|
76
|
+
...search,
|
|
76
77
|
},
|
|
77
78
|
parseResponse: async response => {
|
|
78
79
|
return await response.text()
|
package/src/api/tables.js
CHANGED
|
@@ -64,32 +64,22 @@ export const buildTableEndpoints = API => ({
|
|
|
64
64
|
* @param tableId the table ID to import to
|
|
65
65
|
* @param data the data import object
|
|
66
66
|
*/
|
|
67
|
-
importTableData: async ({ tableId,
|
|
67
|
+
importTableData: async ({ tableId, rows }) => {
|
|
68
68
|
return await API.post({
|
|
69
69
|
url: `/api/tables/${tableId}/import`,
|
|
70
70
|
body: {
|
|
71
|
-
|
|
71
|
+
rows,
|
|
72
72
|
},
|
|
73
73
|
})
|
|
74
74
|
},
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* Validates a candidate CSV to be imported for a certain table.
|
|
78
|
-
* @param tableId the table ID to import to
|
|
79
|
-
* @param csvString the CSV contents as a string
|
|
80
|
-
* @param schema the proposed schema
|
|
81
|
-
*/
|
|
82
|
-
validateTableCSV: async ({ tableId, csvString, schema }) => {
|
|
75
|
+
csvToJson: async csvString => {
|
|
83
76
|
return await API.post({
|
|
84
|
-
url: "/api/
|
|
77
|
+
url: "/api/convert/csvToJson",
|
|
85
78
|
body: {
|
|
86
79
|
csvString,
|
|
87
|
-
schema,
|
|
88
|
-
tableId,
|
|
89
80
|
},
|
|
90
81
|
})
|
|
91
82
|
},
|
|
92
|
-
|
|
93
83
|
/**
|
|
94
84
|
* Gets a list o tables.
|
|
95
85
|
*/
|
|
@@ -120,4 +110,22 @@ export const buildTableEndpoints = API => ({
|
|
|
120
110
|
url: `/api/tables/${tableId}/${tableRev}`,
|
|
121
111
|
})
|
|
122
112
|
},
|
|
113
|
+
validateNewTableImport: async ({ rows, schema }) => {
|
|
114
|
+
return await API.post({
|
|
115
|
+
url: "/api/tables/validateNewTableImport",
|
|
116
|
+
body: {
|
|
117
|
+
rows,
|
|
118
|
+
schema,
|
|
119
|
+
},
|
|
120
|
+
})
|
|
121
|
+
},
|
|
122
|
+
validateExistingTableImport: async ({ rows, tableId }) => {
|
|
123
|
+
return await API.post({
|
|
124
|
+
url: "/api/tables/validateExistingTableImport",
|
|
125
|
+
body: {
|
|
126
|
+
rows,
|
|
127
|
+
tableId,
|
|
128
|
+
},
|
|
129
|
+
})
|
|
130
|
+
},
|
|
123
131
|
})
|
package/src/api/user.js
CHANGED
|
@@ -146,6 +146,16 @@ export const buildUserEndpoints = API => ({
|
|
|
146
146
|
})
|
|
147
147
|
},
|
|
148
148
|
|
|
149
|
+
/**
|
|
150
|
+
* Retrieves the invitation associated with a provided code.
|
|
151
|
+
* @param code The unique code for the target invite
|
|
152
|
+
*/
|
|
153
|
+
getUserInvite: async code => {
|
|
154
|
+
return await API.get({
|
|
155
|
+
url: `/api/global/users/invite/${code}`,
|
|
156
|
+
})
|
|
157
|
+
},
|
|
158
|
+
|
|
149
159
|
/**
|
|
150
160
|
* Invites multiple users to the current tenant.
|
|
151
161
|
* @param users An array of users to invite
|
|
@@ -168,13 +178,17 @@ export const buildUserEndpoints = API => ({
|
|
|
168
178
|
* Accepts an invite to join the platform and creates a user.
|
|
169
179
|
* @param inviteCode the invite code sent in the email
|
|
170
180
|
* @param password the password for the newly created user
|
|
181
|
+
* @param firstName the first name of the new user
|
|
182
|
+
* @param lastName the last name of the new user
|
|
171
183
|
*/
|
|
172
|
-
acceptInvite: async ({ inviteCode, password }) => {
|
|
184
|
+
acceptInvite: async ({ inviteCode, password, firstName, lastName }) => {
|
|
173
185
|
return await API.post({
|
|
174
186
|
url: "/api/global/users/invite/accept",
|
|
175
187
|
body: {
|
|
176
188
|
inviteCode,
|
|
177
189
|
password,
|
|
190
|
+
firstName,
|
|
191
|
+
lastName,
|
|
178
192
|
},
|
|
179
193
|
})
|
|
180
194
|
},
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import BG from "../../assets/bg.png"
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<div class="split-page">
|
|
6
|
+
<div class="left">
|
|
7
|
+
<div class="content">
|
|
8
|
+
<slot />
|
|
9
|
+
</div>
|
|
10
|
+
</div>
|
|
11
|
+
<div class="right spectrum spectrum--darkest">
|
|
12
|
+
<!-- No alt attribute to avoid flash -->
|
|
13
|
+
<img src={BG} alt=" " />
|
|
14
|
+
<slot name="right" />
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
<style>
|
|
19
|
+
.split-page {
|
|
20
|
+
height: 100%;
|
|
21
|
+
display: grid;
|
|
22
|
+
grid-template-columns: max(50%, 380px) 1fr;
|
|
23
|
+
justify-content: stretch;
|
|
24
|
+
overflow: hidden;
|
|
25
|
+
}
|
|
26
|
+
.left {
|
|
27
|
+
background: var(--background);
|
|
28
|
+
display: grid;
|
|
29
|
+
place-items: center;
|
|
30
|
+
padding: 40px;
|
|
31
|
+
overflow-y: auto;
|
|
32
|
+
}
|
|
33
|
+
.right {
|
|
34
|
+
overflow: hidden;
|
|
35
|
+
position: relative;
|
|
36
|
+
}
|
|
37
|
+
.right img {
|
|
38
|
+
position: absolute;
|
|
39
|
+
top: 0;
|
|
40
|
+
left: 0;
|
|
41
|
+
height: 100%;
|
|
42
|
+
width: 100%;
|
|
43
|
+
}
|
|
44
|
+
.content {
|
|
45
|
+
width: 100%;
|
|
46
|
+
max-width: 400px;
|
|
47
|
+
min-height: 480px;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@media (max-width: 740px) {
|
|
51
|
+
.split-page {
|
|
52
|
+
grid-template-columns: 1fr;
|
|
53
|
+
}
|
|
54
|
+
.left {
|
|
55
|
+
padding: 20px;
|
|
56
|
+
}
|
|
57
|
+
.right {
|
|
58
|
+
display: none;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
</style>
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import SplitPage from "./SplitPage.svelte"
|
|
3
|
+
import { Layout } from "@budibase/bbui"
|
|
4
|
+
import Bulgaria from "../../assets/bulgaria.png"
|
|
5
|
+
import Covanta from "../../assets/covanta.png"
|
|
6
|
+
import Schnellecke from "../../assets/schnellecke.png"
|
|
7
|
+
|
|
8
|
+
const testimonials = [
|
|
9
|
+
{
|
|
10
|
+
text: "Budibase was the only solution that checked all the boxes for Covanta. Covanta expects to realize $3.2MM in savings due to the elimination of redundant data entry.",
|
|
11
|
+
name: "Charles Link",
|
|
12
|
+
role: "Senior Director, Data and Analytics",
|
|
13
|
+
image: Covanta,
|
|
14
|
+
imageSize: 105,
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
text: "Budibase was mission-critical for us and went a long way in preventing what could have become a humanitarian crisis here in Bulgaria.",
|
|
18
|
+
name: "Bozhidar Bozhanov",
|
|
19
|
+
role: "Government of Bulgaria",
|
|
20
|
+
image: Bulgaria,
|
|
21
|
+
imageSize: 49,
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
text: "Centralization of authentication, quick turnaround time for requests, integration with different database systems has given it the edge and it’s now used daily for internal development for those apps that you know you need but don’t feel value in losing days of development to reinvent the wheel.",
|
|
25
|
+
name: "Davide Lenzarini",
|
|
26
|
+
role: "IT manager",
|
|
27
|
+
image: Schnellecke,
|
|
28
|
+
imageSize: 141,
|
|
29
|
+
},
|
|
30
|
+
]
|
|
31
|
+
const testimonial = testimonials[Math.floor(Math.random() * 3)]
|
|
32
|
+
</script>
|
|
33
|
+
|
|
34
|
+
<SplitPage>
|
|
35
|
+
<slot />
|
|
36
|
+
<div class="wrapper" slot="right">
|
|
37
|
+
<div class="testimonial">
|
|
38
|
+
<Layout noPadding gap="S">
|
|
39
|
+
<img
|
|
40
|
+
width={testimonial.imageSize}
|
|
41
|
+
alt="a-happy-budibase-user"
|
|
42
|
+
src={testimonial.image}
|
|
43
|
+
/>
|
|
44
|
+
<div class="text">
|
|
45
|
+
"{testimonial.text}"
|
|
46
|
+
</div>
|
|
47
|
+
<div class="author">
|
|
48
|
+
<div class="name">{testimonial.name}</div>
|
|
49
|
+
<div class="company">{testimonial.role}</div>
|
|
50
|
+
</div>
|
|
51
|
+
</Layout>
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
</SplitPage>
|
|
55
|
+
|
|
56
|
+
<style>
|
|
57
|
+
.wrapper {
|
|
58
|
+
width: 100%;
|
|
59
|
+
height: 100%;
|
|
60
|
+
display: grid;
|
|
61
|
+
place-items: center;
|
|
62
|
+
}
|
|
63
|
+
.testimonial {
|
|
64
|
+
width: 380px;
|
|
65
|
+
padding: 40px;
|
|
66
|
+
}
|
|
67
|
+
.text {
|
|
68
|
+
font-size: var(--font-size-l);
|
|
69
|
+
font-style: italic;
|
|
70
|
+
}
|
|
71
|
+
.name {
|
|
72
|
+
font-weight: bold;
|
|
73
|
+
color: var(--spectrum-global-color-gray-900);
|
|
74
|
+
font-size: var(--font-size-l);
|
|
75
|
+
}
|
|
76
|
+
.company {
|
|
77
|
+
color: var(--spectrum-global-color-gray-700);
|
|
78
|
+
}
|
|
79
|
+
</style>
|
package/src/constants.js
CHANGED
|
@@ -114,6 +114,7 @@ export const ApiVersion = "1"
|
|
|
114
114
|
export const Features = {
|
|
115
115
|
USER_GROUPS: "userGroups",
|
|
116
116
|
BACKUPS: "appBackups",
|
|
117
|
+
ENVIRONMENT_VARIABLES: "environmentVariables",
|
|
117
118
|
}
|
|
118
119
|
|
|
119
120
|
// Role IDs
|
|
@@ -174,3 +175,7 @@ export const Themes = [
|
|
|
174
175
|
base: "darkest",
|
|
175
176
|
},
|
|
176
177
|
]
|
|
178
|
+
|
|
179
|
+
export const EventPublishType = {
|
|
180
|
+
ENV_VAR_UPGRADE_PANEL_OPENED: "environment_variable_upgrade_panel_opened",
|
|
181
|
+
}
|
package/src/index.js
CHANGED
package/src/themes/midnight.css
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
--spectrum-global-color-gray-500: hsl(var(--hue), var(--sat), 40%);
|
|
11
11
|
--spectrum-global-color-gray-600: hsl(var(--hue), var(--sat), 60%);
|
|
12
12
|
--spectrum-global-color-gray-700: hsl(var(--hue), var(--sat), 70%);
|
|
13
|
-
--spectrum-global-color-gray-800: hsl(var(--hue), var(--sat),
|
|
13
|
+
--spectrum-global-color-gray-800: hsl(var(--hue), var(--sat), 85%);
|
|
14
14
|
--spectrum-global-color-gray-900: hsl(var(--hue), var(--sat), 95%);
|
|
15
15
|
|
|
16
16
|
--modal-background: var(--spectrum-global-color-gray-50);
|