OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Use host name in modal and print if request hostname mismatches
Oliver Günther8e48d8f48f6c
diff --git a/config/locales/js-en.yml b/config/locales/js-en.ymlindex 01c42b0e546..f437a8a1a28 100644--- a/config/locales/js-en.yml+++ b/config/locales/js-en.yml@@ -230,6 +230,7 @@ en:label_expires_at: "Expires at"receive_newsletter: I want to receive the OpenProject <a target="_blank" href="%{link}">newsletter</a>.taken_domain: There can only be one active trial per domain.+ domain_mismatch: The current request host name does not match the configured host name. Please double check your system settings.taken_email: Each user can only create one trial.email_not_received: "You did not receive an email? You can resend the email with the link on the right."try_another_email: "Or try it with another email address."diff --git a/frontend/src/app/features/enterprise/enterprise-modal/enterprise-trial-form/ee-trial-form.component.html b/frontend/src/app/features/enterprise/enterprise-modal/enterprise-trial-form/ee-trial-form.component.htmlindex 861ebb54dfc..bd7d62f2e2a 100644--- a/frontend/src/app/features/enterprise/enterprise-modal/enterprise-trial-form/ee-trial-form.component.html+++ b/frontend/src/app/features/enterprise/enterprise-modal/enterprise-trial-form/ee-trial-form.component.html@@ -57,7 +57,10 @@disabled></div></div>- <div *ngIf="eeTrialService.domainTaken" class="form--field-instructions">{{ eeTrialService.errorMsg }}</div>+ <div class="form--field-instructions">+ <p *ngIf="requestHost !== configuredHost" [textContent]="text.domain_mismatch"></p>+ <p *ngIf="eeTrialService.domainTaken" [textContent]="eeTrialService.errorMsg"></p>+ </div></div><div class="form--field -required"><div class="form--field-container">@@ -86,4 +89,4 @@</label></div></div>-</form>\ No newline at end of file+</form>diff --git a/frontend/src/app/features/enterprise/enterprise-modal/enterprise-trial-form/ee-trial-form.component.ts b/frontend/src/app/features/enterprise/enterprise-modal/enterprise-trial-form/ee-trial-form.component.tsindex 1dd0b68e139..cc2436079f1 100644--- a/frontend/src/app/features/enterprise/enterprise-modal/enterprise-trial-form/ee-trial-form.component.ts+++ b/frontend/src/app/features/enterprise/enterprise-modal/enterprise-trial-form/ee-trial-form.component.ts@@ -32,6 +32,7 @@ import { I18nService } from 'core-app/core/i18n/i18n.service';import { EnterpriseTrialData, EnterpriseTrialService } from 'core-app/features/enterprise/enterprise-trial.service';import { CurrentUserService } from 'core-app/core/current-user/current-user.service';import { localizeLink } from 'core-app/shared/helpers/i18n/localized-link';+import { ConfigurationService } from 'core-app/core/config/configuration.service';const newsletterURL = 'https://www.openproject.org/newsletter/';@@ -44,12 +45,17 @@ export class EETrialFormComponent {// Retain used valuesuserData:Partial<EnterpriseTrialData> = this.eeTrialService.userData$.getValueOr({});+ // The current request host+ requestHost = window.location.host;+ // The configured host name+ configuredHost = this.configurationService.hostName;+trialForm = this.formBuilder.group({company: [this.userData.company, Validators.required],first_name: [this.userData.first_name, Validators.required],last_name: [this.userData.last_name, Validators.required],email: ['', [Validators.required, Validators.email]],- domain: [this.userData.domain || window.location.host, Validators.required],+ domain: [this.userData.domain || this.configuredHost, Validators.required],general_consent: [null, Validators.required],newsletter_consent: null,language: this.currentUserService.language,@@ -72,6 +78,7 @@ export class EETrialFormComponent {label_last_name: this.I18n.t('js.admin.enterprise.trial.form.label_last_name'),label_email: this.I18n.t('js.label_email'),label_domain: this.I18n.t('js.admin.enterprise.trial.form.label_domain'),+ domain_mismatch: this.I18n.t('js.admin.enterprise.trial.form.domain_mismatch'),privacy_policy: this.I18n.t('js.admin.enterprise.trial.form.privacy_policy'),receive_newsletter: this.I18n.t('js.admin.enterprise.trial.form.receive_newsletter', { link: newsletterURL }),terms_of_service: this.I18n.t('js.admin.enterprise.trial.form.terms_of_service'),@@ -81,6 +88,7 @@ export class EETrialFormComponent {readonly I18n:I18nService,private formBuilder:FormBuilder,readonly currentUserService:CurrentUserService,+ readonly configurationService:ConfigurationService,public eeTrialService:EnterpriseTrialService) {}