Skip to content

Commit

Permalink
NAS-129512: PR Update
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexKarpov98 committed Oct 17, 2024
2 parents 15ace6e + b2a7e20 commit 662b190
Show file tree
Hide file tree
Showing 346 changed files with 4,735 additions and 1,738 deletions.
8 changes: 4 additions & 4 deletions src/app/app.routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const rootRouterConfig: Routes = [
},
{
path: 'system-tasks',
loadChildren: () => import('app/pages/system-tasks/system-tasks.module').then((module) => module.SystemTasksModule),
loadChildren: () => import('app/pages/system-tasks/system-tasks.routes').then((module) => module.systemTasksRoutes),
data: { title: T('Others'), breadcrumb: T('Others') },
},
],
Expand All @@ -39,7 +39,7 @@ export const rootRouterConfig: Routes = [
children: [
{
path: 'dashboard',
loadChildren: () => import('app/pages/dashboard/dashboard.module').then((module) => module.DashboardModule),
loadComponent: () => import('app/pages/dashboard/components/dashboard/dashboard.component').then((module) => module.DashboardComponent),
data: { title: T('Dashboard'), breadcrumb: T('Dashboard') },
},
{
Expand Down Expand Up @@ -74,7 +74,7 @@ export const rootRouterConfig: Routes = [
},
{
path: 'apps',
loadChildren: () => import('app/pages/apps/apps.module').then((module) => module.AppsModule),
loadChildren: () => import('app/pages/apps/apps.routes').then((module) => module.appsRoutes),
data: { title: T('Applications'), breadcrumb: T('Applications') },
},
{
Expand All @@ -94,7 +94,7 @@ export const rootRouterConfig: Routes = [
},
{
path: 'reportsdashboard',
loadChildren: () => import('app/pages/reports-dashboard/reports-dashboard.module').then((module) => module.ReportsDashboardModule),
loadChildren: () => import('app/pages/reports-dashboard/reports-dashboard.routes').then((module) => module.reportsDashboardRoutes),
data: { title: T('Reporting'), breadcrumb: T('Reporting') },
},
{
Expand Down
11 changes: 6 additions & 5 deletions src/app/enums/app-state.enum.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { marker as T } from '@biesbjerg/ngx-translate-extract-marker';
import { iconMarker } from 'app/modules/ix-icon/icon-marker.util';

export enum AppState {
Running = 'RUNNING',
Expand All @@ -9,11 +10,11 @@ export enum AppState {
}

export const appStateIcons = new Map<AppState, string>([
[AppState.Running, 'mdi-check-circle'],
[AppState.Deploying, 'mdi-progress-wrench'],
[AppState.Stopped, 'mdi-stop-circle'],
[AppState.Stopping, 'mdi-progress-wrench'],
[AppState.Crashed, 'mdi-alert-circle'],
[AppState.Running, iconMarker('mdi-check-circle')],
[AppState.Deploying, iconMarker('mdi-progress-wrench')],
[AppState.Stopped, iconMarker('mdi-stop-circle')],
[AppState.Stopping, iconMarker('mdi-progress-wrench')],
[AppState.Crashed, iconMarker('mdi-alert-circle')],
]);

export const appStateLabels = new Map<AppState, string>([
Expand Down
1 change: 1 addition & 0 deletions src/app/helptext/account/user-form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,5 @@ export const helptextUsers = {
account is only possible when <b>Disable Password</b> is <i>No</i> and \
a <b>Password</b> has been created for the account.'),
user_form_smb_tooltip: T('Set to allow user to authenticate to Samba shares.'),
smbBuiltin: T('Cannot be enabled for built-in users.'),
};
4 changes: 2 additions & 2 deletions src/app/interfaces/api/api-job-directory.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ export interface ApiJobDirectory {
'support.new_ticket': { params: [CreateNewTicket]; response: NewTicketResponse };

// System
'system.reboot': { params: { delay?: number }; response: void };
'system.shutdown': { params: { delay?: number }; response: void };
'system.reboot': { params: { delay?: number; reason?: string }; response: void };
'system.shutdown': { params: { delay?: number; reason?: string }; response: void };
'system.security.update': { params: [SystemSecurityConfig]; response: void };

// SystemDataset
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

mat-progress-bar {
opacity: 0.6;
position: absolute;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<a
tabindex="0"
class="mobile-back-button"
ixTest="disk-details-back"
[attr.aria-label]="'Back' | translate"
(click)="onClose.emit()"
(keydown.enter)="onClose.emit()"
>
<ix-icon name="mdi-chevron-left"></ix-icon>
</a>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
@import 'scss-imports/variables';

a.mobile-back-button {
cursor: pointer;
display: none;
padding: 5px 10px;

@media (max-width: $breakpoint-hidden) {
display: inline-block;
left: 2px;
position: relative;
top: 3px;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { Spectator, createComponentFactory } from '@ngneat/spectator/jest';
import { MobileBackButtonComponent } from './mobile-back-button.component';

describe('MobileBackButtonComponent', () => {
let spectator: Spectator<MobileBackButtonComponent>;
const createComponent = createComponentFactory({
component: MobileBackButtonComponent,
});

beforeEach(() => {
spectator = createComponent();
});

it('should render a button with the correct classes and attributes', () => {
const button = spectator.query('.mobile-back-button');
expect(button).toBeTruthy();
expect(button).toHaveAttribute('tabindex', '0');
expect(button).toHaveAttribute('aria-label', 'Back');
});

it('should emit onClose when the button is clicked', () => {
const onCloseSpy = jest.spyOn(spectator.component.onClose, 'emit');
spectator.click('.mobile-back-button');
expect(onCloseSpy).toHaveBeenCalled();
});

it('should emit onClose when the Enter key is pressed', () => {
const onCloseSpy = jest.spyOn(spectator.component.onClose, 'emit');
spectator.dispatchKeyboardEvent('.mobile-back-button', 'keydown', 'Enter');
expect(onCloseSpy).toHaveBeenCalled();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import {
Component, output, ChangeDetectionStrategy,
} from '@angular/core';
import { MatButton } from '@angular/material/button';
import { TranslateModule } from '@ngx-translate/core';
import { IxIconComponent } from 'app/modules/ix-icon/ix-icon.component';
import { TestDirective } from 'app/modules/test-id/test.directive';

@Component({
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: true,
imports: [
MatButton,
IxIconComponent,
TranslateModule,
TestDirective,
],
selector: 'ix-mobile-back-button',
templateUrl: './mobile-back-button.component.html',
styleUrls: ['./mobile-back-button.component.scss'],
})
export class MobileBackButtonComponent {
readonly onClose = output();
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { MatButtonHarness } from '@angular/material/button/testing';
import { createComponentFactory, Spectator } from '@ngneat/spectator/jest';
import { mockWindow } from 'app/core/testing/utils/mock-window.utils';
import { WINDOW } from 'app/helpers/window.helper';
import { OauthButtonComponent } from 'app/modules/buttons/oauth-button/components/oauth-button/oauth-button.component';
import { OauthButtonType } from 'app/modules/buttons/oauth-button/interfaces/oauth-button.interface';
import { OauthButtonComponent } from 'app/modules/buttons/oauth-button/oauth-button.component';

describe('OauthButtonComponent', () => {
let spectator: Spectator<OauthButtonComponent>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,28 @@
import {
ChangeDetectionStrategy, ChangeDetectorRef, Component, Inject, Input, OnDestroy, output,
} from '@angular/core';
import { TranslateService } from '@ngx-translate/core';
import { MatButton } from '@angular/material/button';
import { TranslateService, TranslateModule } from '@ngx-translate/core';
import { WINDOW } from 'app/helpers/window.helper';
import { GmailOauthConfig } from 'app/interfaces/mail-config.interface';
import { OauthMessage } from 'app/interfaces/oauth-message.interface';
import { OauthButtonType } from 'app/modules/buttons/oauth-button/interfaces/oauth-button.interface';
import { DialogService } from 'app/modules/dialog/dialog.service';
import { OauthJiraMessage } from 'app/modules/feedback/interfaces/file-ticket.interface';
import { TestDirective } from 'app/modules/test-id/test.directive';
import { OauthProviderData } from 'app/pages/credentials/backup-credentials/cloud-credentials-form/oauth-provider/oauth-provider.component';

@Component({
selector: 'ix-oauth-button',
templateUrl: './oauth-button.component.html',
styleUrls: ['./oauth-button.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: true,
imports: [
MatButton,
TestDirective,
TranslateModule,
],
})
export class OauthButtonComponent implements OnDestroy {
@Input() oauthType: OauthButtonType;
Expand Down
20 changes: 0 additions & 20 deletions src/app/modules/buttons/oauth-button/oauth-button.module.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import { MockComponent } from 'ng-mocks';
import { of } from 'rxjs';
import { fakeFile } from 'app/core/testing/utils/fake-file.uitls';
import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils';
import { OauthButtonComponent } from 'app/modules/buttons/oauth-button/components/oauth-button/oauth-button.component';
import { OauthButtonType } from 'app/modules/buttons/oauth-button/interfaces/oauth-button.interface';
import { OauthButtonComponent } from 'app/modules/buttons/oauth-button/oauth-button.component';
import { FileTicketComponent } from 'app/modules/feedback/components/file-ticket/file-ticket.component';
import { SimilarIssuesComponent } from 'app/modules/feedback/components/similar-issues/similar-issues.component';
import { FeedbackType } from 'app/modules/feedback/interfaces/feedback.interface';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { MiB } from 'app/constants/bytes.constant';
import { TicketType, ticketAcceptedFiles } from 'app/enums/file-ticket.enum';
import { helptextSystemSupport as helptext } from 'app/helptext/system/support';
import { OauthButtonType } from 'app/modules/buttons/oauth-button/interfaces/oauth-button.interface';
import { OauthButtonModule } from 'app/modules/buttons/oauth-button/oauth-button.module';
import { OauthButtonComponent } from 'app/modules/buttons/oauth-button/oauth-button.component';
import { FeedbackDialogComponent } from 'app/modules/feedback/components/feedback-dialog/feedback-dialog.component';
import { SimilarIssuesComponent } from 'app/modules/feedback/components/similar-issues/similar-issues.component';
import { FeedbackType } from 'app/modules/feedback/interfaces/feedback.interface';
Expand Down Expand Up @@ -44,7 +44,7 @@ import { WebSocketService } from 'app/services/ws.service';
IxFileInputComponent,
MatDialogActions,
FormActionsComponent,
OauthButtonModule,
OauthButtonComponent,
TranslateModule,
],
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { IxListItemComponent } from 'app/modules/forms/ix-forms/components/ix-li
import { IxListComponent } from 'app/modules/forms/ix-forms/components/ix-list/ix-list.component';
import { IxSelectComponent } from 'app/modules/forms/ix-forms/components/ix-select/ix-select.component';
import { CastPipe } from 'app/modules/pipes/cast/cast.pipe';
import { SchedulerModule } from 'app/modules/scheduler/scheduler.module';
import { SchedulerComponent } from 'app/modules/scheduler/components/scheduler/scheduler.component';
import { TooltipComponent } from 'app/modules/tooltip/tooltip.component';

const components = [
Expand All @@ -36,7 +36,6 @@ const components = [
imports: [
TranslateModule,
ReactiveFormsModule,
SchedulerModule,
MatDividerModule,
CastPipe,
TooltipComponent,
Expand All @@ -52,6 +51,7 @@ const components = [
IxIpInputWithNetmaskComponent,
IxFieldsetComponent,
AsyncPipe,
SchedulerComponent,
],
exports: [
...components,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
@if (label || tooltip) {
@if (label() || tooltip()) {
<ix-label
[label]="label"
[tooltip]="tooltip"
[required]="required"
[label]="label()"
[tooltip]="tooltip()"
[required]="required()"
></ix-label>
}

<div class="star-rating" [attr.aria-label]="label">
@for (rating of ratings; track index; let index = $index) {
<div class="star-rating" [attr.aria-label]="label()">
@for (rating of ratings(); track index; let index = $index) {
<div>
<button
mat-icon-button
Expand All @@ -18,10 +18,10 @@
(click)="onValueChanged(index + 1)"
(blur)="onTouch()"
>
<ix-icon [name]="value >= index + 1 ? 'mdi-star' : 'mdi-star-outline'"></ix-icon>
<ix-icon [name]="value >= index + 1 ? iconMarker('mdi-star') : iconMarker('mdi-star-outline')"></ix-icon>
</button>
</div>
}
</div>

<ix-errors [control]="controlDirective.control" [label]="label"></ix-errors>
<ix-errors [control]="controlDirective.control" [label]="label()"></ix-errors>
Loading

0 comments on commit 662b190

Please sign in to comment.