Skip to content

Commit

Permalink
Merge branch 'main' into tip-calculator
Browse files Browse the repository at this point in the history
  • Loading branch information
atapas committed Oct 19, 2023
2 parents 8444974 + fd84dd6 commit e10709c
Show file tree
Hide file tree
Showing 110 changed files with 17,993 additions and 378 deletions.
9 changes: 9 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,15 @@
"contributions": [
"code"
]
},
{
"login": "freemrl",
"name": "Jannik Schmidtke",
"avatar_url": "https://avatars.githubusercontent.com/u/66525499?v=4",
"profile": "https://github.com/FreemRL",
"contributions": [
"code"
]
}
],
"contributorsPerLine": 7,
Expand Down
1 change: 1 addition & 0 deletions .env.development
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
REACT_APP_PLAY_API_URL=https://api.github.com/repos/reactplay
REACT_APP_NHOST_BACKEND_URL=https://rgkjmwftqtbpayoyolwh.nhost.run
REACT_APP_NHOST_VERSION=v1
REACT_APP_NHOST_ENDPOINT=graphql
Expand Down
4 changes: 4 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ module.exports = {
ignorePatterns: ['**/plays/index.js'],

rules: {
// Note: you must disable the base rule as it can report incorrect errors
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "warn",

'import/extensions': 0,

'import/no-named-as-default-member': 0,
Expand Down
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/#2PlaysAMonth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: '🔥 #2PlaysAMonth Entry'
description: 'Add a new Play entry for the #2PlaysAMonth event.'
title: '[#2PlaysAMonth]: '
labels: ['#2PlaysAMonth']
assignees: ['']
body:
- type: markdown
attributes:
Expand Down
8 changes: 5 additions & 3 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
name: "\U0001F41B [Bug report]:"
description: Create a report to help us improve
title: "\U0001F41B [Bug report]: "
labels: ['bug']
assignees: ['']
labels: ["bug","🛠 goal: fix", "🚦status: awaiting triage", "💻 aspect: code"]
body:
- type: markdown
attributes:
Expand Down Expand Up @@ -70,7 +69,7 @@ body:
attributes:
label: Relevant log output
description: Add any other context about the problem here.
render: shell


- type: checkboxes
id: record
Expand All @@ -82,6 +81,9 @@ body:
- label: I have read the [Contributing Guidelines](https://github.com/reactplay/react-play/blob/main/CONTRIBUTING.md)
required: true
- label: I want to work on this issue
- label: I am in Hacktoberfest
required: true


- type: checkboxes
id: terms
Expand Down
45 changes: 45 additions & 0 deletions .github/ISSUE_TEMPLATE/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: 🔖 Documentation update
description: Improve Documentation
title: "docs:"
labels:
[
"📄 aspect: text",
"🚦status: awaiting triage",
"✨ goal: improvement",
"good first issue"
]
body:
- type: textarea
id: improve-docs
attributes:
label: what's wrong with the documentation?
description: which things do we need to add?
placeholder: Add description
validations:
required: true
- type: textarea
id: screenshots
attributes:
label: Add screenshots
description: Add screenshots to see the demo
placeholder: Add screenshots
validations:
required: true
- type: checkboxes
id: terms
attributes:
label: "Record"
options:
- label: I have checked the existing [issues](https://github.com/reactplay/react-play/issues)
required: true

- label: I have read the [Contributing Guidelines](https://github.com/reactplay/react-play/blob/main/CONTRIBUTING.md)
required: true

- label: I agree to follow this project's [Code of Conduct](https://github.com/reactplay/react-play/blob/main/CODE_OF_CONDUCT.md)
required: true

- label: I am in Hacktoberfest
required: true

- label: I want to work on this issue
5 changes: 3 additions & 2 deletions .github/ISSUE_TEMPLATE/feature-request.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
name: '✨ [Feature request]:'
description: Suggest an idea for this project
title: '✨ [Feature request]: '
labels: []
assignees: ['']
labels: ["🚦status: awaiting triage", "💻 aspect: code", "⭐ goal: addition"]
body:
- type: markdown
attributes:
Expand Down Expand Up @@ -55,6 +54,8 @@ body:
- label: I have read the [Contributing Guidelines](https://github.com/reactplay/react-play/blob/main/CONTRIBUTING.md)
required: true
- label: I want to work on this issue
- label: I am in Hacktoberfest
required: true

- type: checkboxes
id: terms
Expand Down
5 changes: 3 additions & 2 deletions .github/ISSUE_TEMPLATE/new-play.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
name: New Play
description: Add a New Play Request
title: '[Add a Play]: '
labels: ['play-request']
assignees: ['']
labels: ["play request","🚦status: awaiting triage", "💻 aspect: code" ]
body:
- type: markdown
attributes:
Expand Down Expand Up @@ -35,6 +34,8 @@ body:
- label: I have read the [Contributing Guidelines](https://github.com/reactplay/react-play/blob/main/CONTRIBUTING.md)
required: true
- label: I want to work on this issue
- label: I am in Hacktoberfest
required: true

- type: checkboxes
id: terms
Expand Down
39 changes: 39 additions & 0 deletions .github/ISSUE_TEMPLATE/refactor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Refactor Code 🔧
description: Use this label for code refactoring tasks.
title: "[Refactor] <write what you want to add>"
labels: ["🛠 goal: refactor", "🚦status: awaiting triage","💻 aspect: code"]
body:
- type: input
id: refactor_input
attributes:
label: File Name
description: "Enter the file that you want to refactor in the codebase."
placeholder: "For example - src/common"
validations:
required: true
- type: textarea
id: refactor_description
attributes:
label: "Reason for Refactoring the Code"
description: "Describe what improvements can be made in the codebase without introducing breaking changes."
validations:
required: true
- type: checkboxes
id: refactor_terms
attributes:
label: "Record"
options:
- label: I have checked the existing [issues](https://github.com/reactplay/react-play/issues)
required: true

- label: I have read the [Contributing Guidelines](https://github.com/reactplay/react-play/blob/main/CONTRIBUTING.md)
required: true

- label: I agree to follow this project's [Code of Conduct](https://github.com/reactplay/react-play/blob/main/CODE_OF_CONDUCT.md)
required: true

- label: I am in Hacktoberfest
required: true


- label: I want to work on this issue
13 changes: 13 additions & 0 deletions .github/workflows/author-assign.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: 'Author Assign'

on:
pull_request_target:
types: [opened, reopened]

jobs:
assign-author:
runs-on: ubuntu-latest
steps:
- uses: toshimaru/auto-author-assign@v2.0.1
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
2 changes: 1 addition & 1 deletion .github/workflows/contributions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ concurrency:
cancel-in-progress: true
jobs:
add-contributors:
if: github.event.pull_request.merged == true
if: github.event.pull_request.merged == true && github.repository == 'reactplay/react-play'
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v6
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ concurrency:
jobs:
cypress-run:
runs-on: ubuntu-latest
if: github.repository == 'reactplay/react-play'
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/greetings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ concurrency:
jobs:
welcome:
runs-on: ubuntu-latest
if: github.repository == 'reactplay/react-play'
steps:
- uses: actions/checkout@v4
- uses: EddieHubCommunity/gh-action-community/src/welcome@main
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/issue-lock.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: 'Lock new issues'

on:
issues:
types: opened

permissions:
issues: write

jobs:
action:
runs-on: ubuntu-latest
if: github.repository == 'reactplay/react-play'
steps:
- uses: dessant/repo-lockdown@v3
with:
close-issue: false
exclude-issue-labels: '🏁 status: ready for dev'
process-only: 'issues'
skip-closed-issue-comment: true
issue-comment: >
To reduce notifications, issues are locked. Your issue will be unlocked when we add the label `🏁 status: ready for dev`.
1 change: 1 addition & 0 deletions .github/workflows/stale-issue-and-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
stale:
name: 🧹 Clean up stale issues and PRs
runs-on: ubuntu-latest
if: github.repository == 'reactplay/react-play'
steps:
- name: 🚀 Stale Issue And PR
uses: actions/stale@v8
Expand Down
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ yarn.lock

# play index
src/plays/index.js
plays/index.js
src/plays/index.json
plays/index.json


# play test
cypress/e2e/play.cy.ts


# vscode setting
.vscode
.vscode
Empty file removed TestimonialModal.jsx
Empty file.
Empty file removed Testtimonal.css
Empty file.
36 changes: 12 additions & 24 deletions cypress/e2e/homePage.cy.ts
Original file line number Diff line number Diff line change
@@ -1,38 +1,26 @@
/// <reference types="cypress" />
// / <reference types="cypress" />

import { CONTRIBUTORS_COUNT, TWEET_COUNT } from '../support/constant';
import { CONTRIBUTORS_COUNT, TESTIMONIALS_COUNT } from '../support/constant';

describe('Test home page', () => {
beforeEach(() => {
cy.intercept('POST', '**/v1/graphql').as('contribs');
cy.visit('/');
cy.wait('@contribs');
});

it('Header component should render properly', () => {
cy.get('[data-testid="app-header"]').should('be.visible');
cy.get('[data-testid="app-logo"]').should('be.visible');
cy.get('[data-testid="plays-search-box-container"]').should('not.exist');
cy.get('[data-testid="header-links-container"]').should('be.visible');
cy.get('[data-testid="browse-btn"]').should('be.visible').as('browseBtn');
cy.get('[data-testid="create-btn"]').should('be.visible');
cy.get('[data-testid="ideas-btn"]').should('be.visible');
cy.get('[data-testid="github-btn"]').should('be.visible');
cy.get('[data-testid="twitter-btn"]').should('be.visible');
cy.get('[data-testid="share-btn"]').should('be.visible');
cy.get('[data-testid="leaderboard-btn"]').should('be.visible');
cy.header();
});

cy.get('@browseBtn').click();
cy.get('[data-testid="plays-search-box-container"]').should('be.visible');
it('Testitomonials section should render and navigation must be clickable', () => {
cy.get('[data-testid="testimonials-section"]').scrollIntoView().should('be.visible');
cy.get('[data-testid="testimonials-swiper"]').scrollIntoView().should('be.visible');
});

it('Tweet section should render with all tweets', () => {
cy.intercept('GET', 'https://cdn.syndication.twimg.com/*').as('tweets');
cy.wait('@tweets');
cy.get('[data-testid="tweet-container"]').scrollIntoView().should('be.visible');
cy.get('[data-testid="tweet-container"] [id*="twitter-widget"]').should(
'have.length',
TWEET_COUNT
);
cy.get('[data-testid="watch-svg"]').should('not.exist');
it('Testitomonials should have a number of slides', () => {
cy.get('[data-testid="testimonials-swiper"]').scrollIntoView().should('be.visible');
cy.get('.swiper-slide').should('have.length', TESTIMONIALS_COUNT);
});

it('Contributors section should render with all contributors', () => {
Expand Down
11 changes: 11 additions & 0 deletions cypress/e2e/ideasPage.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// / <reference types="cypress" />

describe('Test play ideas page', () => {
beforeEach(() => {
cy.visit('/ideas');
});

it('Header component should render properly', () => {
cy.header();
});
});
11 changes: 11 additions & 0 deletions cypress/e2e/leaderboardPage.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// / <reference types="cypress" />

describe('Test leaderboard page', () => {
beforeEach(() => {
cy.visit('/leaderboard');
});

it('Header component should render properly', () => {
cy.header();
});
});
19 changes: 18 additions & 1 deletion cypress/support/commands.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// <reference types="cypress" />
// / <reference types="cypress" />
// ***********************************************
// This example commands.ts shows you how to
// create various custom commands and overwrite
Expand Down Expand Up @@ -35,3 +35,20 @@
// }
// }
// }

// methods
Cypress.Commands.add('header', () => {
cy.get('[data-testid="app-header"]').should('be.visible');
cy.get('[data-testid="app-logo"]').should('be.visible');
cy.get('[data-testid="plays-search-box-container"]').should('not.exist');
cy.get('[data-testid="header-links-container"]').should('be.visible');
cy.get('[data-testid="browse-btn"]').should('be.visible').as('browseBtn');
cy.get('[data-testid="create-btn"]').should('be.visible');
cy.get('[data-testid="ideas-btn"]').should('be.visible');
cy.get('[data-testid="github-btn"]').should('be.visible');
cy.get('[data-testid="twitter-btn"]').should('be.visible');
cy.get('[data-testid="share-btn"]').should('be.visible');
cy.get('[data-testid="leaderboard-btn"]').should('be.visible');
cy.get('@browseBtn').click();
cy.get('[data-testid="plays-search-box-container"]').should('be.visible');
});
2 changes: 1 addition & 1 deletion cypress/support/constant.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export const TWEET_COUNT = 11;
export const TESTIMONIALS_COUNT = 9;
export const CONTRIBUTORS_COUNT = 29;
Loading

0 comments on commit e10709c

Please sign in to comment.