MM-50347 Make desktop app landing page optional (#28421)
* fix: Make desktop app landing page optional * Update i18n strings * Fix linting and unit test --------- Co-authored-by: Kiran <kiran@krinati.co>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
0048723ccd
Коммит
394f625bcb
@@ -2024,6 +2024,13 @@ const AdminDefinition: AdminDefinitionType = {
|
||||
isDisabled: it.not(it.userHasWritePermissionOnResource(RESOURCE_KEYS.SITE.CUSTOMIZATION)),
|
||||
isHidden: it.configIsTrue('ExperimentalSettings', 'RestrictSystemAdmin'),
|
||||
},
|
||||
{
|
||||
type: 'bool',
|
||||
key: 'ServiceSettings.EnableDesktopLandingPage',
|
||||
label: defineMessage({id: 'admin.customization.enableDesktopLandingPageTitle', defaultMessage: 'Enable Desktop App Landing Page:'}),
|
||||
help_text: defineMessage({id: 'admin.customization.enableDesktopLandingPageDesc', defaultMessage: 'Whether or not to prompt a user to use the Desktop App when they first use Mattermost.'}),
|
||||
isDisabled: it.not(it.userHasWritePermissionOnResource(RESOURCE_KEYS.SITE.CUSTOMIZATION)),
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
|
||||
@@ -61,6 +61,7 @@ function mapStateToProps(state: GlobalState) {
|
||||
iosDownloadLink: config.IosAppDownloadLink,
|
||||
androidDownloadLink: config.AndroidAppDownloadLink,
|
||||
appDownloadLink: config.AppDownloadLink,
|
||||
enableDesktopLandingPage: config.EnableDesktopLandingPage === 'true',
|
||||
permalinkRedirectTeamName: permalinkRedirectTeam ? permalinkRedirectTeam.name : '',
|
||||
showTermsOfService,
|
||||
plugins,
|
||||
|
||||
@@ -93,6 +93,7 @@ describe('components/Root', () => {
|
||||
rhsState: null,
|
||||
shouldShowAppBar: false,
|
||||
isCloud: false,
|
||||
enableDesktopLandingPage: true,
|
||||
actions: {
|
||||
loadConfigAndMe: jest.fn().mockImplementation(() => {
|
||||
return Promise.resolve({
|
||||
@@ -356,6 +357,19 @@ describe('components/Root', () => {
|
||||
expect(props.history.push).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
test('should not show when disabled', async () => {
|
||||
const props = {
|
||||
...landingProps,
|
||||
enableDesktopLandingPage: false,
|
||||
};
|
||||
|
||||
renderWithContext(<Root {...props}/>);
|
||||
|
||||
await waitFor(() => {
|
||||
expect(props.history.push).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -193,6 +193,11 @@ export default class Root extends React.PureComponent<Props, State> {
|
||||
};
|
||||
|
||||
private showLandingPageIfNecessary = () => {
|
||||
// Only show Landing Page if enabled
|
||||
if (!this.props.enableDesktopLandingPage) {
|
||||
return;
|
||||
}
|
||||
|
||||
// We have nothing to redirect to if we're already on Desktop App
|
||||
// Chromebook has no Desktop App to switch to
|
||||
if (isDesktopApp() || isChromebook()) {
|
||||
|
||||
@@ -647,6 +647,8 @@
|
||||
"admin.customization.customUrlSchemesPlaceholder": "E.g.: \"git,smtp\"",
|
||||
"admin.customization.enableCustomEmojiDesc": "Enable users to create custom emoji for use in messages. When enabled, custom emoji settings can be accessed in Channels through the emoji picker.",
|
||||
"admin.customization.enableCustomEmojiTitle": "Enable Custom Emoji:",
|
||||
"admin.customization.enableDesktopLandingPageDesc": "Whether or not to prompt a user to use the Desktop App when they first use Mattermost.",
|
||||
"admin.customization.enableDesktopLandingPageTitle": "Enable Desktop App Landing Page:",
|
||||
"admin.customization.enableEmojiPickerDesc": "The emoji picker allows users to select emoji to add as reactions or use in messages. Enabling the emoji picker with a large number of custom emoji may slow down performance.",
|
||||
"admin.customization.enableEmojiPickerTitle": "Enable Emoji Picker:",
|
||||
"admin.customization.enableGifPickerDesc": "Allows users to select GIFs from the emoji picker.",
|
||||
|
||||
@@ -64,6 +64,7 @@ export type ClientConfig = {
|
||||
EnableCustomTermsOfService: string;
|
||||
EnableDeveloper: string;
|
||||
EnableDiagnostics: string;
|
||||
EnableDesktopLandingPage: 'true' | 'false';
|
||||
EnableEmailBatching: string;
|
||||
EnableEmailInvitations: string;
|
||||
EnableEmojiPicker: string;
|
||||
|
||||
Ссылка в новой задаче
Block a user