@budibase/frontend-core 2.8.9 → 2.8.10-alpha.0

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,17 +1,17 @@
1
1
  {
2
2
  "name": "@budibase/frontend-core",
3
- "version": "2.8.9",
3
+ "version": "2.8.10-alpha.0",
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.8.9",
10
- "@budibase/shared-core": "2.8.9",
9
+ "@budibase/bbui": "2.8.10-alpha.0",
10
+ "@budibase/shared-core": "2.8.10-alpha.0",
11
11
  "dayjs": "^1.11.7",
12
12
  "lodash": "^4.17.21",
13
13
  "socket.io-client": "^4.6.1",
14
14
  "svelte": "^3.46.2"
15
15
  },
16
- "gitHead": "2f4705aa45c71425b41b0401ba00a115d635e534"
16
+ "gitHead": "953c293ac8de6a1bd0340c129fd0e5c5a7699b93"
17
17
  }
package/src/api/index.js CHANGED
@@ -30,6 +30,7 @@ import { buildBackupsEndpoints } from "./backups"
30
30
  import { buildEnvironmentVariableEndpoints } from "./environmentVariables"
31
31
  import { buildEventEndpoints } from "./events"
32
32
  import { buildAuditLogsEndpoints } from "./auditLogs"
33
+ import { buildLogsEndpoints } from "./logs"
33
34
 
34
35
  /**
35
36
  * Random identifier to uniquely identify a session in a tab. This is
@@ -277,5 +278,6 @@ export const createAPIClient = config => {
277
278
  ...buildEnvironmentVariableEndpoints(API),
278
279
  ...buildEventEndpoints(API),
279
280
  ...buildAuditLogsEndpoints(API),
281
+ ...buildLogsEndpoints(API),
280
282
  }
281
283
  }
@@ -0,0 +1,14 @@
1
+ export const buildLogsEndpoints = API => ({
2
+ /**
3
+ * Gets a stream for the system logs.
4
+ */
5
+ getSystemLogs: async () => {
6
+ return await API.get({
7
+ url: "/api/system/logs",
8
+ json: false,
9
+ parseResponse: async response => {
10
+ return response
11
+ },
12
+ })
13
+ },
14
+ })
@@ -33,7 +33,7 @@
33
33
  <Tooltip
34
34
  direction={tooltipDirection}
35
35
  textWrapping
36
- text={user.email}
36
+ text={helpers.getUserLabel(user)}
37
37
  size="S"
38
38
  />
39
39
  </div>
@@ -46,13 +46,15 @@
46
46
  position: relative;
47
47
  }
48
48
  .tooltip {
49
- display: none;
50
49
  position: absolute;
51
50
  top: 0;
52
51
  left: 50%;
53
52
  white-space: nowrap;
53
+ pointer-events: none;
54
+ opacity: 0;
55
+ transition: opacity 130ms ease-out;
54
56
  }
55
57
  .user-avatar:hover .tooltip {
56
- display: block;
58
+ opacity: 1;
57
59
  }
58
60
  </style>
@@ -258,7 +258,7 @@
258
258
  class:wrap={editable || contentLines > 1}
259
259
  on:wheel={e => (focused ? e.stopPropagation() : null)}
260
260
  >
261
- {#each value || [] as relationship, idx}
261
+ {#each value || [] as relationship}
262
262
  {#if relationship.primaryDisplay}
263
263
  <div class="badge">
264
264
  <span
@@ -2,16 +2,9 @@
2
2
  import { getContext } from "svelte"
3
3
  import { GutterWidth } from "../lib/constants"
4
4
 
5
- const {
6
- columns,
7
- resize,
8
- renderedColumns,
9
- stickyColumn,
10
- isReordering,
11
- scrollLeft,
12
- } = getContext("grid")
5
+ const { resize, renderedColumns, stickyColumn, isReordering, scrollLeft } =
6
+ getContext("grid")
13
7
 
14
- $: cutoff = $scrollLeft + GutterWidth + ($columns[0]?.width || 0)
15
8
  $: offset = GutterWidth + ($stickyColumn?.width || 0)
16
9
  $: activeColumn = $resize.column
17
10
 
@@ -30,8 +30,9 @@ export const deriveStores = context => {
30
30
  ([$users, $focusedCellId]) => {
31
31
  let map = {}
32
32
  $users.forEach(user => {
33
- if (user.focusedCellId && user.focusedCellId !== $focusedCellId) {
34
- map[user.focusedCellId] = user
33
+ const cellId = user.gridMetadata?.focusedCellId
34
+ if (cellId && cellId !== $focusedCellId) {
35
+ map[cellId] = user
35
36
  }
36
37
  })
37
38
  return map
@@ -11,3 +11,26 @@ export function downloadText(filename, text) {
11
11
 
12
12
  URL.revokeObjectURL(url)
13
13
  }
14
+
15
+ export async function downloadStream(streamResponse) {
16
+ const blob = await streamResponse.blob()
17
+
18
+ const contentDisposition = streamResponse.headers.get("Content-Disposition")
19
+
20
+ const matches = /filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/.exec(
21
+ contentDisposition
22
+ )
23
+
24
+ const filename = matches[1].replace(/['"]/g, "")
25
+
26
+ const resBlob = new Blob([blob])
27
+
28
+ const blobUrl = URL.createObjectURL(resBlob)
29
+
30
+ const link = document.createElement("a")
31
+ link.href = blobUrl
32
+ link.download = filename
33
+ link.click()
34
+
35
+ URL.revokeObjectURL(blobUrl)
36
+ }
@@ -5,4 +5,4 @@ export * as RoleUtils from "./roles"
5
5
  export * as Utils from "./utils"
6
6
  export { memo, derivedMemo } from "./memo"
7
7
  export { createWebsocket } from "./websocket"
8
- export { downloadText } from "./download"
8
+ export * from "./download"