Skip to content

Commit 8e2529f

Browse files
author
Weblate
committed
Merge remote-tracking branch 'origin/develop' into develop
2 parents 3cec252 + 76f21ab commit 8e2529f

File tree

5 files changed

+54
-50
lines changed

5 files changed

+54
-50
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,11 @@ For a good example, see https://riot.im/develop/config.json
127127
release to release.
128128
1. `brand`: String to pass to your homeserver when configuring email notifications, to let the
129129
homeserver know what email template to use when talking to you.
130+
1. `branding`: Configures various branding and logo details, such as:
131+
1. `welcomeBackgroundUrl`: An image to use as a wallpaper outside the app
132+
during authentication flows
133+
1. `authHeaderLogoUrl`: An logo image that is shown in the header during
134+
authentication flows
130135
1. `integrations_ui_url`: URL to the web interface for the integrations server. The integrations
131136
server is not Riot and normally not your homeserver either. The integration server settings
132137
may be left blank to disable integrations.

karma.conf.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ module.exports = function (config) {
7878
watched: false, included: false, served: true, nocache: false,
7979
},
8080
{
81-
pattern: 'res/themes/**',
81+
pattern: 'res/**',
8282
watched: false, included: false, served: true, nocache: false,
8383
},
8484
],
@@ -87,6 +87,8 @@ module.exports = function (config) {
8787
// redirect img links to the karma server. See above.
8888
"/img/": "/base/node_modules/matrix-react-sdk/res/img/",
8989
"/themes/": "/base/res/themes/",
90+
"/welcome.html": "/base/res/welcome.html",
91+
"/welcome/": "/base/res/welcome/",
9092
},
9193

9294
// preprocess matching files before serving them to the browser

src/components/views/auth/VectorAuthHeaderLogo.js

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,26 @@ limitations under the License.
1919

2020
import React from 'react';
2121
import PropTypes from 'prop-types';
22+
import SdkConfig from 'matrix-react-sdk/lib/SdkConfig';
2223

23-
const LOGO_URI = "themes/riot/img/logos/riot-im-logo-black-text.svg";
24+
export default class VectorAuthHeaderLogo extends React.PureComponent {
25+
static replaces = 'AuthHeaderLogo'
2426

25-
module.exports = React.createClass({
26-
displayName: 'VectorAuthHeaderLogo',
27-
statics: {
28-
replaces: 'AuthHeaderLogo',
29-
},
30-
propTypes: {
27+
static propTypes = {
3128
icon: PropTypes.string,
32-
},
29+
}
30+
31+
render() {
32+
const brandingConfig = SdkConfig.get().branding;
33+
let logoUrl = "themes/riot/img/logos/riot-im-logo-black-text.svg";
34+
if (brandingConfig && brandingConfig.authHeaderLogoUrl) {
35+
logoUrl = brandingConfig.authHeaderLogoUrl;
36+
}
3337

34-
render: function() {
3538
return (
3639
<div className="mx_AuthHeaderLogo">
37-
<img src={LOGO_URI} alt="Riot" />
40+
<img src={logoUrl} alt="Riot" />
3841
</div>
3942
);
40-
},
41-
});
43+
}
44+
}

src/components/views/auth/VectorAuthPage.js

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,24 @@ limitations under the License.
1616

1717
'use strict';
1818

19-
const React = require('react');
19+
import React from 'react';
2020
import sdk from 'matrix-react-sdk/lib/index';
21+
import SdkConfig from 'matrix-react-sdk/lib/SdkConfig';
2122

22-
module.exports = React.createClass({
23-
displayName: 'VectorAuthPage',
23+
export default class VectorAuthPage extends React.PureComponent {
24+
static replaces = 'AuthPage'
2425

25-
statics: {
26-
replaces: 'AuthPage',
27-
},
28-
29-
render: function() {
26+
render() {
3027
const AuthFooter = sdk.getComponent('auth.AuthFooter');
3128

29+
const brandingConfig = SdkConfig.get().branding;
30+
let backgroundUrl = "themes/riot/img/backgrounds/valley.jpg";
31+
if (brandingConfig && brandingConfig.welcomeBackgroundUrl) {
32+
backgroundUrl = brandingConfig.welcomeBackgroundUrl;
33+
}
34+
3235
const pageStyle = {
33-
background: 'center/cover fixed url(themes/riot/img/backgrounds/valley.jpg)',
36+
background: `center/cover fixed url(${backgroundUrl})`,
3437
};
3538

3639
const modalStyle = {
@@ -66,5 +69,5 @@ module.exports = React.createClass({
6669
<AuthFooter />
6770
</div>
6871
);
69-
},
70-
});
72+
}
73+
}

test/app-tests/loading.js

Lines changed: 17 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,7 @@ describe('loading:', function() {
222222
}).done(done, done);
223223
});
224224

225-
// TODO: Repair this test in https://github.com/vector-im/riot-web/issues/8468
226-
/* it('should follow the original link after successful login', function(done) {
225+
it('should follow the original link after successful login', function(done) {
227226
loadApp({
228227
uriFragment: "#/room/!room:id",
229228
});
@@ -258,10 +257,9 @@ describe('loading:', function() {
258257
expect(localStorage.getItem('mx_hs_url')).toEqual(DEFAULT_HS_URL);
259258
expect(localStorage.getItem('mx_is_url')).toEqual(DEFAULT_IS_URL);
260259
}).done(done, done);
261-
}); */
260+
});
262261

