Skip to content

Commit

Permalink
added link to github profile to GhUser component; fixed workflow in r…
Browse files Browse the repository at this point in the history
…eadme
  • Loading branch information
michaelchadwick committed Jun 20, 2024
1 parent 84d9a20 commit 5d38cbc
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,6 @@ Currently being built on [Netlify](https://mc-emberjs-remember-stuff.netlify.app
- Add new serializer fields to `app/serializers/gh-user.js`
- Use fake data from `public/api/gh-users/michaelchadwick.json`
- Pass new fields into `<Debug>` component in `app/templates/application.hbs`
- Add those fields to `<GhUser>` component in `app/components/gh-user.hbs`
- Add those fields to `<GhUser>` component in `app/components/debug.hbs`
- (Optional) Add new translations to `/translations/*` files
- Add those fields to `app/components/gh-user.hbs` template
1 change: 1 addition & 0 deletions app/components/debug.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

<GhUser
@username={{@ghUsername}}
@htmlUrl={{@ghHtmlUrl}}
@publicRepos={{@ghPublicRepos}}
@publicGists={{@ghPublicGists}}
@followers={{@ghFollowers}}
Expand Down
2 changes: 1 addition & 1 deletion app/components/gh-user.hbs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="gh-user">
<h3>{{t "components.ghUser.head"}}</h3>

<strong>{{@username}}</strong><br />
<strong><a href={{@htmlUrl}}>{{@username}}</a></strong><br />
{{t "components.ghUser.repos"}}: {{@publicRepos}}<br />
{{t "components.ghUser.gists"}}: {{@publicGists}}<br />
{{t "components.ghUser.followers"}}: {{@followers}}<br />
Expand Down
1 change: 1 addition & 0 deletions app/models/gh-user.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import Model, { attr } from '@ember-data/model';

export default class GhUserModel extends Model {
@attr ghUsername;
@attr ghHtmlUrl;
@attr('number') ghPublicRepos;
@attr('number') ghPublicGists;
@attr('number') ghFollowers;
Expand Down
1 change: 1 addition & 0 deletions app/serializers/gh-user.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export default class GhUserSerializer extends JSONAPISerializer {
type: type.modelName,
attributes: {
ghUsername: payload.name,
ghHtmlUrl: payload.html_url,
ghPublicRepos: payload.public_repos,
ghPublicGists: payload.public_gists,
ghFollowers: payload.followers,
Expand Down
1 change: 1 addition & 0 deletions app/templates/application.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

<Debug
@ghUsername={{@model.ghUsername}}
@ghHtmlUrl={{@model.ghHtmlUrl}}
@ghPublicRepos={{@model.ghPublicRepos}}
@ghPublicGists={{@model.ghPublicGists}}
@ghFollowers={{@model.ghFollowers}}
Expand Down

0 comments on commit 5d38cbc

Please sign in to comment.