Skip to content

Commit

Permalink
Merge branch 'main' into SHOPX-1418
Browse files Browse the repository at this point in the history
  • Loading branch information
lkostrowski authored Nov 4, 2024
2 parents ea81f31 + e77aa06 commit 52cdbd8
Show file tree
Hide file tree
Showing 229 changed files with 4,747 additions and 11,127 deletions.
5 changes: 5 additions & 0 deletions .changeset/dull-glasses-juggle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"saleor-dashboard": patch
---

Mailpit service uses has been removed due to issues with checking email during E2E runs on PRs. This means the tests no longer check if export emails have been received.
5 changes: 5 additions & 0 deletions .changeset/giant-queens-smell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"saleor-dashboard": patch
---

Fixes a bug when the text truncating breaks on undefined attribute value.
5 changes: 0 additions & 5 deletions .changeset/itchy-moose-listen.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/late-pants-collect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"saleor-dashboard": minor
---

Always add comment after tests to CORE release PR, even if previous job fails.
5 changes: 5 additions & 0 deletions .changeset/light-squids-shave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"saleor-dashboard": patch
---

The value of attribute type `plainText` is now capped. This prevents the UI from freezing when the value is very large.
5 changes: 0 additions & 5 deletions .changeset/silver-items-turn.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/slow-mangos-beg.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/sour-balloons-clean.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/spotty-lemons-give.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"saleor-dashboard": patch
---

The tax app version no longer displayed in the tax select input because showing the initial installed app version caused confusing
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,5 +105,5 @@
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": "off"
},
"ignorePatterns": ["node_modules/", "**/types/**/*", "type-policies.ts"]
"ignorePatterns": ["node_modules/", "**/types/**/*", "type-policies.ts", "playwright/auth.js"]
}
2 changes: 1 addition & 1 deletion .featureFlags/discounts-rules.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: discounts_rules
displayName: Discounts rules
enabled: false
enabled: true
payload: "default"
visible: true
---
Expand Down
38 changes: 5 additions & 33 deletions .featureFlags/generated.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
// @ts-nocheck

import L19499 from "./images/discounts-list.png"
import I59669 from "./images/improved_refunds.png"
import M04994 from "./images/order-filters.png"
import C77988 from "./images/filters.png"
import R80834 from "./images/discounts-list.png"
import E27647 from "./images/improved_refunds.png"

