diff --git a/src/components/Note/NoteAuthorList/NoteAuthorList.scss b/src/components/Note/NoteAuthorList/NoteAuthorList.scss
index 64da017093..f8a97b17fc 100644
--- a/src/components/Note/NoteAuthorList/NoteAuthorList.scss
+++ b/src/components/Note/NoteAuthorList/NoteAuthorList.scss
@@ -112,7 +112,7 @@ $max-name-length: 112px;
[theme="dark"] {
.note-author__container--self {
- background: rgba(var(--accent-color--dark-rgb), 0.6);
+ background: rgba(var(--accent-color--dark-rgb), 0.32);
}
.note__author-name {
diff --git a/src/components/NoteDialogComponents/NoteDialogNoteComponents/NoteDialogOptions/NoteDialogDeleteNoteButton.scss b/src/components/NoteDialogComponents/NoteDialogNoteComponents/NoteDialogOptions/NoteDialogDeleteNoteButton.scss
index f122e257b2..97cbdd6c18 100644
--- a/src/components/NoteDialogComponents/NoteDialogNoteComponents/NoteDialogOptions/NoteDialogDeleteNoteButton.scss
+++ b/src/components/NoteDialogComponents/NoteDialogNoteComponents/NoteDialogOptions/NoteDialogDeleteNoteButton.scss
@@ -7,8 +7,7 @@
display: flex;
justify-content: center;
align-items: center;
- background-color: rgba(var(--accent-color--light-rgb), 0.2);
- color: var(--accent-color--light);
+ color: var(--accent-color--600);
transition:
background-color 150ms ease-in-out,
color 150ms ease-in-out;
diff --git a/src/components/NoteDialogComponents/NoteDialogNoteComponents/NoteDialogOptions/NoteDialogNoteOptions.scss b/src/components/NoteDialogComponents/NoteDialogNoteComponents/NoteDialogOptions/NoteDialogNoteOptions.scss
index ff44295db5..060823ca90 100644
--- a/src/components/NoteDialogComponents/NoteDialogNoteComponents/NoteDialogOptions/NoteDialogNoteOptions.scss
+++ b/src/components/NoteDialogComponents/NoteDialogNoteComponents/NoteDialogOptions/NoteDialogNoteOptions.scss
@@ -19,16 +19,13 @@
width: 32px;
padding: 0;
border: 0;
- color: var(--accent-color--light);
- background-color: var(--accent-color--100);
+ color: var(--accent-color--600);
+ background-color: transparent;
border-radius: $rounded--full;
cursor: pointer;
transition:
background-color 80ms ease-in-out,
color 80ms ease-in-out;
- box-shadow:
- 0 1px 3px 0 rgba(var(--accent-color--light-rgb), 0.1),
- 0 1px 2px -1px rgba(var(--accent-color--light-rgb), 0.1);
> svg {
height: 100%;
@@ -36,9 +33,9 @@
}
&:hover {
- background-color: var(--accent-color--light);
- color: $gray--000;
+ color: var(--accent-color--500);
}
+
&:focus-visible {
outline: 2px solid var(--accent-color--light);
}
@@ -46,13 +43,12 @@
[theme="dark"] {
.note-option__button {
- background-color: rgba(var(--accent-color--dark-rgb), 0.6);
- color: var(--accent-color--dark);
+ color: var(--accent-color--400);
&:hover {
- background-color: var(--accent-color--light);
- color: $gray--000;
+ color: var(--accent-color--300);
}
+
&:focus-visible {
outline: 2px solid rgba(var(--accent-color--dark-rgb), 0.6);
}
diff --git a/src/components/NoteDialogComponents/NoteDialogNoteWrapper.scss b/src/components/NoteDialogComponents/NoteDialogNoteWrapper.scss
index f8298e002e..08756d185b 100644
--- a/src/components/NoteDialogComponents/NoteDialogNoteWrapper.scss
+++ b/src/components/NoteDialogComponents/NoteDialogNoteWrapper.scss
@@ -22,7 +22,7 @@
display: flex;
flex-direction: column;
align-items: center;
-
+ padding-bottom: $spacing--base;
gap: $spacing--base;
}
diff --git a/src/components/NoteInput/NoteInput.scss b/src/components/NoteInput/NoteInput.scss
index f6fb6c288c..cda38606db 100644
--- a/src/components/NoteInput/NoteInput.scss
+++ b/src/components/NoteInput/NoteInput.scss
@@ -84,7 +84,7 @@ $note-input__input-right: 40px;
.note-input__icon--add {
width: $icon--large;
height: $icon--large;
- color: var(--accent-color--light);
+ color: var(--accent-color--600);
align-self: center;
transition: all 0.08s ease-out;
}
@@ -133,6 +133,10 @@ $note-input__input-right: 40px;
.note-input__input {
color: $gray--000;
}
+
+ .note-input__icon--add {
+ color: var(--accent-color--400);
+ }
}
@keyframes fade-in {
diff --git a/src/components/Votes/VoteButtons/AddVoteButton.scss b/src/components/Votes/VoteButtons/AddVoteButton.scss
index eca823af30..1642f8b5af 100644
--- a/src/components/Votes/VoteButtons/AddVoteButton.scss
+++ b/src/components/Votes/VoteButtons/AddVoteButton.scss
@@ -10,16 +10,24 @@
width: 32px;
background-color: var(--accent-color--100);
- color: var(--accent-color--light);
+ color: var(--accent-color--600);
transition:
background-color 80ms ease-in-out,
color 80ms ease-in-out;
- box-shadow:
- 0 1px 3px 0 rgba(var(--accent-color--light-rgb), 0.1),
- 0 1px 2px -1px rgba(var(--accent-color--light-rgb), 0.1);
-}
-.vote-button-add:disabled {
- opacity: 0.5;
+
+ &:enabled:hover {
+ background-color: var(--accent-color--light);
+ color: $gray--000;
+ }
+
+ &:focus-visible {
+ outline: 2px solid rgba(var(--accent-color--light-rgb), 0.5);
+ }
+
+ &:disabled {
+ background-color: $gray--200;
+ color: $gray--600;
+ }
}
.vote-button-add__icon {
@@ -28,22 +36,23 @@
color: inherit;
pointer-events: none;
}
-.vote-button-add:enabled:hover {
- background-color: var(--accent-color--light);
- color: $gray--000;
-}
-.vote-button-add:focus-visible {
- outline: 2px solid rgba(var(--accent-color--light-rgb), 0.5);
-}
[theme="dark"] {
.vote-button-add {
- background-color: rgba(var(--accent-color--dark-rgb), 0.6);
- color: var(--accent-color--dark);
- filter: drop-shadow(0 3px 4px rgba($navy--900, 0.16));
+ color: var(--accent-color--500);
+ background-color: rgba(var(--accent-color--400-rgb), 0.24);
+
+ &--high-contrast {
+ color: var(--accent-color--200);
+ }
&:enabled:hover {
background-color: var(--accent-color--dark);
}
+
+ &:disabled {
+ background-color: $navy--300;
+ color: $navy--100;
+ }
}
}
diff --git a/src/components/Votes/VoteButtons/AddVoteButton.tsx b/src/components/Votes/VoteButtons/AddVoteButton.tsx
index 0af493f79b..5b27933c16 100644
--- a/src/components/Votes/VoteButtons/AddVoteButton.tsx
+++ b/src/components/Votes/VoteButtons/AddVoteButton.tsx
@@ -5,13 +5,12 @@ import {Plus} from "components/Icon";
import "./AddVoteButton.scss";
import {useAppDispatch} from "store";
import {addVote} from "store/features";
+import classNames from "classnames";
+import {needsHighContrast} from "constants/colors";
-type AddVoteProps = {
- noteId: string;
- disabled: boolean;
-};
+type AddVoteProps = {noteId: string; disabled: boolean; disabledReason?: string; colorClassName?: string};
-export const AddVoteButton: FC
= ({noteId, disabled}) => {
+export const AddVoteButton: FC = ({noteId, disabled, disabledReason, colorClassName}) => {
const dispatch = useAppDispatch();
const {t} = useTranslation();
@@ -20,7 +19,13 @@ export const AddVoteButton: FC = ({noteId, disabled}) => {
};
return (
-
+
);
diff --git a/src/components/Votes/VoteButtons/RemoveVoteButton.scss b/src/components/Votes/VoteButtons/RemoveVoteButton.scss
index 25ebe93b7f..909d518045 100644
--- a/src/components/Votes/VoteButtons/RemoveVoteButton.scss
+++ b/src/components/Votes/VoteButtons/RemoveVoteButton.scss
@@ -10,38 +10,41 @@
align-items: center;
overflow: hidden;
background-color: var(--accent-color--100);
- color: var(--accent-color--light);
+ color: var(--accent-color--600);
transition:
background-color 80ms ease-in-out,
color 80ms ease-in-out;
- box-shadow:
- 0 1px 3px 0 rgba(var(--accent-color--light-rgb), 0.1),
- 0 1px 2px -1px rgba(var(--accent-color--light-rgb), 0.1);
-}
-.vote-button-remove:disabled {
- cursor: default;
-}
-
-.vote-button-remove:active {
- transform: none;
-}
-
-.vote-button-remove:enabled:hover {
- background-color: var(--accent-color--light);
- color: $gray--000;
- .vote-button-remove__count {
- display: none;
+ &:disabled {
+ cursor: default;
}
- .vote-button-remove__icon {
- display: block;
+
+ &:active {
+ transform: none;
}
-}
-.vote-button-remove:focus-visible {
- outline: 2px solid rgba(var(--accent-color--light-rgb), 0.5);
- .vote-button-remove__icon {
- display: block;
+ &:enabled {
+ &:focus-visible {
+ outline: 2px solid rgba(var(--accent-color--light-rgb), 0.5);
+ }
+
+ &:hover,
+ &:focus-visible {
+ background-color: var(--accent-color--light);
+ color: $gray--000;
+
+ .vote-button-remove__count {
+ display: none;
+ }
+
+ .vote-button-remove__icon {
+ display: block;
+ }
+
+ > .vote-button-remove__folded-corner {
+ border-width: 12px 0 0 12px;
+ }
+ }
}
}
@@ -52,7 +55,7 @@
}
.bump {
- animation: bump 0.2s linear;
+ animation: bump 0.2s ease-out;
}
@keyframes bump {
@@ -85,15 +88,14 @@
transition: border-width 0.15s ease-in-out;
}
-.vote-button-remove:enabled:hover > .vote-button-remove__folded-corner {
- border-width: 12px 0 0 12px;
-}
-
[theme="dark"] {
.vote-button-remove {
- color: $gray--000;
- background-color: rgba(var(--accent-color--dark-rgb), 0.6);
- filter: drop-shadow(0 3px 4px rgba($navy--900, 0.16));
+ color: var(--accent-color--500);
+ background-color: rgba(var(--accent-color--400-rgb), 0.24);
+
+ &--high-contrast {
+ color: var(--accent-color--200);
+ }
&:enabled:hover {
background-color: var(--accent-color--dark);
diff --git a/src/components/Votes/VoteButtons/RemoveVoteButton.tsx b/src/components/Votes/VoteButtons/RemoveVoteButton.tsx
index 71d91613f5..a173ef82ad 100644
--- a/src/components/Votes/VoteButtons/RemoveVoteButton.tsx
+++ b/src/components/Votes/VoteButtons/RemoveVoteButton.tsx
@@ -6,14 +6,16 @@ import {Minus} from "components/Icon";
import "./RemoveVoteButton.scss";
import {useAppDispatch} from "store";
import {deleteVote} from "store/features";
+import {needsHighContrast} from "constants/colors";
type RemoveVoteProps = {
noteId: string;
disabled?: boolean;
numberOfVotes: number;
+ colorClassName?: string;
};
-export const RemoveVoteButton: FC = ({noteId, disabled, numberOfVotes}) => {
+export const RemoveVoteButton: FC = ({noteId, disabled, numberOfVotes, colorClassName}) => {
const dispatch = useAppDispatch();
const {t} = useTranslation();
@@ -34,13 +36,14 @@ export const RemoveVoteButton: FC = ({noteId, disabled, numberO
return (
{
setDoBump(false);
}}
+ dataTooltipId="scrumlr-tooltip"
+ dataTooltipContent={disabled ? t("Votes.VotesOnNote", {count: numberOfVotes}) : t("Votes.RemoveVote")}
>
diff --git a/src/components/Votes/Votes.tsx b/src/components/Votes/Votes.tsx
index 37f304c5f9..10d7da5f79 100644
--- a/src/components/Votes/Votes.tsx
+++ b/src/components/Votes/Votes.tsx
@@ -1,4 +1,5 @@
import {FC} from "react";
+import {useTranslation} from "react-i18next";
import classNames from "classnames";
import _ from "underscore";
import {useAppSelector} from "store";
@@ -10,9 +11,12 @@ type VotesProps = {
noteId: string;
// Aggregate the votes of the child notes
aggregateVotes?: boolean;
+ colorClassName?: string;
};
export const Votes: FC = (props) => {
+ const {t} = useTranslation();
+
const voting = useAppSelector((state) => state.votings.open);
const ongoingVotes = useAppSelector(
(state) => ({
@@ -31,6 +35,19 @@ export const Votes: FC = (props) => {
const isModerator = useAppSelector((state) => ["OWNER", "MODERATOR"].some((role) => role === state.participants!.self?.role));
const boardLocked = useAppSelector((state) => state.board.data!.isLocked);
+ const addVotesDisabledReason = (): string => {
+ if (!voting) return "";
+
+ if (ongoingVotes.total === voting.voteLimit) {
+ return t("Votes.VoteLimitReached");
+ }
+ if (ongoingVotes.note > 0 && !voting.allowMultipleVotes) {
+ return t("Votes.MultipleVotesNotAllowed");
+ }
+
+ return "";
+ };
+
/**
* If there's no active voting going on and there are no casted votes for
* this note from previous votings, we don't need to render anything.
@@ -42,11 +59,18 @@ export const Votes: FC = (props) => {
return voting || allPastVotes > 0 ? (
e.stopPropagation()}>
{/* standard display for votes */}
- {!voting && allPastVotes > 0 && }
+ {!voting && allPastVotes > 0 && }
{/* display for votes when voting is open */}
- {voting && ongoingVotes.note > 0 && }
+ {voting && ongoingVotes.note > 0 && (
+
+ )}
{voting && (isModerator || !boardLocked) && (
- 0 && !voting.allowMultipleVotes)} />
+ 0 && !voting.allowMultipleVotes)}
+ disabledReason={addVotesDisabledReason()}
+ colorClassName={props.colorClassName}
+ />
)}
) : null;
diff --git a/src/components/Votes/__tests__/Votes.test.tsx b/src/components/Votes/__tests__/Votes.test.tsx
index 9f41e71ac2..a0a1c67f86 100644
--- a/src/components/Votes/__tests__/Votes.test.tsx
+++ b/src/components/Votes/__tests__/Votes.test.tsx
@@ -90,8 +90,8 @@ describe("Votes", () => {
expect(screen.queryByTitle(i18n.t("Votes.AddVote"))).not.toBeInTheDocument();
expect(screen.queryByTitle(i18n.t("Votes.RemoveVote"))).not.toBeInTheDocument();
- expect(screen.queryByTitle(i18n.t("Votes.VotesOnNote", {votes: 1}))).toBeInTheDocument();
- expect(screen.queryByTitle(i18n.t("Votes.VotesOnNote", {votes: 1}))).toBeDisabled();
+ expect(screen.queryByLabelText(i18n.t("Votes.VotesOnNote", {count: 1}))).toBeInTheDocument();
+ expect(screen.queryByLabelText(i18n.t("Votes.VotesOnNote", {count: 1}))).toBeDisabled();
});
it("add vote button should be visible and remove vote button not disabled on locked board if participant is moderator", () => {
@@ -115,12 +115,16 @@ describe("Votes", () => {
others: [],
focusInitiator: undefined,
},
+ votings: {
+ open: getTestVoting({allowMultipleVotes: true}),
+ past: [],
+ },
})
);
- expect(screen.getByTitle(i18n.t("Votes.AddVote"))).toBeInTheDocument();
- expect(screen.queryByTitle(i18n.t("Votes.RemoveVote"))).toBeInTheDocument();
- expect(screen.queryByTitle(i18n.t("Votes.RemoveVote"))).not.toBeDisabled();
- expect(screen.queryByTitle(i18n.t("Votes.VotesOnNote", {votes: 1}))).not.toBeInTheDocument();
+ expect(screen.queryByLabelText(i18n.t("Votes.AddVote"))).toBeInTheDocument();
+ expect(screen.queryByLabelText(i18n.t("Votes.RemoveVote"))).toBeInTheDocument();
+ expect(screen.queryByLabelText(i18n.t("Votes.RemoveVote"))).not.toBeDisabled();
+ expect(screen.queryByLabelText(i18n.t("Votes.VotesOnNote", {count: 1}))).not.toBeInTheDocument();
});
});
diff --git a/src/components/Votes/__tests__/__snapshots__/Votes.test.tsx.snap b/src/components/Votes/__tests__/__snapshots__/Votes.test.tsx.snap
index 6fb09491a4..2ee839427f 100644
--- a/src/components/Votes/__tests__/__snapshots__/Votes.test.tsx.snap
+++ b/src/components/Votes/__tests__/__snapshots__/Votes.test.tsx.snap
@@ -7,8 +7,10 @@ exports[`Votes should render correctly with no votes and active voting 1`] = `
role="none"
>