Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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

未关闭
#1,181 0 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

@daveconnis 已经在做这个了。

开始于 2017年10月18日。

评估

这个 Issue 还没有评估数据。

描述

Difficulty: Easy Skill: ember-cli-page-object Skill: Ember.js Skill: JavaScript Skill: Testing

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:

{{#if currentProjectMembership.isLoaded}}
  {{#if (eq currentProjectMembership.role 'pending')}}
    <button class="clear small" disabled>Request sent</button>
  {{else}}
    <button class="clear small" disabled>Member</button>
  {{/if}}
{{/if}}

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

should be replaced with the equivalent of:

{{#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
主要语言
JavaScript
星标
120
派生
75
PR 合并指标
30 天内没有已合并 PR

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

code-corps/code-corps-ember 的其他 Issue

查看 code-corps/code-corps-ember 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。