Cherry pick hidden card btn actions (#3261)

* Feature added: Pressing enter should create a category

* Followed the review request changed and updated the code

* Removed the submit attribute as it no longer been used

* Create .gitpod.yml (#3010)

* update board title when duplicated (#3011)

* Displayed only board members in autocomplete (#2969)

* Displayed only board members in autocomplete

* Removed debug logs

* update min version in Plugin and build (#3018)

* 2889 - Hiding images on share modal on personal (#2925)

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>

* GH-2469 Add board-bot to team (#3026)

* add bot to team before any mention or subscription notification

* allow duplicating cards/baords if filecopy fails (#3012)

* allow duplicating cards/baords if filecopy fails

* change back to error logs

* standardize env var naming (#3031)

* Translated using Weblate (Malayalam)

Currently translated at 100.0% (303 of 303 strings)

Translation: Focalboard/webapp
Translate-URL: https://translate.mattermost.com/projects/focalboard/webapp/ml/

* Update translation files

Updated by "Cleanup translation files" hook in Weblate.

Translation: Focalboard/webapp
Translate-URL: https://translate.mattermost.com/projects/focalboard/webapp/

Update translation files

Updated by "Cleanup translation files" hook in Weblate.

Translation: Focalboard/webapp
Translate-URL: https://translate.mattermost.com/projects/focalboard/webapp/

Update translation files

Updated by "Cleanup translation files" hook in Weblate.

Translation: Focalboard/webapp
Translate-URL: https://translate.mattermost.com/projects/focalboard/webapp/

* Translated using Weblate (German)

Currently translated at 100.0% (312 of 312 strings)

Translation: Focalboard/webapp
Translate-URL: https://translate.mattermost.com/projects/focalboard/webapp/de/

* implement personal server/desktop cloud advertising

* update for standard colors/button, add telemetry

* only display if active 24 hours

* remove log, update snapshot

* lint fixes

* more lint fixes

* fixes

* add copyright

* Updating UI

* All team users autocomplete new (#3016)

* WIP

* Made search debounced

* Lint fiX

* Fixed tests

* Calledn un-debounced version on first load

* Added delete feature in Table view (#2383)

* Added delete feature in Table view

* Fixed the build failure

* Added test cased for delete the row in table view

* Fixes for useMemo, useCallback and proposed CSS solution

* UI fixes

* Resolved the test-case issue

Co-authored-by: Rajat Dabade <rajat@Rajats-MacBook-Pro.local>

* fix broken jest test

* update singleUser to return workspace UpdateAt as getMe User createAt

* Translated using Weblate (Croatian)

Currently translated at 100.0% (312 of 312 strings)

Translation: Focalboard/webapp
Translate-URL: https://translate.mattermost.com/projects/focalboard/webapp/hr/

* Translated using Weblate (Persian)

Currently translated at 32.0% (100 of 312 strings)

Translation: Focalboard/webapp
Translate-URL: https://translate.mattermost.com/projects/focalboard/webapp/fa/

Added translation using Weblate (Persian)

* GH-2959 - Updating boards modal styling (#3048)

* GH-2959 - Updating boards modal styling

* Updating test

* update to version 7.2.0

* Refactor notify init (#3043)

* remove unneeded store interfaces

* - reduce dependencies for notifications service
- notifications service no longer concerned with web socket notifications

gnored, and an empty message aborts the commit.

* use app to add member to board

* remove unneeded API

* remove dependency on app package

* fix webapp jest

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>

* Adding the board default role for public boards (#2884)

* Adding the default role concept in the backend

* Adding the interface part

* Fix golang-ci lint errors

* Adding local permissions tests

* Address PR review comments

* Improving the code a bit

* Another small fix

* Renaming DefaultRole to MinimumRole

* Setting the minimum role at minimum to check the permissions per roles in the integration tests

* Adding the new minimum role behavior

* Fixing some tests

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>

* [GH-2442] Improve performance for table column resize (#3032)

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>

* update template, remove view (#3080)

* update template, remove view

* update new template file

* Translated using Weblate (Turkish)

Currently translated at 100.0% (313 of 313 strings)

Translation: Focalboard/webapp
Translate-URL: https://translate.mattermost.com/projects/focalboard/webapp/tr/

* Translated using Weblate (Persian)

Currently translated at 31.9% (100 of 313 strings)

Translation: Focalboard/webapp
Translate-URL: https://translate.mattermost.com/projects/focalboard/webapp/fa/

* Translated using Weblate (Hungarian)

Currently translated at 100.0% (313 of 313 strings)

Translation: Focalboard/webapp
Translate-URL: https://translate.mattermost.com/projects/focalboard/webapp/hu/

* Translated using Weblate (Chinese (Simplified))

Currently translated at 56.8% (178 of 313 strings)

Translation: Focalboard/webapp
Translate-URL: https://translate.mattermost.com/projects/focalboard/webapp/zh_Hans/

* Translated using Weblate (Polish)

Currently translated at 100.0% (313 of 313 strings)

Translation: Focalboard/webapp
Translate-URL: https://translate.mattermost.com/projects/focalboard/webapp/pl/

* Translated using Weblate (English (Australia))

Currently translated at 100.0% (313 of 313 strings)

Translation: Focalboard/webapp
Translate-URL: https://translate.mattermost.com/projects/focalboard/webapp/en_AU/

* Translated using Weblate (German)

Currently translated at 100.0% (313 of 313 strings)

Translation: Focalboard/webapp
Translate-URL: https://translate.mattermost.com/projects/focalboard/webapp/de/

* Translated using Weblate (Dutch)

Currently translated at 100.0% (313 of 313 strings)

Translation: Focalboard/webapp
Translate-URL: https://translate.mattermost.com/projects/focalboard/webapp/nl/

* Translated using Weblate (Chinese (Traditional))

Currently translated at 82.4% (258 of 313 strings)

Translation: Focalboard/webapp
Translate-URL: https://translate.mattermost.com/projects/focalboard/webapp/zh_Hant/

* Added a Dialog notification after clicking on the Cards hidden button (#3180)

* Added a Dailog notification after clicking on the Cards hidden button

* Reverted the unwanted changes

* Updated required snapshot

* Css fixed

* Snapshot update

* ESlinter fix

* Snapshot update

* Removed HiddenCardCountNotification and used cardLimitNotification template

* Update

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>

* Translated using Weblate (Malayalam)

Currently translated at 100.0% (303 of 303 strings)

Translation: Focalboard/webapp
Translate-URL: https://translate.mattermost.com/projects/focalboard/webapp/ml/

* Update translation files

Updated by "Cleanup translation files" hook in Weblate.

Translation: Focalboard/webapp
Translate-URL: https://translate.mattermost.com/projects/focalboard/webapp/

Update translation files

Updated by "Cleanup translation files" hook in Weblate.

Translation: Focalboard/webapp
Translate-URL: https://translate.mattermost.com/projects/focalboard/webapp/

Update translation files

Updated by "Cleanup translation files" hook in Weblate.

Translation: Focalboard/webapp
Translate-URL: https://translate.mattermost.com/projects/focalboard/webapp/

* Translated using Weblate (German)

Currently translated at 100.0% (312 of 312 strings)

Translation: Focalboard/webapp
Translate-URL: https://translate.mattermost.com/projects/focalboard/webapp/de/

* Added templates.boardarchive back

* Removed unwanted changes

* Update webapp/i18n/en.json

Co-authored-by: Rajat Dabade <rajat@Rajats-MacBook-Pro.local>
Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com>
Co-authored-by: Scott Bishel <scott.bishel@mattermost.com>
Co-authored-by: Harshil Sharma <18575143+harshilsharma63@users.noreply.github.com>
Co-authored-by: Asaad Mahmood <asaadmahmood@users.noreply.github.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Doug Lauder <wiggin77@warpmail.net>
Co-authored-by: Varghese Jose <varghese.jose@tutanota.com>
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: jprusch <rs@schaeferbarthold.de>
Co-authored-by: Milo Ivir <mail@milotype.de>
Co-authored-by: vaheeD khoshnouD <khoshnud@gmail.com>
Co-authored-by: Jesús Espino <jespinog@gmail.com>
Co-authored-by: kamre <eremchenko@gmail.com>
Co-authored-by: Kaya Zeren <kayazeren@gmail.com>
Co-authored-by: Abraham Foam <foam.abraham@gmail.com>
Co-authored-by: Tóth Csaba // Online ERP Hungary Kft <csaba.toth@online-erp.hu>
Co-authored-by: windane <windane@gmail.com>
Co-authored-by: master7 <marcin.karkosz@rajska.info>
Co-authored-by: Matthew Williams <Matthew.Williams@outlook.com.au>
Co-authored-by: JtheBAB <srast@bioc.uzh.ch>
Co-authored-by: Tom De Moor <tom@controlaltdieliet.be>
Co-authored-by: Su Jing Jhong <sujingjhong@gmail.com>
This commit is contained in:
Rajat Dabade 2022-06-21 23:21:58 +05:30 committed by GitHub
parent 484c3f213c
commit 56cc64f608
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 974 additions and 11 deletions

View file

@ -249,6 +249,7 @@
"TableHeaderMenu.sort-descending": "Sort descending",
"TableRow.delete": "Delete",
"TableRow.open": "Open",
"TableRow.delete": "Delete",
"TopBar.give-feedback": "Give feedback",
"URLProperty.copiedLink": "Copied!",
"URLProperty.copy": "Copy",
@ -337,4 +338,4 @@
"tutorial_tip.ok": "Next",
"tutorial_tip.out": "Opt out of these tips.",
"tutorial_tip.seen": "Seen this before?"
}
}

View file

@ -1,5 +1,760 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`components/centerPanel Clicking on the Hidden card count should open a dailog 1`] = `
<div>
<div
class="BoardComponent"
>
<div
class="top-head"
>
<div
class="TopBar"
>
<a
class="link"
href="https://www.focalboard.com/fwlink/feedback-focalboard.html?v=1.0.0"
rel="noreferrer"
target="_blank"
>
Give feedback
</a>
<a
href="https://www.focalboard.com/guide/user?utm_source=webapp"
rel="noreferrer"
target="_blank"
>
<i
class="CompassIcon icon-help-circle-outline HelpIcon"
/>
</a>
</div>
<div
class="mid-head"
>
<div
class="ViewTitle"
>
<div
class="add-buttons add-visible"
>
<button
type="button"
>
<i
class="CompassIcon icon-eye-off-outline undefined"
/>
<span>
hide description
</span>
</button>
</div>
<div
class="title"
>
<div
class="IconSelector"
>
<div
aria-label="menuwrapper"
class="MenuWrapper"
role="button"
>
<div
class="octo-icon size-m"
>
<span>
i
</span>
</div>
</div>
</div>
<input
class="Editable title"
placeholder="Untitled board"
spellcheck="true"
title="board title"
value="board title"
/>
</div>
<div
class="description"
>
<div
class="MarkdownEditor octo-editor "
>
<div
class="octo-editor-preview"
data-testid="preview-element"
/>
<div
class="MarkdownEditorInput MarkdownEditorInput--IsNotEditing"
>
<div
class="DraftEditor-root"
>
<div
class="DraftEditor-editorContainer"
>
<div
aria-autocomplete="list"
aria-expanded="false"
class="notranslate public-DraftEditor-content"
contenteditable="true"
role="combobox"
spellcheck="false"
style="outline: none; user-select: text; white-space: pre-wrap; word-wrap: break-word;"
>
<div
data-contents="true"
>
<div
class=""
data-block="true"
data-editor="123"
data-offset-key="123-0-0"
>
<div
class="public-DraftStyleDefault-block public-DraftStyleDefault-ltr"
data-offset-key="123-0-0"
>
<span
data-offset-key="123-0-0"
>
<span
data-text="true"
>
description
</span>
</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class="shareButtonWrapper"
>
<div
class="ShareBoardButton"
>
<button
title="Share board"
type="button"
>
<i
class="CompassIcon icon-lock-outline LockOutlineIcon"
/>
<span>
Share
</span>
</button>
</div>
</div>
</div>
<div
class="ViewHeader"
>
<div
class="viewSelector"
>
<input
class="Editable "
placeholder="Untitled View"
spellcheck="true"
title="view title"
value="view title"
/>
<div>
<div
aria-label="View menu"
class="MenuWrapper"
role="button"
>
<button
type="button"
>
<i
class="CompassIcon icon-chevron-down DropdownIcon"
/>
</button>
</div>
</div>
</div>
<div
class="octo-spacer"
/>
<div
aria-label="Properties menu"
class="MenuWrapper"
role="button"
>
<button
type="button"
>
<span>
Properties
</span>
</button>
</div>
<div
aria-label="menuwrapper"
class="MenuWrapper"
role="button"
>
<button
type="button"
>
<span>
Group by:
<span
id="groupByLabel"
>
name
</span>
</span>
</button>
</div>
<div
class="ModalWrapper"
>
<button
type="button"
>
<span>
Filter
</span>
</button>
</div>
<div
aria-label="menuwrapper"
class="MenuWrapper"
role="button"
>
<button
type="button"
>
<span>
Sort
</span>
</button>
</div>
<div
class="board-search-field"
>
<i
class="CompassIcon icon-magnify board-search-icon"
/>
<input
class="Editable "
placeholder="Search cards"
value=""
/>
</div>
<div
class="ModalWrapper"
>
<div
aria-label="View header menu"
class="MenuWrapper"
role="button"
>
<button
type="button"
>
<i
class="CompassIcon icon-dots-horizontal OptionsIcon"
/>
</button>
</div>
</div>
<div
class="ButtonWithMenu"
>
<div
class="button-text"
>
New
</div>
<div
aria-label="menuwrapper"
class="MenuWrapper"
role="button"
>
<div
class="button-dropdown"
>
<i
class="CompassIcon icon-chevron-down DropdownIcon"
/>
</div>
</div>
</div>
</div>
</div>
<div
class="Table"
>
<div
class="octo-table-body"
>
<div
class="octo-table-header TableHeaders"
id="mainBoardHeader"
>
<div
class="octo-table-cell header-cell"
style="overflow: unset; opacity: 1; width: 100px;"
>
<div
aria-label="menuwrapper"
class="MenuWrapper"
role="button"
>
<span
class="Label empty "
>
Name
</span>
</div>
<div
class="octo-spacer"
/>
<div
class="HorizontalGrip"
/>
</div>
</div>
<div
class="table-row-container"
>
<div
class="octo-table-group"
>
<div
class="octo-group-header-cell expanded"
draggable="true"
style="opacity: 1;"
>
<div
class="octo-table-cell"
style="width: 100px;"
>
<button
type="button"
>
<svg
class="DisclosureTriangleIcon Icon"
viewBox="0 0 100 100"
xmlns="http://www.w3.org/2000/svg"
>
<polygon
points="37,35 37,65 63,50"
/>
</svg>
</button>
<span
class="Label empty "
title="Items with an empty name property will go here. This column cannot be removed."
>
No name
</span>
</div>
<button
type="button"
>
<span>
0
</span>
</button>
<div
aria-label="menuwrapper"
class="MenuWrapper"
role="button"
>
<button
type="button"
>
<i
class="CompassIcon icon-dots-horizontal OptionsIcon"
/>
</button>
</div>
<button
type="button"
>
<i
class="CompassIcon icon-plus AddIcon"
/>
</button>
</div>
</div>
<div
class="octo-table-group"
>
<div
class="octo-group-header-cell expanded"
draggable="true"
style="opacity: 1;"
>
<div
class="octo-table-cell"
style="width: 100px;"
>
<button
type="button"
>
<svg
class="DisclosureTriangleIcon Icon"
viewBox="0 0 100 100"
xmlns="http://www.w3.org/2000/svg"
>
<polygon
points="37,35 37,65 63,50"
/>
</svg>
</button>
<span
class="Label propColorOrange "
>
<input
class="Editable "
placeholder="New Select"
spellcheck="true"
title="Q1"
value="Q1"
/>
</span>
</div>
<button
type="button"
>
<span>
2
</span>
</button>
<div
aria-label="menuwrapper"
class="MenuWrapper"
role="button"
>
<button
type="button"
>
<i
class="CompassIcon icon-dots-horizontal OptionsIcon"
/>
</button>
</div>
<button
type="button"
>
<i
class="CompassIcon icon-plus AddIcon"
/>
</button>
</div>
<div
class="TableRow octo-table-row"
draggable="true"
style="opacity: 1;"
>
<div
class="action-cell octo-table-cell-btn"
>
<div
aria-label="menuwrapper"
class="MenuWrapper optionsMenu"
role="button"
>
<button
aria-label="MenuBtn"
title="MenuBtn"
type="button"
>
<i
class="CompassIcon icon-dots-horizontal OptionsIcon"
/>
</button>
</div>
<button
type="button"
>
<svg
class="GripIcon Icon"
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M0 0h24v24H0V0z"
fill="none"
/>
<path
d="M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2zm-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"
/>
</svg>
</button>
</div>
<div
class="octo-table-cell title-cell"
id="mainBoardHeader"
style="width: 100px;"
>
<div
class="octo-icontitle"
>
<div
class="octo-icon"
>
i
</div>
<input
class="Editable "
placeholder="Untitled"
spellcheck="true"
title="card1"
value="card1"
/>
</div>
<div
class="open-button"
>
<button
type="button"
>
<span>
Open
</span>
</button>
</div>
</div>
</div>
<div
class="TableRow octo-table-row"
draggable="true"
style="opacity: 1;"
>
<div
class="action-cell octo-table-cell-btn"
>
<div
aria-label="menuwrapper"
class="MenuWrapper optionsMenu"
role="button"
>
<button
aria-label="MenuBtn"
title="MenuBtn"
type="button"
>
<i
class="CompassIcon icon-dots-horizontal OptionsIcon"
/>
</button>
</div>
<button
type="button"
>
<svg
class="GripIcon Icon"
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M0 0h24v24H0V0z"
fill="none"
/>
<path
d="M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2zm-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"
/>
</svg>
</button>
</div>
<div
class="octo-table-cell title-cell"
id="mainBoardHeader"
style="width: 100px;"
>
<div
class="octo-icontitle"
>
<div
class="octo-icon"
>
i
</div>
<input
class="Editable "
placeholder="Untitled"
spellcheck="true"
title="card2"
value="card2"
/>
</div>
<div
class="open-button"
>
<button
type="button"
>
<span>
Open
</span>
</button>
</div>
</div>
</div>
</div>
<div
class="octo-table-group"
>
<div
class="octo-group-header-cell expanded"
draggable="true"
style="opacity: 1;"
>
<div
class="octo-table-cell"
style="width: 100px;"
>
<button
type="button"
>
<svg
class="DisclosureTriangleIcon Icon"
viewBox="0 0 100 100"
xmlns="http://www.w3.org/2000/svg"
>
<polygon
points="37,35 37,65 63,50"
/>
</svg>
</button>
<span
class="Label propColorBlue "
>
<input
class="Editable "
placeholder="New Select"
spellcheck="true"
title="Q2"
value="Q2"
/>
</span>
</div>
<button
type="button"
>
<span>
0
</span>
</button>
<div
aria-label="menuwrapper"
class="MenuWrapper"
role="button"
>
<button
type="button"
>
<i
class="CompassIcon icon-dots-horizontal OptionsIcon"
/>
</button>
</div>
<button
type="button"
>
<i
class="CompassIcon icon-plus AddIcon"
/>
</button>
</div>
</div>
</div>
<div
class="octo-table-footer"
/>
<div
class="CalculationRow octo-table-row"
>
<div
class="Calculation count octo-table-cell "
style="width: 100px;"
tabindex="0"
>
<span
class="calculationLabel"
>
Count
</span>
<span
class="calculationValue"
>
2
</span>
</div>
</div>
</div>
<div
class="HiddenCardCount"
>
<div
class="hidden-card-title"
>
Cards hidden
</div>
<button
title="hidden-card-count"
type="button"
>
<span>
2
</span>
</button>
</div>
</div>
<div
class="NotificationBox"
>
<div
class="NotificationBox__icon"
>
<i
class="CompassIcon icon-alert-outline AlertIcon"
/>
</div>
<div
class="content"
>
<p
class="title"
>
2 cards hidden from board
</p>
Card limit reached, to view older cards,
<a>
upgrade to a paid plan
</a>
</div>
<button
type="button"
>
<i
class="CompassIcon icon-close CloseIcon"
/>
</button>
</div>
</div>
</div>
`;
exports[`components/centerPanel return centerPanel and click on card to show card 1`] = `
<div>
<div

View file

@ -106,6 +106,7 @@ const BoardTemplateSelectorPreview = (props: Props) => {
addCard={() => Promise.resolve()}
showCard={() => null}
hiddenCardsCount={0}
showHiddenCardCountNotification={() => null}
/>}
{activeView?.fields.viewType === 'table' &&
<Table
@ -122,6 +123,7 @@ const BoardTemplateSelectorPreview = (props: Props) => {
addCard={() => Promise.resolve()}
showCard={() => null}
hiddenCardsCount={0}
showHiddenCardCountNotification={() => null}
/>}
{activeView?.fields.viewType === 'gallery' &&
<Gallery
@ -133,6 +135,7 @@ const BoardTemplateSelectorPreview = (props: Props) => {
onCardClicked={() => null}
addCard={() => Promise.resolve()}
hiddenCardsCount={0}
showHiddenCardCountNotification={() => null}
/>}
{activeView?.fields.viewType === 'calendar' &&
<CalendarFullView

View file

@ -14,10 +14,15 @@ import octoClient from '../octoClient'
import NotificationBox from '../widgets/notification-box'
type Props = {
showHiddenCardNotification: boolean
hiddenCardCountNotificationHandler: (show: boolean) => void
}
const snoozeTime = 1000 * 60 * 60 * 24 * 10
const checkSnoozeInterval = 1000 * 60 * 5
const CardLimitNotification = () => {
const CardLimitNotification = (props: Props) => {
const intl = useIntl()
const [time, setTime] = useState(Date.now())
@ -68,6 +73,10 @@ const CardLimitNotification = () => {
{cards: hiddenCards},
)
if (!show && props.showHiddenCardNotification) {
show = true
}
if (hiddenCards > 0 && time > snoozedUntil) {
show = true
}
@ -110,12 +119,17 @@ const CardLimitNotification = () => {
return null
}
const hidHiddenCardNotification = () => {
show = false
props.hiddenCardCountNotificationHandler(false)
}
return (
<NotificationBox
icon={<AlertIcon/>}
title={title}
onClose={onClose}
closeTooltip={intl.formatMessage({
onClose={props.showHiddenCardNotification ? hidHiddenCardNotification : onClose}
closeTooltip={props.showHiddenCardNotification ? '' : intl.formatMessage({
id: 'notification-box-card-limit-reached.close-tooltip',
defaultMessage: 'Snooze for 10 days',
})}

View file

@ -530,3 +530,131 @@ describe('components/centerPanel', () => {
})
})
})
describe('components/centerPanel', () => {
const board = TestBlockFactory.createBoard()
board.id = '1'
const activeView = TestBlockFactory.createBoardView(board)
activeView.id = '1'
const card1 = TestBlockFactory.createCard(board)
card1.id = '1'
card1.title = 'card1'
card1.fields.properties = {id: 'property_value_id_1'}
card1.limited = true
const card2 = TestBlockFactory.createCard(board)
card2.id = '2'
card2.title = 'card2'
card2.fields.properties = {id: 'property_value_id_1'}
card2.limited = true
const comment1 = TestBlockFactory.createComment(card1)
comment1.id = '1'
const comment2 = TestBlockFactory.createComment(card2)
comment2.id = '2'
const groupProperty: IPropertyTemplate = {
id: 'id',
name: 'name',
type: 'text',
options: [
{
color: 'propColorOrange',
id: 'property_value_id_1',
value: 'Q1',
},
{
color: 'propColorBlue',
id: 'property_value_id_2',
value: 'Q2',
},
],
}
const state = {
clientConfig: {
value: {
featureFlags: {
subscriptions: true,
},
},
},
searchText: '',
users: {
me: {
id: 'user_id_1',
props: {
focalboard_onboardingTourStarted: false,
},
},
workspaceUsers: [
{username: 'username_1'},
],
boardUsers: [
{username: 'username_1'},
],
blockSubscriptions: [],
},
teams: {
current: {id: 'team-id'},
},
boards: {
current: board.id,
boards: {
[board.id]: board,
},
templates: [],
myBoardMemberships: {
[board.id]: {userId: 'user_id_1', schemeAdmin: true},
},
},
cards: {
templates: [card1, card2],
cards: [card1, card2],
current: card1.id,
},
views: {
views: {
boardView: activeView,
},
current: 'boardView',
},
contents: {},
comments: {
comments: [comment1, comment2],
},
limits: {
limits: {
views: 0,
},
},
}
const store = mockStateStore([], state)
beforeAll(() => {
mockDOM()
console.error = jest.fn()
})
beforeEach(() => {
activeView.fields.viewType = 'board'
jest.clearAllMocks()
})
test('Clicking on the Hidden card count should open a dailog', () => {
activeView.fields.viewType = 'table'
activeView.fields.defaultTemplateId = '1'
const {container, getByTitle, getByText} = render(wrapDNDIntl(
<ReduxProvider store={store}>
<CenterPanel
cards={[card1, card2]}
views={[activeView]}
board={board}
activeView={activeView}
readonly={false}
showCard={jest.fn()}
groupByProperty={groupProperty}
shownCardId={card1.id}
hiddenCardsCount={2}
/>
</ReduxProvider>,
))
fireEvent.click(getByTitle('hidden-card-count'))
expect(getByText('2 cards hidden from board')).not.toBeNull()
expect(container).toMatchSnapshot()
})
})

View file

@ -76,6 +76,7 @@ const CenterPanel = (props: Props) => {
const intl = useIntl()
const [selectedCardIds, setSelectedCardIds] = useState<string[]>([])
const [cardIdToFocusOnRender, setCardIdToFocusOnRender] = useState('')
const [showHiddenCardCountNotification, setShowHiddenCardCountNotification] = useState(false)
const onboardingTourStarted = useAppSelector(getOnboardingTourStarted)
const onboardingTourCategory = useAppSelector(getOnboardingTourCategory)
@ -341,6 +342,10 @@ const CenterPanel = (props: Props) => {
e.stopPropagation()
}, [selectedCardIds, props.activeView, props.cards, showCard])
const hiddenCardCountNotifyHandler = useCallback((show: boolean) => {
setShowHiddenCardCountNotification(show)
}, [showHiddenCardCountNotification])
const showShareButton = !props.readonly && me?.id !== 'single-user'
const showShareLoginButton = props.readonly && me?.id !== 'single-user'
@ -349,13 +354,11 @@ const CenterPanel = (props: Props) => {
() => getVisibleAndHiddenGroups(cards, activeView.fields.visibleOptionIds, activeView.fields.hiddenOptionIds, groupByProperty),
[cards, activeView.fields.visibleOptionIds, activeView.fields.hiddenOptionIds, groupByProperty],
)
return (
<div
className='BoardComponent'
onClick={backgroundClicked}
>
<CardLimitNotification/>
{props.shownCardId &&
<RootPortal>
<CardDialog
@ -420,6 +423,7 @@ const CenterPanel = (props: Props) => {
addCard={addCard}
showCard={showCard}
hiddenCardsCount={props.hiddenCardsCount}
showHiddenCardCountNotification={hiddenCardCountNotifyHandler}
/>}
{activeView.fields.viewType === 'table' &&
<Table
@ -436,6 +440,7 @@ const CenterPanel = (props: Props) => {
addCard={addCard}
onCardClicked={cardClicked}
hiddenCardsCount={props.hiddenCardsCount}
showHiddenCardCountNotification={hiddenCardCountNotifyHandler}
/>}
{activeView.fields.viewType === 'calendar' &&
<CalendarFullView
@ -460,7 +465,12 @@ const CenterPanel = (props: Props) => {
selectedCardIds={selectedCardIds}
addCard={(show) => addCard('', show)}
hiddenCardsCount={props.hiddenCardsCount}
showHiddenCardCountNotification={hiddenCardCountNotifyHandler}
/>}
<CardLimitNotification
showHiddenCardNotification={showHiddenCardCountNotification}
hiddenCardCountNotificationHandler={hiddenCardCountNotifyHandler}
/>
</div>
)
}

View file

@ -65,7 +65,7 @@ exports[`src/components/gallery/Gallery limited card count check 1`] = `
<div
class="hidden-card-title"
>
Cards Hidden
Cards hidden
</div>
<button
class="Button"

View file

@ -83,6 +83,7 @@ describe('src/components/gallery/Gallery', () => {
selectedCardIds={[card.id]}
onCardClicked={jest.fn()}
hiddenCardsCount={0}
showHiddenCardCountNotification={jest.fn()}
/>
</ReduxProvider>,
))
@ -103,6 +104,7 @@ describe('src/components/gallery/Gallery', () => {
selectedCardIds={[card.id]}
onCardClicked={jest.fn()}
hiddenCardsCount={0}
showHiddenCardCountNotification={jest.fn()}
/>
</ReduxProvider>,
))
@ -123,6 +125,7 @@ describe('src/components/gallery/Gallery', () => {
selectedCardIds={[card.id]}
onCardClicked={jest.fn()}
hiddenCardsCount={0}
showHiddenCardCountNotification={jest.fn()}
/>
</ReduxProvider>,
))
@ -146,6 +149,7 @@ describe('src/components/gallery/Gallery', () => {
selectedCardIds={[card.id]}
onCardClicked={jest.fn()}
hiddenCardsCount={0}
showHiddenCardCountNotification={jest.fn()}
/>
</ReduxProvider>,
))
@ -163,6 +167,7 @@ describe('src/components/gallery/Gallery', () => {
selectedCardIds={[]}
onCardClicked={jest.fn()}
hiddenCardsCount={0}
showHiddenCardCountNotification={jest.fn()}
/>
</ReduxProvider>,
))
@ -232,6 +237,7 @@ describe('src/components/gallery/Gallery', () => {
selectedCardIds={[card1.id]}
onCardClicked={jest.fn()}
hiddenCardsCount={2}
showHiddenCardCountNotification={jest.fn()}
/>
</ReduxProvider>,
))

View file

@ -26,6 +26,7 @@ type Props = {
selectedCardIds: string[]
onCardClicked: (e: React.MouseEvent, card: Card) => void
hiddenCardsCount: number
showHiddenCardCountNotification: (show: boolean) => void
}
const Gallery = (props: Props): JSX.Element => {
@ -105,6 +106,7 @@ const Gallery = (props: Props): JSX.Element => {
<div className='gallery-hidden-cards'>
<HiddenCardCount
hiddenCardsCount={hiddenCardsCount}
showHiddenCardNotification={props.showHiddenCardCountNotification}
/>
</div>}
</div>

View file

@ -2,6 +2,10 @@
display: flex;
height: 30px;
&:hover {
cursor: pointer;
}
.hidden-card-title {
background: rgba(243, 192, 199, 0.2);
color: #d24b4e;

View file

@ -10,13 +10,21 @@ import './hiddenCardCount.scss'
type Props = {
hiddenCardsCount: number
showHiddenCardNotification: (show: boolean) => void
}
const HiddenCardCount = (props: Props): JSX.Element => {
const intl = useIntl()
const onClickHandler = () => {
props.showHiddenCardNotification(true)
}
return (
<div className='HiddenCardCount'>
<div className='hidden-card-title'>{intl.formatMessage({id: 'limitedCard.title', defaultMessage: 'Cards Hidden'})}</div>
<div
className='HiddenCardCount'
onClick={onClickHandler}
>
<div className='hidden-card-title'>{intl.formatMessage({id: 'limitedCard.title', defaultMessage: 'Cards hidden'})}</div>
<Button title='hidden-card-count'>{props.hiddenCardsCount}</Button>
</div>
)

View file

@ -128,6 +128,7 @@ describe('src/component/kanban/kanban', () => {
addCard={jest.fn()}
showCard={jest.fn()}
hiddenCardsCount={0}
showHiddenCardCountNotification={jest.fn()}
/>
</ReduxProvider>,
), {wrapper: MemoryRouter})
@ -163,6 +164,7 @@ describe('src/component/kanban/kanban', () => {
addCard={jest.fn()}
showCard={jest.fn()}
hiddenCardsCount={0}
showHiddenCardCountNotification={jest.fn()}
/>
</ReduxProvider>,
), {wrapper: MemoryRouter})
@ -197,6 +199,7 @@ describe('src/component/kanban/kanban', () => {
addCard={jest.fn()}
showCard={jest.fn()}
hiddenCardsCount={0}
showHiddenCardCountNotification={jest.fn()}
/>
</ReduxProvider>,
), {wrapper: MemoryRouter})
@ -233,6 +236,7 @@ describe('src/component/kanban/kanban', () => {
addCard={jest.fn()}
showCard={jest.fn()}
hiddenCardsCount={0}
showHiddenCardCountNotification={jest.fn()}
/>
</ReduxProvider>,
), {wrapper: MemoryRouter})
@ -279,6 +283,7 @@ describe('src/component/kanban/kanban', () => {
addCard={jest.fn()}
showCard={jest.fn()}
hiddenCardsCount={0}
showHiddenCardCountNotification={jest.fn()}
/>
</ReduxProvider>,
), {wrapper: MemoryRouter})
@ -325,6 +330,7 @@ describe('src/component/kanban/kanban', () => {
addCard={jest.fn()}
showCard={jest.fn()}
hiddenCardsCount={0}
showHiddenCardCountNotification={jest.fn()}
/>
</ReduxProvider>,
), {wrapper: MemoryRouter})
@ -372,6 +378,7 @@ describe('src/component/kanban/kanban', () => {
addCard={mockedAddCard}
showCard={jest.fn()}
hiddenCardsCount={0}
showHiddenCardCountNotification={jest.fn()}
/>
</ReduxProvider>,
), {wrapper: MemoryRouter})
@ -410,6 +417,7 @@ describe('src/component/kanban/kanban', () => {
addCard={jest.fn()}
showCard={jest.fn()}
hiddenCardsCount={0}
showHiddenCardCountNotification={jest.fn()}
/>
</ReduxProvider>,
), {wrapper: MemoryRouter})
@ -448,6 +456,7 @@ describe('src/component/kanban/kanban', () => {
addCard={jest.fn()}
showCard={jest.fn()}
hiddenCardsCount={0}
showHiddenCardCountNotification={jest.fn()}
/>
</ReduxProvider>,
), {wrapper: MemoryRouter})
@ -493,6 +502,7 @@ describe('src/component/kanban/kanban', () => {
addCard={jest.fn()}
showCard={jest.fn()}
hiddenCardsCount={0}
showHiddenCardCountNotification={jest.fn()}
/>
</ReduxProvider>,
), {wrapper: MemoryRouter})

View file

@ -42,6 +42,7 @@ type Props = {
addCard: (groupByOptionId?: string, show?:boolean) => Promise<void>
showCard: (cardId?: string) => void
hiddenCardsCount: number
showHiddenCardCountNotification: (show: boolean) => void
}
const ScrollingComponent = withScrolling('div')
@ -320,7 +321,10 @@ const Kanban = (props: Props) => {
))}
{hiddenCardsCount > 0 &&
<div className='ml-1'>
<HiddenCardCount hiddenCardsCount={hiddenCardsCount}/>
<HiddenCardCount
hiddenCardsCount={hiddenCardsCount}
showHiddenCardNotification={props.showHiddenCardCountNotification}
/>
</div>}
</div>}
</div>

View file

@ -2248,7 +2248,7 @@ exports[`components/table/Table limited card in table view 1`] = `
<div
class="hidden-card-title"
>
Cards Hidden
Cards hidden
</div>
<button
class="Button"

View file

@ -100,6 +100,7 @@ describe('components/table/Table', () => {
addCard={addCard}
onCardClicked={jest.fn()}
hiddenCardsCount={0}
showHiddenCardCountNotification={jest.fn()}
/>
</ReduxProvider>,
)
@ -129,6 +130,7 @@ describe('components/table/Table', () => {
addCard={addCard}
onCardClicked={jest.fn()}
hiddenCardsCount={0}
showHiddenCardCountNotification={jest.fn()}
/>
</ReduxProvider>,
)
@ -158,6 +160,7 @@ describe('components/table/Table', () => {
addCard={addCard}
onCardClicked={jest.fn()}
hiddenCardsCount={0}
showHiddenCardCountNotification={jest.fn()}
/>
</ReduxProvider>,
)
@ -194,6 +197,7 @@ describe('components/table/Table', () => {
addCard={addCard}
onCardClicked={jest.fn()}
hiddenCardsCount={0}
showHiddenCardCountNotification={jest.fn()}
/>
</ReduxProvider>,
)
@ -254,6 +258,7 @@ describe('components/table/Table', () => {
addCard={addCard}
onCardClicked={jest.fn()}
hiddenCardsCount={2}
showHiddenCardCountNotification={jest.fn()}
/>
</ReduxProvider>,
)
@ -361,6 +366,7 @@ describe('components/table/Table extended', () => {
addCard={addCard}
onCardClicked={jest.fn()}
hiddenCardsCount={0}
showHiddenCardCountNotification={jest.fn()}
/>
</ReduxProvider>,
)
@ -446,6 +452,7 @@ describe('components/table/Table extended', () => {
addCard={addCard}
onCardClicked={jest.fn()}
hiddenCardsCount={0}
showHiddenCardCountNotification={jest.fn()}
/>
</ReduxProvider>,
)
@ -504,6 +511,7 @@ describe('components/table/Table extended', () => {
addCard={addCard}
onCardClicked={jest.fn()}
hiddenCardsCount={0}
showHiddenCardCountNotification={jest.fn()}
/>
</ReduxProvider>,
)
@ -595,6 +603,7 @@ describe('components/table/Table extended', () => {
addCard={addCard}
onCardClicked={jest.fn()}
hiddenCardsCount={0}
showHiddenCardCountNotification={jest.fn()}
/>
</ReduxProvider>,
)
@ -647,6 +656,7 @@ describe('components/table/Table extended', () => {
addCard={jest.fn()}
onCardClicked={jest.fn()}
hiddenCardsCount={0}
showHiddenCardCountNotification={jest.fn()}
/>
</ReduxProvider>,
)

View file

@ -40,6 +40,7 @@ type Props = {
addCard: (groupByOptionId?: string) => Promise<void>
onCardClicked: (e: React.MouseEvent, card: Card) => void
hiddenCardsCount: number
showHiddenCardCountNotification: (show: boolean) => void
}
const Table = (props: Props): JSX.Element => {
@ -257,6 +258,7 @@ const Table = (props: Props): JSX.Element => {
{hiddenCardsCount > 0 &&
<HiddenCardCount
showHiddenCardNotification={props.showHiddenCardCountNotification}
hiddenCardsCount={hiddenCardsCount}
/>}
</div>

View file

@ -46,6 +46,7 @@
height: 44px;
font-size: 14px;
text-overflow: ellipsis;
background-color: rgb(255, 255, 255);
position: fixed;
z-index: 100;
}

View file

@ -9,6 +9,7 @@
display: flex;
padding: 22px;
width: 400px;
height: 116px;
z-index: 1000;
.NotificationBox__icon {
@ -27,6 +28,10 @@
}
}
.IconButton {
margin-left: auto;
}
.octo-tooltip {
font-size: 12px;
font-weight: 600;