Skip to content

Commit

Permalink
NAS-132330: Update TrueNAS Brand
Browse files Browse the repository at this point in the history
  • Loading branch information
denysbutenko committed Jan 9, 2025
1 parent e9440f1 commit 1008c98
Show file tree
Hide file tree
Showing 129 changed files with 569 additions and 281 deletions.
4 changes: 2 additions & 2 deletions src/app/enums/product-type.enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ export enum ProductType {
}

export const productTypeLabels = new Map<ProductType, string>([
[ProductType.Scale, ''],
[ProductType.ScaleEnterprise, 'ENTERPRISE'],
[ProductType.Scale, 'Community Edition'],
[ProductType.ScaleEnterprise, 'Enterprise'],
]);
5 changes: 3 additions & 2 deletions src/app/helpers/copyright-text.helper.spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { ProductType } from 'app/enums/product-type.enum';
import { getCopyrightText } from 'app/helpers/copyright-text.helper';

describe('getCopyrightText', () => {
it('should return the correct copyright text', () => {
expect(getCopyrightText(false, 2024)).toBe('TrueNAS ® © 2024');
expect(getCopyrightText(ProductType.Scale, 2024)).toBe('TrueNAS Community Edition ® © 2024');
});

it('should return the correct enterprise copyright text', () => {
expect(getCopyrightText(true, 2024)).toBe('TrueNAS ENTERPRISE ® © 2024');
expect(getCopyrightText(ProductType.ScaleEnterprise, 2024)).toBe('TrueNAS Enterprise ® © 2024');
});
});
12 changes: 7 additions & 5 deletions src/app/helpers/copyright-text.helper.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
export function getCopyrightText(isEnterprise: boolean, buildYear: number): string {
if (isEnterprise) {
return `TrueNAS ENTERPRISE ® © ${buildYear}`;
}
return `TrueNAS ® © ${buildYear}`;
import { ProductType, productTypeLabels } from 'app/enums/product-type.enum';

export function getCopyrightText(
productType: ProductType,
buildYear: number,
): string {
return `TrueNAS ${productTypeLabels.get(productType)} ® © ${buildYear}`;
}
2 changes: 1 addition & 1 deletion src/app/helptext/about.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ target="_blank">Enterprise level</a> support and services? Contact \
<a href="https://www.ixsystems.com/quote-form/?utm_source=truenas+core+ui&utm_medium=os&utm_campaign=welcome"\
target="_blank">iXsystems</a> for more information.'),

opensource: T('TrueNAS is Free and <a href="https://github.com/truenas/" target="_blank"> \
opensource: T('TrueNAS Community Edition is Free and <a href="https://github.com/truenas/" target="_blank"> \
Open Source</a> software, which is provided as-is with no warranty.'),

actionBtnText: {
Expand Down
18 changes: 2 additions & 16 deletions src/app/modules/layout/admin-layout/admin-layout.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,7 @@
(closedStart)="onMenuClosed()"
>
<div id="scroll-area" class="navigation-hold">
<div class="branding topbar" [class.truenas-scale]="!isEnterprise()">
<a routerLink="/dashboard" class="logo" ixTest="main-logo">
<ix-icon
class="app-logo"
[fullSize]="true"
[name]="isDefaultTheme ? 'ix-truenas-logo-mark-color': 'ix-truenas-logo-mark'"
></ix-icon>
</a>
<a routerLink="/dashboard" class="logo-text" ixTest="main-logo">
<ix-icon
class="app-logo-text"
[fullSize]="true"
[name]="isDefaultTheme ? iconMarker('ix-truenas-logo-type-color'): iconMarker('ix-truenas-logo-type')"
></ix-icon>
</a>
</div>
<ix-truenas-logo [hideText]="isSidenavCollapsed"></ix-truenas-logo>

<ix-navigation
[isSidenavCollapsed]="isSidenavCollapsed"
Expand Down Expand Up @@ -53,6 +38,7 @@
@if (hostname$ | async; as hostname) {
<div
class="hostname-label"
matTooltipPosition="above"
[matTooltip]="'Hostname: {hostname}' | translate: { hostname }"
>{{ hostname }}</div>
}
Expand Down
62 changes: 4 additions & 58 deletions src/app/modules/layout/admin-layout/admin-layout.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,78 +11,24 @@
width: 400px;
}

.app-logo,
.app-logo-text {
position: relative;
}

.app-logo {
height: 36px;
top: 13px;
width: 36px;
}

.logo-text {
align-items: center;
display: flex;
}

.branding {
align-items: center;
ix-truenas-logo {
background-color: var(--topbar) !important;
color: var(--topbar-txt) !important;
display: flex;
height: 48px;
justify-content: center;
left: 0;
line-height: 64px;
max-width: var(--sidenav-width); /*15rem;*/
overflow: hidden;
line-height: 48px;
max-width: var(--sidenav-width);
position: fixed;
text-align: center;
top: 0;
width: 100%;
z-index: 9999;

.app-logo {
margin-left: 8px;
margin-right: 8px;
}

.app-logo-text {
height: auto;
margin-right: 8px;
width: 96px;
}

&.truenas-scale {
.app-logo {
height: 40px;
top: 12px;
width: 40px;
}
}
}

.logo:focus-visible,
.logo-text:focus-visible {
background: var(--focus-bg);
box-shadow: 0 0 0 1.5px var(--focus-brd) inset !important;
outline-width: 0;
}

.app-side-nav-container {
height: 100vh;
height: 100%;
}

.enterprise-logo .ix-icon {
height: auto !important;
margin-left: -4px !important;
top: 14px !important;
width: 108px !important;
}

.hostname-label {
font-size: 12px;
margin: auto;
Expand All @@ -103,7 +49,7 @@

.copyright-line {
font-size: 10px;
margin: 0 58px;
margin: 0 46px;
}
}

Expand Down
7 changes: 3 additions & 4 deletions src/app/modules/layout/admin-layout/admin-layout.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
MatDrawerMode, MatSidenav, MatSidenavContainer, MatSidenavContent,
} from '@angular/material/sidenav';
import { MatTooltip } from '@angular/material/tooltip';
import { RouterLink, RouterOutlet } from '@angular/router';
import { RouterOutlet } from '@angular/router';
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
import { Store } from '@ngrx/store';
import { TranslateModule } from '@ngx-translate/core';
Expand All @@ -32,10 +32,10 @@ import { NavigationComponent } from 'app/modules/layout/navigation/navigation.co
import { SecondaryMenuComponent } from 'app/modules/layout/secondary-menu/secondary-menu.component';
import { SidenavService } from 'app/modules/layout/sidenav.service';
import { TopbarComponent } from 'app/modules/layout/topbar/topbar.component';
import { TruenasLogoComponent } from 'app/modules/layout/topbar/truenas-logo/truenas-logo.component';
import { DefaultPageHeaderComponent } from 'app/modules/page-header/default-page-header/default-page-header.component';
import { SlideInControllerComponent } from 'app/modules/slide-ins/components/slide-in-controller/slide-in-controller.component';
import { OldSlideInComponent } from 'app/modules/slide-ins/old-slide-in.component';
import { TestDirective } from 'app/modules/test-id/test.directive';
import { ThemeService } from 'app/modules/theme/theme.service';
import { SentryService } from 'app/services/sentry.service';
import { SessionTimeoutService } from 'app/services/session-timeout.service';
Expand All @@ -53,7 +53,6 @@ import { selectCopyrightText, selectIsEnterprise, waitForSystemInfo } from 'app/
imports: [
MatSidenavContainer,
MatSidenav,
RouterLink,
IxIconComponent,
NavigationComponent,
SecondaryMenuComponent,
Expand All @@ -69,7 +68,7 @@ import { selectCopyrightText, selectIsEnterprise, waitForSystemInfo } from 'app/
OldSlideInComponent,
AsyncPipe,
TranslateModule,
TestDirective,
TruenasLogoComponent,
],
})
export class AdminLayoutComponent implements OnInit, AfterViewInit, OnDestroy {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@
<div class="header">
<div class="header-overlay">
<div class="logo-wrapper">
<ix-icon
name="ix-truenas-logo"
class="logo"
[fullSize]="true"
></ix-icon>
<ix-truenas-logo color="white" [fullSize]="true"></ix-truenas-logo>
</div>
</div>
</div>
Expand All @@ -30,7 +26,7 @@ <h1 class="help">{{ helptext.help | translate }}</h1>
[innerHtml]="helptext.forums | translate"
></div>
</div>

@if (!isEnterprise()) {
<div
id="open-source"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,20 @@
display: flex;
margin: 20px 10px;

> *:first-child {
>*:first-child {
flex: 1 1 10%;
}

> *:last-child {
>*:last-child {
flex: 1 1 90%;
}
}

.bullet-icon {
font-size: 36px;
height: 36px;
width: 36px;;
width: 36px;
;
}

#ix-img {
Expand Down Expand Up @@ -115,6 +116,6 @@
.bullet-icon {
font-size: 24px;
height: 24px;
width: 24px;;
width: 24px;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import { MatButtonHarness } from '@angular/material/button/testing';
import { MatDialogRef } from '@angular/material/dialog';
import { createComponentFactory, Spectator, mockProvider } from '@ngneat/spectator/jest';
import { provideMockStore } from '@ngrx/store/testing';
import { TranslateModule } from '@ngx-translate/core';
import { MockComponent } from 'ng-mocks';
import { helptextAbout } from 'app/helptext/about';
import { IxIconComponent } from 'app/modules/ix-icon/ix-icon.component';
import { AboutDialogComponent } from 'app/modules/layout/topbar/about-dialog/about-dialog.component';
import { TruenasLogoComponent } from 'app/modules/layout/topbar/truenas-logo/truenas-logo.component';
import { ApiService } from 'app/modules/websocket/api.service';
import { SystemInfoState } from 'app/store/system-info/system-info.reducer';
import { selectSystemInfoState } from 'app/store/system-info/system-info.selectors';
Expand All @@ -19,9 +19,7 @@ describe('AboutDialogComponent', () => {

const createComponent = createComponentFactory({
component: AboutDialogComponent,
imports: [
TranslateModule.forRoot(),
],
imports: [],
providers: [
provideMockStore({
selectors: [
Expand All @@ -40,7 +38,10 @@ describe('AboutDialogComponent', () => {
mockProvider(ApiService),
mockProvider(MatDialogRef),
],
declarations: [MockComponent(IxIconComponent)],
declarations: [
MockComponent(IxIconComponent),
MockComponent(TruenasLogoComponent),
],
});

beforeEach(() => {
Expand Down Expand Up @@ -76,6 +77,6 @@ describe('AboutDialogComponent', () => {

it('should display product-specific open source text', () => {
const openSourceElement = spectator.query('#open-source');
expect(openSourceElement).toHaveText('TrueNAS is Free and Open Source software, which is provided as-is with no warranty.');
expect(openSourceElement).toHaveText('TrueNAS Community Edition is Free and Open Source software, which is provided as-is with no warranty.');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { map } from 'rxjs';
import { helptextAbout } from 'app/helptext/about';
import { IxIconComponent } from 'app/modules/ix-icon/ix-icon.component';
import { CopyrightLineComponent } from 'app/modules/layout/copyright-line/copyright-line.component';
import { TruenasLogoComponent } from 'app/modules/layout/topbar/truenas-logo/truenas-logo.component';
import { TestDirective } from 'app/modules/test-id/test.directive';
import { AppState } from 'app/store';
import { selectIsEnterprise, selectSystemInfoState } from 'app/store/system-info/system-info.selectors';
Expand All @@ -28,6 +29,7 @@ import { selectIsEnterprise, selectSystemInfoState } from 'app/store/system-info
TranslateModule,
TestDirective,
AsyncPipe,
TruenasLogoComponent,
],
})
export class AboutDialogComponent {
Expand Down
7 changes: 1 addition & 6 deletions src/app/modules/layout/topbar/topbar.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,7 @@

<ix-global-search-trigger></ix-global-search-trigger>

<a class="mobile-logo" routerLink="/" ixTest="mobile-logo">
<div class="mobile-logo-container">
<ix-icon name="ix-truenas-logo-mark-color" class="logomark" [fullSize]="true"></ix-icon>
<ix-icon name="ix-truenas-logo-type-color" class="logotype" [fullSize]="true"></ix-icon>
</div>
</a>
<ix-truenas-logo></ix-truenas-logo>

<div class="topbar-mobile-footer" [class.has-console-footer]="hasConsoleFooter$ | async">
<ix-logo></ix-logo>
Expand Down
33 changes: 8 additions & 25 deletions src/app/modules/layout/topbar/topbar.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -67,31 +67,14 @@
}
}

.mobile-logo {
display: none;
overflow: hidden;
width: 100%;

@media (max-width: $breakpoint-tablet) {
display: flex;
place-content: center;
}

.mobile-logo-container {
align-items: center;
display: flex;
gap: 10px;
height: 48px;
position: relative;
width: 200px;
}

.logomark {
width: 40px;
}

.logotype {
width: 96px;
ix-truenas-logo {
height: 48px;
opacity: 1;
visibility: visible;

@media(min-width: $breakpoint-tablet) {
opacity: 0;
visibility: hidden;
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/app/modules/layout/topbar/topbar.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { IxLogoComponent } from 'app/modules/layout/topbar/ix-logo/ix-logo.compo
import { JobsIndicatorComponent } from 'app/modules/layout/topbar/jobs-indicator/jobs-indicator.component';
import { PowerMenuComponent } from 'app/modules/layout/topbar/power-menu/power-menu.component';
import { TopbarComponent } from 'app/modules/layout/topbar/topbar.component';
import { TruenasLogoComponent } from 'app/modules/layout/topbar/truenas-logo/truenas-logo.component';
import { UserMenuComponent } from 'app/modules/layout/topbar/user-menu/user-menu.component';
import { ThemeService } from 'app/modules/theme/theme.service';
import { SystemGeneralService } from 'app/services/system-general.service';
Expand Down Expand Up @@ -53,6 +54,7 @@ describe('TopbarComponent', () => {
JobsIndicatorComponent,
UserMenuComponent,
PowerMenuComponent,
TruenasLogoComponent,
),
],
providers: [
Expand Down
Loading

0 comments on commit 1008c98

Please sign in to comment.