Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Shift to M_RESOURCE_LIMIT_EXCEEDED errors #2120

Merged
merged 4 commits into from
Aug 16, 2018
Merged

Conversation

dbkr
Copy link
Member

@dbkr dbkr commented Aug 15, 2018

With support for admin_contact and limit_type fields

For element-hq/element-web#7091

With support for admin_contact and limit_type fields

For element-hq/element-web#7091
@dbkr dbkr requested a review from a team August 15, 2018 16:05
@@ -434,17 +434,21 @@ const LoggedInView = React.createClass({
}

const mauLimitEvent = this.state.serverNoticeEvents.find((e) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As MAU is now just one case of resource limit exceeded, how about renaming the variables that are not specific to MAU?

@@ -327,11 +327,18 @@ module.exports = React.createClass({
} else {
let consentError = null;
let mauError = null;
const translateMauError = sub => {
if (mauError.data.admin_contact) {
return <a href={mauError.data.admin_contact} target="_blank" rel="noopener">{sub}</a>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mailto?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the admin contact should be a URI, so it should already have mailto: if it's an email address (also lets you specify a web form or something)

{
a: (sub) => {
if (response.data.admin_contact) {
return <a rel="noopener" target="_blank" href={response.data.admin_contact}>{sub}</a>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here, admin_contact is a e-mail address I presume, so you might need a mailto: prefix to turn it into a url.

@@ -164,10 +164,22 @@ module.exports = React.createClass({
if (!success) {
let msg = response.message || response.toString();
// can we give a better error message?
if (response.errcode == 'M_MAU_LIMIT_EXCEEDED') {
if (response.errcode == 'M_RESOURCE_LIMIT_EXCEEDED') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There seems to be a bit of duplication across RoomStatusBar, Login, Registration & ServerLimitBar for this use case, with the only thing different being the specific translation string to use. I wonder if it would make sense to put some of this somewhere centralized (e.g. a helper)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it is a bit - hopefully this is a bit better now.

@bwindels bwindels merged commit cde5ef4 into develop Aug 16, 2018
@bwindels bwindels deleted the dbkr/mau_to_limit_exceeded branch August 16, 2018 13:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants