Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update blocknote #3517

Merged
merged 3 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"@apollo/server": "^4.7.3",
"@aws-sdk/client-s3": "^3.363.0",
"@aws-sdk/credential-providers": "^3.363.0",
"@blocknote/core": "^0.10.1",
"@blocknote/react": "^0.10.1",
"@blocknote/core": "^0.11.0",
"@blocknote/react": "^0.11.0",
"@chakra-ui/accordion": "^2.3.0",
"@chakra-ui/system": "^2.6.0",
"@codesandbox/sandpack-react": "^2.9.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import { IconFile } from '@/ui/display/icon';

import { blockSchema } from './schema';

export const getSlashMenu = (imagesActivated: boolean) => {
let items = [
export const getSlashMenu = () => {
const items = [
...getDefaultReactSlashMenuItems(blockSchema),
{
name: 'File',
Expand Down Expand Up @@ -40,10 +40,5 @@ export const getSlashMenu = (imagesActivated: boolean) => {
},
},
];

if (!imagesActivated) {
items = items.filter((x) => x.name !== 'Image');
}

return items;
};
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ import { Activity } from '@/activities/types/Activity';
import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';
import { useUpdateOneRecord } from '@/object-record/hooks/useUpdateOneRecord';
import { BlockEditor } from '@/ui/input/editor/components/BlockEditor';
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
import { REACT_APP_SERVER_BASE_URL } from '~/config';
import { FileFolder, useUploadFileMutation } from '~/generated/graphql';

import { blockSpecs } from '../blocks/blockSpecs';
import { getSlashMenu } from '../blocks/slashMenu';
import { getFileType } from '../files/utils/getFileType';

import '@blocknote/react/style.css';

const StyledBlockNoteStyledContainer = styled.div`
width: 100%;
`;
Expand Down Expand Up @@ -55,8 +56,7 @@ export const ActivityBodyEditor = ({
return debounce(onInternalChange, 200);
}, [updateOneRecord, activity.id]);

const imagesActivated = useIsFeatureEnabled('IS_NOTE_CREATE_IMAGES_ENABLED');
const slashMenuItems = getSlashMenu(imagesActivated);
const slashMenuItems = getSlashMenu();

const [uploadFile] = useUploadFileMutation();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
export type FeatureFlagKey =
| 'IS_MESSAGING_ENABLED'
| 'IS_NOTE_CREATE_IMAGES_ENABLED'
| 'IS_QUICK_ACTIONS_ENABLED'
| 'IS_RATING_FIELD_TYPE_ENABLED'
| 'IS_RELATION_FIELD_CARD_ENABLED'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import { Workspace } from 'src/core/workspace/workspace.entity';
export enum FeatureFlagKeys {
IsRelationFieldTypeEnabled = 'IS_RELATION_FIELD_TYPE_ENABLED',
IsMessagingEnabled = 'IS_MESSAGING_ENABLED',
IsNoteCreateImagesEnabled = 'IS_NOTE_CREATE_IMAGES_ENABLED',
IsSelectFieldTypeEnabled = 'IS_SELECT_FIELD_TYPE_ENABLED',
IsRatingFieldTypeEnabled = 'IS_RATING_FIELD_TYPE_ENABLED',
IsWorkspaceCleanable = 'IS_WORKSPACE_CLEANABLE',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ export const seedFeatureFlags = async (
workspaceId: workspaceId,
value: true,
},
{
key: FeatureFlagKeys.IsNoteCreateImagesEnabled,
workspaceId: workspaceId,
value: true,
},
{
key: FeatureFlagKeys.IsSelectFieldTypeEnabled,
workspaceId: workspaceId,
Expand Down
Loading