const discounts_rules = () => (<><p><img src={L19499} alt="Discount rules"/></p>
const discounts_rules = () => (<><p><img src={R80834} alt="Discount rules"/></p>
<p>Apply the new discounts rules to narrow your promotions audience.
Set up conditions and channels that must be fulfilled to apply defined reward.</p>
</>)
const improved_refunds = () => (<><p><img src={I59669} alt="Improved refunds"/></p>
const improved_refunds = () => (<><p><img src={E27647} alt="Improved refunds"/></p>
<h3 id="enable-the-enhanced-refund-feature-to-streamline-your-refund-process">Enable the enhanced refund feature to streamline your refund process:</h3>
<ul>
<li><p>• Choose between automatic calculations based on selected items or enter refund amounts directly for overcharges and custom adjustments.</p>
Expand All @@ -18,14 +16,6 @@ const improved_refunds = () => (<><p><img src={I59669} alt="Improved refunds"/><
</li>
</ul>

</>)
const order_filters = () => (<><p><img src={M04994} alt="new filters"/></p>
<p>Experience the new look and enhanced abilities of new orders filtering mechanism.
Easily combine any criteria you want, and quickly browse their values.</p>
</>)
const product_filters = () => (<><p><img src={C77988} alt="new filters"/></p>
<p>Experience the new look and enhanced abilities of new fitering mechanism.
Easily combine any criteria you want, and quickly browse their values.</p>
</>)

export const AVAILABLE_FLAGS = [{
Expand All @@ -34,7 +24,7 @@ export const AVAILABLE_FLAGS = [{
component: discounts_rules,
visible: true,
content: {
enabled: false,
enabled: true,
payload: "default",
}
},{
Expand All @@ -46,22 +36,4 @@ export const AVAILABLE_FLAGS = [{
enabled: true,
payload: "default",
}
},{
name: "order_filters",
displayName: "Orders filtering",
component: order_filters,
visible: true,
content: {
enabled: true,
payload: "default",
}
},{
name: "product_filters",
displayName: "Products filtering",
component: product_filters,
visible: true,
content: {
enabled: true,
payload: "default",
}
}] as const;
12 changes: 0 additions & 12 deletions .featureFlags/order-filters.md

This file was deleted.

12 changes: 0 additions & 12 deletions .featureFlags/product-filters.md

This file was deleted.

48 changes: 48 additions & 0 deletions .github/actions/prepare-accounts/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Prepare accounts
description: Prepare accounts that are used by Playwright
inputs:
BASE_URL:
description: "Dashboard base url"
required: true
API_URL:
description: "API url"
required: true
E2E_USER_NAME:
description: "Username for e2e tests"
required: true
E2E_USER_PASSWORD:
description: "Password for e2e tests"
required: true
E2E_PERMISSIONS_USERS_PASSWORD:
description: "Permissions user password for e2e tests"
required: true
E2E_ENCODE_PASS:
description: "Password for encoding credentials"
required: true

outputs:
ACCOUNTS:
description: "Encrypted accounts"
value: ${{ steps.accounts.outputs.ACCOUNTS }}


runs:
using: "composite"
steps:
- uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"

- name: Prepare accounts
shell: bash
id: accounts
env:
BASE_URL: ${{ inputs.BASE_URL }}
API_URL: ${{ inputs.API_URL }}
E2E_USER_NAME: ${{ inputs.E2E_USER_NAME }}
E2E_USER_PASSWORD: ${{ inputs.E2E_USER_PASSWORD }}
E2E_ENCODE_PASS: ${{ inputs.E2E_ENCODE_PASS }}
E2E_PERMISSIONS_USERS_PASSWORD: ${{ inputs.E2E_PERMISSIONS_USERS_PASSWORD }}
run: |
ACCOUNTS=$(node playwright/auth.js login)
echo "ACCOUNTS=${ACCOUNTS}" >> "$GITHUB_OUTPUT"
32 changes: 32 additions & 0 deletions .github/actions/restore-accounts/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Restore accounts
description: Restore accounts to be consumed by Playwright
inputs:
ACCOUNTS:
description: "Accounts encrypted string"
required: true
E2E_ENCODE_PASS:
description: "Password for encoding credentials"
required: true
BASE_URL:
description: "Dashboard base url"
required: true
API_URL:
description: "API url"
required: true

runs:
using: "composite"
steps:
- uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"

- name: Restore accounts
shell: bash
env:
E2E_ENCODE_PASS: ${{ inputs.E2E_ENCODE_PASS }}
ACCOUNTS: ${{ inputs.ACCOUNTS }}
API_URL: ${{ inputs.API_URL }}
BASE_URL: ${{ inputs.BASE_URL }}
run: |
node playwright/auth.js restore "$ACCOUNTS"
18 changes: 16 additions & 2 deletions .github/actions/run-pw-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,15 @@ inputs:
description: "Playwright retries"
required: true
PROJECT:
description: "Project name form playwright config"
description: "Project name from playwright config"
required: false
default: "e2e"
ACCOUNTS:
description: "Accounts hash"
required: true
E2E_ENCODE_PASS:
description: "Password for encoding credentials"
required: true

runs:
using: "composite"
Expand All @@ -47,6 +53,14 @@ runs:
shell: bash
run: npm ci

- name: Restore accounts
uses: ./.github/actions/restore-accounts
with:
BASE_URL: ${{ inputs.BASE_URL }}
API_URL: ${{ inputs.API_URL }}
ACCOUNTS: ${{ inputs.ACCOUNTS }}
E2E_ENCODE_PASS: ${{ inputs.E2E_ENCODE_PASS }}

- name: Install Playwright Browsers
shell: bash
run: npx playwright install --with-deps
Expand Down Expand Up @@ -82,4 +96,4 @@ runs:
with:
name: all-blob-reports
path: blob-report
retention-days: 1
retention-days: 1
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ jobs:
secrets: inherit

add-comment-to-release-pr:
if: ${{ !cancelled() }}
needs: run-tests-on-release
runs-on: ubuntu-22.04
steps:
Expand Down
18 changes: 17 additions & 1 deletion .github/workflows/pr-automation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ jobs:
deploy-dashboard:
if: github.event.pull_request.head.repo.full_name == 'saleor/saleor-dashboard'
outputs:
ACCOUNTS: ${{ steps.accounts.outputs.ACCOUNTS }}
runs-on: ubuntu-22.04
needs: initialize-cloud
permissions:
Expand Down Expand Up @@ -151,6 +153,17 @@ jobs:
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
env: ${{ needs.initialize-cloud.outputs.POOL_NAME }}

- name: Prepare accounts
id: accounts
uses: ./.github/actions/prepare-accounts
with:
BASE_URL: ${{ needs.initialize-cloud.outputs.BASE_URL }}
API_URL: ${{ needs.initialize-cloud.outputs.API_URL }}
E2E_USER_NAME: ${{ secrets.E2E_USER_NAME }}
E2E_USER_PASSWORD: ${{ secrets.E2E_USER_PASSWORD }}
E2E_ENCODE_PASS: ${{ secrets.E2E_ENCODE_PASS }}
E2E_PERMISSIONS_USERS_PASSWORD: ${{ secrets.E2E_PERMISSIONS_USERS_PASSWORD }}

run-tests:
if: ${{ contains(github.event.pull_request.labels.*.name, 'run pw-e2e') }}
runs-on: ubuntu-22.04
Expand All @@ -159,6 +172,7 @@ jobs:
fail-fast: false
matrix:
shard: ${{ fromJson(needs.initialize-cloud.outputs.SHARD_MATRIX) }}

steps:
- uses: actions/checkout@v4

Expand All @@ -174,6 +188,8 @@ jobs:
MAILPITURL: ${{ secrets.MAILPITURL }}
PW_WORKERS: ${{ vars.PW_WORKERS }}
PW_RETRIES: ${{ vars.PW_RETRIES }}
ACCOUNTS: ${{ needs.deploy-dashboard.outputs.ACCOUNTS }}
E2E_ENCODE_PASS: ${{ secrets.E2E_ENCODE_PASS }}

merge-reports:
if: "!cancelled() && contains(github.event.pull_request.labels.*.name, 'run pw-e2e')"
Expand All @@ -184,4 +200,4 @@ jobs:
- uses: actions/checkout@v4

- name: Merge playwright reports
uses: ./.github/actions/merge-pw-reports
uses: ./.github/actions/merge-pw-reports
Loading

0 comments on commit 52cdbd8

Please sign in to comment.