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

Show author names next to final result in author merge tool #10297

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions openlibrary/components/MergeUI/MergeTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,11 @@ export default {
},

async merge() {
if (!this.master_key || !this.records || !this.editions)
if (!this.master_key || !this.enhancedRecords || !this.editions)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Darn :D Ah the issue was here; we don't want to use the enhancedRecords during the merge, since that will result in the extra author name fields being saved to Open Library! We just want the fields for display.

So you will likely have to create a helper method that can run this function with either .records or .enhancedRecords, and use one for the actual merge that's saved to Open Library, and the other just for display. Let us know if you have any questions 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see, I wasn't aware of this! I'll work on it, and if I have any questions, I'll get back to you @cdrini

return undefined;

const master = this.records.find(r => r.key === this.master_key);
const all_dupes = this.records
const master = this.enhancedRecords.find(r => r.key === this.master_key);
const all_dupes = this.enhancedRecords
.filter(r => this.selected[r.key])
.filter(r => r.key !== this.master_key);
const dupes = all_dupes.filter(r => r.type.key === '/type/work');
Expand All @@ -212,7 +212,7 @@ export default {
list_count: (this.lists) ? _.sum(records.map(r => this.lists[r.key].size)) : null
};

const unmergeable_works = this.records
const unmergeable_works = this.enhancedRecords
.filter(work => work.type.key === '/type/work' &&
this.selected[work.key] &&
work.key !== this.master_key &&
Expand Down
Loading