Skip to content

Commit

Permalink
fix: finish porting minor changes to major
Browse files Browse the repository at this point in the history
  • Loading branch information
waterplea committed Dec 11, 2024
1 parent 115c599 commit 7d57aa4
Show file tree
Hide file tree
Showing 76 changed files with 1,173 additions and 1,373 deletions.
486 changes: 245 additions & 241 deletions web/package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"pbkdf2": "^3.1.2",
"rxjs": "^7.5.6",
"swiper": "^8.2.4",
"ts-matches": "^5.5.1",
"ts-matches": "^6.1.0",
"tslib": "^2.8.1",
"uuid": "^8.3.2",
"zone.js": "^0.14.2"
Expand Down
4 changes: 2 additions & 2 deletions web/projects/install-wizard/src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<tui-root>
<main>
<img class="logo" src="assets/img/icon.png" alt="Start9" />
<section tuiCardLarge tuiSurface="elevated" class="card">
<section tuiCardLarge tuiSurface="floating" class="card">
<header class="header">
@if (selected) {
<button
tuiIconButton
appearance="flat"
appearance="flat-grayscale"
size="m"
class="back"
iconStart="@tui.chevron-left"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ import { ChangeDetectionStrategy, Component, inject } from '@angular/core'
import { Exver, MarkdownPipeModule } from '@start9labs/shared'
import { TuiButton, TuiDialogContext, TuiLoader } from '@taiga-ui/core'
import { TuiAccordion } from '@taiga-ui/kit'
import {
POLYMORPHEUS_CONTEXT,
PolymorpheusComponent,
} from '@taiga-ui/polymorpheus'
import { injectContext, PolymorpheusComponent } from '@taiga-ui/polymorpheus'
import { MarketplacePkg } from '../../src/types'

@Component({
Expand Down Expand Up @@ -35,7 +32,7 @@ import { MarketplacePkg } from '../../src/types'
export class ReleaseNotesComponent {
private readonly exver = inject(Exver)
private readonly pkg =
inject<TuiDialogContext<void, MarketplacePkg>>(POLYMORPHEUS_CONTEXT).data
injectContext<TuiDialogContext<void, MarketplacePkg>>().data

readonly notes = Object.entries(this.pkg.otherVersions)
.filter(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { PolymorpheusContent } from '@taiga-ui/polymorpheus'
>
<button
tuiIconButton
appearance="flat"
appearance="flat-grayscale"
iconStart="@tui.chevron-left"
title="Previous"
type="button"
Expand Down Expand Up @@ -60,7 +60,7 @@ import { PolymorpheusContent } from '@taiga-ui/polymorpheus'
</tui-carousel>
<button
tuiIconButton
appearance="flat"
appearance="flat-grayscale"
type="button"
iconStart="@tui.chevron-right"
title="Next"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@ import {
} from '@taiga-ui/core'
import { TUI_VALIDATION_ERRORS, TuiFieldErrorPipe } from '@taiga-ui/kit'
import { TuiInputModule, TuiInputPasswordModule } from '@taiga-ui/legacy'
import {
POLYMORPHEUS_CONTEXT,
PolymorpheusComponent,
} from '@taiga-ui/polymorpheus'
import { injectContext, PolymorpheusComponent } from '@taiga-ui/polymorpheus'
import { SERVERS, ServersResponse } from 'src/app/components/servers.component'
import { ApiService } from 'src/app/services/api.service'

Expand Down Expand Up @@ -108,8 +105,7 @@ export class CifsComponent {
private readonly dialogs = inject(TuiDialogService)
private readonly api = inject(ApiService)
private readonly loader = inject(LoadingService)
private readonly context =
inject<TuiDialogContext<CifsResponse>>(POLYMORPHEUS_CONTEXT)
private readonly context = injectContext<TuiDialogContext<CifsResponse>>()

readonly form = new FormGroup({
hostname: new FormControl('', {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import { TuiInputPasswordModule } from '@taiga-ui/legacy'
import { Component, inject } from '@angular/core'
import { FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms'
import * as argon2 from '@start9labs/argon2'
import { ErrorService } from '@start9labs/shared'
import { TuiDialogContext, TuiError, TuiButton } from '@taiga-ui/core'
import {
POLYMORPHEUS_CONTEXT,
PolymorpheusComponent,
} from '@taiga-ui/polymorpheus'
import { TuiButton, TuiDialogContext, TuiError } from '@taiga-ui/core'
import { TuiInputPasswordModule } from '@taiga-ui/legacy'
import { injectContext, PolymorpheusComponent } from '@taiga-ui/polymorpheus'

interface DialogData {
passwordHash?: string
Expand Down Expand Up @@ -67,7 +64,7 @@ interface DialogData {
export class PasswordComponent {
private readonly errorService = inject(ErrorService)
private readonly context =
inject<TuiDialogContext<string, DialogData>>(POLYMORPHEUS_CONTEXT)
injectContext<TuiDialogContext<string, DialogData>>()

readonly storageDrive = this.context.data.storageDrive
readonly password = new FormControl('', { nonNullable: true })
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import { Component, inject } from '@angular/core'
import { Component } from '@angular/core'
import { ServerComponent } from '@start9labs/shared'
import { TuiDialogContext } from '@taiga-ui/core'
import {
POLYMORPHEUS_CONTEXT,
PolymorpheusComponent,
} from '@taiga-ui/polymorpheus'
import { injectContext, PolymorpheusComponent } from '@taiga-ui/polymorpheus'
import { PasswordDirective } from 'src/app/components/password.directive'
import { StartOSDiskInfoWithId } from 'src/app/services/api.service'

Expand All @@ -27,8 +24,7 @@ export interface ServersResponse {
imports: [ServerComponent, PasswordDirective],
})
export class ServersComponent {
readonly context =
inject<TuiDialogContext<ServersResponse, Data>>(POLYMORPHEUS_CONTEXT)
readonly context = injectContext<TuiDialogContext<ServersResponse, Data>>()

select(password: string, serverId: string) {
this.context.completeWith({ serverId, password })
Expand Down
2 changes: 1 addition & 1 deletion web/projects/setup-wizard/src/app/pages/home.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { StateService } from 'src/app/services/state.service'
@if (recover) {
<button
tuiIconButton
appearance="flat"
appearance="flat-grayscale"
class="back"
iconStart="@tui.chevron-left"
(click)="recover = false"
Expand Down
4 changes: 2 additions & 2 deletions web/projects/setup-wizard/src/app/pages/success.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import { StateService } from 'src/app/services/state.service'
<h3>You can now safely unplug your old StartOS data drive</h3>
}
<button tuiCardLarge tuiSurface="elevated" (click)="download()">
<button tuiCardLarge tuiSurface="floating" (click)="download()">
<strong class="caps">Download address info</strong>
<span>
start.local was for setup purposes only. It will no longer work.
Expand All @@ -53,7 +53,7 @@ import { StateService } from 'src/app/services/state.service'
<a
tuiCardLarge
tuiSurface="elevated"
tuiSurface="floating"
target="_blank"
[attr.href]="disableLogin ? null : lanAddress"
>
Expand Down
10 changes: 3 additions & 7 deletions web/projects/shared/src/components/loading/loading.component.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import { ChangeDetectionStrategy, Component, inject } from '@angular/core'
import { ChangeDetectionStrategy, Component } from '@angular/core'
import { TuiLoader } from '@taiga-ui/core'
import {
POLYMORPHEUS_CONTEXT,
PolymorpheusContent,
} from '@taiga-ui/polymorpheus'
import { injectContext, PolymorpheusContent } from '@taiga-ui/polymorpheus'

@Component({
standalone: true,
Expand All @@ -13,6 +10,5 @@ import {
imports: [TuiLoader],
})
export class LoadingComponent {
readonly content: PolymorpheusContent =
inject(POLYMORPHEUS_CONTEXT)['content']
readonly content = injectContext<{ content: PolymorpheusContent }>().content
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { Component, Inject } from '@angular/core'
import { TuiDialogContext } from '@taiga-ui/core'
import { POLYMORPHEUS_CONTEXT } from '@taiga-ui/polymorpheus'
import {
POLYMORPHEUS_CONTEXT,
PolymorpheusComponent,
} from '@taiga-ui/polymorpheus'
import {
catchError,
ignoreElements,
Expand Down Expand Up @@ -42,3 +45,5 @@ export class MarkdownComponent {
return this.context.label || ''
}
}

export const MARKDOWN = new PolymorpheusComponent(MarkdownComponent)
5 changes: 3 additions & 2 deletions web/projects/shared/src/util/get-pkg-id.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { inject } from '@angular/core'
import { ActivatedRoute } from '@angular/router'

export function getPkgId({ snapshot }: ActivatedRoute): string {
const pkgId = snapshot.paramMap.get('pkgId')
export function getPkgId(): string {
const pkgId = inject(ActivatedRoute).snapshot.paramMap.get('pkgId')

if (!pkgId) {
throw new Error('pkgId is missing from route params')
Expand Down
5 changes: 0 additions & 5 deletions web/projects/shared/styles/taiga.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@
color: var(--tui-status-negative);
}

[tuiAppearance][data-appearance='flat'],
[tuiAppearance][data-appearance='outline'] {
color: var(--tui-text-primary);
}

[tuiAppearance][data-appearance='primary'] {
@include appearance-disabled {
background: #eaecee;
Expand Down
8 changes: 4 additions & 4 deletions web/projects/ui/src/app/components/report.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ import { BackupReport } from 'src/app/services/api/api.types'
})
export class BackupsReportModal {
private readonly context =
inject<TuiDialogContext<void, { report: BackupReport; timestamp: string }>>(
POLYMORPHEUS_CONTEXT,
)
inject<
TuiDialogContext<void, { content: BackupReport; timestamp: string }>
>(POLYMORPHEUS_CONTEXT)

readonly system = this.getSystem()

get report(): BackupReport {
return this.context.data.report
return this.context.data.content
}

get timestamp(): string {
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 7d57aa4

Please sign in to comment.