@budibase/frontend-core 2.28.4 → 2.28.6

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/package.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "@budibase/frontend-core",
3
- "version": "2.28.4",
3
+ "version": "2.28.6",
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.28.4",
10
- "@budibase/shared-core": "2.28.4",
11
- "@budibase/types": "2.28.4",
9
+ "@budibase/bbui": "2.28.6",
10
+ "@budibase/shared-core": "2.28.6",
11
+ "@budibase/types": "2.28.6",
12
12
  "dayjs": "^1.10.8",
13
13
  "lodash": "4.17.21",
14
14
  "shortid": "2.2.15",
15
15
  "socket.io-client": "^4.6.1"
16
16
  },
17
- "gitHead": "9b48f1ed3b00767916303b4885c0805bb751cee5"
17
+ "gitHead": "bc810319e03346048231738ec87f781e438e9554"
18
18
  }
@@ -81,6 +81,7 @@
81
81
  }
82
82
  input {
83
83
  flex: 1 1 auto;
84
+ width: 0;
84
85
  border: none;
85
86
  padding: var(--cell-padding);
86
87
  overflow: hidden;
@@ -116,7 +116,9 @@
116
116
  {#each displayColumns as column}
117
117
  <div class="column">
118
118
  <Icon size="S" name={getColumnIcon(column)} />
119
- {column.label}
119
+ <div class="column-label" title={column.label}>
120
+ {column.label}
121
+ </div>
120
122
  </div>
121
123
  <ToggleActionButtonGroup
122
124
  on:click={e => toggleColumn(column, e.detail)}
@@ -139,7 +141,8 @@
139
141
  display: grid;
140
142
  align-items: center;
141
143
  grid-template-columns: 1fr auto;
142
- gap: 8px;
144
+ grid-row-gap: 8px;
145
+ grid-column-gap: 24px;
143
146
  }
144
147
  .columns :global(.spectrum-Switch) {
145
148
  margin-right: 0;
@@ -148,4 +151,11 @@
148
151
  display: flex;
149
152
  gap: 8px;
150
153
  }
154
+ .column-label {
155
+ min-width: 80px;
156
+ max-width: 200px;
157
+ text-overflow: ellipsis;
158
+ white-space: nowrap;
159
+ overflow: hidden;
160
+ }
151
161
  </style>
@@ -29,7 +29,6 @@
29
29
  .permissionPicker {
30
30
  display: flex;
31
31
  gap: var(--spacing-xs);
32
- padding-left: calc(var(--spacing-xl) * 2);
33
32
  }
34
33
 
35
34
  .permissionPicker :global(.spectrum-Icon) {
@@ -23,14 +23,24 @@
23
23
  0
24
24
  )
25
25
 
26
+ const updateBounds = () => {
27
+ bounds.set(body.getBoundingClientRect())
28
+ }
29
+
26
30
  onMount(() => {
27
31
  // Observe and record the height of the body
28
- const observer = new ResizeObserver(() => {
29
- bounds.set(body.getBoundingClientRect())
30
- })
31
- observer.observe(body)
32
+ const resizeObserver = new ResizeObserver(updateBounds)
33
+ resizeObserver.observe(body)
34
+
35
+ // Capture any wheel events on the page to ensure our scroll offset is
36
+ // correct. We don't care about touch events as we only need this for
37
+ // hovering over rows with a mouse.
38
+ window.addEventListener("wheel", updateBounds, true)
39
+
40
+ // Clean up listeners
32
41
  return () => {
33
- observer.disconnect()
42
+ resizeObserver.disconnect()
43
+ window.removeEventListener("wheel", updateBounds, true)
34
44
  }
35
45
  })
36
46
  </script>
@@ -94,6 +94,7 @@ export const createActions = context => {
94
94
  nonPlus,
95
95
  schemaMutations,
96
96
  schema,
97
+ notifications,
97
98
  } = context
98
99
 
99
100
  // Gets the appropriate API for the configured datasource type
@@ -125,16 +126,25 @@ export const createActions = context => {
125
126
  // Saves the datasource definition
126
127
  const saveDefinition = async newDefinition => {
127
128
  // Update local state
129
+ const originalDefinition = get(definition)
128
130
  definition.set(newDefinition)
129
131
 
130
132
  // Update server
131
133
  if (get(config).canSaveSchema) {
132
- await getAPI()?.actions.saveDefinition(newDefinition)
134
+ try {
135
+ await getAPI()?.actions.saveDefinition(newDefinition)
133
136
 
134
- // Broadcast change so external state can be updated, as this change
135
- // will not be received by the builder websocket because we caused it
136
- // ourselves
137
- dispatch("updatedatasource", newDefinition)
137
+ // Broadcast change so external state can be updated, as this change
138
+ // will not be received by the builder websocket because we caused it
139
+ // ourselves
140
+ dispatch("updatedatasource", newDefinition)
141
+ } catch (error) {
142
+ const msg = error?.message || error || "Unknown error"
143
+ get(notifications).error(`Error saving schema: ${msg}`)
144
+
145
+ // Reset the definition if saving failed
146
+ definition.set(originalDefinition)
147
+ }
138
148
  }
139
149
  }
140
150