Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Figma user portal organization screen violates the figma style guide #3197 #3394

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 6 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ src/components/CheckIn/tagTemplate.ts
package.json
package-lock.json
tsconfig.json

fix-readme-links.js
fix-repo-url.js
# Ignore the Docusaurus website subdirectory
docs/**
docs/**

#Ignore markdown files from linting
*.md
85 changes: 50 additions & 35 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: Count number of lines
run: |
chmod +x ./.github/workflows/scripts/countline.py
./.github/workflows/scripts/countline.py --lines 600 --exclude_files src/screens/LoginPage/LoginPage.tsx src/GraphQl/Queries/Queries.ts src/screens/OrgList/OrgList.tsx src/GraphQl/Mutations/mutations.ts src/components/EventListCard/EventListCardModals.tsx src/components/TagActions/TagActionsMocks.ts src/utils/interfaces.ts src/screens/MemberDetail/MemberDetail.tsx
./.github/workflows/scripts/countline.py --lines 600 --exclude_files src/screens/LoginPage/LoginPage.tsx src/GraphQl/Queries/Queries.ts src/screens/OrgList/OrgList.tsx src/GraphQl/Mutations/mutations.ts src/components/EventListCard/EventListCardModals.tsx src/components/TagActions/TagActionsMocks.ts src/utils/interfaces.ts src/screens/MemberDetail/MemberDetail.tsx src/components/OrgPostCard/OrgPostCard.tsx src/components/UsersTableItem/UsersTableItem.tsx

- name: Get changed TypeScript files
id: changed-files
Expand All @@ -65,9 +65,7 @@ jobs:
run: npm run check-tsdoc # Run the TSDoc check script

- name: Check for localStorage Usage
run: |
chmod +x scripts/githooks/check-localstorage-usage.js
node scripts/githooks/check-localstorage-usage.js --scan-entire-repo
run: npx tsx scripts/githooks/check-localstorage-usage.ts --scan-entire-repo

- name: Compare translation files
run: |
Expand Down Expand Up @@ -204,6 +202,7 @@ jobs:
run: |
python .github/workflows/scripts/eslint_disable_check.py --files ${{ steps.changed-files.outputs.all_changed_files }}


Check-Code-Coverage-Disable:
name: Check for code coverage disable
runs-on: ubuntu-latest
Expand Down Expand Up @@ -245,27 +244,50 @@ jobs:
uses: tj-actions/changed-files@v45

- name: Run Jest Tests
if: steps.changed-files.outputs.only_changed != 'true'
if: steps.changed-files.outputs.any_changed == 'true'
env:
NODE_V8_COVERAGE: './coverage/jest'
run: |
npm run test -- --watchAll=false --coverage

- name: Upload Jest Coverage to Codecov
if: steps.changed-files.outputs.any_changed == 'true'
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage/jest/lcov.info
flags: jest
fail_ci_if_error: true

- name: Run Vitest Tests
if: steps.changed-files.outputs.only_changed != 'true'
if: steps.changed-files.outputs.any_changed == 'true'
env:
NODE_V8_COVERAGE: './coverage/vitest'
run: |
npm run test:vitest:coverage

- name: Merge Coverage Reports
if: steps.changed-files.outputs.only_changed != 'true'
- name: Upload Vitest Coverage to Codecov
if: steps.changed-files.outputs.any_changed == 'true'
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage/vitest/lcov.info
flags: vitest
fail_ci_if_error: true

- name: Merge Jest and Vitest Coverage Reports
run: |
mkdir -p coverage
if ! npx lcov-result-merger 'coverage/*/lcov.info' > 'coverage/lcov.info'; then
echo "Failed to merge coverage reports"
exit 1
fi
mkdir -p ./coverage
npx lcov-result-merger './coverage/*/lcov.info' './coverage/lcov.info'

- name: Upload Combined Coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
gcov_ignore: 'docs/'
files: ./coverage/lcov.info
flags: combined
fail_ci_if_error: true

- name: TypeScript compilation for changed files
run: |
Expand All @@ -275,21 +297,11 @@ jobs:
fi
done

- name: Present and Upload coverage to Codecov as ${{env.CODECOV_UNIQUE_NAME}}
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
gcov_ignore: 'docs/'
fail_ci_if_error: false
files: './coverage/lcov.info'
name: '${{env.CODECOV_UNIQUE_NAME}}'

- name: Test acceptable level of code coverage
uses: VeryGoodOpenSource/very_good_coverage@v3
with:
path: "./coverage/lcov.info"
min_coverage: 0.0
min_coverage: 0

# Graphql-Inspector:
# if: ${{ github.actor != 'dependabot[bot]' }}
Expand Down Expand Up @@ -402,27 +414,30 @@ jobs:
run: |
docker stop talawa-admin-app-container
docker rm talawa-admin-app-container


