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

Fix/37847 - Show the tags in the first policyTagLists #38759

Merged
merged 49 commits into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
3566460
add multitag regex
Tony-MK Mar 19, 2024
04d2b59
introducted a new boolean agrument, defaulted to false, callled exclu…
Tony-MK Mar 19, 2024
cbd67a5
introducted a new boolean agrument, defaulted to false, callled exclu…
Tony-MK Mar 20, 2024
3dc48b4
Removing multitags
Tony-MK Mar 21, 2024
10a64ed
Merge branch 'fix/37847' of https://github.com/Tony-MK/Expensify-App …
Tony-MK Mar 21, 2024
3c73312
fix
Tony-MK Mar 21, 2024
a9ab2ac
Merge branch 'Expensify:main' into fix/37847
Tony-MK Mar 21, 2024
6dbefcf
fix
Tony-MK Mar 21, 2024
cb96df9
Refactoring ...
Tony-MK Mar 21, 2024
2260418
Merge branch 'main' of https://github.com/Tony-MK/Expensify-App
Tony-MK Mar 21, 2024
4c353a5
Merge branch 'fix/37847' of https://github.com/Tony-MK/Expensify-App …
Tony-MK Mar 21, 2024
69f3078
Merge branch 'main' of https://github.com/Tony-MK/Expensify-App
Tony-MK Mar 21, 2024
5392149
Merge branch 'fix/37847' of https://github.com/Tony-MK/Expensify-App …
Tony-MK Mar 27, 2024
102711b
Merge branch 'main' into fix/37847
Tony-MK Mar 27, 2024
b972238
CONST.ts revert
Tony-MK Mar 27, 2024
551d81d
revert
Tony-MK Mar 27, 2024
fd16783
reverting ...
Tony-MK Mar 27, 2024
6f8fc54
Merge branch 'main' of https://github.com/Expensify/App into fix/37847
Tony-MK Mar 29, 2024
39e2def
merge confilcts
Tony-MK Mar 29, 2024
8d56fad
prettier...
Tony-MK Mar 29, 2024
d77aa82
Merge branch 'main' of https://github.com/Expensify/App into fix/37847
Tony-MK Apr 3, 2024
821c0cc
Showing only the first tags policyTagList
Tony-MK Apr 4, 2024
07df0ac
prettier
Tony-MK Apr 4, 2024
993b1ed
Cleaning tag names
Tony-MK Apr 5, 2024
edf24b5
Merge branch 'main' of https://github.com/Expensify/App into fix/37847
Tony-MK Apr 5, 2024
e1e6630
Update src/pages/workspace/tags/WorkspaceTagsPage.tsx
Tony-MK Apr 6, 2024
3bccbe8
Refactoring Hello...
Tony-MK Apr 6, 2024
8cd8d17
Prettier..
Tony-MK Apr 6, 2024
203b838
Merge branch 'main' of https://github.com/Expensify/App into fix/37847
Tony-MK Apr 8, 2024
07d2cbd
reverted sort logic..
Tony-MK Apr 8, 2024
80c9fa9
cleaning tag name ...
Tony-MK Apr 9, 2024
a75b0d5
Cleaning tag names
Tony-MK Apr 9, 2024
9bcd1c4
revert and prettier..
Tony-MK Apr 9, 2024
019b2f7
WorkspaceTagsPage...
Tony-MK Apr 9, 2024
879064d
prettier and reverted...
Tony-MK Apr 9, 2024
9126e02
Merge branch 'main' into fix/37847
Tony-MK Apr 9, 2024
401f5bf
Slicing the policyTagLists to get the first policy tag
Tony-MK Apr 9, 2024
b638a4e
cleaning tags
Tony-MK Apr 10, 2024
b31929c
Refactoring...
Tony-MK Apr 10, 2024
eca9e4f
Merge branch 'main' of https://github.com/Expensify/App into fix/37847
Tony-MK Apr 11, 2024
e00c83c
Cleaning TagName WorkspaceEditTagsPage
Tony-MK Apr 11, 2024
611c3e2
fixing small bug for taglistName
Tony-MK Apr 12, 2024
8582e00
lint ...
Tony-MK Apr 12, 2024
db10bfd
Merge branch 'main' of https://github.com/Expensify/App into fix/37847
Tony-MK Apr 12, 2024
5fcac89
config/webpack/webpack.dev.ts
Tony-MK Apr 12, 2024
8d082af
Revert EditTagPage
Tony-MK Apr 12, 2024
7bc2047
EditTagPage.tsx
Tony-MK Apr 16, 2024
5e3b438
Merge branch 'main' of https://github.com/Expensify/App into fix/37847
Tony-MK Apr 16, 2024
8ad872e
Merge branch 'main' into fix/37847
Tony-MK Apr 17, 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
2 changes: 1 addition & 1 deletion src/pages/workspace/tags/EditTagPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function EditTagPage({route, policyTags}: EditTagPageProps) {
const styles = useThemeStyles();
const {translate} = useLocalize();
const {inputCallbackRef} = useAutoFocusInput();
const currentTagName = route.params.tagName;
const currentTagName = PolicyUtils.getCleanedTagName(route.params.tagName);

const validate = useCallback(
(values: FormOnyxValues<typeof ONYXKEYS.FORMS.WORKSPACE_TAG_FORM>) => {
Expand Down
4 changes: 2 additions & 2 deletions src/pages/workspace/tags/TagSettingsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function TagSettingsPage({route, policyTags}: TagSettingsPageProps) {
testID={TagSettingsPage.displayName}
>
<HeaderWithBackButton
title={route.params.tagName}
title={PolicyUtils.getCleanedTagName(route.params.tagName)}
shouldShowThreeDotsButton
shouldSetModalVisibility={false}
threeDotsAnchorPosition={styles.threeDotsPopoverOffset(windowWidth)}
Expand Down Expand Up @@ -122,7 +122,7 @@ function TagSettingsPage({route, policyTags}: TagSettingsPageProps) {
</OfflineWithFeedback>
<OfflineWithFeedback pendingAction={currentPolicyTag.pendingFields?.name}>
<MenuItemWithTopDescription
title={currentPolicyTag.name}
title={PolicyUtils.getCleanedTagName(currentPolicyTag.name)}
description={translate(`workspace.tags.tagName`)}
onPress={navigateToEditTag}
shouldShowRightIcon
Expand Down
6 changes: 4 additions & 2 deletions src/pages/workspace/tags/WorkspaceEditTagsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ function WorkspaceEditTagsPage({route, policyTags}: WorkspaceEditTagsPageProps)

const updateTaglistName = useCallback(
(values: FormOnyxValues<typeof ONYXKEYS.FORMS.POLICY_TAG_NAME_FORM>) => {
Policy.renamePolicyTaglist(route.params.policyID, {oldName: taglistName, newName: values[INPUT_IDS.POLICY_TAGS_NAME]}, policyTags);
if (values[INPUT_IDS.POLICY_TAGS_NAME] !== taglistName) {
Policy.renamePolicyTaglist(route.params.policyID, {oldName: taglistName, newName: values[INPUT_IDS.POLICY_TAGS_NAME]}, policyTags);
}
Navigation.goBack();
},
[policyTags, route.params.policyID, taglistName],
Expand Down Expand Up @@ -81,7 +83,7 @@ function WorkspaceEditTagsPage({route, policyTags}: WorkspaceEditTagsPageProps)
inputID={INPUT_IDS.POLICY_TAGS_NAME}
label={translate(`workspace.tags.customTagName`)}
accessibilityLabel={translate(`workspace.tags.customTagName`)}
defaultValue={taglistName}
defaultValue={PolicyUtils.getCleanedTagName(taglistName)}
Tony-MK marked this conversation as resolved.
Show resolved Hide resolved
role={CONST.ROLE.PRESENTATION}
ref={inputCallbackRef}
/>
Expand Down
5 changes: 3 additions & 2 deletions src/pages/workspace/tags/WorkspaceTagsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ function WorkspaceTagsPage({policyTags, route}: WorkspaceTagsPageProps) {
setSelectedTags({});
}, [isFocused]);

const policyTagLists = useMemo(() => PolicyUtils.getTagLists(policyTags), [policyTags]);
// We currently don't support multi level tags, so let's only get the first level tags.
const policyTagLists = useMemo(() => PolicyUtils.getTagLists(policyTags).slice(0, 1), [policyTags]);
Tony-MK marked this conversation as resolved.
Show resolved Hide resolved
const tagList = useMemo<PolicyForList[]>(
() =>
policyTagLists
Expand All @@ -101,7 +102,7 @@ function WorkspaceTagsPage({policyTags, route}: WorkspaceTagsPageProps) {
const isDisabled = tag.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE;
return {
value: tag.name,
text: tag.name,
text: PolicyUtils.getCleanedTagName(tag.name),
keyForList: tag.name,
isSelected: !!selectedTags[tag.name],
pendingAction: tag.pendingAction,
Expand Down
Loading