mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-17 11:19:15 +00:00
making the link to GitHub Pages part of a branding configuration
This commit is contained in:
+1
-1
@@ -68,7 +68,7 @@ public class Footer extends Composite {
|
||||
supportAnchor.getStyle().setDisplay(Display.NONE);
|
||||
privacyAnchorLink.getStyle().setDisplay(Display.NONE);
|
||||
jobsAnchor.getStyle().setDisplay(Display.NONE);
|
||||
sourceCodeAnchor.setHref("https://sailing-analytics.eclipse.dev/");
|
||||
sourceCodeAnchor.setHref("https://github.com/eclipse-sailing-analytics/sailing-analytics");
|
||||
} else {
|
||||
hideIfBlank(copyrightDiv, cfg.getFooterCopyright());
|
||||
setHrefOrHide(privacyAnchorLink, cfg.getFooterPrivacyLink());
|
||||
|
||||
+1
-1
@@ -43,12 +43,12 @@ public class SocialFooter extends Composite {
|
||||
ClientConfiguration cfg = ClientConfiguration.getInstance();
|
||||
SocialFooterResources.INSTANCE.css().ensureInjected();
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
setHrefOrHide(gitHubItem, gitHubLink, gitHubTopText, cfg.getGitHubPagesLink(), cfg.getFollowGitHub(Optional.empty()));
|
||||
if (!cfg.isBrandingActive() || !Util.hasLength(cfg.getFollowSports(Optional.empty()))) {
|
||||
htmlPanel.getElement().getStyle().setDisplay(Display.NONE);
|
||||
} else {
|
||||
socialHeading.setInnerText(cfg.getFollowSports(Optional.empty()));
|
||||
setHrefOrHide(xItem, xLink, xTopText, cfg.getxLink(), cfg.getSportsOn(Optional.empty()));
|
||||
setHrefOrHide(gitHubItem, gitHubLink, gitHubTopText, cfg.getGitHubLink(), cfg.getFollowGitHub(Optional.empty()));
|
||||
setHrefOrHide(facebookItem, facebookLink, facebookTopText, cfg.getFacebookLink(), cfg.getSportsOn(Optional.empty()));
|
||||
setHrefOrHide(instagramItem, instagramLink, instagramTopText, cfg.getInstagramLink(), cfg.getSportsOn(Optional.empty()));
|
||||
}
|
||||
|
||||
+1
-1
@@ -72,7 +72,7 @@ public class Footer extends Composite {
|
||||
supportAnchor.getStyle().setDisplay(Display.NONE);
|
||||
jobsAnchor.getStyle().setDisplay(Display.NONE);
|
||||
privacyAnchor.getStyle().setDisplay(Display.NONE);
|
||||
sourceCodeAnchor.setHref("https://sailing-analytics.eclipse.dev/");
|
||||
sourceCodeAnchor.setHref("https://github.com/eclipse-sailing-analytics/sailing-analytics");
|
||||
} else {
|
||||
pipe.setInnerText("|");
|
||||
if (!hideIfBlank(copyrightDiv, cfg.getFooterCopyright())) {
|
||||
|
||||
+1
-1
@@ -43,6 +43,7 @@ public class SocialFooter extends Composite {
|
||||
ClientConfiguration cfg = ClientConfiguration.getInstance();
|
||||
SocialFooterResources.INSTANCE.css().ensureInjected();
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
setHrefOrHide(gitHubItem, gitHubLink, gitHubTopText, cfg.getGitHubPagesLink(), cfg.getFollowGitHub(Optional.empty()));
|
||||
if (!cfg.isBrandingActive() || !Util.hasLength(cfg.getFollowSports(Optional.empty()))) {
|
||||
htmlPanel.getElement().getStyle().setDisplay(Display.NONE);
|
||||
} else {
|
||||
@@ -50,7 +51,6 @@ public class SocialFooter extends Composite {
|
||||
setHrefOrHide(xItem, xLink, xTopText, cfg.getxLink(), cfg.getSportsOn(Optional.empty()));
|
||||
setHrefOrHide(facebookItem, facebookLink, facebookTopText, cfg.getFacebookLink(), cfg.getSportsOn(Optional.empty()));
|
||||
setHrefOrHide(instagramItem, instagramLink, instagramTopText, cfg.getInstagramLink(), cfg.getSportsOn(Optional.empty()));
|
||||
setHrefOrHide(gitHubItem, gitHubLink, gitHubTopText, cfg.getGitHubLink(), cfg.getFollowGitHub(Optional.empty()));
|
||||
}
|
||||
htmlPanel.getElement().setAttribute(DEBUG_ID_ATTRIBUTE, "socialFooter");
|
||||
}
|
||||
|
||||
+39
-22
@@ -13,19 +13,19 @@ public class SAPBrandingConfiguration implements BrandingConfiguration {
|
||||
private String greyTransparentLogoURL;
|
||||
private final ResourceBundleStringMessages sailingServerStringMessages;
|
||||
private static final String STRING_MESSAGES_BASE_NAME = "stringmessages/SAPBrandingStringMessages";
|
||||
|
||||
|
||||
/**
|
||||
* The following path consists of the "Web-ContextPath" from the bundle's MANIFEST.MF, followed by the
|
||||
* images folder name and hence constitutes the URL path to which a "/" and the image file name has to
|
||||
* be appended to obtain a URL path to an image.
|
||||
* The following path consists of the "Web-ContextPath" from the bundle's MANIFEST.MF, followed by the images folder
|
||||
* name and hence constitutes the URL path to which a "/" and the image file name has to be appended to obtain a URL
|
||||
* path to an image.
|
||||
*/
|
||||
private static final String IMAGES_ROOT = "/sap-branding/images";
|
||||
|
||||
public SAPBrandingConfiguration() {
|
||||
sailingServerStringMessages = ResourceBundleStringMessages.create(STRING_MESSAGES_BASE_NAME, getClass().getClassLoader(),
|
||||
StandardCharsets.UTF_8.name());
|
||||
sailingServerStringMessages = ResourceBundleStringMessages.create(STRING_MESSAGES_BASE_NAME,
|
||||
getClass().getClassLoader(), StandardCharsets.UTF_8.name());
|
||||
}
|
||||
|
||||
|
||||
private static String image(String fileName) {
|
||||
return IMAGES_ROOT + "/" + fileName;
|
||||
}
|
||||
@@ -49,7 +49,7 @@ public class SAPBrandingConfiguration implements BrandingConfiguration {
|
||||
public String getBrandTitle(Optional<String> locale) {
|
||||
return "SAP";
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getSolutionsInSailingImageURL() {
|
||||
return image("solutions-sap-in-sailing.jpg");
|
||||
@@ -74,7 +74,7 @@ public class SAPBrandingConfiguration implements BrandingConfiguration {
|
||||
public String getSailInSightAppImageURL() {
|
||||
return image("solutions-sap-sailing-insight.png");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getSailingSimulatorImageURL() {
|
||||
return image("solutions-simulator.png");
|
||||
@@ -97,12 +97,14 @@ public class SAPBrandingConfiguration implements BrandingConfiguration {
|
||||
|
||||
@Override
|
||||
public String getSailingAnalyticsReadMoreText(Optional<String> locale) {
|
||||
return sailingServerStringMessages.get(locale.map(l->Locale.forLanguageTag(l)).orElse(Locale.ENGLISH), "sailingAnalyticsReadMore");
|
||||
return sailingServerStringMessages.get(locale.map(l -> Locale.forLanguageTag(l)).orElse(Locale.ENGLISH),
|
||||
"sailingAnalyticsReadMore");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getSailingAnalyticsSailing(Optional<String> locale) {
|
||||
return sailingServerStringMessages.get(locale.map(l->Locale.forLanguageTag(l)).orElse(Locale.ENGLISH), "sailingAnalyticsSailing");
|
||||
return sailingServerStringMessages.get(locale.map(l -> Locale.forLanguageTag(l)).orElse(Locale.ENGLISH),
|
||||
"sailingAnalyticsSailing");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -127,12 +129,14 @@ public class SAPBrandingConfiguration implements BrandingConfiguration {
|
||||
|
||||
@Override
|
||||
public String getSportsOn(Optional<String> locale) {
|
||||
return sailingServerStringMessages.get(locale.map(l->Locale.forLanguageTag(l)).orElse(Locale.ENGLISH), "sportsOn");
|
||||
return sailingServerStringMessages.get(locale.map(l -> Locale.forLanguageTag(l)).orElse(Locale.ENGLISH),
|
||||
"sportsOn");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFollowSports(Optional<String> locale) {
|
||||
return sailingServerStringMessages.get(locale.map(l->Locale.forLanguageTag(l)).orElse(Locale.ENGLISH), "followSports");
|
||||
return sailingServerStringMessages.get(locale.map(l -> Locale.forLanguageTag(l)).orElse(Locale.ENGLISH),
|
||||
"followSports");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -149,45 +153,58 @@ public class SAPBrandingConfiguration implements BrandingConfiguration {
|
||||
public String getInstagramLink() {
|
||||
return "https://www.instagram.com/sap/";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getWelcomeToSailingAnalytics(Optional<String> locale) {
|
||||
return sailingServerStringMessages.get(locale.map(l->Locale.forLanguageTag(l)).orElse(Locale.ENGLISH), "welcomeToSailingAnalytics");
|
||||
return sailingServerStringMessages.get(locale.map(l -> Locale.forLanguageTag(l)).orElse(Locale.ENGLISH),
|
||||
"welcomeToSailingAnalytics");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getWelcomeToSailingAnalyticsBody(Optional<String> locale) {
|
||||
return sailingServerStringMessages.get(locale.map(l->Locale.forLanguageTag(l)).orElse(Locale.ENGLISH), "welcomeToSailingAnalyticsBody");
|
||||
return sailingServerStringMessages.get(locale.map(l -> Locale.forLanguageTag(l)).orElse(Locale.ENGLISH),
|
||||
"welcomeToSailingAnalyticsBody");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getMoreLoginInformationNotificationsURL() {
|
||||
return image("notifications.png");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getMoreLoginInformationSettingsURL() {
|
||||
return image("settings.png");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getMoreLoginInformationSailorProfilesURL() {
|
||||
return image("sailorprofiles.png");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getMoreLoginInformationSimulatorURL() {
|
||||
return image("simulator.png");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInSailingContent(Optional<String> locale) {
|
||||
return sailingServerStringMessages.get(locale.map(l -> Locale.forLanguageTag(l)).orElse(Locale.ENGLISH), "inSailingContent");
|
||||
return sailingServerStringMessages.get(locale.map(l -> Locale.forLanguageTag(l)).orElse(Locale.ENGLISH),
|
||||
"inSailingContent");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFollowGitHub(Optional<String> locale) {
|
||||
return sailingServerStringMessages.get(locale.map(l -> Locale.forLanguageTag(l)).orElse(Locale.ENGLISH), "followGitHub");
|
||||
return sailingServerStringMessages.get(locale.map(l -> Locale.forLanguageTag(l)).orElse(Locale.ENGLISH),
|
||||
"followGitHub");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGitHubLink() {
|
||||
return "https://github.com/SAP/sailing-analytics";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGitHubPagesLink() {
|
||||
return "https://docs.sapsailing.com";
|
||||
}
|
||||
}
|
||||
|
||||
+2
-1
@@ -140,7 +140,8 @@ public interface BrandingConfigurationService {
|
||||
FOLLOW_GITHUB("followGitHub"),
|
||||
|
||||
GITHUB_LINK("gitHubLink"),
|
||||
|
||||
|
||||
GITHUB_PAGES_LINK("gitHubPagesLink"),
|
||||
|
||||
/**
|
||||
* If you place the value of the property identified by this constant into a {@code script} tag in a HTML/JSP page, it will
|
||||
|
||||
+1
@@ -145,6 +145,7 @@ public class BrandingConfigurationServiceImpl implements BrandingConfigurationSe
|
||||
map.put(BrandingConfigurationProperty.WELCOME_TO_SAILING_ANALYTICS_BODY, brandingConfiguration == null ? "" : brandingConfiguration.getWelcomeToSailingAnalyticsBody(locale));
|
||||
map.put(BrandingConfigurationProperty.FOLLOW_GITHUB, brandingConfiguration == null ? "" : brandingConfiguration.getFollowGitHub(locale));
|
||||
map.put(BrandingConfigurationProperty.GITHUB_LINK, brandingConfiguration == null ? "" : brandingConfiguration.getGitHubLink());
|
||||
map.put(BrandingConfigurationProperty.GITHUB_PAGES_LINK, brandingConfiguration == null ? "https://sailing-analytics.eclipse.dev" : brandingConfiguration.getGitHubPagesLink());
|
||||
map.put(BrandingConfigurationProperty.DEBRANDING_ACTIVE_JSP_PROPERTY_NAME, !isBrandingActive());
|
||||
map.put(BrandingConfigurationProperty.BRANDING_ACTIVE_JSP_PROPERTY_NAME, isBrandingActive());
|
||||
map.put(BrandingConfigurationProperty.DASH_WHITELABELED_JSP_PROPERTY_NAME, whitelabeled);
|
||||
|
||||
@@ -260,4 +260,13 @@ public interface BrandingConfiguration {
|
||||
* @return absolute URL. Empty to hide the icon/link.
|
||||
*/
|
||||
String getGitHubLink();
|
||||
|
||||
|
||||
/**
|
||||
* Brand’s GitHub Pages URL, if it exists; contains a brand-specific version of a
|
||||
* project presentation.
|
||||
*
|
||||
* @return absolute URL. Empty to hide the icon/link.
|
||||
*/
|
||||
String getGitHubPagesLink();
|
||||
}
|
||||
|
||||
+3
@@ -127,4 +127,7 @@ public class ClientConfigurationContextDataJSO extends JavaScriptObject {
|
||||
public final native String getGitHubLink() /*-{
|
||||
return this.gitHubLink;
|
||||
}-*/;
|
||||
public final native String getGitHubPagesLink() /*-{
|
||||
return this.gitHubPagesLink;
|
||||
}-*/;
|
||||
}
|
||||
@@ -98,11 +98,11 @@ public class ClientConfiguration implements BrandingConfiguration {
|
||||
private String inSailingContent;
|
||||
private String followGitHub;
|
||||
private String gitHubLink;
|
||||
private String gitHubPagesLink;
|
||||
|
||||
public ClientConfiguration() {
|
||||
try {
|
||||
ClientConfigurationContextDataJSO dataJso = new ClientConfigurationContextDataFactoryImpl().getInstance();
|
||||
|
||||
id = dataJso.getId();
|
||||
brandTitle = dataJso.getBrandTitle();
|
||||
defaultBrandingLogoURL = dataJso.getDefaultBrandingLogoURL();
|
||||
@@ -135,9 +135,8 @@ public class ClientConfiguration implements BrandingConfiguration {
|
||||
moreLoginInformationSailorProfilesURL = dataJso.getMoreLoginInformationSailorProfilesURL();
|
||||
moreLoginInformationSimulatorURL = dataJso.getMoreLoginInformationSimulatorURL();
|
||||
gitHubLink = dataJso.getGitHubLink();
|
||||
gitHubPagesLink = dataJso.getGitHubPagesLink();
|
||||
followGitHub = dataJso.getFollowGitHub();
|
||||
|
||||
|
||||
} catch (RuntimeException e) {
|
||||
GWT.log("no branding information found.");
|
||||
}
|
||||
@@ -150,6 +149,7 @@ public class ClientConfiguration implements BrandingConfiguration {
|
||||
|
||||
/**
|
||||
* Access whitelabeling information.
|
||||
*
|
||||
* @return true when branding information shall be shown
|
||||
*/
|
||||
public boolean isBrandingActive() {
|
||||
@@ -185,7 +185,8 @@ public class ClientConfiguration implements BrandingConfiguration {
|
||||
public String getSailingRaceManagerAppTrimmedImageURL() {
|
||||
return sailingRaceManagerAppTrimmedImageURL;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getSailInSightAppImageURL() {
|
||||
return sailInSightAppImageURL;
|
||||
}
|
||||
@@ -209,75 +210,113 @@ public class ClientConfiguration implements BrandingConfiguration {
|
||||
return buoyPingerAppImageURL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSailingAnalyticsImageURL() {
|
||||
return sailingAnalyticsImageURL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSailingAnalyticsReadMoreText(Optional<String> locale) {
|
||||
return sailingAnalyticsReadMoreText;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSailingAnalyticsSailing(Optional<String> locale) {
|
||||
return sailingAnalyticsSailing;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFooterCopyright() {
|
||||
return footerCopyright;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFooterPrivacyLink() {
|
||||
return footerPrivacyLink;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFooterJobsLink() {
|
||||
return footerJobsLink;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFooterSupportLink() {
|
||||
return footerSupportLink;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSportsOn(Optional<String> locale) {
|
||||
return sportsOn;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFollowSports(Optional<String> locale) {
|
||||
return followSports;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFacebookLink() {
|
||||
return facebookLink;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getxLink() {
|
||||
return xLink;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInstagramLink() {
|
||||
return instagramLink;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getWelcomeToSailingAnalytics(Optional<String> locale) {
|
||||
return welcomeToSailingAnalytics;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getWelcomeToSailingAnalyticsBody(Optional<String> locale) {
|
||||
return welcomeToSailingAnalyticsBody;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getMoreLoginInformationNotificationsURL() {
|
||||
return moreLoginInformationNotificationsURL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMoreLoginInformationSettingsURL() {
|
||||
return moreLoginInformationSettingsURL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMoreLoginInformationSailorProfilesURL() {
|
||||
return moreLoginInformationSailorProfilesURL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMoreLoginInformationSimulatorURL() {
|
||||
return moreLoginInformationSimulatorURL;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getInSailingContent(Optional<String> locale) {
|
||||
return inSailingContent;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getFollowGitHub(Optional<String> locale) {
|
||||
return followGitHub;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getGitHubLink() {
|
||||
return gitHubLink;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGitHubPagesLink() {
|
||||
return gitHubPagesLink;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user