Skip to content

Commit

Permalink
Merge branch 'new/homepage' of github.com:RocketChat/Rocket.Chat into…
Browse files Browse the repository at this point in the history
… feat/change-default-homepage-content

* 'new/homepage' of github.com:RocketChat/Rocket.Chat:
  [NEW] Add Custom homepage Content Setting (#25777)
  • Loading branch information
gabriellsh committed Jun 8, 2022
2 parents 85b5fe7 + a3f89dd commit 5a3d9cb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
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>~~~~ Default html example ~~~~</p>\n<strong>Welcome to (ENTER ORGANIZATION NAME HERE)</strong>\n\n<p>All general communications should be done through #general</p>\n<p>find more information <a href="INSERT LINK" target="_blank" rel="noopener">here</a></p>',
{
type: 'code',
enableQuery: {
_id: 'Layout_Custom_Body',
value: true,
},
code: 'text/html',
multiline: true,
// @TODO -> once Layout_Custom_Body is available, set blocked according to it's value.
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');
});
});
});

0 comments on commit 5a3d9cb

Please sign in to comment.