Skip to content

Commit

Permalink
Merge branch 'master' into NAS-130213
Browse files Browse the repository at this point in the history
  • Loading branch information
denysbutenko committed Aug 8, 2024
2 parents d418518 + 51b658d commit 54fb573
Show file tree
Hide file tree
Showing 182 changed files with 662 additions and 689 deletions.
26 changes: 15 additions & 11 deletions src/app/directives/ui-search.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {
Directive, Input, ElementRef, Renderer2, OnInit,
OnDestroy,
} from '@angular/core';
import { Timeout } from 'app/interfaces/timeout.interface';
import { searchDelayConst } from 'app/modules/global-search/constants/delay.const';
import { getSearchableElementId } from 'app/modules/global-search/helpers/get-searchable-element-id';
import { UiSearchableElement } from 'app/modules/global-search/interfaces/ui-searchable-element.interface';
Expand Down Expand Up @@ -31,6 +32,8 @@ export class UiSearchDirective implements OnInit, OnDestroy {
return hierarchyItem;
}

private highlightTimeout: Timeout = null;

constructor(
private renderer: Renderer2,
private elementRef: ElementRef<HTMLElement>,
Expand Down Expand Up @@ -76,27 +79,28 @@ export class UiSearchDirective implements OnInit, OnDestroy {
}

private highlightAndClickElement(anchorRef: HTMLElement, shouldClick = false): void {
if (!anchorRef) return;
if (shouldClick && anchorRef) setTimeout(() => anchorRef.click(), searchDelayConst);

if (!anchorRef || shouldClick) return;

this.renderer.addClass(anchorRef, 'search-element-highlighted');

if (shouldClick) setTimeout(() => anchorRef.click(), searchDelayConst);
const removeHighlightStyling = (): void => {
this.renderer.removeClass(anchorRef, 'search-element-highlighted');
['click', 'keydown'].forEach((event) => document.removeEventListener(event, removeHighlightStyling));
};

setTimeout(() => {
anchorRef.focus();
anchorRef.scrollIntoView();
document.querySelector<HTMLElement>('.rightside-content-hold').scrollBy(0, -20);
['click', 'keydown'].forEach((event) => document.addEventListener(event, removeHighlightStyling, { once: true }));
}, searchDelayConst);

const handleEvent = (): void => {
this.renderer.removeClass(anchorRef, 'search-element-highlighted');
document.removeEventListener('click', handleEvent);
document.removeEventListener('keydown', handleEvent);
};
if (this.highlightTimeout) {
clearTimeout(this.highlightTimeout);
}

setTimeout(() => {
document.addEventListener('click', handleEvent, { once: true });
document.addEventListener('keydown', handleEvent, { once: true });
}, 0);
this.highlightTimeout = setTimeout(() => removeHighlightStyling(), 4000);
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
export enum CatalogAppState {
Active = 'RUNNING',
Running = 'RUNNING',
Deploying = 'DEPLOYING',
Stopped = 'STOPPED',
}

export const appStateIcons = new Map<CatalogAppState, string>([
[CatalogAppState.Active, 'mdi-check-circle'],
[CatalogAppState.Running, 'mdi-check-circle'],
[CatalogAppState.Deploying, 'mdi-progress-wrench'],
[CatalogAppState.Stopped, 'mdi-stop-circle'],
]);
6 changes: 3 additions & 3 deletions src/app/helptext/apps/apps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const helptextApps = {
action: T('Create Pool'),
},

charts: {
apps: {
delete_dialog: {
title: T('Delete'),
job: T('Deleting...'),
Expand All @@ -72,7 +72,7 @@ export const helptextApps = {
},
},

chartForm: {
appForm: {
title: T('Install Application'),
editTitle: T('Edit Application Settings'),
parseError: {
Expand All @@ -99,7 +99,7 @@ export const helptextApps = {
externalLabel: T('Add External Interfaces'),
},

chartWizard: {
appWizard: {
nameGroup: {
label: 'Application Name',
version: 'Version',
Expand Down
26 changes: 10 additions & 16 deletions src/app/interfaces/api/api-call-directory.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ import {
} from 'app/interfaces/alert.interface';
import { ApiTimestamp } from 'app/interfaces/api-date.interface';
import { ApiKey, CreateApiKeyRequest, UpdateApiKeyRequest } from 'app/interfaces/api-key.interface';
import {
App,
AppQueryParams,
AppUpgradeParams,
} from 'app/interfaces/app.interface';
import { AppUpgradeSummary } from 'app/interfaces/application.interface';
import { AuditConfig, AuditEntry, AuditQueryParams } from 'app/interfaces/audit/audit.interface';
import { AuthSession } from 'app/interfaces/auth-session.interface';
Expand All @@ -51,14 +56,6 @@ import {
CertificateProfiles,
ExtendedKeyUsageChoices,
} from 'app/interfaces/certificate.interface';
import {
ChartReleaseEvent,
} from 'app/interfaces/chart-release-event.interface';
import {
App,
ChartReleaseQueryParams,
AppUpgradeParams,
} from 'app/interfaces/chart-release.interface';
import { Choices } from 'app/interfaces/choices.interface';
import {
CloudBackup,
Expand Down Expand Up @@ -314,10 +311,14 @@ export interface ApiCallDirectory {
'api_key.update': { params: UpdateApiKeyRequest; response: ApiKey };

// App
'app.query': { params: AppQueryParams; response: App[] };
'app.upgrade_summary': { params: AppUpgradeParams; response: AppUpgradeSummary };
'app.available': { params: QueryParams<AvailableApp>; response: AvailableApp[] };
'app.categories': { params: void; response: string[] };
'app.latest': { params: QueryParams<AvailableApp>; response: AvailableApp[] };
'app.similar': { params: [app_name: string, train: string]; response: AvailableApp[] };
'app.rollback_versions': { params: [app_name: string]; response: string[] };
'app.used_ports': { params: void; response: number[] };

// Audit
'audit.config': { params: void; response: AuditConfig };
Expand Down Expand Up @@ -376,17 +377,9 @@ export interface ApiCallDirectory {
response: CertificateAuthority;
};

// Apps
'app.query': { params: ChartReleaseQueryParams; response: App[] };
'app.upgrade_summary': { params: AppUpgradeParams; response: AppUpgradeSummary };

// Chart
'chart.release.events': { params: [name: string]; response: ChartReleaseEvent[] };
'chart.release.get_chart_releases_using_chart_release_images': { params: [name: string]; response: Choices };
'chart.release.pod_console_choices': { params: [string]; response: Record<string, string[]> };
'chart.release.pod_logs_choices': { params: [string]; response: Record<string, string[]> };
'chart.release.query': { params: ChartReleaseQueryParams; response: App[] };
'chart.release.upgrade_summary': { params: AppUpgradeParams; response: AppUpgradeSummary };

// CloudBackup
'cloud_backup.abort': { params: [id: number]; response: void };
Expand Down Expand Up @@ -450,6 +443,7 @@ export interface ApiCallDirectory {
'disk.temperature_alerts': { params: [disks: string[]]; response: Alert[] };
'disk.temperatures': { params: [disks: string[]]; response: DiskTemperatures };
'disk.update': { params: [id: string, update: DiskUpdate]; response: Disk };
'disk.get_instance': { params: [id: string, params?: { extra: { supports_smart: boolean } }]; response: Disk };

// Enclosure
'enclosure2.query': { params: void; response: Enclosure[] };
Expand Down
2 changes: 1 addition & 1 deletion src/app/interfaces/api/api-event-directory.interface.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { DockerStatusResponse } from 'app/enums/docker-config.interface';
import { FailoverStatus } from 'app/enums/failover-status.enum';
import { Alert } from 'app/interfaces/alert.interface';
import { App, ChartStatisticsUpdate } from 'app/interfaces/chart-release.interface';
import { App, ChartStatisticsUpdate } from 'app/interfaces/app.interface';
import { PullContainerImageResponse, PullContainerImageParams, ContainerImage } from 'app/interfaces/container-image.interface';
import { DirectoryServicesState } from 'app/interfaces/directory-services-state.interface';
import { Disk } from 'app/interfaces/disk.interface';
Expand Down
22 changes: 5 additions & 17 deletions src/app/interfaces/api/api-job-directory.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,14 @@ import { DockerConfig, DockerConfigUpdate } from 'app/enums/docker-config.interf
import { SetAcl } from 'app/interfaces/acl.interface';
import { ActiveDirectoryConfig, LeaveActiveDirectory } from 'app/interfaces/active-directory-config.interface';
import { ActiveDirectoryUpdate } from 'app/interfaces/active-directory.interface';
import { AuditEntry } from 'app/interfaces/audit/audit.interface';
import { Certificate, CertificateCreate, CertificateUpdate } from 'app/interfaces/certificate.interface';
import {
ChartRollbackParams,
AppStartQueryParams,
ChartScaleResult,
AppDeleteParams,
} from 'app/interfaces/chart-release-event.interface';
import {
App,
AppCreate,
AppCreate, AppDeleteParams, AppStartQueryParams,
AppUpdate,
AppUpgrade,
AppUpgradeParams,
} from 'app/interfaces/chart-release.interface';
AppUpgradeParams, ChartRollbackParams,
} from 'app/interfaces/app.interface';
import { AuditEntry } from 'app/interfaces/audit/audit.interface';
import { Certificate, CertificateCreate, CertificateUpdate } from 'app/interfaces/certificate.interface';
import { CloudBackupRestoreParams, CloudBackupSnapshot } from 'app/interfaces/cloud-backup.interface';
import { CloudSyncTaskUpdate } from 'app/interfaces/cloud-sync-task.interface';
import { ConfigResetParams } from 'app/interfaces/config-reset-params.interface';
Expand Down Expand Up @@ -89,12 +82,7 @@ export interface ApiJobDirectory {
'app.upgrade': { params: AppUpgradeParams; response: App };

// Chart Release
'chart.release.create': { params: [AppCreate]; response: App };
'chart.release.delete': { params: [string, { delete_unused_images: boolean }]; response: boolean };
'chart.release.rollback': { params: [name: string, params: ChartRollbackParams]; response: App };
'chart.release.scale': { params: AppStartQueryParams; response: ChartScaleResult };
'chart.release.update': { params: [name: string, update: AppUpdate]; response: App };
'chart.release.upgrade': { params: [name: string, upgrade: AppUpgrade]; response: App };

// CloudBackup
'cloud_backup.sync': { params: [id: number, params?: { dry_run: boolean }]; response: void };
Expand Down
2 changes: 1 addition & 1 deletion src/app/interfaces/app-schema.interface.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { FormGroup } from '@angular/forms';
import { Subscription } from 'rxjs';
import { ChartFormValue, ChartSchemaNode, ChartSchemaNodeConf } from 'app/interfaces/chart-release.interface';
import { ChartFormValue, ChartSchemaNode, ChartSchemaNodeConf } from 'app/interfaces/app.interface';
import { AddListItemEvent, DynamicFormSchemaNode } from 'app/interfaces/dynamic-form-schema.interface';
import { HierarchicalObjectMap } from 'app/interfaces/hierarhical-object-map.interface';
import { CustomUntypedFormGroup } from 'app/modules/forms/ix-dynamic-form/components/ix-dynamic-form/classes/custom-untyped-form-group';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { App } from 'app/interfaces/app.interface';
import { AppUpgradeSummary } from 'app/interfaces/application.interface';
import { App } from 'app/interfaces/chart-release.interface';

export interface ChartUpgradeDialogConfig {
export interface AppUpgradeDialogConfig {
appInfo: App;
upgradeSummary: AppUpgradeSummary;
}
Loading

0 comments on commit 54fb573

Please sign in to comment.