From 6e09931952cadad693b51861fd4ae2c291993bf0 Mon Sep 17 00:00:00 2001 From: Artur Date: Tue, 29 Mar 2022 15:24:40 +0300 Subject: [PATCH 1/8] Preserve profile groups collapse state. use local storage rather than config store Remove config save and toggleGroupCollapse not to be async --- .../components/profilesSettingsTab.component.pug | 2 +- .../components/profilesSettingsTab.component.ts | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/tabby-settings/src/components/profilesSettingsTab.component.pug b/tabby-settings/src/components/profilesSettingsTab.component.pug index 6062a050..29199c5e 100644 --- a/tabby-settings/src/components/profilesSettingsTab.component.pug +++ b/tabby-settings/src/components/profilesSettingsTab.component.pug @@ -36,7 +36,7 @@ ul.nav-tabs(ngbNav, #nav='ngbNav') ng-container(*ngFor='let group of profileGroups') ng-container(*ngIf='isGroupVisible(group)') .list-group-item.list-group-item-action.d-flex.align-items-center( - (click)='group.collapsed = !group.collapsed' + (click)='toggleGroupCollapse(group)' ) .fa.fa-fw.fa-chevron-right(*ngIf='group.collapsed') .fa.fa-fw.fa-chevron-down(*ngIf='!group.collapsed') diff --git a/tabby-settings/src/components/profilesSettingsTab.component.ts b/tabby-settings/src/components/profilesSettingsTab.component.ts index 33405328..a910a831 100644 --- a/tabby-settings/src/components/profilesSettingsTab.component.ts +++ b/tabby-settings/src/components/profilesSettingsTab.component.ts @@ -143,6 +143,7 @@ export class ProfilesSettingsTabComponent extends BaseComponent { refresh (): void { this.profiles = this.config.store.profiles this.profileGroups = [] + const profileGroupCollapsed = JSON.parse(window.localStorage.profileGroupCollapsed ?? '{}') for (const profile of this.profiles) { let group = this.profileGroups.find(x => x.name === profile.group) @@ -151,7 +152,7 @@ export class ProfilesSettingsTabComponent extends BaseComponent { name: profile.group, profiles: [], editable: true, - collapsed: false, + collapsed: profileGroupCollapsed[profile.group ?? ''] ?? false, } this.profileGroups.push(group) } @@ -160,12 +161,14 @@ export class ProfilesSettingsTabComponent extends BaseComponent { this.profileGroups.sort((a, b) => a.name?.localeCompare(b.name ?? '') ?? -1) - this.profileGroups.push({ + const builtIn = { name: this.translate.instant('Built-in'), profiles: this.builtinProfiles, editable: false, collapsed: false, - }) + } + builtIn.collapsed = profileGroupCollapsed[builtIn.name ?? ''] ?? false + this.profileGroups.push(builtIn) } async editGroup (group: ProfileGroup): Promise { @@ -246,6 +249,13 @@ export class ProfilesSettingsTabComponent extends BaseComponent { }[this.profilesService.providerForProfile(profile)?.id ?? ''] ?? 'warning' } + toggleGroupCollapse (group: ProfileGroup): void { + group.collapsed = !group.collapsed + const profileGroupCollapsed = JSON.parse(window.localStorage.profileGroupCollapsed ?? '{}') + profileGroupCollapsed[group.name ?? ''] = group.collapsed + window.localStorage.profileGroupCollapsed = JSON.stringify(profileGroupCollapsed) + } + async editDefaults (provider: ProfileProvider): Promise { const modal = this.ngbModal.open( EditProfileModalComponent, From edc9656fd2524dde7d6dd4c7d2d002c19aa15fd7 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Tue, 29 Mar 2022 14:35:38 +0000 Subject: [PATCH 2/8] docs: update README.md [skip ci] --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index ba2efb24..a341e0ef 100644 --- a/README.md +++ b/README.md @@ -242,6 +242,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
Matheus Castello

๐Ÿ’ป
Jai A P

๐Ÿ“ฆ
Richard Yu

๐Ÿ’ป +
artu-ole

๐Ÿ’ป From ed2d1a1606e4039207c6aa7b25cc8fade66084bd Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Tue, 29 Mar 2022 14:35:39 +0000 Subject: [PATCH 3/8] docs: update README.zh-CN.md [skip ci] --- README.zh-CN.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.zh-CN.md b/README.zh-CN.md index c460e2cf..2a67611c 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -242,6 +242,7 @@
Matheus Castello

๐Ÿ’ป
Jai A P

๐Ÿ“ฆ
Richard Yu

๐Ÿ’ป +
artu-ole

๐Ÿ’ป From e71ac85ec33d79233c0be3f4f0e9ad22920f6cf7 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Tue, 29 Mar 2022 14:35:40 +0000 Subject: [PATCH 4/8] docs: update README.ru-RU.md [skip ci] --- README.ru-RU.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.ru-RU.md b/README.ru-RU.md index 5ed27cf0..9d29ca15 100644 --- a/README.ru-RU.md +++ b/README.ru-RU.md @@ -243,6 +243,7 @@ Pull-ะทะฐะฟั€ะพัั‹ ะธ ะฟะปะฐะณะธะฝั‹ ะฟั€ะธะฒะตั‚ัั‚ะฒัƒัŽั‚ัั!
Matheus Castello

๐Ÿ’ป
Jai A P

๐Ÿ“ฆ
Richard Yu

๐Ÿ’ป +
artu-ole

๐Ÿ’ป From 004a04640d300aba208d17ff4d501f207a2dfe65 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Tue, 29 Mar 2022 14:35:41 +0000 Subject: [PATCH 5/8] docs: update README.ko-KR.md [skip ci] --- README.ko-KR.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.ko-KR.md b/README.ko-KR.md index 9e3f9ef9..96538c40 100644 --- a/README.ko-KR.md +++ b/README.ko-KR.md @@ -237,6 +237,7 @@ Pull requests and plugins are welcome!
Matheus Castello

๐Ÿ’ป
Jai A P

๐Ÿ“ฆ
Richard Yu

๐Ÿ’ป +
artu-ole

๐Ÿ’ป From c9e8e54fe30fa80431157e87cbc6b5a30a868ed9 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Tue, 29 Mar 2022 14:35:42 +0000 Subject: [PATCH 6/8] docs: update README.it-IT.md [skip ci] --- README.it-IT.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.it-IT.md b/README.it-IT.md index b84d32d2..d7734555 100644 --- a/README.it-IT.md +++ b/README.it-IT.md @@ -243,6 +243,7 @@ Grazie a queste persone meravigliose ([emoji key](https://allcontributors.org/do
Matheus Castello

๐Ÿ’ป
Jai A P

๐Ÿ“ฆ
Richard Yu

๐Ÿ’ป +
artu-ole

๐Ÿ’ป From 9b8ae6d6be13f1d00e766dbb3e2662a9624915ac Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Tue, 29 Mar 2022 14:35:43 +0000 Subject: [PATCH 7/8] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 7e0e6a56..ad6235d8 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -673,6 +673,15 @@ "contributions": [ "code" ] + }, + { + "login": "artu-ole", + "name": "artu-ole", + "avatar_url": "https://avatars.githubusercontent.com/u/15938416?v=4", + "profile": "https://github.com/artu-ole", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7, From a9bcc0b206429aac840cfa23e1371a08c476a147 Mon Sep 17 00:00:00 2001 From: Eugene Pankov Date: Wed, 30 Mar 2022 14:20:06 +0200 Subject: [PATCH 8/8] sftp: fixed folder refresh after uploading --- tabby-ssh/src/components/sftpPanel.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tabby-ssh/src/components/sftpPanel.component.ts b/tabby-ssh/src/components/sftpPanel.component.ts index 599e841f..96ba5ee0 100644 --- a/tabby-ssh/src/components/sftpPanel.component.ts +++ b/tabby-ssh/src/components/sftpPanel.component.ts @@ -112,8 +112,8 @@ export class SFTPPanelComponent { } async uploadOne (transfer: FileUpload): Promise { - await this.sftp.upload(path.join(this.path, transfer.getName()), transfer) const savedPath = this.path + await this.sftp.upload(path.join(this.path, transfer.getName()), transfer) if (this.path === savedPath) { await this.navigate(this.path) }