Skip to content
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

Display error when retrieving resource and refactors load and save actions. #1508

Merged
merged 1 commit into from Oct 9, 2019

Conversation

justinlittman
Copy link
Contributor

No description provided.

@justinlittman justinlittman marked this pull request as ready for review October 9, 2019 13:00
LANGUAGE_SELECTED: setMyItemsLang,
SHOW_RDF_PREVIEW: showRdfPreview,
LANGUAGES_RECEIVED: languagesReceived,
LOADING_LANGUAGES: loadingLanguages,
Copy link
Contributor

@jcoyne jcoyne Oct 9, 2019

Choose a reason for hiding this comment

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

I wonder if we should change these to RETRIEVE_LANGUAGES_STARTED/FINISHED for consistency.

@@ -26,7 +26,7 @@ describe('fetchResourceTemplate', () => {
await fetchResourceTemplate(resourceTemplateId, dispatch)
expect(dispatch).toBeCalledWith({ type: 'RETRIEVE_RESOURCE_TEMPLATE_STARTED', payload: resourceTemplateId })
expect(dispatch).toBeCalledWith({
type: 'RETRIEVE_ERROR',
type: 'SET_RETRIEVE_RESOURCE_TEMPLATE_ERROR',
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't like SET_* for events. The events should say what happened, not how to handle it. I prefer RETRIEVE_RESOURCE_TEMPLATE_ERROR for this.

type: 'APPEND_RESOURCE',
payload: { reduxPath, resource, resourceTemplates },
export const setResourceTemplate = resourceTemplate => ({
type: 'SET_RESOURCE_TEMPLATE',
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe RESOURCE_TEMPLATE_LOADED? Not SET_

type: 'TOGGLE_COLLAPSE',
payload: { reduxPath },
export const setResourceTemplateSummary = resourceTemplateSummary => ({
type: 'SET_RESOURCE_TEMPLATE_SUMMARY',
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe RESOURCE_TEMPLATE_SUMMARY_LOADED? Not SET_

export const clearSearchResults = () => ({
type: 'CLEAR_SEARCH_RESULTS',
export const setSaveResourceTemplateError = (resourceTemplateId, reason) => ({
type: 'SET_SAVE_RESOURCE_TEMPLATE_ERROR',
Copy link
Contributor

Choose a reason for hiding this comment

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

SAVE_RESOURCE_TEMPLATE_ERROR not SET_

export const clearResourceTemplates = () => ({
type: 'CLEAR_RESOURCE_TEMPLATES',
export const setSaveResourceError = (uri, reason) => ({
type: 'SET_SAVE_RESOURCE_ERROR',
Copy link
Contributor

Choose a reason for hiding this comment

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

SAVE_RESOURCE_ERROR not SET_

… Refactors save/load resource/resource template actions for consistency.

closes #1447
@justinlittman
Copy link
Contributor Author

Various renaming completed @jcoyne .

@jcoyne jcoyne merged commit 0295700 into master Oct 9, 2019
@jcoyne jcoyne deleted the t1447-load_errors branch October 9, 2019 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants