Skip to content

Commit

Permalink
NAS-131378: Fangtooth iSCSI service data-test tag of the Running togg…
Browse files Browse the repository at this point in the history
…le is inconsistent with the other iSCSI toggle. (#10762)
  • Loading branch information
AlexKarpov98 authored Sep 27, 2024
1 parent 48dded2 commit 3c7fecd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/app/modules/ix-table/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { get } from 'lodash-es';
import { Column, ColumnComponent } from 'app/modules/ix-table/interfaces/column-component.class';
import { TableFilter } from 'app/modules/ix-table/interfaces/table-filter.interface';

function convertStringToId(inputString: string): string {
export function convertStringToId(inputString: string): string {
let result = inputString;

if (!result || result.includes('undefined')) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*ixRequiresRoles="requiredRoles()"
color="primary"
[aria-label]="isRunning() ? ('Stop service' | translate) : ('Start service' | translate)"
[ixTest]="['service', 'running', service().name, 'toggle']"
[ixTest]="['service', 'running', testIdServiceName, 'toggle']"
[checked]="isRunning()"
(change)="onSlideToggleChanged($event)"
(click)="$event.stopPropagation()"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { ServiceStatus } from 'app/enums/service-status.enum';
import { ServiceRow } from 'app/interfaces/service.interface';
import { DialogService } from 'app/modules/dialog/dialog.service';
import { ColumnComponent } from 'app/modules/ix-table/interfaces/column-component.class';
import { convertStringToId } from 'app/modules/ix-table/utils';
import { AppLoaderService } from 'app/modules/loader/app-loader.service';
import { SnackbarService } from 'app/modules/snackbar/services/snackbar.service';
import { ErrorHandlerService } from 'app/services/error-handler.service';
Expand All @@ -33,6 +34,10 @@ export class ServiceStateColumnComponent extends ColumnComponent<ServiceRow> {

protected readonly isRunning = computed(() => this.service().state === ServiceStatus.Running);

get testIdServiceName(): string {
return convertStringToId(this.service().name).replace(/\./g, '');
}

private servicesService = inject(ServicesService);
private ws = inject(WebSocketService);
private dialogService = inject(DialogService);
Expand Down

0 comments on commit 3c7fecd

Please sign in to comment.