-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Approver list refactor and bug fix (#184)
* Add badge to Approvers list (owner view) * Component-ize Approvers
- Loading branch information
Showing
6 changed files
with
51 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<Person | ||
@badge={{if (has-approved-doc @email) "approved"}} | ||
@imgURL={{@imgURL}} | ||
@email={{@email}} | ||
/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import Component from "@glimmer/component"; | ||
|
||
interface PersonApproverComponentSignature { | ||
Element: HTMLDivElement; | ||
Args: { | ||
email: string; | ||
imgURL?: string; | ||
}; | ||
Blocks: { | ||
default: []; | ||
}; | ||
} | ||
|
||
export default class PersonApproverComponent extends Component<PersonApproverComponentSignature> {} | ||
|
||
declare module "@glint/environment-ember-loose/registry" { | ||
export default interface Registry { | ||
"Person::Approver": typeof PersonApproverComponent; | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
web/app/components/person.hbs → web/app/components/person/index.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import Component from "@glimmer/component"; | ||
|
||
interface PersonComponentSignature { | ||
Element: HTMLDivElement; | ||
Args: { | ||
email: string; | ||
imgURL?: string; | ||
ignoreUnknown?: boolean; | ||
badge?: string; | ||
}; | ||
} | ||
|
||
export default class PersonComponent extends Component<PersonComponentSignature> { | ||
get isHidden() { | ||
return this.args.ignoreUnknown && !this.args.email; | ||
} | ||
} | ||
|
||
declare module "@glint/environment-ember-loose/registry" { | ||
export default interface Registry { | ||
Person: typeof PersonComponent; | ||
} | ||
} |