Skip to content

Commit

Permalink
Version update
Browse files Browse the repository at this point in the history
  • Loading branch information
fgatti675 committed Sep 16, 2024
1 parent 122cb2b commit 0fe25a2
Show file tree
Hide file tree
Showing 22 changed files with 26 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export function useSupabaseDelegate({ supabase }: SupabaseDataSourceProps): Supa
if (error) {
throw error;
}
return createEntityFromDocument(data, databaseId);
return createEntityFromDocument(data, path, databaseId);
}, [supabase]);

// const listenEntity = useCallback((
Expand Down Expand Up @@ -124,12 +124,11 @@ export function useSupabaseDelegate({ supabase }: SupabaseDataSourceProps): Supa
data,
error
} = await query;
console.log("new data", { props }, data);

if (error) {
throw error;
}
return data.map((doc: any) => createEntityFromDocument(doc));
return data.map((doc: any) => createEntityFromDocument(doc, path, props.collection?.databaseId));
}, [buildQuery]);

// const listenCollection = useCallback(<M extends Record<string, any>>(
Expand Down Expand Up @@ -317,23 +316,20 @@ export function useSupabaseDelegate({ supabase }: SupabaseDataSourceProps): Supa
generateEntityId,
countEntities,
isFilterCombinationValid,
initTextSearch: async ({
path,
databaseId,
collection
}): Promise<boolean> => {
initTextSearch: async (): Promise<boolean> => {
return true;
}
};
}

