This is an automated email from the ASF dual-hosted git repository. riemer pushed a commit to branch STREAMPIPES-319 in repository https://gitbox.apache.org/repos/asf/incubator-streampipes.git
commit 479f2eeb841275adedc281e1901135da66f9132f Author: Dominik Riemer <[email protected]> AuthorDate: Tue Jul 13 21:29:46 2021 +0200 [STREAMPIPES-398] Extract string constants to separate class --- .../endpoint-item/endpoint-item.component.html | 2 +- .../endpoint-item/endpoint-item.component.ts | 4 ++- .../data-marketplace.component.html | 2 +- .../components/feedback/feedback.component.html | 2 +- .../core/components/feedback/feedback.component.ts | 8 +++--- .../welcome-tour/welcome-tour.component.html | 8 +++--- .../dialog/welcome-tour/welcome-tour.component.ts | 4 ++- ui/src/app/home/home.component.html | 9 ++----- ui/src/app/home/home.component.ts | 6 +++-- .../login/components/setup/setup.component.html | 2 +- .../app/login/components/setup/setup.component.ts | 4 ++- .../components/startup/startup.component.html | 4 +-- .../login/components/startup/startup.component.ts | 4 ++- .../profile/components/basic-profile-settings.ts | 4 ++- .../token/token-management-settings.component.html | 2 +- .../{services.module.ts => app.constants.ts} | 29 +++++----------------- ui/src/app/services/services.module.ts | 2 ++ 17 files changed, 45 insertions(+), 51 deletions(-) diff --git a/ui/src/app/add/components/endpoint-item/endpoint-item.component.html b/ui/src/app/add/components/endpoint-item/endpoint-item.component.html index 7b804bd..dd30b85 100644 --- a/ui/src/app/add/components/endpoint-item/endpoint-item.component.html +++ b/ui/src/app/add/components/endpoint-item/endpoint-item.component.html @@ -31,7 +31,7 @@ </div> <div fxFlex fxLayout="column"> - <div class="ml-5"><small *ngIf="!(item.editable)">Internally managed by StreamPipes</small></div> + <div class="ml-5"><small *ngIf="!(item.editable)">Internally managed by {{appConstants.APP_NAME}}</small></div> <div fxFlex fxLayoutAlign="start end" class="ml-5"> <button class="small-button-add" mat-button mat-raised-button color="accent" [disabled]="!(item.editable)" (click)="installSingleElement($event, item)" *ngIf="!item.installed"> diff --git a/ui/src/app/add/components/endpoint-item/endpoint-item.component.ts b/ui/src/app/add/components/endpoint-item/endpoint-item.component.ts index 7bdf08e..55fb649 100644 --- a/ui/src/app/add/components/endpoint-item/endpoint-item.component.ts +++ b/ui/src/app/add/components/endpoint-item/endpoint-item.component.ts @@ -22,6 +22,7 @@ import {PipelineElementEndpointService} from "../../../platform-services/apis/pi import {AddService} from "../../services/add.service"; import {DomSanitizer, SafeUrl} from "@angular/platform-browser"; import {ExtensionsServiceEndpointItem} from "../../../core-model/gen/streampipes-model-client"; +import {AppConstants} from "../../../services/app.constants"; @Component({ selector: 'endpoint-item', @@ -49,7 +50,8 @@ export class EndpointItemComponent implements OnInit { constructor(private snackBar: MatSnackBar, private PipelineElementEndpointService: PipelineElementEndpointService, private addService: AddService, - private sanitizer: DomSanitizer) { + private sanitizer: DomSanitizer, + public appConstants: AppConstants) { } diff --git a/ui/src/app/connect/components/data-marketplace/data-marketplace.component.html b/ui/src/app/connect/components/data-marketplace/data-marketplace.component.html index 762df25..4c4e3a6 100644 --- a/ui/src/app/connect/components/data-marketplace/data-marketplace.component.html +++ b/ui/src/app/connect/components/data-marketplace/data-marketplace.component.html @@ -76,7 +76,7 @@ </div> <div class="container-fluid marketplace-container" *ngIf="adapterLoadingError" fxFlex="100" fxLayoutAlign="center center" fxLayout="row"> - <h4>Available adapters could not be loaded. Did you start a StreamPipes Connect worker node?</h4> + <h4>Available adapters could not be loaded. Did you start a Connect worker node?</h4> </div> <div class="container-fluid marketplace-container" *ngIf="adaptersLoading" fxFlex="100" fxLayoutAlign="center center" fxLayout="row"> diff --git a/ui/src/app/core/components/feedback/feedback.component.html b/ui/src/app/core/components/feedback/feedback.component.html index 790ffd1..781c749 100644 --- a/ui/src/app/core/components/feedback/feedback.component.html +++ b/ui/src/app/core/components/feedback/feedback.component.html @@ -23,7 +23,7 @@ </div> <div fxLayout="column" fxFlex="40" fxLayoutAlign="start center" style="margin-bottom:20px;"> <div fxFlex="100" class="feedback-explainer"> - <span>Your feedback helps us to improve StreamPipes.<br/></span> + <span>Your feedback helps us to improve {{appConstants.APP_NAME}}.<br/></span> <span>Features you'd like to see, bugs you've found or things you like - tell us what you think!</span> </div> </div> diff --git a/ui/src/app/core/components/feedback/feedback.component.ts b/ui/src/app/core/components/feedback/feedback.component.ts index 11ebd11..5bf00d6 100644 --- a/ui/src/app/core/components/feedback/feedback.component.ts +++ b/ui/src/app/core/components/feedback/feedback.component.ts @@ -17,6 +17,7 @@ */ import {Component, EventEmitter, OnInit, Output} from "@angular/core"; +import {AppConstants} from "../../../services/app.constants"; @Component({ selector: 'feedback', @@ -36,9 +37,10 @@ export class FeedbackComponent implements OnInit { feedbackUrl = ""; debugFeedbackUrl = ""; - targetEmail = "[email protected]"; + targetEmail: string; - constructor() { + constructor(public appConstants: AppConstants) { + this.targetEmail = appConstants.EMAIL; } ngOnInit() { @@ -57,4 +59,4 @@ export class FeedbackComponent implements OnInit { window.open("mailto:"+ this.targetEmail + "?subject=" +"[USER-FEEDBACK]" +"&body=" +this.feedback.feedbackText, "_self"); this.sendingFeedbackFinished = true; }; -} \ No newline at end of file +} diff --git a/ui/src/app/editor/dialog/welcome-tour/welcome-tour.component.html b/ui/src/app/editor/dialog/welcome-tour/welcome-tour.component.html index 16772ad..cd7dcc9 100644 --- a/ui/src/app/editor/dialog/welcome-tour/welcome-tour.component.html +++ b/ui/src/app/editor/dialog/welcome-tour/welcome-tour.component.html @@ -20,15 +20,15 @@ <div class="sp-dialog-content p-15" fxLayout="column"> <div fxFlex="100" fxLayoutAlign="center center" fxLayout="column"> <b><h2 class="welcome-animation">Hello!</h2></b> - <b><h3>Thank you for using StreamPipes.</h3></b> + <b><h3>Thank you for using {{appConstants.APP_NAME}}.</h3></b> </div> <div><img src="assets/img/sp-pipeline-white-small.png" style="margin-left:auto;margin-right:auto;display:block;"> </div> <div fxFlex="100" fxLayoutAlign="center center" fxLayout="column"> <div fxFlex="100" fxLayoutAlign="center center" fxLayout="column"> - <b>StreamPipes is your self-service toolbox for real-time analytics.</b> - <p>If you are using StreamPipes for the first time, we recommend taking the interactive tour!</p> + <b>{{appConstants.APP_NAME}} is your self-service toolbox for real-time analytics.</b> + <p>If you are using {{appConstants.APP_NAME}} for the first time, we recommend taking the interactive tour!</p> </div> <button mat-button mat-raised-button color="primary" (click)="startCreatePipelineTour()">Start Tour</button> </div> @@ -42,4 +42,4 @@ Close </button> </div> -</div> \ No newline at end of file +</div> diff --git a/ui/src/app/editor/dialog/welcome-tour/welcome-tour.component.ts b/ui/src/app/editor/dialog/welcome-tour/welcome-tour.component.ts index 66bcaf4..eea09a4 100644 --- a/ui/src/app/editor/dialog/welcome-tour/welcome-tour.component.ts +++ b/ui/src/app/editor/dialog/welcome-tour/welcome-tour.component.ts @@ -20,6 +20,7 @@ import {DialogRef} from "../../../core-ui/dialog/base-dialog/dialog-ref"; import {RestApi} from "../../../services/rest-api.service"; import {ShepherdService} from "../../../services/tour/shepherd.service"; import {Component} from "@angular/core"; +import {AppConstants} from "../../../services/app.constants"; @Component({ selector: 'welcome-tour', @@ -32,7 +33,8 @@ export class WelcomeTourComponent { constructor(private DialogRef: DialogRef<WelcomeTourComponent>, private RestApi: RestApi, - private ShepherdService: ShepherdService) { + private ShepherdService: ShepherdService, + public appConstants: AppConstants) { } startCreatePipelineTour() { diff --git a/ui/src/app/home/home.component.html b/ui/src/app/home/home.component.html index bf5eea9..c9699d9 100644 --- a/ui/src/app/home/home.component.html +++ b/ui/src/app/home/home.component.html @@ -21,12 +21,7 @@ <div fxFlex="100"> <div fxFlex="100" fxLayout="column"> <div class="p-10 header-margin" fxLayoutAlign="center center"> - <div class="welcome-text">Welcome to Apache - <span class="welcome-primary">S</span> - <span class="welcome-accent">tream</span> - <span class="welcome-primary">P</span> - <span class="welcome-accent">ipes</span>! - </div> + <div class="welcome-text">Welcome to {{appConstants.APP_NAME}}!</div> </div> <div fxLayout="column" fxFlex="100" class="home-margin"> <div fxFlex="100" fxLayoutAlign="start center"> @@ -34,7 +29,7 @@ </div> <div fxFlex="100"> <div class="assemblyOptions sp-blue-bg mt-0 round-border" style="padding:5px;"> - <h4>StreamPipes Modules</h4> + <h4>{{appConstants.APP_NAME}} Modules</h4> </div> <div class="sp-blue-border pt-0" fxLayout="column"> <div fxFlex="100" fxLayout="column"> diff --git a/ui/src/app/home/home.component.ts b/ui/src/app/home/home.component.ts index c638c80..f1b7c35 100644 --- a/ui/src/app/home/home.component.ts +++ b/ui/src/app/home/home.component.ts @@ -20,6 +20,7 @@ import {Component} from '@angular/core'; import {DomSanitizer} from '@angular/platform-browser'; import {HomeService} from './home.service'; import {Router} from "@angular/router"; +import {AppConstants} from "../services/app.constants"; @Component({ templateUrl: './home.component.html', @@ -31,7 +32,8 @@ export class HomeComponent { constructor(private homeService: HomeService, private sanitizer: DomSanitizer, - private Router: Router) { + private Router: Router, + public appConstants: AppConstants) { this.serviceLinks = this.homeService.getServiceLinks(); } @@ -47,4 +49,4 @@ export class HomeComponent { } } -} \ No newline at end of file +} diff --git a/ui/src/app/login/components/setup/setup.component.html b/ui/src/app/login/components/setup/setup.component.html index 15c3943..ace0dfb 100644 --- a/ui/src/app/login/components/setup/setup.component.html +++ b/ui/src/app/login/components/setup/setup.component.html @@ -22,7 +22,7 @@ <form #setupForm="ngForm" fxFlex="100" fxLayout="column"> <div class="setup-header p-20"> <img class="sp-logo" alt="icon" src="../../../../assets/img/login/logo.png"> - <h2 class="text-center">Welcome to Apache StreamPipes!</h2> + <h2 class="text-center">Welcome to {{appConstants.APP_NAME}}!</h2> <span class="text-center">Create a user and you are ready to go (the initial setup might take some time)</span> </div> <div fxFlex="100" fxLayout="column" *ngIf="!installationRunning" > diff --git a/ui/src/app/login/components/setup/setup.component.ts b/ui/src/app/login/components/setup/setup.component.ts index dfac67d..cf01ed7 100644 --- a/ui/src/app/login/components/setup/setup.component.ts +++ b/ui/src/app/login/components/setup/setup.component.ts @@ -21,6 +21,7 @@ import {RestApi} from "../../../services/rest-api.service"; import {FormGroup} from "@angular/forms"; import {LoginService} from "../../services/login.service"; import {Router} from "@angular/router"; +import {AppConstants} from "../../../services/app.constants"; @Component({ selector: 'setup', @@ -45,7 +46,8 @@ export class SetupComponent { constructor(private loginService: LoginService, private RestApi: RestApi, - private router: Router) { + private router: Router, + public appConstants: AppConstants) { this.installationFinished = false; this.installationSuccessful = false; diff --git a/ui/src/app/login/components/startup/startup.component.html b/ui/src/app/login/components/startup/startup.component.html index 5a58bcc..2c118ce 100644 --- a/ui/src/app/login/components/startup/startup.component.html +++ b/ui/src/app/login/components/startup/startup.component.html @@ -25,8 +25,8 @@ <h2>Welcome!</h2> </div> <div fxFlex="100"> - <h4 style="text-align:center;">Please wait while StreamPipes is starting up.</h4> - <h5 style="text-align:center;"><i>On some systems, initial startup might take a few minutes. We'll automatically forward you once StreamPipes is ready.</i></h5> + <h4 style="text-align:center;">Please wait while {{appConstants.APP_NAME}} is starting up.</h4> + <h5 style="text-align:center;"><i>On some systems, initial startup might take a few minutes. We'll automatically forward you once {{appConstants.APP_NAME}} is ready.</i></h5> </div> <div fxFlex="100" fxLayoutAlign="center center"> diff --git a/ui/src/app/login/components/startup/startup.component.ts b/ui/src/app/login/components/startup/startup.component.ts index 8f90a53..7d01845 100644 --- a/ui/src/app/login/components/startup/startup.component.ts +++ b/ui/src/app/login/components/startup/startup.component.ts @@ -20,6 +20,7 @@ import {AuthService} from "../../../services/auth.service"; import {AuthStatusService} from "../../../services/auth-status.service"; import {Component, Inject, OnInit} from "@angular/core"; import {Router} from "@angular/router"; +import {AppConstants} from "../../../services/app.constants"; @Component({ selector: 'startup', @@ -34,7 +35,8 @@ export class StartupComponent implements OnInit { constructor(private AuthService: AuthService, private AuthStatusService: AuthStatusService, - private Router: Router) { + private Router: Router, + public appConstants: AppConstants) { } ngOnInit() { diff --git a/ui/src/app/profile/components/basic-profile-settings.ts b/ui/src/app/profile/components/basic-profile-settings.ts index 0f31f7d..1bc1c00 100644 --- a/ui/src/app/profile/components/basic-profile-settings.ts +++ b/ui/src/app/profile/components/basic-profile-settings.ts @@ -19,6 +19,7 @@ import {ProfileService} from "../profile.service"; import {User} from "../../core-model/gen/streampipes-model-client"; import {Directive} from "@angular/core"; +import {AppConstants} from "../../services/app.constants"; @Directive() export abstract class BasicProfileSettings { @@ -28,7 +29,8 @@ export abstract class BasicProfileSettings { profileUpdating: boolean = false; errorMessage: string; - constructor(protected profileService: ProfileService) { + constructor(protected profileService: ProfileService, + public appConstants: AppConstants) { } diff --git a/ui/src/app/profile/components/token/token-management-settings.component.html b/ui/src/app/profile/components/token/token-management-settings.component.html index 63a7474..f21451b 100644 --- a/ui/src/app/profile/components/token/token-management-settings.component.html +++ b/ui/src/app/profile/components/token/token-management-settings.component.html @@ -22,7 +22,7 @@ <div fxFlex="300px" fxLayout="column" class="profile-section"> <div class="settings-title">API Keys</div> <div class="settings-description">Manage your API keys for third-party application access to - StreamPipes. + {{appConstants.APP_NAME}}. </div> </div> <div fxFill fxLayout="column"> diff --git a/ui/src/app/services/services.module.ts b/ui/src/app/services/app.constants.ts similarity index 52% copy from ui/src/app/services/services.module.ts copy to ui/src/app/services/app.constants.ts index 1413a40..3147f32 100644 --- a/ui/src/app/services/services.module.ts +++ b/ui/src/app/services/app.constants.ts @@ -16,28 +16,11 @@ * */ -import {NgModule} from "@angular/core"; -import {RestApi} from "./rest-api.service"; -import {AuthService} from "./auth.service"; -import {ShepherdService} from "./tour/shepherd.service"; -import {TourProviderService} from "./tour/tour-provider.service"; -import {NotificationCountService} from "./notification-count-service"; -import {PropertySelectorService} from "./property-selector.service"; -import {ElementIconText} from "./get-element-icon-text.service"; +import {Injectable} from "@angular/core"; -@NgModule({ - imports: [], - declarations: [], - providers: [ - RestApi, - AuthService, - ElementIconText, - ShepherdService, - TourProviderService, - NotificationCountService, - PropertySelectorService, - ], - entryComponents: [] -}) -export class ServicesModule { +@Injectable() +export class AppConstants { + + public readonly APP_NAME = "Apache StreamPipes"; + public readonly EMAIL = "[email protected]"; } diff --git a/ui/src/app/services/services.module.ts b/ui/src/app/services/services.module.ts index 1413a40..93499c2 100644 --- a/ui/src/app/services/services.module.ts +++ b/ui/src/app/services/services.module.ts @@ -24,11 +24,13 @@ import {TourProviderService} from "./tour/tour-provider.service"; import {NotificationCountService} from "./notification-count-service"; import {PropertySelectorService} from "./property-selector.service"; import {ElementIconText} from "./get-element-icon-text.service"; +import {AppConstants} from "./app.constants"; @NgModule({ imports: [], declarations: [], providers: [ + AppConstants, RestApi, AuthService, ElementIconText,
