diff --git a/.github/workflows/pr-tests.yml b/.github/workflows/pr-tests.yml index 462fa7f..1610785 100644 --- a/.github/workflows/pr-tests.yml +++ b/.github/workflows/pr-tests.yml @@ -4,12 +4,15 @@ on: pull_request: types: - opened - - edited + - synchronize + - reopened + - ready_for_review branches: - main permissions: contents: write + pull-requests: write jobs: test: @@ -24,27 +27,57 @@ jobs: deno-version: v2.x - name: Switch to branch - run: git switch "${{ github.head_ref }}" + run: | + git fetch origin "${{ github.head_ref }}" + git switch "${{ github.head_ref }}" + + - name: Run linter and capture errors + id: lint + continue-on-error: true + run: | + # Run the Deno linter and capture stderr + deno task lint 2> lint-error.log || true # do not fail + + - name: Comment on PR if linter fails + uses: actions/github-script@v7 + with: + script: | + const fs = require('fs'); + + // Read the linter error output + const errorOutput = fs.readFileSync('lint-error.log', 'utf8'); + const problemsFoundRegex = /Found [0-9]+ problem(s)?\n/m + if (!errorOutput || !errorOutput.match(problemsFoundRegex)) { + console.log("No lint errors."); + return; + } + + // Remove ANSI codes + const ansiRegex = /\x1b\[[0-9;]*m/g; + const cleanErrorOutput = errorOutput.replace(ansiRegex, ''); + + // Create a comment on the PR with the error message + await github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: `## Linter Failed:\n\n\`\`\`${cleanErrorOutput}\`\`\`` + }); + + // fail due to error found on previous step + process.exit(1); - - name: Run linter - run: deno task lint + - name: Remove lint-error.log + run: rm lint-error.log - name: Verify formatting run: deno task fmt - - name: Ensure Changes Exist - run: | - if git diff --exit-code; then - echo "No changes to commit, exiting." - exit 0 - fi - - - name: Set up Git user + - name: Push fmt changes run: | + if ! git diff --exit-code; then git config user.name "github-actions" git config user.email "github-actions@github.com" - - - name: Push fmt changes - run: | git commit -am "deno formatting" git push https://x-access-token:${{ github.token }}@github.com/${{ github.repository }} "${{ github.head_ref }}" + fi diff --git a/README.md b/README.md index e32a152..1877da5 100644 --- a/README.md +++ b/README.md @@ -6,15 +6,16 @@ ![Release version](https://img.shields.io/github/manifest-json/v/Astisme/again-why-salesforce?filename=manifest%2Ftemplate-manifest.json&label=Version) ![Last commit](https://img.shields.io/github/last-commit/Astisme/again-why-salesforce?labelColor=black&color=white) -![License](https://img.shields.io/github/license/astisme/again-why-salesforce) -![Code size](https://img.shields.io/github/languages/code-size/astisme/again-why-salesforce) +![License](https://img.shields.io/github/license/Astisme/again-why-salesforce) +![Code size](https://img.shields.io/github/languages/code-size/Astisme/again-why-salesforce) + This extension allows users to create custom tabs in Setup for their most-used settings. @@ -25,7 +26,7 @@ This is a fork of [Why Salesforce](https://www.github.com/walters954/why-salesfo [Install on Chrome Web Store](https://chrome.google.com/webstore/detail/why-salesforce/ghakkjfjpnhpggbkfkeplbefkipfoaod) -### Roadmap +## Roadmap - [x] Ability to customize tab - [x] Salesforce SLDS @@ -43,8 +44,18 @@ This is a fork of [Why Salesforce](https://www.github.com/walters954/why-salesfo - [x] Favourite button on current Setup page #12 - [x] Import & Export tabs -Contributors +## Contributing + +All contributions are welcome. Please head to the [issues page](https://github.com/Astisme/again-why-salesforce/issues) and pick one unassigned issue to work on. + +We'll assign it to you after you comment on it. + +## Best Practices + +The Best Practices followed by this project can be found [at this link](https://blog.jetbrains.com/webstorm/2024/10/javascript-best-practices-2024/). + +## Contributors - [Warren Walters](https://www.linkedin.com/in/walters954/) - [Chris Rouse (Firefox port)](https://www.linkedin.com/in/chris-rouse/) -- [Astisme](https://www.github.com/astisme/) +- [Astisme](https://www.github.com/Astisme/) diff --git a/action/basic.css b/action/basic.css index 08d28fc..55780fc 100644 --- a/action/basic.css +++ b/action/basic.css @@ -1,5 +1,6 @@ *, :before, :after { box-sizing: border-box; + background-color: transparent; } html { @@ -15,13 +16,14 @@ html { "Segoe UI Emoji", "Segoe UI Symbol"; line-height: 1.5; + color: var(--color); + background-color: var(--background-color); } body { padding: 0 !important; margin: 0; font-size: 0.8125rem; - background-color: transparent; } header { @@ -51,6 +53,10 @@ a { } } +input { + color: var(--color); +} + .button, button { position: relative; @@ -60,7 +66,7 @@ button { padding-bottom: 0; padding-left: 1rem; padding-right: 1rem; - border: none; + border: none; border-radius: 0.25rem; line-height: 1.875rem; text-decoration: none; @@ -74,19 +80,47 @@ button { margin-left: 0.25rem; width: 4rem; min-height: 2.3rem; - background-color: #e9e9ed; + color: var(--color); + background-color: var(--button-background-color); + + &:hover { + background-color: var(--button-background-color-hover); + } +} + +.success { + background-color: var(--success); - &:hover { - background-color: #cccccc; - } + &:hover { + background-color: var(--success-hover); + } +} + +.error { + background-color: var(--error); + + &:hover { + background-color: var(--error-hover); + } } .highlight { - background-color: lightblue; + color: var(--background-color); + background-color: var(--highlight); - &:hover { - background-color: skyblue; - } + &:hover { + background-color: var(--highlight-hover); + } +} + +:disabled { + color: var(--background-color); + background-color: var(--shade-hover); + cursor: not-allowed !important; + + &:hover { + background-color: var(--shade-hover); + } } .slds-assistive-text { diff --git a/action/logo.css b/action/logo.css index 5599da9..40e7086 100644 --- a/action/logo.css +++ b/action/logo.css @@ -3,6 +3,7 @@ a { margin-right: 0.75rem; display: flex; align-items: center; + color: var(--color); & > span { line-height: 1; diff --git a/action/logo.html b/action/logo.html index 01f5cda..f05031f 100644 --- a/action/logo.html +++ b/action/logo.html @@ -1,9 +1,13 @@ +