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

feat: support publish database on web #5748

Merged
merged 35 commits into from
Jul 22, 2024
Merged
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
fe810d3
fix: view name
qinluhe Jul 9, 2024
1f611c1
fix: hidden login on web
qinluhe Jul 10, 2024
12f706f
fix: database update bugs
qinluhe Jul 10, 2024
53a2b1f
feat: support render database on web
qinluhe Jul 11, 2024
1747918
fix: loading
qinluhe Jul 11, 2024
5aac9e5
fix: calendar width on mobile
qinluhe Jul 11, 2024
ac604e4
fix: calendar boder color
qinluhe Jul 11, 2024
4fbf5fd
fix: replace some icons
qinluhe Jul 11, 2024
2a498f6
fix: deal with visible view ids
qinluhe Jul 12, 2024
4acab68
fix: filter error child
qinluhe Jul 12, 2024
bff925a
fix: hide filters and sorts
qinluhe Jul 12, 2024
3b43814
fix: the style of relation
qinluhe Jul 12, 2024
94b8c62
fix: throw error when apply fail
qinluhe Jul 16, 2024
fd3214b
fix: upgrade yjs
qinluhe Jul 16, 2024
bb0648e
fix: eslint errors
qinluhe Jul 16, 2024
8370ab2
fix: support group by checkbox
qinluhe Jul 16, 2024
568dcf3
fix: add shortcut to clear data
qinluhe Jul 16, 2024
b05c202
fix: relation
qinluhe Jul 16, 2024
df27c46
fix: relation
qinluhe Jul 16, 2024
5da38bf
fix: relation
qinluhe Jul 16, 2024
6c42ea7
fix: relation
qinluhe Jul 16, 2024
3f94b10
fix: view meta
qinluhe Jul 16, 2024
2738984
fix: view meta
qinluhe Jul 16, 2024
e05150a
fix: view meta
qinluhe Jul 16, 2024
7ac9341
fix: empty database block
qinluhe Jul 16, 2024
8c65109
fix: 0716 bugs
qinluhe Jul 16, 2024
78e5196
fix: add button to url cell
qinluhe Jul 16, 2024
0bff39b
fix: jest test
qinluhe Jul 17, 2024
fad0686
fix: unit tests
qinluhe Jul 17, 2024
eb945af
fix: lint
qinluhe Jul 17, 2024
7b1bf08
fix: reduce database space
qinluhe Jul 17, 2024
3fab5b8
fix: add after payment page
qinluhe Jul 17, 2024
c31c869
fix: add spacing
qinluhe Jul 17, 2024
2bfb25f
Merge branch 'main' into feat/support-publish-database-on-web
LucasXu0 Jul 22, 2024
b638768
Merge branch 'main' into feat/support-publish-database-on-web
LucasXu0 Jul 22, 2024
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
Prev Previous commit
Next Next commit
fix: reduce database space
  • Loading branch information
