diff --git a/web/projects/shared/src/i18n/dictionaries/de.ts b/web/projects/shared/src/i18n/dictionaries/de.ts index c4ba6cf53..252e910ca 100644 --- a/web/projects/shared/src/i18n/dictionaries/de.ts +++ b/web/projects/shared/src/i18n/dictionaries/de.ts @@ -399,7 +399,6 @@ export default { 425: 'Ausführen', 426: 'Aktion kann nur ausgeführt werden, wenn der Dienst', 427: 'Verboten', - 428: 'kann vorübergehend Probleme verursachen', 429: 'hat unerfüllte Abhängigkeiten. Es wird nicht wie erwartet funktionieren.', 430: 'Container wird neu gebaut', 431: 'Deinstallation wird gestartet', diff --git a/web/projects/shared/src/i18n/dictionaries/en.ts b/web/projects/shared/src/i18n/dictionaries/en.ts index ba41fc6bb..32d1803d7 100644 --- a/web/projects/shared/src/i18n/dictionaries/en.ts +++ b/web/projects/shared/src/i18n/dictionaries/en.ts @@ -398,7 +398,6 @@ export const ENGLISH: Record = { 'Run': 425, // as in, run a piece of software 'Action can only be executed when service is': 426, 'Forbidden': 427, - 'may temporarily experiences issues': 428, 'has unmet dependencies. It will not work as expected.': 429, 'Rebuilding container': 430, 'Beginning uninstall': 431, diff --git a/web/projects/shared/src/i18n/dictionaries/es.ts b/web/projects/shared/src/i18n/dictionaries/es.ts index c275cad7d..bb7f6756c 100644 --- a/web/projects/shared/src/i18n/dictionaries/es.ts +++ b/web/projects/shared/src/i18n/dictionaries/es.ts @@ -399,7 +399,6 @@ export default { 425: 'Ejecutar', 426: 'La acción solo se puede ejecutar cuando el servicio está', 427: 'Prohibido', - 428: 'puede experimentar problemas temporales', 429: 'tiene dependencias no satisfechas. No funcionará como se espera.', 430: 'Reconstruyendo contenedor', 431: 'Iniciando desinstalación', diff --git a/web/projects/shared/src/i18n/dictionaries/fr.ts b/web/projects/shared/src/i18n/dictionaries/fr.ts index c5ad31318..1d34c92ea 100644 --- a/web/projects/shared/src/i18n/dictionaries/fr.ts +++ b/web/projects/shared/src/i18n/dictionaries/fr.ts @@ -399,7 +399,6 @@ export default { 425: 'Exécuter', 426: 'Action possible uniquement lorsque le service est', 427: 'Interdit', - 428: 'peut rencontrer des problèmes temporaires', 429: 'a des dépendances non satisfaites. Il ne fonctionnera pas comme prévu.', 430: 'Reconstruction du conteneur', 431: 'Désinstallation initiée', diff --git a/web/projects/shared/src/i18n/dictionaries/pl.ts b/web/projects/shared/src/i18n/dictionaries/pl.ts index 9a40dce68..da9bc99b9 100644 --- a/web/projects/shared/src/i18n/dictionaries/pl.ts +++ b/web/projects/shared/src/i18n/dictionaries/pl.ts @@ -399,7 +399,6 @@ export default { 425: 'Uruchom', 426: 'Akcja może być wykonana tylko gdy serwis jest', 427: 'Zabronione', - 428: 'może tymczasowo napotkać problemy', 429: 'ma niespełnione zależności. Nie będzie działać zgodnie z oczekiwaniami.', 430: 'Odbudowywanie kontenera', 431: 'Rozpoczynanie odinstalowania', diff --git a/web/projects/ui/src/app/routes/portal/routes/services/components/controls.component.ts b/web/projects/ui/src/app/routes/portal/routes/services/components/controls.component.ts index b6fdeebc7..a247f82c6 100644 --- a/web/projects/ui/src/app/routes/portal/routes/services/components/controls.component.ts +++ b/web/projects/ui/src/app/routes/portal/routes/services/components/controls.component.ts @@ -36,7 +36,7 @@ import { InterfaceService } from '../../../components/interfaces/interface.servi diff --git a/web/projects/ui/src/app/routes/portal/routes/updates/item.component.ts b/web/projects/ui/src/app/routes/portal/routes/updates/item.component.ts index fa24823cc..8636e5c3e 100644 --- a/web/projects/ui/src/app/routes/portal/routes/updates/item.component.ts +++ b/web/projects/ui/src/app/routes/portal/routes/updates/item.component.ts @@ -10,7 +10,6 @@ import { RouterLink } from '@angular/router' import { MarketplacePkg } from '@start9labs/marketplace' import { DialogService, - i18nKey, i18nPipe, LocalizePipe, MarkdownPipe, @@ -32,7 +31,6 @@ import { TuiProgressCircle, } from '@taiga-ui/kit' import { PatchDB } from 'patch-db-client' -import { defaultIfEmpty, firstValueFrom } from 'rxjs' import { InstallingProgressPipe } from 'src/app/routes/portal/routes/services/pipes/install-progress.pipe' import { MarketplaceService } from 'src/app/services/marketplace.service' import { @@ -41,8 +39,6 @@ import { PackageDataEntry, UpdatingState, } from 'src/app/services/patch-db/data-model' -import { getAllPackages } from 'src/app/utils/get-package-data' -import { hasCurrentDeps } from 'src/app/utils/has-deps' import UpdatesComponent from './updates.component' @Component({ @@ -106,7 +102,7 @@ import UpdatesComponent from './updates.component' size="s" [loading]="!ready()" [appearance]="error() ? 'destructive' : 'primary'" - (click.stop)="onClick()" + (click.stop)="update()" > {{ error() ? ('Retry' | i18n) : ('Update' | i18n) }} @@ -274,22 +270,7 @@ export class UpdatesItemComponent { readonly local = input.required>() - async onClick() { - this.ready.set(false) - this.error.set('') - - if (hasCurrentDeps(this.item().id, await getAllPackages(this.patch))) { - if (await this.alert()) { - await this.update() - } else { - this.ready.set(true) - } - } else { - await this.update() - } - } - - private async update() { + async update() { const { id, version } = this.item() const url = this.parent.current()?.url || '' @@ -301,21 +282,4 @@ export class UpdatesItemComponent { this.error.set(e.message) } } - - private async alert(): Promise { - return firstValueFrom( - this.dialog - .openConfirm({ - label: 'Warning', - size: 's', - data: { - content: - `${this.i18n.transform('Services that depend on')} ${this.local().stateInfo.manifest.title} ${this.i18n.transform('will no longer work properly and may crash.')}` as i18nKey, - yes: 'Continue', - no: 'Cancel', - }, - }) - .pipe(defaultIfEmpty(false)), - ) - } } diff --git a/web/projects/ui/src/app/services/controls.service.ts b/web/projects/ui/src/app/services/controls.service.ts index 23f3f38c5..4c092c47e 100644 --- a/web/projects/ui/src/app/services/controls.service.ts +++ b/web/projects/ui/src/app/services/controls.service.ts @@ -84,35 +84,16 @@ export class ControlsService { }) } - async restart({ id, title }: T.Manifest) { - const packages = await getAllPackages(this.patch) + async restart(id: string) { + const loader = this.loader.open('Restarting').subscribe() - defer(() => - hasCurrentDeps(id, packages) - ? this.dialog - .openConfirm({ - label: 'Warning', - size: 's', - data: { - content: - `${this.i18n.transform('Services that depend on')} ${title} ${this.i18n.transform('may temporarily experiences issues')}` as i18nKey, - yes: 'Restart', - no: 'Cancel', - }, - }) - .pipe(filter(Boolean)) - : of(null), - ).subscribe(async () => { - const loader = this.loader.open('Restarting').subscribe() - - try { - await this.api.restartPackage({ id }) - } catch (e: any) { - this.errorService.handleError(e) - } finally { - loader.unsubscribe() - } - }) + try { + await this.api.restartPackage({ id }) + } catch (e: any) { + this.errorService.handleError(e) + } finally { + loader.unsubscribe() + } } private alert(content: T.LocaleString): Promise {