Browse Source

Refactoring

pull/5702/head
Thomas Kaul 3 weeks ago
parent
commit
38c71fb778
  1. 4
      apps/client/src/app/app.component.html
  2. 34
      apps/client/src/app/app.component.ts
  3. 14
      apps/client/src/app/components/footer/footer.component.html
  4. 2
      apps/client/src/app/components/footer/footer.component.scss
  5. 32
      apps/client/src/app/components/footer/footer.component.spec.ts

4
apps/client/src/app/app.component.html

@ -47,5 +47,7 @@
</main>
@if (showFooter) {
<gf-footer [info]="info" [user]="user" />
<footer class="justify-content-center overflow-hidden w-100">
<gf-footer class="py-4" [info]="info" [user]="user" />
</footer>
}

34
apps/client/src/app/app.component.ts

@ -55,32 +55,13 @@ export class AppComponent implements OnDestroy, OnInit {
public deviceType: string;
public hasImpersonationId: boolean;
public hasInfoMessage: boolean;
public hasPermissionForStatistics: boolean;
public hasPermissionForSubscription: boolean;
public hasPermissionToAccessFearAndGreedIndex: boolean;
public hasPermissionToChangeDateRange: boolean;
public hasPermissionToChangeFilters: boolean;
public hasPromotion = false;
public hasTabs = false;
public info: InfoItem;
public pageTitle: string;
public routerLinkAbout = publicRoutes.about.routerLink;
public routerLinkAboutChangelog =
publicRoutes.about.subRoutes.changelog.routerLink;
public routerLinkAboutLicense =
publicRoutes.about.subRoutes.license.routerLink;
public routerLinkAboutPrivacyPolicy =
publicRoutes.about.subRoutes.privacyPolicy.routerLink;
public routerLinkAboutTermsOfService =
publicRoutes.about.subRoutes.termsOfService.routerLink;
public routerLinkBlog = publicRoutes.blog.routerLink;
public routerLinkFaq = publicRoutes.faq.routerLink;
public routerLinkFeatures = publicRoutes.features.routerLink;
public routerLinkMarkets = publicRoutes.markets.routerLink;
public routerLinkOpenStartup = publicRoutes.openStartup.routerLink;
public routerLinkPricing = publicRoutes.pricing.routerLink;
public routerLinkRegister = publicRoutes.register.routerLink;
public routerLinkResources = publicRoutes.resources.routerLink;
public showFooter = false;
public user: User;
@ -125,21 +106,6 @@ export class AppComponent implements OnDestroy, OnInit {
this.deviceType = this.deviceService.getDeviceInfo().deviceType;
this.info = this.dataService.fetchInfo();
this.hasPermissionForSubscription = hasPermission(
this.info?.globalPermissions,
permissions.enableSubscription
);
this.hasPermissionForStatistics = hasPermission(
this.info?.globalPermissions,
permissions.enableStatistics
);
this.hasPermissionToAccessFearAndGreedIndex = hasPermission(
this.info?.globalPermissions,
permissions.enableFearAndGreedIndex
);
this.hasPromotion =
!!this.info?.subscriptionOffer?.coupon ||
!!this.info?.subscriptionOffer?.durationExtension;

14
apps/client/src/app/components/footer/footer.component.html

@ -1,5 +1,4 @@
<footer class="justify-content-center overflow-hidden py-4 w-100">
<div class="container">
<div class="container">
<div class="mb-3 row">
<div class="col-sm">
<a [routerLink]="['/']"><gf-logo /></a>
@ -169,15 +168,14 @@
<div class="row text-center text-muted">
<div class="col">
<small class="d-block" i18n
>The risk of loss in trading can be substantial. It is not advisable
to invest money you may need in the short term.</small
>The risk of loss in trading can be substantial. It is not advisable to
invest money you may need in the short term.</small
>
</div>
</div>
</div>
<div class="container d-none d-md-block mt-5">
</div>
<div class="container d-none d-md-block mt-5">
<div class="row justify-content-center">
<div class="font-weight-bold line-height-1 logotype">Ghostfolio</div>
</div>
</div>
</footer>
</div>

2
apps/client/src/app/components/footer/footer.component.scss

@ -1,6 +1,6 @@
:host {
display: block;
background-color: rgba(var(--palette-foreground-text), 0.05);
display: block;
font-size: 90%;
.logotype {

32
apps/client/src/app/components/footer/footer.component.spec.ts

@ -1,32 +0,0 @@
import { GfFooterComponent } from './footer.component';
// TODO: Fix Jest configuration for Ionic components
describe.skip('GfFooterComponent', () => {
let component: GfFooterComponent;
beforeEach(() => {
component = new GfFooterComponent();
});
it('should create', () => {
expect(component).toBeTruthy();
});
it('should have current year property', () => {
expect(component.currentYear).toBe(new Date().getFullYear());
});
it('should have router links defined', () => {
expect(component.routerLinkAbout).toBeDefined();
expect(component.routerLinkFeatures).toBeDefined();
expect(component.routerLinkResources).toBeDefined();
});
it('should initialize permission properties', () => {
component.ngOnChanges();
expect(component.hasPermissionForStatistics).toBeDefined();
expect(component.hasPermissionForSubscription).toBeDefined();
expect(component.hasPermissionToAccessFearAndGreedIndex).toBeDefined();
});
});
Loading…
Cancel
Save