263-
// TODO: Repair this test in https://github.com/vector-im/riot-web/issues/8468
264-
/* it('should not register as a guest when using a #/login link', function() {
262+
it('should not register as a guest when using a #/login link', function() {
265263
loadApp({
266264
uriFragment: "#/login",
267265
});
@@ -288,7 +286,7 @@ describe('loading:', function() {
288286
matrixChat, sdk.getComponent('structures.EmbeddedPage'));
289287
expect(windowLocation.hash).toEqual("#/home");
290288
});
291-
}); */
289+
});
292290
});
293291

294292
describe("MatrixClient rehydrated from stored credentials:", function() {
@@ -300,8 +298,7 @@ describe('loading:', function() {
300298
localStorage.setItem("mx_last_room_id", "!last_room:id");
301299
});
302300

303-
// TODO: Repair this test in https://github.com/vector-im/riot-web/issues/8468
304-
/* it('shows the last known room by default', function() {
301+
it('shows the last known room by default', function() {
305302
httpBackend.when('GET', '/pushrules').respond(200, {});
306303
httpBackend.when('POST', '/filter').respond(200, { filter_id: 'fid' });
307304

@@ -357,7 +354,7 @@ describe('loading:', function() {
357354
httpBackend.verifyNoOutstandingExpectation();
358355
expect(windowLocation.hash).toEqual("#/room/!room:id");
359356
}).done(done, done);
360-
}); */
357+
});
361358

362359
describe('/#/login link:', function() {
363360
beforeEach(function() {
@@ -387,22 +384,20 @@ describe('loading:', function() {
387384
}
388385
});
389386

390-
// TODO: Repair this test in https://github.com/vector-im/riot-web/issues/8468
391-
/* it('shows the homepage after login', function() {
387+
it('shows the homepage after login', function() {
392388
return completeLogin(matrixChat).then(() => {
393389
// we should see a home page, even though we previously had
394390
// a stored mx_last_room_id
395391
ReactTestUtils.findRenderedComponentWithType(
396392
matrixChat, sdk.getComponent('structures.EmbeddedPage'));
397393
expect(windowLocation.hash).toEqual("#/home");
398394
});
399-
}); */
395+
});
400396
});
401397
});
402398

403399
describe('Guest auto-registration:', function() {
404-
// TODO: Repair this test in https://github.com/vector-im/riot-web/issues/8468
405-
/* it('shows a welcome page by default', function(done) {
400+
it('shows a welcome page by default', function(done) {
406401
loadApp();
407402

408403
Promise.delay(1).then(() => {
@@ -430,10 +425,9 @@ describe('loading:', function() {
430425
matrixChat, sdk.getComponent('auth.Welcome'));
431426
expect(windowLocation.hash).toEqual("#/welcome");
432427
}).done(done, done);
433-
}); */
428+
});
434429

435-
// TODO: Repair this test in https://github.com/vector-im/riot-web/issues/8468
436-
/* it('uses the default homeserver to register with', function(done) {
430+
it('uses the default homeserver to register with', function(done) {
437431
loadApp();
438432

439433
Promise.delay(1).then(() => {
@@ -457,15 +451,15 @@ describe('loading:', function() {
457451
}).then((req) => {
458452
expect(req.path).toStartWith(DEFAULT_HS_URL);
459453

460-
// once the sync completes, we should have a home page
454+
// once the sync completes, we should have a welcome page
461455
httpBackend.verifyNoOutstandingExpectation();
462456
ReactTestUtils.findRenderedComponentWithType(
463-
matrixChat, sdk.getComponent('structures.EmbeddedPage'));
464-
expect(windowLocation.hash).toEqual("#/home");
457+
matrixChat, sdk.getComponent('auth.Welcome'));
458+
expect(windowLocation.hash).toEqual("#/welcome");
465459
expect(MatrixClientPeg.get().baseUrl).toEqual(DEFAULT_HS_URL);
466460
expect(MatrixClientPeg.get().idBaseUrl).toEqual(DEFAULT_IS_URL);
467461
}).done(done, done);
468-
}); */
462+
});
469463

470464
it('shows a room view if we followed a room link', function(done) {
471465
loadApp({
@@ -534,15 +528,14 @@ describe('loading:', function() {
534528
});
535529
});
536530

537-
// TODO: Repair this test in https://github.com/vector-im/riot-web/issues/8468
538-
/* it('should give us a login page', function() {
531+
it('should give us a login page', function() {
539532
expect(windowLocation.hash).toEqual("#/login");
540533

541534
// we expect a single <Login> component
542535
ReactTestUtils.findRenderedComponentWithType(
543536
matrixChat, sdk.getComponent('structures.auth.Login'),
544537
);
545-
}); */
538+
});
546539

547540
/*
548541
// ILAG renders this obsolete. I think.
@@ -684,8 +677,6 @@ function awaitSyncingSpinner(matrixChat, retryLimit, retryCount) {
684677

685678
console.log(Date.now() + " Awaiting sync spinner: load complete.");
686679

687-
// state looks good, check the rendered output
688-
assertAtSyncingSpinner(matrixChat);
689680
return Promise.resolve();
690681
}
691682

0 commit comments

Comments
 (0)