From 85447fcdb901d1d03ac969e71e97520e1bb98cbb Mon Sep 17 00:00:00 2001 From: bobzel Date: Fri, 6 Sep 2024 13:57:03 -0400 Subject: removed calendar button. added metadata value input via tagsview --- src/client/views/DocumentButtonBar.tsx | 18 ------------------ src/client/views/TagsView.tsx | 15 +++++++++------ 2 files changed, 9 insertions(+), 24 deletions(-) (limited to 'src') diff --git a/src/client/views/DocumentButtonBar.tsx b/src/client/views/DocumentButtonBar.tsx index 58b7f207c..437ef045f 100644 --- a/src/client/views/DocumentButtonBar.tsx +++ b/src/client/views/DocumentButtonBar.tsx @@ -263,23 +263,6 @@ export class DocumentButtonBar extends ObservableReactComponent<{ views: () => ( ); } - @computed - get calendarButton() { - const targetDoc = this.view0?.Document; - return !targetDoc ? null : ( - Open calendar menu}> -
{ - CalendarManager.Instance.open(this.view0, targetDoc); - }}> - -
-
- ); - } - @computed get keywordButton() { return !DocumentView.Selected().length ? null : ( @@ -460,7 +443,6 @@ export class DocumentButtonBar extends ObservableReactComponent<{ views: () => ( {!DocumentView.Selected().some(v => v.allLinks.length) ? null :
{this.followLinkButton}
}
{this.pinButton}
{this.recordButton}
-
{this.calendarButton}
{this.keywordButton}
{!Doc.UserDoc().documentLinksButton_fullMenu ? null :
{this.shareButton}
}
{this.menuButton}
diff --git a/src/client/views/TagsView.tsx b/src/client/views/TagsView.tsx index 7723da900..2d583d392 100644 --- a/src/client/views/TagsView.tsx +++ b/src/client/views/TagsView.tsx @@ -283,15 +283,18 @@ export class TagsView extends ObservableReactComponent { }; /** - * Adds the specified tag to the Doc. If the tag is not prefixed with '#', then a '#' prefix is added. - * Whne the tag (after the '#') begins with '@', then a metadata key/value pair is displayed instead of - * just the tag. - * @param tag tag string to add + * Adds the specified tag or metadata to the Doc. If the tag is not prefixed with '#', then a '#' prefix is added. + * When the tag (after the '#') begins with '@', then a metadata key/value pair is displayed instead of + * just the tag. In addition, a suffix of : can be added to set a metadata value + * @param tag tag string to add (format: # | #@field(:(=)?value)? ) */ submitTag = undoable( action((tag: string) => { - const submittedLabel = tag.trim(); - submittedLabel && TagItem.addTagToDoc(this._props.View.Document, '#' + submittedLabel.replace(/^#/, '')); + const submittedLabel = tag.trim().replace(/^#/, '').split(':'); + if (submittedLabel[0]) { + TagItem.addTagToDoc(this._props.View.Document, '#' + submittedLabel[0]); + if (submittedLabel.length > 1) Doc.SetField(this._props.View.Document, submittedLabel[0].replace(/^@/, ''), ':' + submittedLabel[1]); + } this._currentInput = ''; // Clear the input box }), 'added doc label' -- cgit v1.2.3-70-g09d2