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

v2.6.1 – Bug fixes #743

Merged
merged 32 commits into from
Aug 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
a908e4e
Bump ejs from 3.1.6 to 3.1.8
dependabot[bot] Jun 28, 2022
5c24005
Bump minimist from 1.2.5 to 1.2.6
dependabot[bot] Jun 28, 2022
070e188
Bump tmpl from 1.0.4 to 1.0.5
dependabot[bot] Jun 28, 2022
ce614cd
Bump protobufjs from 6.11.2 to 6.11.3
dependabot[bot] Jun 28, 2022
daf4a75
Merge pull request #691 from rowyio/dependabot/npm_and_yarn/protobufj…
notsidney Jun 29, 2022
8f53d50
Merge pull request #689 from rowyio/dependabot/npm_and_yarn/ejs-3.1.8
notsidney Jun 29, 2022
454d8cd
Merge pull request #690 from rowyio/dependabot/npm_and_yarn/tmpl-1.0.5
notsidney Jun 29, 2022
a80b086
Merge pull request #688 from rowyio/dependabot/npm_and_yarn/minimist-…
notsidney Jun 29, 2022
28c1d67
fix(rich-text-editor): fix dark mode ui appearance (#696)
htuerker Jun 29, 2022
c856211
update date & time filter operators for clarity
notsidney Jun 29, 2022
2f7f569
Action field: prevent selecting self as required field (fixes ROWY-551)
notsidney Jun 30, 2022
d98d726
Date & Time: only show date for date filters
notsidney Jun 30, 2022
82ecbad
move fullScreenButton to be shared, remove md settings
shamsmosowi Jul 2, 2022
dd214b9
bundle-analyzer
shamsmosowi Jul 3, 2022
ea0da54
Leaf icon: use mdi-material-ui
notsidney Jul 4, 2022
6db708a
Merge branch 'develop' of https://github.com/rowyio/rowy into develop
notsidney Jul 4, 2022
db7b3eb
Feat: Percentage field color customization (#692)
htuerker Jul 5, 2022
5123b1c
extend callable timeout to over 9minutes
shamsmosowi Jul 6, 2022
9a16854
fix timeout value
shamsmosowi Jul 6, 2022
015322f
Merge branch 'develop' of https://github.com/rowyio/rowy into develop
shamsmosowi Jul 6, 2022
4786d05
fix page loading with white screen while system is in dark mode
notsidney Jul 14, 2022
a96b23f
Revert "bundle-analyzer"
notsidney Jul 18, 2022
b641af8
fix nav items not accessible with Tab
notsidney Jul 20, 2022
d6395df
Percentage: don’t display if value null or undefined
notsidney Jul 20, 2022
91b110d
fix NavDrawer causing compile to fail
notsidney Jul 20, 2022
a503602
show text field if collections array is empy
shamsmosowi Jul 25, 2022
781272a
Merge pull request #727 from rowyio/develop
shamsmosowi Jul 25, 2022
b64c6c4
column ids
shamsmosowi Jul 26, 2022
7176c9d
row ID
shamsmosowi Jul 28, 2022
52b5d75
fix create table showing empty dropdown for collections
notsidney Aug 2, 2022
4f25cca
fix row not writing to db once all required fields are written
notsidney Aug 10, 2022
df154c5
Merge branch 'develop' into rc
notsidney Aug 10, 2022
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
6 changes: 6 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@
href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,400;0,700;1,400;1,700&display=swap"
/>

<style>
:root {
color-scheme: light dark;
}
</style>

<title>Rowy</title>

<meta name="title" content="Rowy – GCP as easy as ABC" />
Expand Down
10 changes: 0 additions & 10 deletions src/assets/icons/Leaf.tsx

This file was deleted.

6 changes: 6 additions & 0 deletions src/assets/icons/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ export { LanguageMarkdownOutline as Markdown };
import { TableRow } from "mdi-material-ui";
export { TableRow as Row };

import { Table } from "mdi-material-ui";
export { Table };

import { Leaf } from "mdi-material-ui";
export { Leaf };

export * from "./AddRow";
export * from "./AddRowTop";
export * from "./ChevronDown";
Expand Down
26 changes: 13 additions & 13 deletions src/atoms/tableScope/rowActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -346,16 +346,6 @@ export const updateFieldAtom = atom(
update[tableSettings.auditFieldUpdatedBy || "_updatedBy"] = auditValue;
}

// Check for required fields
const requiredFields = ignoreRequiredFields
? []
: tableColumnsOrdered
.filter((column) => column.config?.required)
.map((column) => column.key);
const missingRequiredFields = ignoreRequiredFields
? []
: requiredFields.filter((field) => row[field] === undefined);

// Apply field update
if (!deleteField) {
// Check for equality. If updated value is same as current, skip update
Expand All @@ -367,6 +357,17 @@ export const updateFieldAtom = atom(
_set(update, fieldName, value);
}

// Check for required fields
const newRowValues = updateRowData(cloneDeep(row), update);
const requiredFields = ignoreRequiredFields
? []
: tableColumnsOrdered
.filter((column) => column.config?.required)
.map((column) => column.key);
const missingRequiredFields = ignoreRequiredFields
? []
: requiredFields.filter((field) => newRowValues[field] === undefined);

// If it’s a local row, update the row in rowsLocal
if (isLocalRow) {
set(tableRowsLocalAtom, {
Expand All @@ -379,12 +380,11 @@ export const updateFieldAtom = atom(
// If it has no missingRequiredFields, also write to db
// And write entire row to handle the case where it doesn’t exist in db yet
if (missingRequiredFields.length === 0) {
const rowValues = updateRowData(cloneDeep(row), update);
if (deleteField) unset(rowValues, fieldName);
if (deleteField) unset(newRowValues, fieldName);

await updateRowDb(
row._rowy_ref.path,
omitRowyFields(rowValues),
omitRowyFields(newRowValues),
deleteField ? [fieldName] : []
);
}
Expand Down
3 changes: 2 additions & 1 deletion src/components/CodeEditor/CodeEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { ResizeBottomRight } from "@src/assets/icons";
import useMonacoCustomizations, {
IUseMonacoCustomizationsProps,
} from "./useMonacoCustomizations";
import FullScreenButton from "./FullScreenButton";
import FullScreenButton from "@src/components/FullScreenButton";
import { spreadSx } from "@src/utils/ui";

export interface ICodeEditorProps
Expand Down Expand Up @@ -73,6 +73,7 @@ export default function CodeEditor({
return (
<TrapFocus open={fullScreen}>
<Box
component="div"
sx={[boxSx, ...spreadSx(containerProps?.sx)]}
style={fullScreen ? { height: "100%" } : {}}
>
Expand Down
3 changes: 2 additions & 1 deletion src/components/CodeEditor/DiffEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { ResizeBottomRight } from "@src/assets/icons";
import useMonacoCustomizations, {
IUseMonacoCustomizationsProps,
} from "./useMonacoCustomizations";
import FullScreenButton from "./FullScreenButton";
import FullScreenButton from "@src/components/FullScreenButton";
import { spreadSx } from "@src/utils/ui";

export interface IDiffEditorProps
Expand Down Expand Up @@ -64,6 +64,7 @@ export default function DiffEditor({
return (
<TrapFocus open={fullScreen}>
<Box
component="div"
sx={[boxSx, ...spreadSx(containerProps?.sx)]}
style={fullScreen ? { height: "100%" } : {}}
>
Expand Down
76 changes: 76 additions & 0 deletions src/components/ColorPickerInput.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import { useState, useRef, MutableRefObject, useLayoutEffect } from "react";
import { Box, useTheme } from "@mui/material";

import { Color, ColorPicker } from "react-color-palette";

const useResponsiveWidth = (): [
width: number,
setRef: MutableRefObject<HTMLElement | null>
] => {
const ref = useRef(null);
const [width, setWidth] = useState(0);

useLayoutEffect(() => {
if (!ref || !ref.current) {
return;
}
const resizeObserver = new ResizeObserver((targets) => {
const { width: currentWidth } = targets[0].contentRect;
setWidth(currentWidth);
});

resizeObserver.observe(ref.current);

return () => {
resizeObserver.disconnect();
};
}, []);

return [width, ref];
};

export interface IColorPickerProps {
value: Color;
onChangeComplete: (color: Color) => void;
disabled?: boolean;
}

export default function ColorPickerInput({
value,
onChangeComplete,
disabled = false,
}: IColorPickerProps) {
const [localValue, setLocalValue] = useState(value);
const [width, setRef] = useResponsiveWidth();
const theme = useTheme();

return (
<Box
ref={setRef}
sx={[
{
padding: theme.spacing(1.5),
paddingTop: theme.spacing(1),
transitionDuration: 0,
"& .rcp": {
border: "none",
"& .rcp-saturation": {
borderRadius: theme.spacing(0.5),
},
"& .rcp-body": {
boxSizing: "unset",
},
},
},
]}
>
<ColorPicker
width={width}
height={150}
color={localValue}
onChange={(color) => setLocalValue(color)}
onChangeComplete={onChangeComplete}
/>
</Box>
);
}
22 changes: 18 additions & 4 deletions src/components/ColumnMenu/ColumnMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,9 @@ export default function ColumnMenu() {
};

const localViewActions: IMenuContentsProps["menuItems"] = [
{ type: "subheader" },
{ type: "subheader", key: "subLocalView" },
{
key: "sortDesc",
label: "Sort: descending",
activeLabel: "Remove sort: descending",
icon: <ArrowDownwardIcon />,
Expand All @@ -139,6 +140,7 @@ export default function ColumnMenu() {
disabled: column.type === FieldType.id,
},
{
key: "sortAsc",
label: "Sort: ascending",
activeLabel: "Remove sort: ascending",
icon: <ArrowUpwardIcon />,
Expand All @@ -152,6 +154,7 @@ export default function ColumnMenu() {
disabled: column.type === FieldType.id,
},
{
key: "hide",
label: "Hide",
icon: <VisibilityIcon />,
onClick: () => {
Expand All @@ -168,6 +171,7 @@ export default function ColumnMenu() {
disabled: !updateUserSettings,
},
{
key: "filter",
label: "Filter…",
icon: <FilterIcon />,
onClick: () => {
Expand All @@ -187,9 +191,10 @@ export default function ColumnMenu() {
];

const configActions: IMenuContentsProps["menuItems"] = [
{ type: "subheader" },
{ type: "subheader", key: "subActionsConfig" },
{
label: "Lock",
key: "lock",
activeLabel: "Unlock",
icon: <LockOpenIcon />,
activeIcon: <LockIcon />,
Expand All @@ -204,6 +209,7 @@ export default function ColumnMenu() {
},
{
label: "Disable resize",
key: "disableResize",
activeLabel: "Enable resize",
icon: <CellResizeIcon />,
onClick: () => {
Expand All @@ -217,6 +223,7 @@ export default function ColumnMenu() {
},
{
label: "Freeze",
key: "freeze",
activeLabel: "Unfreeze",
icon: <FreezeIcon />,
activeIcon: <UnfreezeIcon />,
Expand All @@ -229,6 +236,7 @@ export default function ColumnMenu() {
// { type: "subheader" },
{
label: "Rename…",
key: "rename",
icon: <EditIcon />,
onClick: () => {
openColumnModal({ type: "name", columnKey: column.key });
Expand All @@ -237,6 +245,7 @@ export default function ColumnMenu() {
},
{
label: `Edit type: ${getFieldProp("name", column.type)}…`,
key: "editType",
// This is based on the cell type
icon: getFieldProp("icon", column.type),
onClick: () => {
Expand All @@ -246,6 +255,7 @@ export default function ColumnMenu() {
},
{
label: `Column config…`,
key: "columConfig",
icon: <SettingsIcon />,
onClick: () => {
openColumnModal({ type: "config", columnKey: column.key });
Expand Down Expand Up @@ -299,8 +309,9 @@ export default function ColumnMenu() {
}
};
const derivativeActions: IMenuContentsProps["menuItems"] = [
{ type: "subheader" },
{ type: "subheader", key: "sub-derivative" },
{
key: "evaluateAll",
label: altPress ? "Evaluate all" : "Evaluate all…",
icon: <EvalIcon />,
onClick: altPress
Expand All @@ -323,9 +334,10 @@ export default function ColumnMenu() {
];

const columnActions: IMenuContentsProps["menuItems"] = [
{ type: "subheader" },
{ type: "subheader", key: "subActions" },
{
label: "Insert to the left…",
key: "insertLeft",
icon: <ColumnPlusBeforeIcon />,
onClick: () => {
openColumnModal({ type: "new", index: column.index - 1 });
Expand All @@ -334,6 +346,7 @@ export default function ColumnMenu() {
},
{
label: "Insert to the right…",
key: "insertRight",
icon: <ColumnPlusAfterIcon />,
onClick: () => {
openColumnModal({ type: "new", index: column.index + 1 });
Expand All @@ -342,6 +355,7 @@ export default function ColumnMenu() {
},
{
label: `Delete column${altPress ? "" : "…"}`,
key: "delete",
icon: <ColumnRemoveIcon />,
onClick: altPress
? handleDeleteColumn
Expand Down
2 changes: 2 additions & 0 deletions src/components/ColumnMenu/MenuContents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { MenuItem, ListItemIcon, ListSubheader, Divider } from "@mui/material";

export interface IMenuContentsProps {
menuItems: {
key: string;
type?: string;
label?: string;
activeLabel?: string;
Expand Down Expand Up @@ -36,6 +37,7 @@ export default function MenuContents({ menuItems }: IMenuContentsProps) {
return (
<MenuItem
key={index}
id={`column-menu-item-${item.key}`}
onClick={item.onClick}
color={item.color}
selected={item.active}
Expand Down
Loading