Merge branch 'develop' into feature/account-menu-react

This commit is contained in:
Antonella Sgarlatta
2021-06-10 11:01:10 -03:00
6 changed files with 17 additions and 11 deletions

View File

@@ -115,6 +115,7 @@ export const AutocompleteTagInput = observer(({ appState }: Props) => {
ref={dropdownRef} ref={dropdownRef}
className={`${tags.length > 0 ? 'w-80' : 'w-70 mr-10'} sn-dropdown flex flex-col py-2 absolute`} className={`${tags.length > 0 ? 'w-80' : 'w-70 mr-10'} sn-dropdown flex flex-col py-2 absolute`}
style={{ maxHeight: dropdownMaxHeight, maxWidth: tagsContainerMaxWidth }} style={{ maxHeight: dropdownMaxHeight, maxWidth: tagsContainerMaxWidth }}
onBlur={closeOnBlur}
> >
<div className="overflow-y-scroll"> <div className="overflow-y-scroll">
{autocompleteTagResults.map((tagResult) => ( {autocompleteTagResults.map((tagResult) => (

View File

@@ -126,7 +126,7 @@ const SessionsModal: FunctionComponent<{
return ( return (
<> <>
<Dialog onDismiss={close} className="sessions-modal h-screen py-8"> <Dialog onDismiss={close} className="sessions-modal h-90vh">
<div className="sk-modal-content"> <div className="sk-modal-content">
<div class="sn-component"> <div class="sn-component">
<div class="sk-panel"> <div class="sk-panel">

View File

@@ -267,6 +267,7 @@ class TagsViewCtrl extends PureViewCtrl<unknown, TagState> {
async clickedAddNewTag() { async clickedAddNewTag() {
if (this.getState().editingTag) { if (this.getState().editingTag) {
console.log('editing');
return; return;
} }
const newTag = await this.application.createTemplateItem( const newTag = await this.application.createTemplateItem(
@@ -289,10 +290,10 @@ class TagsViewCtrl extends PureViewCtrl<unknown, TagState> {
async saveTag($event: Event, tag: SNTag) { async saveTag($event: Event, tag: SNTag) {
($event.target! as HTMLInputElement).blur(); ($event.target! as HTMLInputElement).blur();
if (!this.titles[tag.uuid]?.length) {
return this.undoCreateTag(tag);
}
if (this.getState().templateTag) { if (this.getState().templateTag) {
if (!this.titles[tag.uuid]?.length) {
return this.undoCreateTag(tag);
}
return this.saveNewTag(); return this.saveNewTag();
} else { } else {
return this.saveTagRename(tag); return this.saveTagRename(tag);
@@ -314,6 +315,9 @@ class TagsViewCtrl extends PureViewCtrl<unknown, TagState> {
if (newTitle.length === 0) { if (newTitle.length === 0) {
this.titles[tag.uuid] = this.editingOriginalName; this.titles[tag.uuid] = this.editingOriginalName;
this.editingOriginalName = undefined; this.editingOriginalName = undefined;
await this.setState({
editingTag: undefined
});
return; return;
} }
const existingTag = this.application.findTagByTitle(newTitle); const existingTag = this.application.findTagByTitle(newTitle);
@@ -345,6 +349,7 @@ class TagsViewCtrl extends PureViewCtrl<unknown, TagState> {
this.application.alertService!.alert( this.application.alertService!.alert(
"A tag with this name already exists." "A tag with this name already exists."
); );
this.undoCreateTag(newTag);
return; return;
} }
const insertedTag = await this.application.insertItem(newTag); const insertedTag = await this.application.insertItem(newTag);

View File

@@ -259,8 +259,8 @@
height: 4.5rem; height: 4.5rem;
} }
.h-screen { .h-90vh {
height: 100vh; height: 90vh;
} }
.max-h-120 { .max-h-120 {

View File

@@ -71,7 +71,7 @@
"@reach/checkbox": "^0.13.2", "@reach/checkbox": "^0.13.2",
"@reach/dialog": "^0.13.0", "@reach/dialog": "^0.13.0",
"@standardnotes/sncrypto-web": "1.2.10", "@standardnotes/sncrypto-web": "1.2.10",
"@standardnotes/snjs": "2.6.0", "@standardnotes/snjs": "2.6.1",
"mobx": "^6.1.6", "mobx": "^6.1.6",
"mobx-react-lite": "^3.2.0", "mobx-react-lite": "^3.2.0",
"preact": "^10.5.12" "preact": "^10.5.12"

View File

@@ -1936,10 +1936,10 @@
"@standardnotes/sncrypto-common" "^1.2.7" "@standardnotes/sncrypto-common" "^1.2.7"
libsodium-wrappers "^0.7.8" libsodium-wrappers "^0.7.8"
"@standardnotes/snjs@2.6.0": "@standardnotes/snjs@2.6.1":
version "2.6.0" version "2.6.1"
resolved "https://registry.yarnpkg.com/@standardnotes/snjs/-/snjs-2.6.0.tgz#8ebdfcb0918c308198b38a63d7aa946387b83ac4" resolved "https://registry.yarnpkg.com/@standardnotes/snjs/-/snjs-2.6.1.tgz#45c3906086a649d03e5c139ef0b30fa90a639e65"
integrity sha512-Gb/kAdMtjVlSiQH7pkDzFxKtIrrY43i2hSejO2c+zCviZspiDZPpXLpEhMJ295ow2tluhOf8zfBUda3LMC6oDw== integrity sha512-ZuygivyJvqLMGeOurmg5K3lR0tk6zDgf53qIecFD8redaUpFicegeOlV+RW4m0QthU+ne74DHSCqk2U85oUxrA==
dependencies: dependencies:
"@standardnotes/auth" "^2.0.0" "@standardnotes/auth" "^2.0.0"
"@standardnotes/sncrypto-common" "^1.2.9" "@standardnotes/sncrypto-common" "^1.2.9"