code-corps / code-corps/code-corps-ember

Extract project join status from project-card component into a separate component

Offen
#1,181 0 Kommentare 0 Reaktionen 1 zugewiesene Person Beansprucht von @daveconnis Auf GitHub ansehen
Difficulty: Easy Skill: ember-cli-page-object Skill: Ember.js Skill: JavaScript Skill: Testing
Vorherrschende Sprache
JavaScript
Sterne
120
Forks
75
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

# Problem

The logic for the project status/join button in the project card template is highly complex. We could simplify it by extracting a part.

The following code:

```handlebars
{{#if currentProjectMembership.isLoaded}}
{{#if (eq currentProjectMembership.role 'pending')}}
Request sent
{{else}}
Member
{{/if}}
{{/if}}

{{#unless currentProjectMembership}}
{{project-join-modal project=project skills=projectSkills}}
{{/unless}}
```

should be replaced with the equivalent of:

```handlebars
{{#if currentProjectMembership}}
{{membership-status membership=currentProjectMembership}}
{{else}}
{{project-join-modal project=project skills=projectSkills}}
{{/if}}
```

## Subtasks

- [ ] Implement component
- Write integration tests for component
- [ ] If current project membership is loading, it renders nothing
- [ ] If current project membership is loaded and role is pending, it renders the "Request sent" button
- [ ] If current project membership is loaded and role is something else, it renders the "Member" button
- [ ] A page-object should be written for these tests
- [ ] Replace code with component
- Add integration tests for project card component
- [ ] If there is a current project membership, it renders the project-membership-subcomponent
- [ ] If there is no current project membership, it renders the project-join-modal subcomponent
- [ ] The project-card page object will need to be expanded with two new properties for this

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.