@firecms/core 3.0.0-canary.41 → 3.0.0-canary.42

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,7 +1,7 @@
1
1
  {
2
2
  "name": "@firecms/core",
3
3
  "type": "module",
4
- "version": "3.0.0-canary.41",
4
+ "version": "3.0.0-canary.42",
5
5
  "description": "Awesome Firebase/Firestore-based headless open-source CMS",
6
6
  "funding": {
7
7
  "url": "https://github.com/sponsors/firecmsco"
@@ -46,8 +46,8 @@
46
46
  "./package.json": "./package.json"
47
47
  },
48
48
  "dependencies": {
49
- "@firecms/formex": "^3.0.0-canary.41",
50
- "@firecms/ui": "^3.0.0-canary.41",
49
+ "@firecms/formex": "^3.0.0-canary.42",
50
+ "@firecms/ui": "^3.0.0-canary.42",
51
51
  "@fontsource/jetbrains-mono": "^5.0.19",
52
52
  "@hello-pangea/dnd": "^16.5.0",
53
53
  "@radix-ui/react-portal": "^1.0.4",
@@ -118,7 +118,7 @@
118
118
  "dist",
119
119
  "src"
120
120
  ],
121
- "gitHead": "d1ffa185f8930bab4e7b9941ba551c53f947aa1f",
121
+ "gitHead": "d6a2f28e93d3c532dd6efacfccffb91383d5330e",
122
122
  "publishConfig": {
123
123
  "access": "public"
124
124
  }
@@ -191,7 +191,7 @@ export function DefaultHomePage({
191
191
  />
192
192
  </div>
193
193
  ))}
194
- {AdditionalCards &&
194
+ {group?.toLowerCase() !== "admin" && AdditionalCards &&
195
195
  AdditionalCards.map((AdditionalCard, i) => (
196
196
  <div key={`nav_${group}_add_${i}`}>
197
197
  <AdditionalCard {...actionProps} />
@@ -20,7 +20,7 @@ import { VirtualTableContextProps } from "./types";
20
20
  import { VirtualTableHeaderRow } from "./VirtualTableHeaderRow";
21
21
  import { VirtualTableRow } from "./VirtualTableRow";
22
22
  import { VirtualTableCell } from "./VirtualTableCell";
23
- import { AssignmentIcon, cn, Typography } from "@firecms/ui";
23
+ import { AssignmentIcon, CenteredView, cn, Typography } from "@firecms/ui";
24
24
 
25
25
  const VirtualListContext = createContext<VirtualTableContextProps<any>>({} as any);
26
26
  VirtualListContext.displayName = "VirtualListContext";
@@ -227,19 +227,6 @@ export const VirtualTable = React.memo<VirtualTableProps<any>>(
227
227
  if (onFilterUpdate) onFilterUpdate(newFilterValue);
228
228
  }, [checkFilterCombination, currentSort, onFilterUpdate, sortByProperty]);
229
229
 
230
- const buildErrorView = useCallback(() => (
231
- <div
232
- className="h-full flex flex-col items-center justify-center sticky left-0">
233
-
234
- <Typography variant={"h6"}>
235
- {"Error fetching data from the data source"}
236
- </Typography>
237
-
238
- {error?.message && <SafeLinkRenderer text={error.message}/>}
239
-
240
- </div>
241
- ), [error?.message]);
242
-
243
230
  const buildEmptyView = useCallback(() => {
244
231
  if (loading)
245
232
  return <CircularProgressCenter/>;
@@ -251,7 +238,18 @@ export const VirtualTable = React.memo<VirtualTableProps<any>>(
251
238
  }, [emptyComponent, loading]);
252
239
 
253
240
  const empty = !loading && (data?.length ?? 0) === 0;
254
- const customView = error ? buildErrorView() : (empty ? buildEmptyView() : undefined);
241
+ const customView = error
242
+ ? <CenteredView maxWidth={"2xl"}
243
+ className="flex flex-col gap-2">
244
+
245
+ <Typography variant={"h6"}>
246
+ {"Error fetching data from the data source"}
247
+ </Typography>
248
+
249
+ {error?.message && <SafeLinkRenderer text={error.message}/>}
250
+
251
+ </CenteredView>
252
+ : (empty ? buildEmptyView() : undefined);
255
253
 
256
254
  const virtualListController = {
257
255
  data,
@@ -406,10 +404,10 @@ const SafeLinkRenderer: React.FC<{
406
404
  const urlRegex = /https?:\/\/[^\s]+/g;
407
405
  const htmlContent = text.replace(urlRegex, (url) => {
408
406
  // For each URL found, replace it with an HTML <a> tag
409
- return `<a href="${url}" target="_blank">Link to your console</a>`;
407
+ return `<a href="${url}" target="_blank">Link</a><br/>`;
410
408
  });
411
409
 
412
410
  return (
413
- <div className={"px-4 break-all"} dangerouslySetInnerHTML={{ __html: htmlContent }}/>
411
+ <div className={"break-all"} dangerouslySetInnerHTML={{ __html: htmlContent }}/>
414
412
  );
415
413
  };
@@ -450,14 +450,14 @@ async function resolveCollections(collections: undefined | EntityCollection[] |
450
450
  resolvedCollections = collections;
451
451
  }
452
452
 
453
- resolvedCollections = applyPermissionsFunctionIfEmpty(resolvedCollections, collectionPermissions);
454
-
455
- resolvedCollections = filterOutNotAllowedCollections(resolvedCollections, authController);
456
-
457
453
  if (injectCollections) {
458
454
  resolvedCollections = injectCollections(resolvedCollections ?? []);
459
455
  }
460
456
 
457
+ resolvedCollections = applyPermissionsFunctionIfEmpty(resolvedCollections, collectionPermissions);
458
+
459
+ resolvedCollections = filterOutNotAllowedCollections(resolvedCollections, authController);
460
+
461
461
  return resolvedCollections;
462
462
  }
463
463