mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-03-06 12:20:56 +01:00
Rename "mail host" to "mail domain name"
This commit is contained in:
@@ -81,10 +81,10 @@ public class ScmConfiguration implements Configuration {
|
||||
public static final String DEFAULT_LOGIN_INFO_URL = "https://login-info.scm-manager.org/api/v1/login-info";
|
||||
|
||||
/**
|
||||
* Default e-mail host that will be used whenever we have to generate an e-mail address for a user that has no mail
|
||||
* address configured.
|
||||
* Default e-mail domain name that will be used whenever we have to generate an e-mail address for a user that has no
|
||||
* mail address configured.
|
||||
*/
|
||||
public static final String DEFAULT_MAIL_HOST = "scm-manager.local";
|
||||
public static final String DEFAULT_MAIL_DOMAIN_NAME = "scm-manager.local";
|
||||
|
||||
/**
|
||||
* Default plugin url from version 1.0
|
||||
@@ -193,8 +193,8 @@ public class ScmConfiguration implements Configuration {
|
||||
@XmlElement(name = "login-info-url")
|
||||
private String loginInfoUrl = DEFAULT_LOGIN_INFO_URL;
|
||||
|
||||
@XmlElement(name = "mail-host")
|
||||
private String mailHost = DEFAULT_MAIL_HOST;
|
||||
@XmlElement(name = "mail-domain-name")
|
||||
private String mailDomainName = DEFAULT_MAIL_DOMAIN_NAME;
|
||||
|
||||
/**
|
||||
* Calls the {@link sonia.scm.ConfigChangedListener#configChanged(Object)}
|
||||
@@ -235,7 +235,7 @@ public class ScmConfiguration implements Configuration {
|
||||
this.namespaceStrategy = other.namespaceStrategy;
|
||||
this.loginInfoUrl = other.loginInfoUrl;
|
||||
this.releaseFeedUrl = other.releaseFeedUrl;
|
||||
this.mailHost = other.mailHost;
|
||||
this.mailDomainName = other.mailDomainName;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -305,8 +305,8 @@ public class ScmConfiguration implements Configuration {
|
||||
*
|
||||
* @since 2.8.0
|
||||
*/
|
||||
public String getMailHost() {
|
||||
return mailHost;
|
||||
public String getMailDomainName() {
|
||||
return mailDomainName;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -492,11 +492,11 @@ public class ScmConfiguration implements Configuration {
|
||||
/**
|
||||
* Sets the mail host, that will be used to create e-mail addresses for users without one whenever one is required.
|
||||
*
|
||||
* @param mailHost The new mail host to use.
|
||||
* @param mailDomainName The new mail host to use.
|
||||
* @since 2.8.0
|
||||
*/
|
||||
public void setMailHost(String mailHost) {
|
||||
this.mailHost = mailHost;
|
||||
public void setMailDomainName(String mailDomainName) {
|
||||
this.mailDomainName = mailDomainName;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -43,7 +43,7 @@ public class EMail {
|
||||
if (user.getId().contains("@")) {
|
||||
return user.getId();
|
||||
} else {
|
||||
return user.getId() + "@" + scmConfiguration.getMailHost();
|
||||
return user.getId() + "@" + scmConfiguration.getMailDomainName();
|
||||
}
|
||||
} else {
|
||||
return user.getMail();
|
||||
|
||||
@@ -288,7 +288,7 @@ class ModifyCommandBuilderTest {
|
||||
|
||||
@Test
|
||||
void shouldUseMailFromUser() throws IOException {
|
||||
SCM_CONFIGURATION.setMailHost("heart-of-gold.local");
|
||||
SCM_CONFIGURATION.setMailDomainName("heart-of-gold.local");
|
||||
initCommand()
|
||||
.modifyFile("toBeModified").withData(ByteSource.wrap("content".getBytes()))
|
||||
.execute();
|
||||
|
||||
@@ -48,6 +48,6 @@ export type Config = {
|
||||
namespaceStrategy: string;
|
||||
loginInfoUrl: string;
|
||||
releaseFeedUrl: string;
|
||||
mailHost: string;
|
||||
mailDomainName: string;
|
||||
_links: Links;
|
||||
};
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
"skip-failed-authenticators": "Fehlgeschlagene Authentifizierer überspringen",
|
||||
"plugin-url": "Plugin Center URL",
|
||||
"release-feed-url": "Release Feed URL",
|
||||
"mail-host": "Fallback Mail Host",
|
||||
"mail-domain-name": "Fallback E-Mail Domain Name",
|
||||
"enabled-xsrf-protection": "XSRF Protection aktivieren",
|
||||
"namespace-strategy": "Namespace Strategie",
|
||||
"login-info-url": "Login Info URL"
|
||||
@@ -63,7 +63,7 @@
|
||||
"dateFormatHelpText": "Moments Datumsformat. Zulässige Formate sind in der MomentJS Dokumentation beschrieben.",
|
||||
"pluginUrlHelpText": "Die URL der Plugin Center API. Beschreibung der Platzhalter: version = SCM-Manager Version; os = Betriebssystem; arch = Architektur",
|
||||
"releaseFeedUrlHelpText": "Die URL des RSS Release Feed des SCM-Manager. Darüber wird über die neue SCM-Manager Version informiert. Um diese Funktion zu deaktivieren lassen Sie dieses Feld leer.",
|
||||
"mailHostHelpText": "Dieser Host Name wird genutzt, wenn für einen User eine E-Mail-Adresse benötigt wird, für den keine hinterlegt ist. Dieser Host wird nicht zum Versenden von E-Mails genutzt und auch keine anderweitige Verbindung aufgebaut.",
|
||||
"mailDomainNameHelpText": "Dieser Domain Name wird genutzt, wenn für einen User eine E-Mail-Adresse benötigt wird, für den keine hinterlegt ist. Diese Domain wird nicht zum Versenden von E-Mails genutzt und auch keine anderweitige Verbindung aufgebaut.",
|
||||
"enableForwardingHelpText": "mod_proxy Port Weiterleitung aktivieren.",
|
||||
"disableGroupingGridHelpText": "Repository Gruppen deaktivieren. Nach einer Änderung an dieser Einstellung muss die Seite komplett neu geladen werden.",
|
||||
"allowAnonymousAccessHelpText": "Anonyme Benutzer haben Zugriff auf freigegebene Repositories.",
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
"skip-failed-authenticators": "Skip Failed Authenticators",
|
||||
"plugin-url": "Plugin Center URL",
|
||||
"release-feed-url": "Release Feed URL",
|
||||
"mail-host": "Fallback Mail Host",
|
||||
"mail-domain-name": "Fallback Mail Domain Name",
|
||||
"enabled-xsrf-protection": "Enabled XSRF Protection",
|
||||
"namespace-strategy": "Namespace Strategy",
|
||||
"login-info-url": "Login Info URL"
|
||||
@@ -63,7 +63,7 @@
|
||||
"dateFormatHelpText": "Moments date format. Please have a look at the MomentJS documentation.",
|
||||
"pluginUrlHelpText": "The url of the Plugin Center API. Explanation of the placeholders: version = SCM-Manager Version; os = Operation System; arch = Architecture",
|
||||
"releaseFeedUrlHelpText": "The url of the RSS Release Feed for SCM-Manager. This provides up-to-date version information. To disable this feature just leave the url blank.",
|
||||
"mailHostHelpText": "This host name will be used to create email addresses for users when needed and they have none configured. It will not be used to send mails nor will be accessed otherwise.",
|
||||
"mailDomainNameHelpText": "This domain name will be used to create email addresses for users without one when needed. It will not be used to send mails nor will be accessed otherwise.",
|
||||
"enableForwardingHelpText": "Enable mod_proxy port forwarding.",
|
||||
"disableGroupingGridHelpText": "Disable repository Groups. A complete page reload is required after a change of this value.",
|
||||
"allowAnonymousAccessHelpText": "Anonymous users have access on granted repositories.",
|
||||
|
||||
@@ -144,7 +144,7 @@ class ConfigForm extends React.Component<Props, State> {
|
||||
skipFailedAuthenticators={config.skipFailedAuthenticators}
|
||||
pluginUrl={config.pluginUrl}
|
||||
releaseFeedUrl={config.releaseFeedUrl}
|
||||
mailHost={config.mailHost}
|
||||
mailDomainName={config.mailDomainName}
|
||||
enabledXsrfProtection={config.enabledXsrfProtection}
|
||||
namespaceStrategy={config.namespaceStrategy}
|
||||
onChange={(isValid, changedValue, name) => this.onChange(isValid, changedValue, name)}
|
||||
|
||||
@@ -36,7 +36,7 @@ type Props = WithTranslation & {
|
||||
skipFailedAuthenticators: boolean;
|
||||
pluginUrl: string;
|
||||
releaseFeedUrl: string;
|
||||
mailHost: string;
|
||||
mailDomainName: string;
|
||||
enabledXsrfProtection: boolean;
|
||||
namespaceStrategy: string;
|
||||
namespaceStrategies?: NamespaceStrategies;
|
||||
@@ -52,7 +52,7 @@ class GeneralSettings extends React.Component<Props> {
|
||||
loginInfoUrl,
|
||||
pluginUrl,
|
||||
releaseFeedUrl,
|
||||
mailHost,
|
||||
mailDomainName,
|
||||
enabledXsrfProtection,
|
||||
anonymousMode,
|
||||
namespaceStrategy,
|
||||
@@ -142,11 +142,11 @@ class GeneralSettings extends React.Component<Props> {
|
||||
</div>
|
||||
<div className="column is-half">
|
||||
<InputField
|
||||
label={t("general-settings.mail-host")}
|
||||
onChange={this.handleMailHostChange}
|
||||
value={mailHost}
|
||||
label={t("general-settings.mail-domain-name")}
|
||||
onChange={this.handleMailDomainNameChange}
|
||||
value={mailDomainName}
|
||||
disabled={!hasUpdatePermission}
|
||||
helpText={t("help.mailHostHelpText")}
|
||||
helpText={t("help.mailDomainNameHelpText")}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -175,8 +175,8 @@ class GeneralSettings extends React.Component<Props> {
|
||||
handleReleaseFeedUrlChange = (value: string) => {
|
||||
this.props.onChange(true, value, "releaseFeedUrl");
|
||||
};
|
||||
handleMailHostChange = (value: string) => {
|
||||
this.props.onChange(true, value, "mailHost");
|
||||
handleMailDomainNameChange = (value: string) => {
|
||||
this.props.onChange(true, value, "mailDomainName");
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ public class ConfigDto extends HalRepresentation {
|
||||
private String namespaceStrategy;
|
||||
private String loginInfoUrl;
|
||||
private String releaseFeedUrl;
|
||||
private String mailHost;
|
||||
private String mailDomainName;
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("squid:S1185") // We want to have this method available in this package
|
||||
|
||||
@@ -75,7 +75,7 @@ public class ConfigDtoToScmConfigurationMapperTest {
|
||||
assertTrue(config.isEnabledXsrfProtection());
|
||||
assertEquals("username", config.getNamespaceStrategy());
|
||||
assertEquals("https://scm-manager.org/login-info", config.getLoginInfoUrl());
|
||||
assertEquals("hitchhiker.mail", config.getMailHost());
|
||||
assertEquals("hitchhiker.mail", config.getMailDomainName());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -114,7 +114,7 @@ public class ConfigDtoToScmConfigurationMapperTest {
|
||||
configDto.setEnabledXsrfProtection(true);
|
||||
configDto.setNamespaceStrategy("username");
|
||||
configDto.setLoginInfoUrl("https://scm-manager.org/login-info");
|
||||
configDto.setMailHost("hitchhiker.mail");
|
||||
configDto.setMailDomainName("hitchhiker.mail");
|
||||
|
||||
return configDto;
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ public class ScmConfigurationToConfigDtoMapperTest {
|
||||
assertEquals("username", dto.getNamespaceStrategy());
|
||||
assertEquals("https://scm-manager.org/login-info", dto.getLoginInfoUrl());
|
||||
assertEquals("https://www.scm-manager.org/download/rss.xml", dto.getReleaseFeedUrl());
|
||||
assertEquals("scm-manager.local", dto.getMailHost());
|
||||
assertEquals("scm-manager.local", dto.getMailDomainName());
|
||||
|
||||
assertEquals(expectedBaseUri.toString(), dto.getLinks().getLinkBy("self").get().getHref());
|
||||
assertEquals(expectedBaseUri.toString(), dto.getLinks().getLinkBy("update").get().getHref());
|
||||
|
||||
Reference in New Issue
Block a user