Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/go_modules/server/src/main/github…
Browse files Browse the repository at this point in the history
….com/golang-migrate/migrate/v4-4.18.1
  • Loading branch information
mateo-ivc authored Sep 24, 2024
2 parents 28f93bd + e495bd0 commit 82beea9
Show file tree
Hide file tree
Showing 16 changed files with 872 additions and 590 deletions.
481 changes: 250 additions & 231 deletions docs/yarn.lock

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@
"@dnd-kit/modifiers": "^7.0.0",
"@dnd-kit/sortable": "^8.0.0",
"@dnd-kit/utilities": "^3.2.2",
"@fontsource/raleway": "^5.0.20",
"@fontsource/raleway": "^5.1.0",
"@react-hook/resize-observer": "^2.0.2",
"@react-spring/web": "^9.7.4",
"@reduxjs/toolkit": "^1.9.7",
"avataaars": "^2.0.0",
"classnames": "^2.5.1",
"file-saver": "^2.0.5",
"i18next": "^23.14.0",
"i18next": "^23.15.1",
"i18next-browser-languagedetector": "^8.0.0",
"js-cookie": "^3.0.5",
"linkify-react": "^4.1.3",
"linkifyjs": "^4.1.3",
"marked": "14.1.1",
"marked": "14.1.2",
"plausible-tracker": "^0.3.9",
"qrcode.react": "^4.0.1",
"query-string": "^9.1.0",
Expand All @@ -36,10 +36,10 @@
"react-focus-lock": "^2.13.2",
"react-helmet": "^6.1.0",
"react-hotkeys-hook": "^4.5.1",
"react-i18next": "^15.0.1",
"react-i18next": "^15.0.2",
"react-redux": "^9.1.2",
"react-router": "^6.22.0",
"react-router-dom": "^6.26.1",
"react-router-dom": "^6.26.2",
"react-to-print": "^2.15.1",
"react-toastify": "^10.0.5",
"react-tooltip": "^5.28.0",
Expand All @@ -57,11 +57,11 @@
"@types/file-saver": "^2.0.7",
"@types/history": "^5.0.0",
"@types/i18next-fs-backend": "^1.1.5",
"@types/jest": "^29.5.12",
"@types/jest": "^29.5.13",
"@types/js-cookie": "^3.0.6",
"@types/node": "^22.5.4",
"@types/node": "^22.5.5",
"@types/qrcode.react": "^1.0.5",
"@types/react": "^18.3.5",
"@types/react": "^18.3.8",
"@types/react-dom": "^18.3.0",
"@types/react-helmet": "^6.1.11",
"@types/redux-mock-store": "^1.0.6",
Expand All @@ -72,7 +72,7 @@
"@typescript-eslint/parser": "^5.62.0",
"cross-env": "^7.0.3",
"cypress": "^13.14.2",
"eslint": "^8.57.0",
"eslint": "^8.57.1",
"eslint-config-airbnb": "19.0.4",
"eslint-config-airbnb-typescript": "^17.1.0",
"eslint-config-prettier": "^9.1.0",
Expand All @@ -83,10 +83,10 @@
"eslint-plugin-jsx-a11y": "6.10.0",
"eslint-plugin-only-warn": "^1.1.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-react": "7.35.2",
"eslint-plugin-react": "7.36.1",
"eslint-plugin-react-hooks": "4.6.2",
"hash-files": "^1.1.1",
"husky": "^9.1.5",
"husky": "^9.1.6",
"i18next-fs-backend": "^2.3.2",
"lint-staged": "^15.2.10",
"prettier": "^3.3.3",
Expand All @@ -95,11 +95,11 @@
"react-scripts": "^5.0.1",
"redux-mock-store": "^1.5.4",
"resize-observer-polyfill": "^1.5.1",
"sass": "^1.78.0",
"sass": "^1.79.3",
"stylelint": "^16.9.0",
"stylelint-config-standard": "^36.0.1",
"ts-jest": "^29.2.5",
"typescript": "^5.5.4"
"typescript": "^5.6.2"
},
"scripts": {
"start": "react-scripts start",
Expand Down
114 changes: 114 additions & 0 deletions src/components/ColorPicker/ColorPicker.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
@import "constants/style";

.color-picker {
z-index: $menu-item-z-index;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
padding-bottom: $spacing--xxs;
box-shadow: 0 0 20px rgba($navy--400, 0.12);
background-color: $gray--300;
list-style: none;
padding-left: 0;
margin-top: auto;
border-radius: $rounded--full;

&__item {
display: flex;
justify-content: center;
align-items: center;

&-button {
cursor: pointer;
border: none;
background: none;
padding: 0;
width: 40px;
height: 40px;
display: flex;
justify-content: center;
align-items: center;

&:focus-within {
> .column__header-color-option {
border: 3px solid var(--accent-color--100);
}
}

&:focus-visible {
border-radius: $rounded--full;
outline: none;
}
}
}
}

[theme="dark"] {
.color-picker {
background-color: $navy--600;

&__item {
&__button {
&:focus-visible {
border-radius: $rounded--full;
outline: none;
}
}
}
}
}

.column__header-color-option {
width: 24px;
height: 24px;
border-radius: $rounded--full;
background-color: var(--accent-color--400);
border: 3px solid $gray--300;

&--selected {
background-color: var(--accent-color--400);
border: 3px solid var(--accent-color--200);
}

&:hover,
&:focus-visible {
background-color: var(--accent-color--400);
border: 3px solid var(--accent-color--100);
}
}

[theme="dark"] {
.column__header-color-option {
border: 3px solid $navy--600;

&--selected {
border: 3px solid var(--accent-color--200);
}

&:hover,
&:focus-visible {
border: 3px solid var(--accent-color--100);
}
}
}

.fix-focus-lock-placement {
margin-top: auto;
}

@media #{$smartphone} {
.color-picker {
flex-direction: row-reverse;
position: absolute;
right: 0;
margin: auto;
justify-self: center;
padding-right: $spacing--xxs;
}

.fix-focus-lock-placement {
margin-top: initial;
margin-bottom: auto;
}
}
77 changes: 77 additions & 0 deletions src/components/ColorPicker/ColorPicker.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
import {useEffect} from "react";
import {useDispatch} from "react-redux";
import {uniqueId} from "underscore";
import ReactFocusLock from "react-focus-lock";
import {Color, getColorClassName, formatColorName} from "constants/colors";
import {Actions} from "../../store/action";
import {Tooltip} from "../Tooltip";