Test-Docusaurus-Deployment:
name: Test Deployment to https://docs-admin.talawa.io
runs-on: ubuntu-latest
needs: [Docker-Start-Check, Start-App-Without-Docker]
# Run only if the develop-postgres branch and not dependabot
# Run only if the develop-postgres branch and not dependabot
if: ${{ github.actor != 'dependabot[bot]' && github.event.pull_request.base.ref == 'develop-postgres' }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- name: Checkout the Repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: yarn
cache-dependency-path: 'docs/'
# Run Docusaurus in the ./docs directory
node-version: '20.x'

- name: Install dependencies
working-directory: ./docs
run: yarn install --frozen-lockfile
run: npm install

- name: Test building the website
working-directory: ./docs
run: yarn build
run: npm run build

Check-Target-Branch:
if: ${{ github.actor != 'dependabot[bot]' }}
Expand All @@ -446,8 +461,8 @@ jobs:
uses: actions/checkout@v4
- name: Validate CodeRabbit.ai Approval
run: |
chmod +x $GITHUB_WORKSPACE/.github/workflows/scripts/validate-coderabbit.sh
$GITHUB_WORKSPACE/.github/workflows/scripts/validate-coderabbit.sh
chmod +x .github/workflows/scripts/validate-coderabbit.sh
.github/workflows/scripts/validate-coderabbit.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/push-deploy-website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
name: Deploy https://docs-admin.talawa.io website
runs-on: ubuntu-latest
# Run only if the develop-postgres branch and not dependabot
if: ${{ github.actor != 'dependabot[bot]' && github.event.pull_request.base.ref == 'develop' }}
if: ${{ github.actor != 'dependabot[bot]' }}
environment:
# This "name" has to be the repos' branch that contains
# the current active website. There must be an entry for
Expand All @@ -38,9 +38,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: yarn
cache-dependency-path: 'docs/'
node-version: '20.x'
- uses: webfactory/ssh-agent@v0.9.0
with:
ssh-private-key: ${{ secrets.DEPLOY_GITHUB_PAGES }}
Expand Down
45 changes: 19 additions & 26 deletions .github/workflows/scripts/eslint_disable_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,8 @@ def has_eslint_disable(file_path):
"""
# Initialize key variables
eslint_disable_pattern = re.compile(
r"\/\/\s*eslint-disable(?:-next-line"
r"|-line)?[^\n]*|\/\*\s*eslint-disable[^\*]*\*\/",
re.IGNORECASE,
r"\/\/.*eslint-disable.*|\/\*[\s\S]*?eslint-disable[\s\S]*?\*\/",
re.IGNORECASE | re.DOTALL,
)

try:
Expand All @@ -49,13 +48,11 @@ def has_eslint_disable(file_path):
return bool(eslint_disable_pattern.search(content))
except FileNotFoundError:
print(f"File not found: {file_path}")
return False
except PermissionError:
print(f"Permission denied: {file_path}")
return False
except (IOError, OSError) as e:
print(f"Error reading file {file_path}: {e}")
return False
return False


def check_eslint(files_or_directories):
Expand All @@ -71,31 +68,27 @@ def check_eslint(files_or_directories):

for item in files_or_directories:
if os.path.isfile(item):
# If it's a file, directly check it
if item.endswith(".ts") or item.endswith(".tsx"):
if has_eslint_disable(item):
print(
f"""\
File {item} contains eslint-disable statement. Please remove them and \
ensure the code adheres to the specified ESLint rules."""
)
eslint_found = True
# Check a single file
if item.endswith((".ts", ".tsx")) and has_eslint_disable(item):
print(
f"Error: File {item} contains eslint-disable statements."
)
eslint_found = True
elif os.path.isdir(item):
# If it's a directory, walk through it and check all
# .ts and .tsx files
# Recursively check files in a directory
for root, _, files in os.walk(item):
if "node_modules" in root:
continue
for file_name in files:
if file_name.endswith(".ts") or file_name.endswith(".tsx"):
if file_name.endswith((".ts", ".tsx")):
file_path = os.path.join(root, file_name)
if has_eslint_disable(file_path):
print(
f"""File {file_path} contains eslint-disable
statement."""
f"Error: File {file_path} contains "
"eslint-disable statements."
)
eslint_found = True

eslint_found = True
return eslint_found


Expand All @@ -107,22 +100,22 @@ def arg_parser_resolver():
Returns:
result: Parsed argument object
"""
parser = argparse.ArgumentParser()
parser = argparse.ArgumentParser(
description="Check TypeScript files for eslint-disable statements."
)
parser.add_argument(
"--files",
type=str,
nargs="+",
default=[],
help="""List of files to check for eslint disable
statements (default: None).""",
help="List of files to check for eslint-disable statements.",
)
parser.add_argument(
"--directory",
type=str,
nargs="+",
default=[os.getcwd()],
help="""One or more directories to check for eslint disable
statements (default: current directory).""",
help="One or more directories to check for eslint-disable statements.",
)
return parser.parse_args()

Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Docusaurus related
.docusaurus

# generated docs using husky pre-commit hook
# /docs/docs/auto-docs

# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# files that interfere with YARN
Expand Down
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

npm run generate-docs
npm run format:fix
# npm run lint:fix
npm run lint-staged
Expand Down
2 changes: 1 addition & 1 deletion .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"**/*.{ts,tsx,yml}": "eslint --fix",
"**/*.{ts,tsx,json,scss,css,yml}": "prettier --write",
"**/*.{ts,tsx}": "node scripts/githooks/check-localstorage-usage.js"
"**/*.{ts,tsx}": "npx tsx scripts/githooks/check-localstorage-usage.ts"
}
Empty file removed 3141
Empty file.
Loading
Loading