plouc / mozaik-ext-github

Mozaïk github widgets
http://mozaik-github.herokuapp.com/
MIT License
11 stars 23 forks source link

Provide optional PullRequests title #10

Closed macklinu closed 8 years ago

macklinu commented 8 years ago

This commit allows the user to supply an optional title property for the PullRequests widget. When title is not supplied, the widget falls back to the previous title, "Pull Requests", so as not to break the current functionality.

An example configuration of the PullRequests widget with the title property:

{
  type: 'github.pull_requests',
  title: 'Main Repo',
  repository: 'plouc/mozaik',
  columns: 1, rows: 1, x: 0, y: 0
}

A screenshot with the title supplied:

screen shot 2016-03-24 at 11 59 42

A screenshot without the title supplied:

screen shot 2016-03-24 at 12 03 43

My use case: I am setting up a dashboard for a client project that contains multiple repos, and we will want to keep track of each repo's pull requests and supply named titles to easily differentiate between each repo.

Let me know what you think of this approach.

plouc commented 8 years ago

@macklinu, it's a good idea to be able to override the title, but the default should be something like "repo name pull requests" like for other widgets (see http://mozaik-github.herokuapp.com/).

plouc commented 8 years ago

You've got an example here https://github.com/plouc/mozaik-ext-github/blob/master/src/components/Branches.jsx#L38

macklinu commented 8 years ago

Thanks for the feedback. I agree and will reference the Branches component and update this PR to match the other widgets' titles.

macklinu commented 8 years ago

@plouc made the changes. Here are some screenshot as well.

Default

screen shot 2016-03-24 at 13 53 38

Custom Title

screen shot 2016-03-24 at 13 54 31

plouc commented 8 years ago

Perfect! thanks @macklinu

plouc commented 8 years ago

@macklinu, available in mozaik-ext-github@1.1.0