New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[student-libraries] Exporter ui fail #31502
Changes from all commits
d1f5a7a
7004084
6e10a4b
754acb6
fcfe0da
0ccc636
a0966a3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,10 +13,12 @@ import Button from '@cdo/apps/templates/Button'; | |
|
||
const styles = { | ||
alert: { | ||
color: 'red' | ||
color: 'red', | ||
width: '90%' | ||
}, | ||
libraryBoundary: { | ||
padding: 10 | ||
padding: 10, | ||
width: '90%' | ||
}, | ||
largerCheckbox: { | ||
width: 20, | ||
|
@@ -55,7 +57,8 @@ function select(event) { | |
export const LoadingState = { | ||
LOADING: 'loading', | ||
DONE_LOADING: 'done_loading', | ||
PUBLISHED: 'published' | ||
PUBLISHED: 'published', | ||
ERROR_PUBLISH: 'error_publish' | ||
}; | ||
|
||
class LibraryCreationDialog extends React.Component { | ||
|
@@ -128,6 +131,7 @@ class LibraryCreationDialog extends React.Component { | |
libraryJson, | ||
error => { | ||
console.warn(`Error publishing library: ${error}`); | ||
this.setState({loadingState: LoadingState.ERROR_PUBLISH}); | ||
}, | ||
() => { | ||
this.setState({loadingState: LoadingState.PUBLISHED}); | ||
|
@@ -213,9 +217,11 @@ class LibraryCreationDialog extends React.Component { | |
disabled={!this.state.canPublish} | ||
/> | ||
{this.state.loadingState === LoadingState.ERROR_PUBLISH && ( | ||
<p id="error-alert" style={styles.alert}> | ||
{i18n.libraryPublishFail()} | ||
</p> | ||
<div> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this container div needed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I liked the idea of having this state-specific behavior in a div, but it's not necessarily needed. I'm going to leave for now to avoid delaying this PR. |
||
<p id="error-alert" style={styles.alert}> | ||
{i18n.libraryPublishFail()} | ||
</p> | ||
</div> | ||
)} | ||
</div> | ||
</form> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still want this console warn now that there's UI for it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Jessie and I chatted and we decided yes, because then we can help debug if someone writes in with issues.