Skip to content
This repository has been archived by the owner on Feb 16, 2023. It is now read-only.

Feature: merge tool UI #789

Merged
merged 63 commits into from
Apr 3, 2021
Merged

Feature: merge tool UI #789

merged 63 commits into from
Apr 3, 2021

Conversation

shamoon
Copy link
Contributor

@shamoon shamoon commented Mar 18, 2021

This PR is a work-in-progress for an initial build of a UI for the merge tool. See issue #335

split_merge_ui_250321.mov
split_merge_3.mov

@shamoon shamoon marked this pull request as ready for review March 26, 2021 06:10
@shamoon shamoon marked this pull request as draft March 26, 2021 06:10
@shamoon shamoon marked this pull request as ready for review March 26, 2021 06:11
@shamoon shamoon marked this pull request as draft March 26, 2021 06:13
@shamoon
Copy link
Contributor Author

shamoon commented Mar 26, 2021

Oh, I guess I cant request a code review (I can on other repos) but consider this a request @jonaswinkler , whenever you have the chance obviously. And Im not sure why tests are failing...

@jonaswinkler
Copy link
Owner

I'll get to it this weekend.

@shamoon
Copy link
Contributor Author

shamoon commented Mar 30, 2021

I'll get to it this weekend.

Of course, take your time 🙂

ngOnInit(): void {
this.list.selectNone()
this.list.activateSavedView(null)
this.list.reload()
Copy link
Owner

Choose a reason for hiding this comment

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

Why do you need to do all this here? I've removed the init entirely and it feels quite natural.

</div>
<div class="modal-body">
<div class="m-n2 row row-cols-paperless-cards">
<app-document-card-small [simpleCard]="true" [selected]="list.isSelected(d)" (toggleSelected)="toggleSelected(d, $event)" [document]="d" *ngFor="let d of list.documents"></app-document-card-small>
Copy link
Owner

Choose a reason for hiding this comment

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

I'd probably do a separate selection model for the document chooser and not interfere with the list view at all.

This is also not very difficult, since there's no pagination / hidden items / filtering happenind in the chooser popup.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, so to accomplish this would you basically copy the logic from the list view service e.g. toggleSelected, selectRangeTo and others directly into the chooser component? Just want to make sure I understand. That would mean the code essentially duplicated in two places but yes, would no longer mess with the main list.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Or another service?

Copy link
Owner

Choose a reason for hiding this comment

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

Oh right, range selection.

I'll take care of that.

}

cancelClicked() {
this.list.selectNone()
Copy link
Owner

Choose a reason for hiding this comment

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

Just as with the above, I'd not rely on the document list for selection state.

modal.componentInstance.confirmClicked.subscribe(() => {
modal.componentInstance.buttonsEnabled = false
this.splitMergeService.addDocuments(this.list.selectedDocuments)
this.list.selectNone()
Copy link
Owner

Choose a reason for hiding this comment

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

Again, I'd really prefer if this component did not mess with selection state of the list view.

@jonaswinkler
Copy link
Owner

Can I merge this?

@shamoon
Copy link
Contributor Author

shamoon commented Apr 3, 2021

Can I merge this?

Sure, I guess youre saying you'd like to take care of the list abstraction thing (Im happy to do it if you want, just would need a little more direction), sounds good!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants