Skip to content

Conversation

@jordandrako
Copy link
Contributor

@jordandrako jordandrako commented Mar 31, 2018

Enable them on ActivityItemPage.

Pull request checklist

  • Include a change request file using $ npm run change

Description of changes

New ComponentPage APIs:

  • componentUrl Enables the 'View On GitHub' button and programmatically enables the 'Edit' (pencil) buttons. The edit buttons use the URL given, then adds "/docs/${ComponentName}${section}.md" so it points to the relavant markdown file.
  • editBestPracticesUrl Enables just the edit button for the Best Practices section. Overrides the URL from componentUrl.
  • editOverviewUrl Enables just the edit button for the Overview section. Overrides the URL from componentUrl.
  • editDosUrl Enables just the edit button for the Dos section. Overrides the URL from componentUrl.
  • editDontsUrl Enables just the edit button for the Don'ts section. Overrides the URL from componentUrl.

If only componentUrl is used, the edit buttons are generated from that, the component's name, and the section name. It will not render an edit button if the section doesn't use a React Component, like PageMarkdown, so using HTML like a div won't make an edit button appear in places you can't edit.

All new buttons:

image

Edit buttons on hover show generated tooltip:

image

Focus areas to test

Ensure edit buttons are a11y compliant.

@jordandrako jordandrako changed the title Edit docs buttons ComponentPage: Add Edit On GitHub buttons API page sections Mar 31, 2018
@jordandrako jordandrako changed the title ComponentPage: Add Edit On GitHub buttons API page sections ComponentPage: Add Edit On GitHub buttons to page sections Mar 31, 2018
}
return (
<TooltipHost
content={ `Edit ${this.props.componentName} ${readableSection} on GitHub` }
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@betrue-final-final I am not sure how accessible this new button is. Is the tooltip with this generated content good enough?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@betrue-final-final Just a friendly bump. I'll have Kirk Myhre take a look at this design-wise too.

Choose a reason for hiding this comment

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

@betrue-final-final Are you just worried about the color of the pencil or the addition of the icon and its place in the tab order/narrator in general?

Copy link
Member

Choose a reason for hiding this comment

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

I actually didn't look yet, but now that I am, I do have some.

  1. The "View on Github" appearing as a pivot here is a usability issue actually. It looks like a pivot, but it's actually a link. That will affect everyone.
  2. Is it necessary to be able to edit all those things separately? Do we need that, or just enable editing the whole page?

Let's answer these questions and then evaluate the resulting design for accessibility.

Choose a reason for hiding this comment

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

Good comment on the "View on Github" link placement. We'll have to figure out a better place for that within the content of the page.
Each one of those content "chunks" will be editable individually. Based on the way Markdown works and the way we're crafting the community editing experience, we want to provide a quick, easy way for folks to update only the bits that they're responsible for without affecting any others. make sense?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  1. It doesn't have to appear there, or even at all, but I thought it might be convenient.
  2. It is necessary since they are each individual files and have to be that way to reduce non-dev confusion. If we are to implement more than three sections down the road it will be confusing to those not familiar with the component what file to edit if we link to just the /docs folder.

Copy link
Member

Choose a reason for hiding this comment

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

Ok cool. However you might consider "Do's" and "Don'ts" as a single unit. I don't think one person will be assigned to "Do's" and another "Don'ts".

What color are the pencils?

Copy link
Member

Choose a reason for hiding this comment

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

Right, ok that might be tricky on dos and don'ts. Just trying to simplify.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Peter and I thought about how to combine Do's and Don'ts into one file. It'd require some sort of trigger in the markdown file for the markdown-to-jsx component to find and split into the required sections. It'd be too easy to break.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@betrue-final-final The color of the pencils was palette.neutralSecondary but I'm thinking about removing any of the styles and just using IconButton's default styles.

@betrue-final-final
Copy link
Member

That makes sense. Use components here.

@jordandrako
Copy link
Contributor Author

jordandrako commented Apr 10, 2018

@kirkmyhre Do you have any suggestions on where to place the "View on GitHub" button, or not have it at all? My plan was for it to link to the component root in the repo ie: https://github.com/OfficeDev/office-ui-fabric-react/tree/master/packages/office-ui-fabric-react/src/components/ActivityItem

@jordandrako
Copy link
Contributor Author

I'll leave this button off this PR, and we can come back to add it in later if we feel it'll be helpful in the future. It sounds like the edit buttons are good to go through, so if I can get approval for those today it'd unblock me converting the rest of the docs over.

@jordandrako
Copy link
Contributor Author

@betrue-final-final Thoughts on approving? Kirk doesn't have permissions to do so.

@betrue-final-final
Copy link
Member

Let me take a look.

@betrue-final-final
Copy link
Member

I ran the project, but I'm not seeing the changes. I may not have admin permissions to edit the sections. Maybe I can just take a look over your shoulder.

@jordandrako
Copy link
Contributor Author

This only enables the sections to be enabled if they have markdown, that'll come after this is merged since that conversion relies on the APIs I enabled here.

@jordandrako
Copy link
Contributor Author

jordandrako commented Apr 11, 2018

Feel free to come by my desk to see how it works.

}
}

.ComponentPage-doSectionHr {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you expand 'Hr' into 'Header' or what ever it's for?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's for the <hr> tag that used to be the :after on the header since it now has to be inside a container for the edit button.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah, makes sense now! Maybe another word then? Like 'line' or something? In case it ends up not being an hr tag someday.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good suggestion

}

export enum ComponentPageSection {
Dos = 0,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we start these out alphabetized?

Copy link
Collaborator

@lynamemi lynamemi left a comment

Choose a reason for hiding this comment

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

Left a couple of nit comments, but looks good, these are exciting changes!

@jordandrako
Copy link
Contributor Author

@mikewheaton @lynamemi Looking the upcoming Fabric site changes, do you think it'd be worthwhile to split this edit button into its own functional component for use elsewhere?

@lynamemi
Copy link
Collaborator

@jordandrako I like that idea! It definitely has its own thing going on.

@jordandrako jordandrako merged commit ebbb573 into microsoft:master Apr 13, 2018
@microsoft microsoft locked as resolved and limited conversation to collaborators Aug 31, 2019
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.

5 participants