From 513ba86538ea0a84ebee24467c516e49955b13b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karol=20S=C3=B3jko?= Date: Wed, 5 Jan 2022 16:10:41 +0100 Subject: [PATCH 1/4] Revert "fix: system smart tags on empty account (#796)" This reverts commit f543bbe507f00032561f7a78cf96d3976f8634e9. --- app/assets/javascripts/ui_models/app_state/tags_state.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/assets/javascripts/ui_models/app_state/tags_state.ts b/app/assets/javascripts/ui_models/app_state/tags_state.ts index 905bcfa80..a825c7a88 100644 --- a/app/assets/javascripts/ui_models/app_state/tags_state.ts +++ b/app/assets/javascripts/ui_models/app_state/tags_state.ts @@ -86,8 +86,6 @@ export class TagsState { this.previouslySelected_ = undefined; this.editing_ = undefined; - this.smartTags = this.application.getSmartTags(); - makeObservable(this, { tags: observable.ref, smartTags: observable.ref, From 122f8fc2669aa14d0c196d87f02834d400b05f95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karol=20S=C3=B3jko?= Date: Wed, 5 Jan 2022 16:11:00 +0100 Subject: [PATCH 2/4] Revert "feat: allows duplicate names in tags folder & smart tags (#792)" This reverts commit a165fa9b4eb83545102c5c78b2f9174f3e98acdf. --- .../components/AutocompleteTagResult.tsx | 8 +-- app/assets/javascripts/components/NoteTag.tsx | 12 +--- .../ui_models/app_state/note_tags_state.ts | 39 +---------- .../ui_models/app_state/tags_state.ts | 64 +------------------ 4 files changed, 6 insertions(+), 117 deletions(-) diff --git a/app/assets/javascripts/components/AutocompleteTagResult.tsx b/app/assets/javascripts/components/AutocompleteTagResult.tsx index d732541af..84bb150ac 100644 --- a/app/assets/javascripts/components/AutocompleteTagResult.tsx +++ b/app/assets/javascripts/components/AutocompleteTagResult.tsx @@ -21,9 +21,6 @@ export const AutocompleteTagResult = observer( const tagResultRef = useRef(null); - const title = tagResult.title; - const prefixTitle = appState.noteTags.getPrefixTitle(tagResult); - const onTagOptionClick = async (tag: SNTag) => { await appState.noteTags.addTagToActiveNote(tag); appState.noteTags.clearAutocompleteSearch(); @@ -89,10 +86,9 @@ export const AutocompleteTagResult = observer( > - {prefixTitle && {prefixTitle}} {autocompleteSearchQuery === '' - ? title - : title + ? tagResult.title + : tagResult.title .split(new RegExp(`(${autocompleteSearchQuery})`, 'gi')) .map((substring, index) => ( { - const noteTags = appState.noteTags; - - const { autocompleteInputFocused, focusedTagUuid, tags } = noteTags; + const { autocompleteInputFocused, focusedTagUuid, tags } = appState.noteTags; const [showDeleteButton, setShowDeleteButton] = useState(false); const [tagClicked, setTagClicked] = useState(false); @@ -20,10 +18,6 @@ export const NoteTag = observer(({ appState, tag }: Props) => { const tagRef = useRef(null); - const title = tag.title; - const prefixTitle = noteTags.getPrefixTitle(tag); - const longTitle = noteTags.getLongTitle(tag); - const deleteTag = () => { appState.noteTags.focusPreviousTag(tag); appState.noteTags.removeTagFromActiveNote(tag); @@ -103,12 +97,10 @@ export const NoteTag = observer(({ appState, tag }: Props) => { onFocus={onFocus} onBlur={onBlur} tabIndex={getTabIndex()} - title={longTitle} > - {prefixTitle && {prefixTitle}} - {title} + {tag.title} {showDeleteButton && (