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

[FC-0036] feat: New "Add Tags" widget #834

Merged
merged 26 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
f19b21b
feat: Use react-select for tags selector
yusuf-musleh Feb 13, 2024
250cfbd
fix: Fix missing deps causing constant rerender
yusuf-musleh Feb 15, 2024
85b5025
feat: Add stagedContentTags state in react-select
yusuf-musleh Feb 18, 2024
80ef785
feat: Split up applied & staged content tags trees
yusuf-musleh Feb 20, 2024
80d9220
feat: Change style of implicit checkbox to checks
yusuf-musleh Feb 21, 2024
f121042
feat: Add bottom buttons in tags dropdown selector
yusuf-musleh Feb 21, 2024
70aa9c3
refactor: Remove cloneDeep + simplify code
yusuf-musleh Feb 27, 2024
bb783c9
feat: Update placeholder/button texts
yusuf-musleh Feb 27, 2024
45d9ae3
feat: Implement cancel button + add proptypes
yusuf-musleh Feb 27, 2024
f18c650
feat: Implement commit/cancel staged tags
yusuf-musleh Feb 28, 2024
b21e1c8
feat: Keep all staged tags only commit explicit
yusuf-musleh Feb 29, 2024
42f606a
feat: Change style of add/cancel/load more buttons
yusuf-musleh Feb 29, 2024
972a01d
feat: Add inline "Add" button to commit tags
yusuf-musleh Mar 2, 2024
00e8a19
fix: Keep applied tag checked when only staged child unchecked
yusuf-musleh Mar 3, 2024
6ca73d1
feat: Style add tags widget + staged tags
yusuf-musleh Mar 3, 2024
e68d08a
feat: Fixed some typing errors
yusuf-musleh Mar 3, 2024
9227bf8
test: Update tests to fix existing broken cases
yusuf-musleh Mar 4, 2024
34cc413
test: Add new functionality tests
yusuf-musleh Mar 5, 2024
0f2a608
chore: add types to ContentTagsCollapsible
bradenmacdonald Mar 9, 2024
4c2ba51
chore: add types for useContentTagsCollapsibleHelper
bradenmacdonald Mar 9, 2024
183bf2f
fix: Small bug with useIntl
yusuf-musleh Mar 10, 2024
35cd452
chore: Fix more linter issues
yusuf-musleh Mar 10, 2024
167d290
refactor: Separate stagedTags and stagedTagsTree state updates
yusuf-musleh Mar 10, 2024
c58e012
chore: Update package-lock.json
yusuf-musleh Mar 12, 2024
234afac
fix: Reset applied tags in selectbox when fetching
yusuf-musleh Mar 13, 2024
94581f1
chore: Update package.json
yusuf-musleh Mar 13, 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
197 changes: 195 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"react-responsive": "9.0.2",
"react-router": "6.16.0",
"react-router-dom": "6.16.0",
"react-select": "5.8.0",
"react-textarea-autosize": "^8.4.1",
"react-transition-group": "4.4.5",
"redux": "4.0.5",
Expand Down
39 changes: 39 additions & 0 deletions src/content-tags-drawer/ContentTagsCollapsible.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import type {} from 'react-select/base';
// This import is necessary for module augmentation.
// It allows us to extend the 'Props' interface in the 'react-select/base' module
// and add our custom property 'myCustomProp' to it.

export interface TagTreeEntry {
explicit: boolean;
children: Record<string, TagTreeEntry>;
canChangeObjecttag: boolean;
canDeleteObjecttag: boolean;
}

export interface TaxonomySelectProps {
taxonomyId: number;
searchTerm: string;
appliedContentTagsTree: Record<string, TagTreeEntry>;
stagedContentTagsTree: Record<string, TagTreeEntry>;
checkedTags: string[];
handleCommitStagedTags: () => void;
handleCancelStagedTags: () => void;
handleSelectableBoxChange: React.ChangeEventHandler;
}

// Unfortunately the only way to specify the custom props we pass into React Select
// is with this global type augmentation.
// https://react-select.com/typescript#custom-select-props
// If in the future other parts of this MFE need to use React Select for different things,
// we should change to using a 'react context' to share this data within <ContentTagsCollapsible>,
// rather than using the custom <Select> Props (selectProps).
declare module 'react-select/base' {
export interface Props<
Option,
IsMulti extends boolean,
Group extends GroupBase<Option>
> extends TaxonomySelectProps {
}
}

export default ContentTagsCollapsible;
Loading
Loading