mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-16 13:14:58 +08:00
Iterate rageshake download styling
This commit is contained in:
parent
df980dbf92
commit
8aa50ecb59
@ -59,6 +59,7 @@
|
|||||||
@import "./views/context_menus/_WidgetContextMenu.scss";
|
@import "./views/context_menus/_WidgetContextMenu.scss";
|
||||||
@import "./views/dialogs/_AddressPickerDialog.scss";
|
@import "./views/dialogs/_AddressPickerDialog.scss";
|
||||||
@import "./views/dialogs/_Analytics.scss";
|
@import "./views/dialogs/_Analytics.scss";
|
||||||
|
@import "./views/dialogs/_BugReportDialog.scss";
|
||||||
@import "./views/dialogs/_ChangelogDialog.scss";
|
@import "./views/dialogs/_ChangelogDialog.scss";
|
||||||
@import "./views/dialogs/_ChatCreateOrReuseChatDialog.scss";
|
@import "./views/dialogs/_ChatCreateOrReuseChatDialog.scss";
|
||||||
@import "./views/dialogs/_ConfirmUserActionDialog.scss";
|
@import "./views/dialogs/_ConfirmUserActionDialog.scss";
|
||||||
|
23
res/css/views/dialogs/_BugReportDialog.scss
Normal file
23
res/css/views/dialogs/_BugReportDialog.scss
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2020 The Matrix.org Foundation C.I.C.
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
.mx_BugReportDialog {
|
||||||
|
.mx_BugReportDialog_download {
|
||||||
|
.mx_AccessibleButton_kind_link {
|
||||||
|
padding-left: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -36,6 +36,8 @@ export default class BugReportDialog extends React.Component {
|
|||||||
issueUrl: "",
|
issueUrl: "",
|
||||||
text: "",
|
text: "",
|
||||||
progress: null,
|
progress: null,
|
||||||
|
downloadBusy: false,
|
||||||
|
downloadProgress: null,
|
||||||
};
|
};
|
||||||
this._unmounted = false;
|
this._unmounted = false;
|
||||||
this._onSubmit = this._onSubmit.bind(this);
|
this._onSubmit = this._onSubmit.bind(this);
|
||||||
@ -44,6 +46,7 @@ export default class BugReportDialog extends React.Component {
|
|||||||
this._onIssueUrlChange = this._onIssueUrlChange.bind(this);
|
this._onIssueUrlChange = this._onIssueUrlChange.bind(this);
|
||||||
this._onSendLogsChange = this._onSendLogsChange.bind(this);
|
this._onSendLogsChange = this._onSendLogsChange.bind(this);
|
||||||
this._sendProgressCallback = this._sendProgressCallback.bind(this);
|
this._sendProgressCallback = this._sendProgressCallback.bind(this);
|
||||||
|
this._downloadProgressCallback = this._downloadProgressCallback.bind(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
@ -97,26 +100,25 @@ export default class BugReportDialog extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_onDownload = async (ev) => {
|
_onDownload = async (ev) => {
|
||||||
this.setState({ busy: true, progress: null, err: null });
|
this.setState({ downloadBusy: true });
|
||||||
this._sendProgressCallback(_t("Preparing to download logs"));
|
this._downloadProgressCallback(_t("Preparing to download logs"));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await downloadBugReport({
|
await downloadBugReport({
|
||||||
sendLogs: true,
|
sendLogs: true,
|
||||||
progressCallback: this._sendProgressCallback,
|
progressCallback: this._downloadProgressCallback,
|
||||||
label: this.props.label,
|
label: this.props.label,
|
||||||
});
|
});
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
busy: false,
|
downloadBusy: false,
|
||||||
progress: null,
|
downloadProgress: null,
|
||||||
});
|
});
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (!this._unmounted) {
|
if (!this._unmounted) {
|
||||||
this.setState({
|
this.setState({
|
||||||
busy: false,
|
downloadBusy: false,
|
||||||
progress: null,
|
downloadProgress: _t("Failed to send logs: ") + `${err.message}`,
|
||||||
err: _t("Failed to send logs: ") + `${err.message}`,
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -141,6 +143,13 @@ export default class BugReportDialog extends React.Component {
|
|||||||
this.setState({progress: progress});
|
this.setState({progress: progress});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_downloadProgressCallback(downloadProgress) {
|
||||||
|
if (this._unmounted) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.setState({ downloadProgress });
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const Loader = sdk.getComponent("elements.Spinner");
|
const Loader = sdk.getComponent("elements.Spinner");
|
||||||
const BaseDialog = sdk.getComponent('views.dialogs.BaseDialog');
|
const BaseDialog = sdk.getComponent('views.dialogs.BaseDialog');
|
||||||
@ -201,9 +210,12 @@ export default class BugReportDialog extends React.Component {
|
|||||||
) }
|
) }
|
||||||
</b></p>
|
</b></p>
|
||||||
|
|
||||||
<AccessibleButton onClick={this._onDownload} kind="link">
|
<div className="mx_BugReportDialog_download">
|
||||||
{ _t("Download logs") }
|
<AccessibleButton onClick={this._onDownload} kind="link" disabled={this.state.downloadBusy}>
|
||||||
</AccessibleButton>
|
{ _t("Download logs") }
|
||||||
|
</AccessibleButton>
|
||||||
|
{this.state.downloadProgress && <span>{this.state.downloadProgress} ...</span>}
|
||||||
|
</div>
|
||||||
|
|
||||||
<Field
|
<Field
|
||||||
type="text"
|
type="text"
|
||||||
|
Loading…
Reference in New Issue
Block a user