Skip to content

Add attachment drag and drop support#109

Merged
keith merged 1 commit intomasterfrom
ks/drag-drop-attachments
Jul 30, 2017
Merged

Add attachment drag and drop support#109
keith merged 1 commit intomasterfrom
ks/drag-drop-attachments

Conversation

@keith
Copy link
Copy Markdown
Member

@keith keith commented Jul 30, 2017

This allows you to drag and drop a single attachment onto the bottom of
the new radar UI

This supersedes #102 and fixes #35

@keith keith force-pushed the ks/drag-drop-attachments branch from 89363fc to 97f24ec Compare July 30, 2017 20:52
@keith keith added this to the 1.1.0 milestone Jul 30, 2017
self.reproducibilityPopUp.setItems(titles: Reproducibility.All.map { $0.name })
self.productPopUp.set(items: Product.All, getTitle: { $0.name }, getGroup: { $0.category })
self.attachmentDroppableView.droppedAttachment = { [weak self] attachments in
self?.attachments = [attachments]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should this be overridden or appended? I get we don't really support multiple attachments now, but if there's UI for this in the future I think adding makes more sense here than replacing?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Right now since we're not supporting multiple attachments this is a replacement. Eventually it will definitely be an append but it gets weird with the current UI since you don't know what you have attached, and removing removes all of them.


fileprivate extension NSDraggingInfo {
private var files: [String]? {
return self.draggingPasteboard().propertyList(forType: NSFilenamesPboardType) as? [String]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is the meaning between nil and an empty array here different? If not, I'd ?? [].

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

good point. done

@keith keith force-pushed the ks/drag-drop-attachments branch 3 times, most recently from d35b981 to 546a4b1 Compare July 30, 2017 21:04
This allows you to drag and drop a single attachment onto the bottom of
the new radar UI
@keith keith force-pushed the ks/drag-drop-attachments branch from 546a4b1 to 7af2a89 Compare July 30, 2017 21:11
@keith keith merged commit c2ce5ef into master Jul 30, 2017
@keith keith deleted the ks/drag-drop-attachments branch July 30, 2017 21:17
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.

Ability to drag and drop attachments

2 participants