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

Go File Upload #149

Merged
merged 12 commits into from
Oct 31, 2019
Merged

Go File Upload #149

merged 12 commits into from
Oct 31, 2019

Conversation

devchris
Copy link
Contributor

This attempts to close #127

@devchris devchris changed the base branch from master to v1.2.0 August 30, 2019 19:14
@devchris devchris added the feature New feature request label Aug 30, 2019
@grahamhency grahamhency modified the milestones: Needs Triaged, v1.3.0 Sep 13, 2019
@StevenUlmer StevenUlmer changed the base branch from v1.2.0 to v1.3.0 September 30, 2019 17:22
@grahamhency
Copy link
Contributor

grahamhency commented Oct 3, 2019

@StevenUlmer we've already discussed this a bit, but can you look into what it would take for us to make the file upload process something like that InVision mockup?
Screen Shot 2019-10-03 at 9 41 13 AM
Screen Shot 2019-10-03 at 9 42 06 AM
Screen Shot 2019-10-03 at 9 42 14 AM

Copy link
Contributor

@grahamhency grahamhency left a comment

Choose a reason for hiding this comment

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

Could we swap the "File Name" to a <label> here?

Also, let's add some padding to the right of the file name to separate the icon-button from the file name.

Screen Shot 2019-10-09 at 10 21 40 AM

Also, let's make the border solid on the drag/drop section.

@StevenUlmer
Copy link
Contributor

@grahamhency I think this is ready for another look

Copy link
Contributor

@grahamhency grahamhency left a comment

Choose a reason for hiding this comment

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

Got a few items to attend to, let me know if you have questions. This could also do with a rebase.

export class DragonDropDirective {
@Output() fileDropped: EventEmitter<any> = new EventEmitter<any>();

@HostBinding('class.go-file-upload--active') active: boolean = false;
Copy link
Contributor

Choose a reason for hiding this comment

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

@StevenUlmer what if we extracted this out into it's own thing? We could pass in the go-file-upload--active class as an @Input here and then handle the drop event in the file-upload component as an event handler.

We don't have to in this PR, could always extract it out later. But that would make this drag/drop functionality reusable which would be nice.

Thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

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

I went ahead and pulled out al the functionality I could. I had to do some stuff around using class here because just using @HostBinding('class') overwrites all classes already applied to the element

<span class="go-file-upload__container--loading-text">Uploading File...</span>
</div>
<div class="go-file-upload__container go-file-upload__container--selected" *ngIf="state === 'selected' && !isLoading">
<go-icon icon="check" iconModifier="positive" iconClass="go-icon--large"></go-icon>
Copy link
Contributor

Choose a reason for hiding this comment

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

We might want to check if @jaredami's PR is going to affect the iconModifer here. #281

Copy link
Contributor

@jaredami jaredami Oct 22, 2019

Choose a reason for hiding this comment

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

I don't think my PR effects this. However, if I'm not mistaken, while the go-button takes "positive" as an option for its buttonVariant input (and converts it internally to "primary"), the go-icon only accepts "primary" for its iconModifier input, since it has no internal logic which converts "positive" to "primary" and only has a go-icon--primary class, and not a go-icon--positive class.

So I don't think iconModifier="positive" will do anything. You probably want iconModifier="primary", if anything, although all that does it set the color to black, which is probably unnecessary due to inheritance.

Copy link
Contributor

Choose a reason for hiding this comment

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

@jaredami you make a good point here. I think it might make more sense to set the color via a class from the go-file-upload component itself. Thought's @StevenUlmer ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ya that makes sense. I added a class in the go-file-upload component to set the color

@Input() label: string;
@Input() multiple: boolean = false;
@Input() state: 'selecting' | 'selected' = 'selecting';
@Input() theme: 'light' | 'dark' = 'light';
Copy link
Contributor

Choose a reason for hiding this comment

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

This binding exists, but it doesn't seem this actually works as intended. Can you take a look at the styling for a dark theme and update them to be correct please?

Copy link
Contributor

Choose a reason for hiding this comment

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

We'll also want documentation for this.

Copy link
Contributor

Choose a reason for hiding this comment

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

I fixed the dark theming here and added documentation for it.

projects/go-lib/src/public_api.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@grahamhency grahamhency left a comment

Choose a reason for hiding this comment

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

👍 This looks good to me! We'll see how this goes in practice 😂

I am confident it will work well though 🏆

@grahamhency grahamhency merged commit 0ec0d50 into v1.3.0 Oct 31, 2019
@grahamhency grahamhency deleted the go_file_upload branch October 31, 2019 16:16
@grahamhency grahamhency mentioned this pull request Oct 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants