Skip to content

Commit a5aa877

Browse files
Merge pull request #452 from dreamfactorysoftware/DP-771
[DP-771] Add banner to Open Source and Heroku trial
2 parents 912d863 + d6c76ae commit a5aa877

File tree

6 files changed

+141
-1
lines changed

6 files changed

+141
-1
lines changed

src/app/app.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<df-engagement-banner></df-engagement-banner>
12
<ng-container
23
*ngIf="(licenseCheck$ | async)?.disableUi === 'true'; else enabled">
34
<router-outlet />

src/app/app.component.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
NavigationEnd,
99
} from '@angular/router';
1010
import { DfSideNavComponent } from './shared/components/df-side-nav/df-side-nav.component';
11+
import { DfEngagementBannerComponent } from './shared/components/df-engagement-banner/df-engagement-banner.component';
1112
import { DfLicenseCheckService } from './shared/services/df-license-check.service';
1213
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
1314
import { AuthService } from './shared/services/auth.service';
@@ -22,7 +23,13 @@ import { filter } from 'rxjs/operators';
2223
templateUrl: './app.component.html',
2324
styleUrls: ['./app.component.scss'],
2425
standalone: true,
25-
imports: [DfSideNavComponent, RouterOutlet, NgIf, AsyncPipe],
26+
imports: [
27+
DfSideNavComponent,
28+
DfEngagementBannerComponent,
29+
RouterOutlet,
30+
NgIf,
31+
AsyncPipe,
32+
],
2633
})
2734
export class AppComponent implements OnInit {
2835
title = 'df-admin-interface';
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<ng-container *ngIf="showBanner">
2+
<div class="engagement-banner">
3+
<div class="banner-content">
4+
<span class="banner-text">
5+
{{ 'engagementBanner.message' | transloco }}
6+
</span>
7+
<button class="cta-button" (click)="openCalendly()">
8+
{{ 'engagementBanner.ctaButton' | transloco }}
9+
</button>
10+
</div>
11+
</div>
12+
<div class="banner-spacer"></div>
13+
</ng-container>
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
.engagement-banner {
2+
background-color: #ffd9b3;
3+
color: #2d2d2d;
4+
padding: 12px 20px;
5+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
6+
font-family: inherit;
7+
position: fixed;
8+
top: 0;
9+
left: 0;
10+
right: 0;
11+
z-index: 1100;
12+
13+
.banner-content {
14+
display: flex;
15+
align-items: center;
16+
justify-content: center;
17+
gap: 15px;
18+
max-width: 1200px;
19+
margin: 0 auto;
20+
position: relative;
21+
}
22+
23+
.banner-text {
24+
font-size: 14px;
25+
font-weight: 500;
26+
line-height: 1.4;
27+
}
28+
29+
.cta-button {
30+
background-color: #7c3aed;
31+
color: white;
32+
border: none;
33+
padding: 8px 20px;
34+
border-radius: 4px;
35+
font-size: 14px;
36+
font-weight: 600;
37+
cursor: pointer;
38+
transition: background-color 0.2s ease;
39+
white-space: nowrap;
40+
41+
&:hover {
42+
background-color: #6a28d9;
43+
}
44+
45+
&:focus {
46+
outline: 2px solid #7c3aed;
47+
outline-offset: 2px;
48+
}
49+
}
50+
}
51+
52+
.banner-spacer {
53+
height: 56px;
54+
}
55+
56+
@media (max-width: 768px) {
57+
.banner-spacer {
58+
height: 72px;
59+
}
60+
.engagement-banner {
61+
padding: 10px 15px;
62+
63+
.banner-content {
64+
flex-direction: column;
65+
gap: 10px;
66+
padding-right: 40px;
67+
}
68+
69+
.banner-text {
70+
font-size: 13px;
71+
text-align: center;
72+
}
73+
74+
.cta-button {
75+
padding: 8px 16px;
76+
font-size: 13px;
77+
}
78+
}
79+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import { Component, OnInit } from '@angular/core';
2+
import { CommonModule } from '@angular/common';
3+
import { DfSystemConfigDataService } from '../../services/df-system-config-data.service';
4+
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
5+
import { TranslocoModule } from '@ngneat/transloco';
6+
7+
@UntilDestroy({ checkProperties: true })
8+
@Component({
9+
selector: 'df-engagement-banner',
10+
templateUrl: './df-engagement-banner.component.html',
11+
styleUrls: ['./df-engagement-banner.component.scss'],
12+
standalone: true,
13+
imports: [CommonModule, TranslocoModule],
14+
})
15+
export class DfEngagementBannerComponent implements OnInit {
16+
showBanner = false;
17+
calendlyUrl =
18+
'https://calendly.com/dreamfactory-platform/expert-consultation-lab-setup';
19+
20+
constructor(private systemConfigService: DfSystemConfigDataService) {}
21+
22+
ngOnInit() {
23+
this.systemConfigService.environment$
24+
.pipe(untilDestroyed(this))
25+
.subscribe(environment => {
26+
const license = environment.platform?.license?.toUpperCase();
27+
const isTrial = environment.platform?.isTrial ?? false;
28+
29+
this.showBanner = license === 'OPEN SOURCE' || isTrial;
30+
});
31+
}
32+
33+
openCalendly() {
34+
window.open(this.calendlyUrl, '_blank');
35+
}
36+
}

src/assets/i18n/en.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,5 +442,9 @@
442442
"language": "Change language",
443443
"languages": {
444444
"en": "English"
445+
},
446+
"engagementBanner": {
447+
"message": "Testing DreamFactory? Let's show you what's possible. Book your free walkthrough",
448+
"ctaButton": "Schedule Now"
445449
}
446450
}

0 commit comments

Comments
 (0)