Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NEW] Add Custom homepage Content Setting #25777

Merged
merged 8 commits into from
Jun 8, 2022
8 changes: 8 additions & 0 deletions apps/meteor/app/lib/server/startup/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1542,11 +1542,19 @@ settingsRegistry.addGroup('Layout', function () {
type: 'boolean',
public: true,
});
this.add('Layout_Custom_Body', false, {
type: 'boolean',
public: true,
});
this.add(
'Layout_Home_Body',
'<p>Welcome to Rocket.Chat!</p>\n<p>The Rocket.Chat desktops apps for Windows, macOS and Linux are available to download <a title="Rocket.Chat desktop apps" href="https://rocket.chat/download" target="_blank" rel="noopener">here</a>.</p><p>The native mobile app, Rocket.Chat,\n for Android and iOS is available from <a title="Rocket.Chat on Google Play" href="https://play.google.com/store/apps/details?id=chat.rocket.android" target="_blank" rel="noopener">Google Play</a> and the <a title="Rocket.Chat on the App Store" href="https://itunes.apple.com/app/rocket-chat/id1148741252" target="_blank" rel="noopener">App Store</a>.</p>\n<p>For further help, please consult the <a title="Rocket.Chat Documentation" href="https://rocket.chat/docs/" target="_blank" rel="noopener">documentation</a>.</p>\n<p>If you\'re an admin, feel free to change this content via <strong>Administration</strong> &rarr; <strong>Layout</strong> &rarr; <strong>Home Body</strong>. Or clicking <a title="Home Body Layout" href="/admin/Layout">here</a>.</p>',
{
type: 'code',
enableQuery: {
_id: 'Layout_Custom_Body',
value: true,
},
code: 'text/html',
multiline: true,
public: true,
Expand Down
1 change: 1 addition & 0 deletions apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -2543,6 +2543,7 @@
"Layout_Login_Terms": "Login Terms",
"Layout_Privacy_Policy": "Privacy Policy",
"Layout_Show_Home_Button": "Show \"Home Button\"",
"Layout_Custom_Body": "Use custom homepage content",
"Layout_Sidenav_Footer": "Side Navigation Footer",
"Layout_Sidenav_Footer_description": "Footer size is 260 x 70px",
"Layout_Terms_of_Service": "Terms of Service",
Expand Down
6 changes: 3 additions & 3 deletions apps/meteor/tests/e2e/14-setting-permissions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ test.describe('[Rocket.Chat Settings based permissions]', () => {
await admin.rolesSettingsFindInput().fill('Layout');
await admin.getPage().locator('table tbody tr:first-child td:nth-child(1) >> text="Layout"').waitFor();
const isOptionChecked = await admin.getPage().isChecked('table tbody tr:first-child td:nth-child(6) label input');
const changeHomeTitleSelected = await admin.getPage().isChecked('table tbody tr:nth-child(3) td:nth-child(6) label input');
const changeHomeTitleSelected = await admin.getPage().isChecked('table tbody tr:nth-child(4) td:nth-child(6) label input');
if (!isOptionChecked && !changeHomeTitleSelected) {
await admin.getPage().click('table tbody tr:first-child td:nth-child(6) label');
await admin.getPage().click('table tbody tr:nth-child(3) td:nth-child(6) label');
await admin.getPage().click('table tbody tr:nth-child(4) td:nth-child(6) label');
}
});
});
Expand Down Expand Up @@ -110,7 +110,7 @@ test.describe('[Rocket.Chat Settings based permissions]', () => {
await admin.rolesSettingsFindInput().fill('Layout');
await admin.getPage().locator('table tbody tr:first-child td:nth-child(1) >> text="Layout"').waitFor();
await admin.getPage().click('table tbody tr td:nth-child(6) label');
await admin.getPage().click('table tbody tr:nth-child(3) td:nth-child(6) label');
await admin.getPage().click('table tbody tr:nth-child(4) td:nth-child(6) label');
});
});
});