const createEntityFromDocument = <M extends Record<string, any>>(
data: any,
path: string,
databaseId?: string
): Entity<M> => {
return {
id: data.id,
path: data.path,
path: path,
values: data,
databaseId
};
Expand Down
6 changes: 3 additions & 3 deletions packages/cli/templates/template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"private": true,
"type": "module",
"dependencies": {
"@firecms/core": "^3.0.0-canary",
"@firecms/firebase": "^3.0.0-canary",
"@firecms/ui": "^3.0.0-canary",
"@firecms/core": "^3.0.0-beta",
"@firecms/firebase": "^3.0.0-beta",
"@firecms/ui": "^3.0.0-beta",
"firebase": "^10.12.2",
"react": "^18.3.1",
"react-dom": "^18.3.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/templates/template_cloud/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"logout": "firecms logout"
},
"dependencies": {
"@firecms/cloud": "^3.0.0-canary",
"@firecms/cloud": "^3.0.0-beta",
"firebase": "^10.12.2",
"react": "^18.3.1",
"react-dom": "^18.3.1"
Expand Down
20 changes: 10 additions & 10 deletions packages/cli/templates/template_pro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
"dependencies": {
"typeface-rubik": "^1.1.13",
"@fontsource/jetbrains-mono": "^5.0.20",
"@firecms/collection_editor": "^3.0.0-canary",
"@firecms/collection_editor_firebase": "^3.0.0-canary",
"@firecms/core": "^3.0.0-canary",
"@firecms/data_enhancement": "^3.0.0-canary",
"@firecms/data_import": "^3.0.0-canary",
"@firecms/data_export": "^3.0.0-canary",
"@firecms/firebase": "^3.0.0-canary",
"@firecms/schema_inference": "^3.0.0-canary",
"@firecms/ui": "^3.0.0-canary",
"@firecms/user_management": "^3.0.0-canary",
"@firecms/collection_editor": "^3.0.0-beta",
"@firecms/collection_editor_firebase": "^3.0.0-beta",
"@firecms/core": "^3.0.0-beta",
"@firecms/data_enhancement": "^3.0.0-beta",
"@firecms/data_import": "^3.0.0-beta",
"@firecms/data_export": "^3.0.0-beta",
"@firecms/firebase": "^3.0.0-beta",
"@firecms/schema_inference": "^3.0.0-beta",
"@firecms/ui": "^3.0.0-beta",
"@firecms/user_management": "^3.0.0-beta",
"firebase": "^10.12.2",
"react": "^18.3.1",
"react-dom": "^18.3.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ export function useFirestoreCollectionsConfigController<EC extends PersistedColl
if (newPropertiesOrder) {
data.propertiesOrder = newPropertiesOrder;
}
console.log("Saving property", {
console.debug("Saving property", {
path,
propertyKey,
property,
Expand Down Expand Up @@ -254,7 +254,7 @@ export function useFirestoreCollectionsConfigController<EC extends PersistedColl
if (newPropertiesOrder) {
data.propertiesOrder = newPropertiesOrder;
}
console.log("Deleting property", {
console.debug("Deleting property", {
path,
propertyKey,
collectionPath,
Expand Down
1 change: 0 additions & 1 deletion packages/data_enhancement/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,6 @@ export async function autocompleteStream(props: {
}

}).then(() => {
console.log("Autocomplete result", result);
return result;
});

Expand Down
5 changes: 2 additions & 3 deletions packages/datatalk/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export async function streamDataTalkCommand(firebaseAccessToken: string,
let result = "";
const processChunk = (chunk: ReadableStreamReadResult<Uint8Array>): void | Promise<void> => {
if (chunk.done) {
console.log("Stream completed", { result });
console.debug("Stream completed", { result });
resolve(result);
return;
}
Expand All @@ -62,11 +62,10 @@ export async function streamDataTalkCommand(firebaseAccessToken: string,
try {
const message = JSON.parse(part);
if (message.type === "delta") {
console.log("Delta received:", message.data.delta);
result += message.data.delta;
onDelta(message.data.delta);
} else if (message.type === "result") {
console.log("Result received:", message.data);
console.debug("Result received:", message.data);
resolve(message.data.text);
}
} catch (error) {
Expand Down
4 changes: 0 additions & 4 deletions packages/datatalk/src/components/TableResults.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,9 @@ export function TableResults({

const firestore = getFirestore();
const firebaseValues = cmsToFirestoreModel(updatedValues, firestore);
console.log("Saving", firebaseValues, entity);
console.log("Firestore", firestore);
const documentReference: DocumentReference = doc(firestore, entity.path);
console.log("Document reference", documentReference)
return setDoc(documentReference, firebaseValues, { merge: true })
.then((res) => {
console.log("Document updated", res);
onValueUpdated();
})
.catch((error) => {
Expand Down
1 change: 0 additions & 1 deletion packages/editor/src/extensions/InlineAutocomplete.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ export const AutocompleteExtension = Node.create<

// Find the suggestion decoration
const decoration = pluginState.find(cursorPos)?.[0];
console.log(decoration);
// @ts-ignore
if (decoration && decoration.type?.spec?.suggestionText) {
// @ts-ignore
Expand Down
4 changes: 0 additions & 4 deletions packages/firecms_cloud/src/FireCMSCloudApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,11 @@ export function FireCMSCloudApp({
fromUrl: backendApiHost + "/config"
});

console.log("backendFirebaseApp", backendFirebaseApp);
const fireCMSBackend = useBuildFireCMSBackend({
backendApiHost,
backendFirebaseApp
});


console.log("fireCMSBackend", fireCMSBackend);
let component;

if (backendConfigLoading || !backendFirebaseApp) {
Expand Down Expand Up @@ -800,7 +797,6 @@ function buildAdminRoutes(usersLimit: number | undefined,
hideFromNavigation: true,
view: <DataTalkRoutes
onAnalyticsEvent={(event, params) => {
console.log("DataTalk event", event, params);
onAnalyticsEvent?.("datatalk:" + event, params);
}}
apiEndpoint={dataTalkEndpoint}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ export function FireCMSCloudLoginView({
<GoogleLoginButton
disabled={!termsAccepted && includeTermsAndNewsLetter}
onClick={() => {
console.log("Google login");
fireCMSBackend.googleLogin(includeGoogleAdminScopes).then((user) => {
if (subscribeToNewsletter && user?.email) {
subscribeNewsletter(user.email);
Expand Down Expand Up @@ -139,6 +138,5 @@ const subscribeNewsletter = (email: string) => {
source: "saas"
})
}).then((res) => {
console.log("newsletter response", res);
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ export const TableReferenceFieldInternal = React.memo(
}, [updateValue]);

const onMultipleEntitiesSelected = useCallback((entities: Entity<any>[]) => {
console.log("onMultipleEntitiesSelected", entities);
updateValue(entities.map((e) => getReferenceFrom(e)));
}, [updateValue]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ function StorageUpload({
onDropRejected: (fileRejections, event) => {
for (const fileRejection of fileRejections) {
for (const error of fileRejection.errors) {
console.log("Error uploading file: ", error);
console.error("Error uploading file: ", error);
if (error.code === "file-too-large") {
snackbarContext.open({
type: "error",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ export const EntityCollectionView = React.memo(
}, [tableController.setPopupCell]);

const onEntityClick = useCallback((clickedEntity: Entity<M>) => {
console.log("Entity clicked", clickedEntity)
const collection = collectionRef.current;
setHighlightedEntity(clickedEntity);
analyticsController.onAnalyticsEvent?.("edit_entity_clicked", {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ export function DefaultHomePage({
setFilteredUrls(null);
} else {
const searchResult = fuse.current?.search(value);
console.log("Search result", searchResult);
if (searchResult) {
setFilteredUrls(searchResult.map((e) => e.item.url));
}
Expand Down
1 change: 0 additions & 1 deletion packages/firecms_core/src/components/SearchIconsView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ export function SearchIconsView({
}, [query, updateSearchResults]);

const icons = keys === null ? coolIconKeys : keys;
console.log("Icons", icons);

return (
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ export function StringNumberFilterField({

const multiple = multipleSelectOperations.includes(operation);

console.log("internalValue", { internalValue });
return (

<div className="flex w-[440px]">
Expand Down
2 changes: 1 addition & 1 deletion packages/firecms_core/src/core/DefaultDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export function DefaultDrawer({
.map((view, index) =>
<DrawerNavigationItem
key={`navigation_${index}`}
icon={<IconForView collectionOrView={view.collection ?? view.view}/>}
icon={<IconForView collectionOrView={view.collection ?? view.view} size={"small"}/>}
tooltipsOpen={tooltipsOpen}
adminMenuOpen={adminMenuOpen}
drawerOpen={drawerOpen}
Expand Down
1 change: 0 additions & 1 deletion packages/firecms_core/src/core/EntityEditView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,6 @@ export function EntityEditViewInner<M extends Record<string, any>>({
onUpdate({ entity: updatedEntity });

if (closeAfterSave) {
console.log("Closing side dialog")
sideDialogContext.setBlocked(false);
sideDialogContext.close(true);
onClose?.();
Expand Down
1 change: 0 additions & 1 deletion packages/firecms_core/src/core/SideDialogs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ function SideDialogView({
const handleDrawerCloseOk = () => {
setBlocked(false);
setDrawerCloseRequested(false);
console.log("handleDrawerCloseOk");
sideDialogsController.close();
panel?.onClose?.();
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ function FileDropComponent({
onDropRejected: (fileRejections, event) => {
for (const fileRejection of fileRejections) {
for (const error of fileRejection.errors) {
console.log("Error uploading file: ", error);
console.error("Error uploading file: ", error);
if (error.code === "file-too-large") {
snackbarContext.open({
type: "error",
Expand Down
1 change: 0 additions & 1 deletion packages/ui/src/components/MultiSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ export const MultiSelect = React.forwardRef<
) => {
const [isPopoverOpen, setIsPopoverOpen] = React.useState(open ?? false);
const [selectedValues, setSelectedValues] = React.useState<string[]>(value ?? []);
console.log("selectedValues", selectedValues);

const onPopoverOpenChange = (open: boolean) => {
setIsPopoverOpen(open);
Expand Down

0 comments on commit 0fe25a2

Please sign in to comment.