@firecms/core 3.0.0-canary.84 → 3.0.0-canary.85
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/dist/hooks/useProjectLog.d.ts +2 -2
- package/dist/index.es.js +23 -11
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +23 -11
- package/dist/index.umd.js.map +1 -1
- package/dist/types/auth.d.ts +1 -1
- package/dist/types/datasource.d.ts +9 -6
- package/package.json +11 -11
- package/src/components/EntityCollectionTable/fields/TableReferenceField.tsx +1 -0
- package/src/components/EntityPreview.tsx +1 -0
- package/src/components/SelectableTable/filters/DateTimeFilterField.tsx +1 -1
- package/src/core/FireCMS.tsx +1 -1
- package/src/form/field_bindings/DateTimeFieldBinding.tsx +1 -1
- package/src/hooks/data/useDataSource.tsx +1 -1
- package/src/hooks/useProjectLog.tsx +18 -7
- package/src/internal/useBuildDataSource.ts +2 -2
- package/src/types/auth.tsx +1 -1
- package/src/types/collections.ts +1 -1
- package/src/types/datasource.ts +12 -7
package/dist/index.umd.js
CHANGED
|
@@ -5173,6 +5173,7 @@
|
|
|
5173
5173
|
},
|
|
5174
5174
|
className: ui.cls(
|
|
5175
5175
|
"bg-white dark:bg-gray-900",
|
|
5176
|
+
"min-h-[42px]",
|
|
5176
5177
|
fullwidth ? "w-full" : "",
|
|
5177
5178
|
"items-center",
|
|
5178
5179
|
hover ? "hover:bg-slate-50 dark:hover:bg-gray-800 group-hover:bg-slate-50 dark:group-hover:bg-gray-800" : "",
|
|
@@ -7145,6 +7146,7 @@
|
|
|
7145
7146
|
updateValue(entity ? getReferenceFrom(entity) : null);
|
|
7146
7147
|
}, [updateValue]);
|
|
7147
7148
|
const onMultipleEntitiesSelected = React.useCallback((entities) => {
|
|
7149
|
+
console.log("onMultipleEntitiesSelected", entities);
|
|
7148
7150
|
updateValue(entities.map((e) => getReferenceFrom(e)));
|
|
7149
7151
|
}, [updateValue]);
|
|
7150
7152
|
const selectedEntityIds = internalValue ? Array.isArray(internalValue) ? internalValue.map((ref) => ref.id) : internalValue.id ? [internalValue.id] : [] : [];
|
|
@@ -14632,7 +14634,7 @@
|
|
|
14632
14634
|
ui.DateTimeField,
|
|
14633
14635
|
{
|
|
14634
14636
|
value: internalValue,
|
|
14635
|
-
onChange: (dateValue) => setValue(dateValue
|
|
14637
|
+
onChange: (dateValue) => setValue(dateValue),
|
|
14636
14638
|
size: "medium",
|
|
14637
14639
|
mode: property.mode,
|
|
14638
14640
|
clearable: property.clearable,
|
|
@@ -19171,7 +19173,7 @@
|
|
|
19171
19173
|
inputValues: firestoreValues,
|
|
19172
19174
|
properties,
|
|
19173
19175
|
status,
|
|
19174
|
-
timestampNowValue: delegate.currentTime(),
|
|
19176
|
+
timestampNowValue: delegate.currentTime?.() ?? /* @__PURE__ */ new Date(),
|
|
19175
19177
|
setDateToMidnight: delegate.setDateToMidnight
|
|
19176
19178
|
}
|
|
19177
19179
|
) : firestoreValues;
|
|
@@ -19227,7 +19229,7 @@
|
|
|
19227
19229
|
filter,
|
|
19228
19230
|
orderBy,
|
|
19229
19231
|
order,
|
|
19230
|
-
isCollectionGroup: Boolean(collection.collectionGroup)
|
|
19232
|
+
isCollectionGroup: Boolean(collection.collectionGroup)
|
|
19231
19233
|
});
|
|
19232
19234
|
} : void 0,
|
|
19233
19235
|
isFilterCombinationValid: React.useCallback(({
|
|
@@ -19253,8 +19255,13 @@
|
|
|
19253
19255
|
};
|
|
19254
19256
|
}
|
|
19255
19257
|
const DEFAULT_SERVER = "https://api-drplyi3b6q-ey.a.run.app";
|
|
19256
|
-
async function makeRequest(authController, pluginKeys) {
|
|
19257
|
-
|
|
19258
|
+
async function makeRequest(authController, dataSourceKey, pluginKeys) {
|
|
19259
|
+
let idToken;
|
|
19260
|
+
try {
|
|
19261
|
+
idToken = await authController.getAuthToken();
|
|
19262
|
+
} catch (e) {
|
|
19263
|
+
idToken = null;
|
|
19264
|
+
}
|
|
19258
19265
|
return fetch(
|
|
19259
19266
|
DEFAULT_SERVER + "/access_log",
|
|
19260
19267
|
{
|
|
@@ -19262,24 +19269,29 @@
|
|
|
19262
19269
|
method: "POST",
|
|
19263
19270
|
headers: {
|
|
19264
19271
|
"Content-Type": "application/json",
|
|
19265
|
-
Authorization: `Basic ${
|
|
19272
|
+
Authorization: `Basic ${idToken}`
|
|
19266
19273
|
},
|
|
19267
|
-
body: JSON.stringify({
|
|
19274
|
+
body: JSON.stringify({
|
|
19275
|
+
email: authController.user?.email ?? null,
|
|
19276
|
+
datasource: dataSourceKey,
|
|
19277
|
+
plugins: pluginKeys
|
|
19278
|
+
})
|
|
19268
19279
|
}
|
|
19269
19280
|
).then(async (res) => {
|
|
19270
19281
|
return res.json();
|
|
19271
19282
|
});
|
|
19272
19283
|
}
|
|
19273
|
-
function useProjectLog(authController, plugins) {
|
|
19284
|
+
function useProjectLog(authController, dataSourceDelegate, plugins) {
|
|
19274
19285
|
const [accessResponse, setAccessResponse] = React.useState(null);
|
|
19275
19286
|
const accessedUserRef = React.useRef(null);
|
|
19287
|
+
const dataSourceKey = dataSourceDelegate.key;
|
|
19276
19288
|
const pluginKeys = plugins?.map((plugin) => plugin.key);
|
|
19277
19289
|
React.useEffect(() => {
|
|
19278
19290
|
if (authController.user && authController.user.uid !== accessedUserRef.current && !authController.initialLoading) {
|
|
19279
|
-
makeRequest(authController, pluginKeys).then(setAccessResponse);
|
|
19291
|
+
makeRequest(authController, dataSourceKey, pluginKeys).then(setAccessResponse);
|
|
19280
19292
|
accessedUserRef.current = authController.user.uid;
|
|
19281
19293
|
}
|
|
19282
|
-
}, [authController, pluginKeys]);
|
|
19294
|
+
}, [authController, dataSourceKey, pluginKeys]);
|
|
19283
19295
|
return accessResponse;
|
|
19284
19296
|
}
|
|
19285
19297
|
function FireCMS(props) {
|
|
@@ -19321,7 +19333,7 @@
|
|
|
19321
19333
|
const analyticsController = React.useMemo(() => ({
|
|
19322
19334
|
onAnalyticsEvent
|
|
19323
19335
|
}), []);
|
|
19324
|
-
const accessResponse = useProjectLog(authController, plugins);
|
|
19336
|
+
const accessResponse = useProjectLog(authController, dataSourceDelegate, plugins);
|
|
19325
19337
|
if (navigationController.navigationLoadingError) {
|
|
19326
19338
|
return /* @__PURE__ */ jsxRuntime.jsx(ui.CenteredView, { maxWidth: "md", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
19327
19339
|
ErrorView,
|