Skip to content

Commit

Permalink
Remove collection library registrations. (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathangreen authored Aug 2, 2023
1 parent 8bd8895 commit 0d20247
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 62 deletions.
21 changes: 0 additions & 21 deletions src/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,6 @@ export default class ActionCreator extends BaseActionCreator {
"REGISTER_LIBRARY_WITH_DISCOVERY_SERVICE";
static readonly DISCOVERY_SERVICE_LIBRARY_REGISTRATIONS =
"DISCOVERY_SERVICE_LIBRARY_REGISTRATIONS";
static readonly REGISTER_LIBRARY_WITH_COLLECTION =
"REGISTER_LIBRARY_WITH_COLLECTION";
static readonly COLLECTION_LIBRARY_REGISTRATIONS =
"COLLECTION_LIBRARY_REGISTRATIONS";
static readonly CUSTOM_LISTS = "CUSTOM_LISTS";
static readonly CUSTOM_LIST_DETAILS = "CUSTOM_LIST_DETAILS";
static readonly CUSTOM_LIST_DETAILS_MORE = "CUSTOM_LIST_DETAILS_MORE";
Expand Down Expand Up @@ -781,23 +777,6 @@ export default class ActionCreator extends BaseActionCreator {
).bind(this);
}

registerLibraryWithCollection(data: FormData) {
const url = "/admin/collection_library_registrations";
return this.postForm(
ActionCreator.REGISTER_LIBRARY_WITH_COLLECTION,
url,
data
).bind(this);
}

fetchCollectionLibraryRegistrations() {
const url = "/admin/collection_library_registrations";
return this.fetchJSON<LibraryRegistrationsData>(
ActionCreator.COLLECTION_LIBRARY_REGISTRATIONS,
url
).bind(this);
}

fetchCustomLists(library: string) {
const url = "/" + library + "/admin/custom_lists";
return this.fetchJSON<CustomListsData>(
Expand Down
23 changes: 2 additions & 21 deletions src/components/Collections.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,31 +139,16 @@ function mapStateToProps(state, ownProps) {
if (state.editor.libraries && state.editor.libraries.data) {
data.allLibraries = state.editor.libraries.data.libraries;
}
if (
state.editor.collectionLibraryRegistrations &&
state.editor.collectionLibraryRegistrations.data
) {
data.libraryRegistrations =
state.editor.collectionLibraryRegistrations.data.library_registrations;
}
// fetchError = an error involving loading the list of collections; formError = an error upon
// submission of the create/edit form (including upon submitting a change to a library's registration).
// submission of the create/edit form.
return {
data: data,
responseBody:
state.editor.collections && state.editor.collections.successMessage,
fetchError: state.editor.collections.fetchError,
formError:
state.editor.collections.formError ||
(state.editor.collectionLibraryRegistrations &&
state.editor.collectionLibraryRegistrations.fetchError) ||
(state.editor.registerLibraryWithCollection &&
state.editor.registerLibraryWithCollection.fetchError),
formError: state.editor.collections.formError,
isFetching:
state.editor.collections.isFetching || state.editor.collections.isEditing,
isFetchingLibraryRegistrations:
state.editor.collectionLibraryRegistrations &&
state.editor.collectionLibraryRegistrations.isFetching,
};
}

Expand All @@ -174,10 +159,6 @@ function mapDispatchToProps(dispatch, ownProps) {
editItem: (data: FormData) => dispatch(actions.editCollection(data)),
deleteItem: (identifier: string | number) =>
dispatch(actions.deleteCollection(identifier)),
registerLibrary: (data: FormData) =>
dispatch(actions.registerLibraryWithCollection(data)),
fetchLibraryRegistrations: () =>
dispatch(actions.fetchCollectionLibraryRegistrations()),
};
}

Expand Down
7 changes: 0 additions & 7 deletions src/reducers/collectionLibraryRegistrations.ts

This file was deleted.

6 changes: 0 additions & 6 deletions src/reducers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ import catalogServices from "./catalogServices";
import discoveryServices from "./discoveryServices";
import registerLibraryWithDiscoveryService from "./registerLibraryWithDiscoveryService";
import discoveryServiceLibraryRegistrations from "./discoveryServiceLibraryRegistrations";
import registerLibraryWithCollection from "./registerLibraryWithCollection";
import collectionLibraryRegistrations from "./collectionLibraryRegistrations";
import customLists from "./customLists";
import customListDetails, {
FetchMoreCustomListDetails,
Expand Down Expand Up @@ -100,8 +98,6 @@ export interface State {
discoveryServiceLibraryRegistrations: FetchEditState<
LibraryRegistrationsData
>;
registerLibraryWithCollection: RegisterLibraryState;
collectionLibraryRegistrations: FetchEditState<LibraryRegistrationsData>;
customLists: FetchEditState<CustomListsData>;
customListDetails: FetchMoreCustomListDetails<CollectionData>;
customListEditor: CustomListEditorState;
Expand Down Expand Up @@ -144,8 +140,6 @@ export default combineReducers<State>({
discoveryServices,
registerLibraryWithDiscoveryService,
discoveryServiceLibraryRegistrations,
registerLibraryWithCollection,
collectionLibraryRegistrations,
customLists,
customListDetails,
customListEditor,
Expand Down
7 changes: 0 additions & 7 deletions src/reducers/registerLibraryWithCollection.ts

This file was deleted.

0 comments on commit 0d20247

Please sign in to comment.