type ColorPickerProps = {
id: string;
name: string;
visible: boolean;
index: number;
color: Color;
onClose?: () => void;
colors: Color[];
closeColorPicker: () => void;
};

export const ColorPicker = (props: ColorPickerProps) => {
const dispatch = useDispatch();
const colorsWithoutSelectedColor = props.colors.filter((curColor) => curColor !== props.color);
const primColorAnchor = uniqueId(`color-picker-${props.color.toString()}`);

useEffect(() => {
const handleKeyPress = (e: KeyboardEvent) => {
if (e.key === "Escape") {
e.stopPropagation();
props.closeColorPicker();
}
};

document.addEventListener("keydown", handleKeyPress, true); // trigger in capture phase
return () => document.removeEventListener("keydown", handleKeyPress, true);
}, [props]);

return (
<ReactFocusLock autoFocus={false} className="fix-focus-lock-placement">
<ul className="color-picker">
<li className={`${getColorClassName(props.color)} color-picker__item`}>
<button
id={primColorAnchor}
aria-label={formatColorName(props.color)}
title={formatColorName(props.color)}
onClick={() => {
props.onClose?.();
dispatch(Actions.editColumn(props.id, {name: props.name, color: props.color, index: props.index, visible: props.visible}));
}}
className="color-picker__item-button"
>
<div className="column__header-color-option column__header-color-option--selected" />
</button>
<Tooltip anchorSelect={`#${primColorAnchor}`} content={formatColorName(props.color)} />
</li>
{colorsWithoutSelectedColor.map((item) => {
const anchor = uniqueId(`color-picker-${item.toString()}`);
return (
<li className={`${getColorClassName(item)} color-picker__item`}>
<button
id={anchor}
aria-label={formatColorName(item)}
title={formatColorName(item)}
onClick={() => {
props.onClose?.();
dispatch(Actions.editColumn(props.id, {name: props.name, color: item, index: props.index, visible: props.visible}));
}}
className={`${item.toString()} color-picker__item-button`}
>
<div className={`column__header-color-option column__header-color-option--${item.toString()}`} />
</button>
</li>
);
})}
</ul>
</ReactFocusLock>
);
};
8 changes: 5 additions & 3 deletions src/components/Column/Column.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,9 @@ export const Column = ({id, name, color, visible, index}: ColumnProps) => {
<Close className="column__header-edit-button-icon" />
</button>
)}
{!isTemporary && (
{!isTemporary && !openedColumnSettings && (
<button title={t("Column.settings")} className="column__header-edit-button" onClick={() => setOpenedColumnSettings((o) => !o)}>
{openedColumnSettings ? <Close className="column__header-edit-button-icon" /> : <ThreeDots className="column__header-edit-button-icon" />}
<ThreeDots className="column__header-edit-button-icon" style={{transform: "rotate(90deg)"}} /> {/* inline style to avoid funky rotating behaviour when hovering */}
</button>
)}
</>
Expand Down Expand Up @@ -212,7 +212,7 @@ export const Column = ({id, name, color, visible, index}: ColumnProps) => {
{notes.length}
</span>
)}
{isModerator && renderColumnModifiers()}
{!openedColumnSettings && isModerator && renderColumnModifiers()}
{openedColumnSettings && (
<ColumnSettings
id={id}
Expand All @@ -222,6 +222,8 @@ export const Column = ({id, name, color, visible, index}: ColumnProps) => {
index={index}
onClose={() => setOpenedColumnSettings(false)}
onNameEdit={() => setColumnNameMode("EDIT")}
setOpenColumnSet={setOpenedColumnSettings}
closeColumnSettings={() => setOpenedColumnSettings(false)}
/>
)}
</div>
Expand Down
Loading

0 comments on commit 82beea9

Please sign in to comment.