qinluhe committed Jul 17, 2024
commit 7b1bf082b089100e3c4d6bcb79a3524d9da4fd92
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ export function Calendar() {
const { dayPropGetter, localizer, formats, events, emptyEvents } = useCalendarSetup();

return (
<div className={'database-calendar h-full max-h-[960px] px-16 pb-6 pt-4 max-md:px-4'}>
<div className={'database-calendar h-full max-h-[960px] pb-6 pt-4 '}>
<BigCalendar
components={{
toolbar: (props) => <Toolbar {...props} emptyEvents={emptyEvents} />,
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ export const Group = ({ groupId }: GroupProps) => {

if (notFound) {
return (
<div className={'mt-[10%] flex h-full w-full flex-col items-center gap-2 px-16 text-text-caption max-md:px-4'}>
<div className={'mt-[10%] flex h-full w-full flex-col items-center gap-2 text-text-caption'}>
<div className={'text-sm font-medium'}>{t('board.noGroup')}</div>
<div className={'text-xs'}>{t('board.noGroupDesc')}</div>
</div>
@@ -24,7 +24,7 @@ export const Group = ({ groupId }: GroupProps) => {

if (columns.length === 0 || !fieldId) return null;
return (
<AFScroller overflowYHidden className={'relative px-16 max-md:px-4'}>
<AFScroller overflowYHidden className={'relative'}>
<div className='columns flex h-full w-fit min-w-full gap-4 border-t border-line-divider py-4'>
{columns.map((data) => (
<Column key={data.id} id={data.id} fieldId={fieldId} rows={groupResult.get(data.id)} />
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ export function GridColumn({ column, index }: { column: Column; index: number })
<Tooltip title={name} enterNextDelay={1000} placement={'right'}>
<div
style={{
borderLeftWidth: index === 1 ? 0 : 1,
borderLeftWidth: index === 0 ? 0 : 1,
}}
className={
'flex h-full w-full items-center overflow-hidden whitespace-nowrap border-t border-b border-l border-line-divider px-1.5 text-xs font-medium hover:bg-fill-list-active'
Original file line number Diff line number Diff line change
@@ -27,19 +27,19 @@ export function useRenderFields() {
}));

return [
{
type: GridColumnType.Action,
width: 64,
},
// {
// type: GridColumnType.Action,
// width: 64,
// },
...data,
{
type: GridColumnType.NewProperty,
width: 150,
},
{
type: GridColumnType.Action,
width: 64,
},
// {
// type: GridColumnType.Action,
// width: 64,
// },
].filter(Boolean) as RenderColumn[];
}, [fields]);

Original file line number Diff line number Diff line change
@@ -87,7 +87,7 @@ export const GridTable = ({ scrollLeft, columnWidth, columns, onScrollLeft }: Gr
<div
data-row-id={row.rowId}
className={classList.join(' ')}
style={{ ...style, borderLeftWidth: columnIndex === 1 || column.type === GridColumnType.Action ? 0 : 1 }}
style={{ ...style, borderLeftWidth: columnIndex === 0 || column.type === GridColumnType.Action ? 0 : 1 }}
>
<GridRowCell
onResize={onResize}
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ function DatabaseHeader({
return (
<div
className={
'my-10 flex w-full items-center gap-4 overflow-hidden whitespace-pre-wrap break-words break-all px-16 text-[2.25rem] font-bold leading-[1.5em] max-md:px-4 max-sm:text-[7vw]'
'my-10 flex w-full items-center gap-4 overflow-hidden whitespace-pre-wrap break-words break-all text-[2.25rem] font-bold leading-[1.5em] max-sm:text-[7vw]'
}
>
<div className={'relative'}>
Original file line number Diff line number Diff line change
@@ -39,9 +39,7 @@ export const DatabaseTabs = forwardRef<HTMLDivElement, DatabaseTabBarProps>(
};

const className = useMemo(() => {
const classList = [
'mx-16 -mb-[0.5px] flex items-center overflow-hidden border-line-divider text-text-title max-md:mx-4',
];
const classList = ['-mb-[0.5px] flex items-center overflow-hidden border-line-divider text-text-title'];

if (layout === DatabaseViewLayout.Calendar) {
classList.push('border-b');
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@
switch (type) {
case BlockType.GridBlock:
Object.assign(style, {
height: 460,
height: 400,
});
break;
case BlockType.CalendarBlock:
@@ -72,20 +72,20 @@
setSelectedViewId(viewId);
}

setIidName(meta.name);

Check warning on line 75 in frontend/appflowy_web_app/src/components/editor/components/blocks/database/DatabaseBlock.tsx

Codecov / codecov/patch

frontend/appflowy_web_app/src/components/editor/components/blocks/database/DatabaseBlock.tsx#L75

Added line #L75 was not covered by tests
setVisibleViewIds(viewIds);
};

Check warning on line 77 in frontend/appflowy_web_app/src/components/editor/components/blocks/database/DatabaseBlock.tsx

Codecov / codecov/patch

frontend/appflowy_web_app/src/components/editor/components/blocks/database/DatabaseBlock.tsx#L77

Added line #L77 was not covered by tests

void (async () => {
try {
const meta = await loadViewMeta?.(viewId, updateVisibleViewIds);

Check warning on line 81 in frontend/appflowy_web_app/src/components/editor/components/blocks/database/DatabaseBlock.tsx

Codecov / codecov/patch

frontend/appflowy_web_app/src/components/editor/components/blocks/database/DatabaseBlock.tsx#L80-L81

Added lines #L80 - L81 were not covered by tests

if (meta) {
await updateVisibleViewIds(meta);
}
} catch (e) {
setNotFound(true);
}

Check warning on line 88 in frontend/appflowy_web_app/src/components/editor/components/blocks/database/DatabaseBlock.tsx

Codecov / codecov/patch

frontend/appflowy_web_app/src/components/editor/components/blocks/database/DatabaseBlock.tsx#L88

Added line #L88 was not covered by tests
})();
}, [loadViewMeta, viewId]);

@@ -100,7 +100,7 @@
<div ref={ref} className={'absolute left-0 top-0 h-full w-full caret-transparent'}>
{children}
</div>
<div contentEditable={false} style={style} className={`container-bg relative flex w-full flex-col px-3`}>
<div contentEditable={false} style={style} className={`container-bg relative flex w-full flex-col`}>
{selectedViewId && doc ? (
<>
<Database
Original file line number Diff line number Diff line change
@@ -47,7 +47,7 @@ function DatabaseView({ viewMeta, ...props }: DatabaseProps) {
style={{
height: 'calc(100vh - 48px)',
}}
className={'relative flex h-full w-full flex-col'}
className={'relative flex h-full w-full flex-col px-16 max-md:px-4'}
>
<DatabaseHeader {...viewMeta} />
<Suspense fallback={<ComponentLoading />}>
Loading