Skip to content

Commit 8e3a68d

Browse files
authored
Merge pull request element-hq#3426 from vector-im/dbkr/msisdn_signin_2
Support for phone number registration/signin, mk2
2 parents af12217 + c4d3d66 commit 8e3a68d

5 files changed

Lines changed: 158 additions & 2 deletions

File tree

‎src/skins/vector/css/_components.scss‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,11 @@
2222
@import "./matrix-react-sdk/views/elements/_AddressSelector.scss";
2323
@import "./matrix-react-sdk/views/elements/_AddressTile.scss";
2424
@import "./matrix-react-sdk/views/elements/_DirectorySearchBox.scss";
25+
@import "./matrix-react-sdk/views/elements/_Dropdown.scss";
2526
@import "./matrix-react-sdk/views/elements/_MemberEventListSummary.scss";
2627
@import "./matrix-react-sdk/views/elements/_ProgressBar.scss";
2728
@import "./matrix-react-sdk/views/elements/_RichText.scss";
29+
@import "./matrix-react-sdk/views/login/_InteractiveAuthEntryComponents.scss";
2830
@import "./matrix-react-sdk/views/login/_ServerConfig.scss";
2931
@import "./matrix-react-sdk/views/messages/_MImageBody.scss";
3032
@import "./matrix-react-sdk/views/messages/_MNoticeBody.scss";

‎src/skins/vector/css/matrix-react-sdk/structures/login/_Login.scss‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ limitations under the License.
6666
margin-bottom: 14px;
6767
}
6868

69+
.mx_Login_username {
70+
margin-bottom: 0px;
71+
}
72+
6973
.mx_Login_fieldLabel {
7074
margin-top: -10px;
7175
margin-left: 8px;
@@ -163,3 +167,16 @@ limitations under the License.
163167
margin-bottom: 12px;
164168
}
165169

170+
.mx_Login_phoneSection {
171+
display: table;
172+
}
173+
174+
.mx_Login_phoneCountry {
175+
display: table-cell;
176+
width: 70px;
177+
}
178+
179+
.mx_Login_phoneNumberField {
180+
width: 210px;
181+
margin-left: 3px;
182+
}
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
/*
2+
Copyright 2017 OpenMarket Ltd
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
.mx_Dropdown {
18+
position: relative;
19+
}
20+
21+
.mx_Dropdown_input {
22+
position: relative;
23+
border-radius: 3px;
24+
border: 1px solid $strong-input-border-color;
25+
font-weight: 300;
26+
font-size: 13px;
27+
user-select: none;
28+
}
29+
30+
.mx_Dropdown_arrow {
31+
border-color: $primary-fg-color transparent transparent;
32+
border-style: solid;
33+
border-width: 5px 5px 0;
34+
display: block;
35+
height: 0;
36+
position: absolute;
37+
right: 10px;
38+
top: 14px;
39+
width: 0
40+
}
41+
42+
.mx_Dropdown_option {
43+
height: 35px;
44+
line-height: 35px;
45+
padding-left: 8px;
46+
padding-right: 8px;
47+
}
48+
49+
.mx_Dropdown_option img {
50+
margin: 5px;
51+
width: 25px;
52+
vertical-align: middle;
53+
}
54+
55+
input.mx_Dropdown_option, input.mx_Dropdown_option:focus {
56+
border: 0;
57+
padding-top: 0;
58+
padding-bottom: 0;
59+
// XXX: hack to prevent text box being too big and pushing
60+
// its parent out / overlapping the dropdown arrow. Only really
61+
// works in the Country dropdown.
62+
width: 60%;
63+
}
64+
65+
.mx_Dropdown_menu {
66+
position: absolute;
67+
left: -1px;
68+
right: -1px;
69+
top: 100%;
70+
z-index: 2;
71+
margin: 0;
72+
padding: 0px;
73+
border-radius: 3px;
74+
border: 1px solid $accent-color;
75+
background-color: $primary-bg-color;
76+
max-height: 200px;
77+
overflow-y: scroll;
78+
}
79+
80+
.mx_Dropdown_menu .mx_Dropdown_option_highlight {
81+
background-color: $focus-bg-color;
82+
}
83+
84+
.mx_Dropdown_menu {
85+
font-weight: bold;
86+
}
87+
88+
.mx_Dropdown_searchPrompt {
89+
font-weight: normal;
90+
margin-left: 5px;
91+
margin-bottom: 5px;
92+
}
93+
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
Copyright 2017 Vector Creations Ltd
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
.mx_InteractiveAuthEntryComponents_msisdnWrapper {
18+
text-align: center;
19+
}
20+
21+
.mx_InteractiveAuthEntryComponents_msisdnEntry {
22+
font-size: 200%;
23+
font-weight: bold;
24+
border: 1px solid $strong-input-border-color;
25+
border-radius: 3px;
26+
width: 6em;
27+
}
28+
29+
.mx_InteractiveAuthEntryComponents_msisdnEntry:focus {
30+
border: 1px solid $accent-color;
31+
}
32+
33+
.mx_InteractiveAuthEntryComponents_msisdnSubmit {
34+
margin-top: 4px;
35+
margin-bottom: 5px;
36+
}
37+
38+
// XXX: This should be a common button class
39+
.mx_InteractiveAuthEntryComponents_msisdnSubmit:disabled {
40+
background-color: $light-fg-color;
41+
cursor: default;
42+
}

‎test/app-tests/loading.js‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,15 +188,17 @@ describe('loading:', function () {
188188
let login = ReactTestUtils.findRenderedComponentWithType(
189189
matrixChat, sdk.getComponent('structures.login.Login'));
190190
httpBackend.when('POST', '/login').check(function(req) {
191+
console.log(req);
191192
expect(req.data.type).toEqual('m.login.password');
192-
expect(req.data.user).toEqual('user');
193+
expect(req.data.identifier.type).toEqual('m.id.user');
194+
expect(req.data.identifier.user).toEqual('user');
193195
expect(req.data.password).toEqual('pass');
194196
}).respond(200, {
195197
user_id: '@user:id',
196198
device_id: 'DEVICE_ID',
197199
access_token: 'access_token',
198200
});
199-
login.onPasswordLogin("user", "pass")
201+
login.onPasswordLogin("user", undefined, undefined, "pass")
200202
return httpBackend.flush();
201203
}).then(() => {
202204
// Wait for another trip around the event loop for the UI to update

0 commit comments

Comments
 (0)