From 1112766ac080cfb100b4a0770745b65924b8f6ea Mon Sep 17 00:00:00 2001 From: Eugene Pankov Date: Mon, 15 May 2023 22:55:05 +0200 Subject: [PATCH] fixed #8404 - missing SFTP progressbar --- app/src/plugins.ts | 2 ++ package.json | 1 + .../src/components/appRoot.component.pug | 2 +- .../components/transfersMenu.component.pug | 7 +------ tabby-core/src/index.ts | 2 ++ tabby-core/src/theme.new.scss | 7 +++++++ web/polyfills.ts | 2 ++ yarn.lock | 20 +++++++++++++++++++ 8 files changed, 36 insertions(+), 7 deletions(-) diff --git a/app/src/plugins.ts b/app/src/plugins.ts index aed8b2e3..c313d5af 100644 --- a/app/src/plugins.ts +++ b/app/src/plugins.ts @@ -27,6 +27,8 @@ const cachedBuiltinModules = { '@angular/compiler': require('@angular/compiler'), '@angular/core': require('@angular/core'), '@angular/forms': require('@angular/forms'), + '@angular/localize': require('@angular/localize'), + '@angular/localize/init': require('@angular/localize/init'), '@angular/platform-browser': require('@angular/platform-browser'), '@angular/platform-browser/animations': require('@angular/platform-browser/animations'), '@angular/platform-browser-dynamic': require('@angular/platform-browser-dynamic'), diff --git a/package.json b/package.json index 52bd74a5..d13ac8d9 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "@angular/compiler-cli": "^15.2.6", "@angular/core": "^15.2.6", "@angular/forms": "^15.2.6", + "@angular/localize": "^15.2.9", "@angular/platform-browser": "^15.2.6", "@angular/platform-browser-dynamic": "^15.2.6", "@biesbjerg/ngx-translate-extract-marker": "^1.0.0", diff --git a/tabby-core/src/components/appRoot.component.pug b/tabby-core/src/components/appRoot.component.pug index 8845a573..4b1d87d9 100644 --- a/tabby-core/src/components/appRoot.component.pug +++ b/tabby-core/src/components/appRoot.component.pug @@ -51,7 +51,7 @@ title-bar( #activeTransfersDropdown='ngbDropdown' ) button.btn.btn-secondary.btn-tab-bar( - *ngIf='activeTransfers.length > 0', + [hidden]='activeTransfers.length == 0', title='File transfers', ngbDropdownToggle ) !{require('../icons/transfers.svg')} diff --git a/tabby-core/src/components/transfersMenu.component.pug b/tabby-core/src/components/transfersMenu.component.pug index 7ac952f1..ca73a41f 100644 --- a/tabby-core/src/components/transfersMenu.component.pug +++ b/tabby-core/src/components/transfersMenu.component.pug @@ -6,12 +6,7 @@ .icon(*ngIf='!isDownload(transfer)') !{require('../icons/upload.svg')} .main label.no-wrap([title]='transfer.getName()') {{transfer.getName()}} - .status(*ngIf='transfer.isComplete()') - ngb-progressbar(type='success', [value]='100') - .status(*ngIf='transfer.isCancelled()') - ngb-progressbar(type='danger', [value]='100') - .status(*ngIf='!transfer.isComplete() && !transfer.isCancelled()') - ngb-progressbar(type='info', [value]='getProgress(transfer)') + ngb-progressbar([type]='transfer.isComplete() ? "success" : transfer.isCancelled() ? "danger" : "info"', [value]='getProgress(transfer)') .metadata .size {{transfer.getSize()|filesize}} .speed(*ngIf='transfer.getSpeed()') {{transfer.getSpeed()|filesize}}/s diff --git a/tabby-core/src/index.ts b/tabby-core/src/index.ts index 0dafa9b8..56229857 100644 --- a/tabby-core/src/index.ts +++ b/tabby-core/src/index.ts @@ -8,6 +8,8 @@ import { DragDropModule } from '@angular/cdk/drag-drop' import { TranslateModule, TranslateCompiler, TranslateService, MissingTranslationHandler } from '@ngx-translate/core' import { TranslateMessageFormatCompiler, MESSAGE_FORMAT_CONFIG } from 'ngx-translate-messageformat-compiler' +import '@angular/localize/init' + import { AppRootComponent } from './components/appRoot.component' import { CheckboxComponent } from './components/checkbox.component' import { TabBodyComponent } from './components/tabBody.component' diff --git a/tabby-core/src/theme.new.scss b/tabby-core/src/theme.new.scss index 8078ed43..ee20189e 100644 --- a/tabby-core/src/theme.new.scss +++ b/tabby-core/src/theme.new.scss @@ -171,6 +171,13 @@ body { } } +.dropdown-menu { + --bs-dropdown-bg: var(--theme-bg-more); +} + +.progress { + --bs-progress-height: 3px; +} tab-body { terminal-toolbar { diff --git a/web/polyfills.ts b/web/polyfills.ts index 9566c4c5..d91a6526 100644 --- a/web/polyfills.ts +++ b/web/polyfills.ts @@ -138,6 +138,8 @@ Tabby.registerModule('@angular/platform-browser', require('@angular/platform-bro Tabby.registerModule('@angular/platform-browser/animations', require('@angular/platform-browser/animations')) Tabby.registerModule('@angular/platform-browser-dynamic', require('@angular/platform-browser-dynamic')) Tabby.registerModule('@angular/animations', require('@angular/animations')) +Tabby.registerModule('@angular/localize', require('@angular/localize')) +Tabby.registerModule('@angular/localize/init', require('@angular/localize/init')) Tabby.registerModule('@ng-bootstrap/ng-bootstrap', require('@ng-bootstrap/ng-bootstrap')) Tabby.registerModule('ngx-toastr', require('ngx-toastr')) Tabby.registerModule('deepmerge', require('deepmerge')) diff --git a/yarn.lock b/yarn.lock index eb1e48f3..f0065b42 100644 --- a/yarn.lock +++ b/yarn.lock @@ -75,6 +75,15 @@ dependencies: tslib "^2.3.0" +"@angular/localize@^15.2.9": + version "15.2.9" + resolved "https://registry.yarnpkg.com/@angular/localize/-/localize-15.2.9.tgz#9fd960b5b6daab597c816b33e2f00977719c673f" + integrity sha512-7ZGK3BWwIukSK5ORWjM3y/FYj7/ZJFl1RO1GCeL/tHD4nq0kd3q3pYvcpnoi9HGl+q8AkL24xdsfzgCFo8SB0g== + dependencies: + "@babel/core" "7.19.3" + glob "8.1.0" + yargs "^17.2.1" + "@angular/platform-browser-dynamic@^15.2.6": version "15.2.6" resolved "https://registry.yarnpkg.com/@angular/platform-browser-dynamic/-/platform-browser-dynamic-15.2.6.tgz#e3b347524b547385e90aad9bed59b5f14e6716cb" @@ -4084,6 +4093,17 @@ glob-to-regexp@^0.4.1: once "^1.3.0" path-is-absolute "^1.0.0" +glob@8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/glob/-/glob-8.1.0.tgz#d388f656593ef708ee3e34640fdfb99a9fd1c33e" + integrity sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^5.0.1" + once "^1.3.0" + glob@^8.0.1, glob@^8.0.3: version "8.0.3" resolved "https://registry.yarnpkg.com/glob/-/glob-8.0.3.tgz#415c6eb2deed9e502c68fa44a272e6da6eeca42e"