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

Update locale for PL #1

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/eighty-insects-repeat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"saleor-dashboard": minor
---

You can now run E2E Playwright tests for staff members CRUD
5 changes: 5 additions & 0 deletions .changeset/four-humans-reply.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"saleor-dashboard": minor
---

The API_URI is no longer used across the codebase. API_URI stays in workflows for backward compatibility
5 changes: 5 additions & 0 deletions .changeset/giant-ligers-jump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"saleor-dashboard": patch
---

You can now use improved Polish translations
5 changes: 5 additions & 0 deletions .changeset/grumpy-laws-leave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"saleor-dashboard": minor
---

Modal for refund reason now has an improved copy
5 changes: 5 additions & 0 deletions .changeset/many-deers-brush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"saleor-dashboard": minor
---

Warning message on manual refund view is no longer unreadable on dark mode
5 changes: 5 additions & 0 deletions .changeset/old-ducks-leave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"saleor-dashboard": patch
---

Update description of how to run e2e tests
5 changes: 5 additions & 0 deletions .changeset/olive-files-perform.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"saleor-dashboard": minor
---

Fixes incorrect button label for adding or editing refund reason
5 changes: 5 additions & 0 deletions .changeset/quick-timers-taste.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"saleor-dashboard": patch
---

Fixes an issue that caused an error when a page was serched in navigation menu
5 changes: 5 additions & 0 deletions .changeset/sour-rings-occur.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"saleor-dashboard": minor
---

Orders: In order list view you can now use new, easy to use and improved filters.
5 changes: 5 additions & 0 deletions .changeset/swift-balloons-serve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"saleor-dashboard": patch
---

You can now assign warehouses in product variant page without page crash
5 changes: 5 additions & 0 deletions .changeset/tame-tables-push.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"saleor-dashboard": patch
---

Webhook details view now correctly displays active/inactive status.
4 changes: 2 additions & 2 deletions .env.template
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
API_URI=https://demo.saleor.io/graphql/
API_URL=https://demo.saleor.io/graphql/
APP_MOUNT_URI=/
APPS_MARKETPLACE_API_URI=https://apps.saleor.io/api/v2/saleor-apps
APPS_MARKETPLACE_API_URL=https://apps.saleor.io/api/v2/saleor-apps
LOCALE_CODE="EN"
DEMO_MODE=false

Expand Down
26 changes: 20 additions & 6 deletions .featureFlags/generated.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
// @ts-nocheck

import S10225 from "./images/discounts-list.png"
import I95990 from "./images/improved_refunds.png"
import T06462 from "./images/filters.png"
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"

const discounts_rules = () => (<><p><img src={S10225} alt="Discount rules"/></p>
const discounts_rules = () => (<><p><img src={L19499} 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={I95990} alt="Improved refunds"/></p>
const improved_refunds = () => (<><p><img src={I59669} 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,7 +19,11 @@ const improved_refunds = () => (<><p><img src={I95990} alt="Improved refunds"/><
</ul>

</>)
const product_filters = () => (<><p><img src={T06462} alt="new filters"/></p>
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>
</>)
Expand All @@ -41,6 +46,15 @@ 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",
Expand Down
Binary file added .featureFlags/images/order-filters.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions .featureFlags/order-filters.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
name: order_filters
displayName: Orders filtering
enabled: true
payload: "default"
visible: true
---

![new filters](./images/order-filters.png)

Experience the new look and enhanced abilities of new orders filtering mechanism.
Easily combine any criteria you want, and quickly browse their values.
3 changes: 3 additions & 0 deletions .github/actions/e2e/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ runs:
install: ${{inputs.install}}
browser: ${{inputs.browser}}
env:
## backward compatibility for older versions
API_URI: ${{inputs.apiUrl}}

API_URL: ${{inputs.apiUrl}}
APP_MOUNT_URI: ${{ inputs.appMountUri }}
BASE_URL: ${{inputs.baseUrl}}
CYPRESS_USER_NAME: ${{ inputs.userName }}
Expand Down
9 changes: 9 additions & 0 deletions .github/actions/prepare-instance/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,12 @@ runs:
--domain="$INSTANCE_NAME" \
--skip-restrict \
--skip-webhooks-update

- name: Add client origins
shell: bash
if: ${{!contains(inputs.BASE_URL, inputs.POOL_INSTANCE) && !steps.instance_check.outputs.INSTANCE_KEY }} # Add base url as a trusted origins if we're using deployed dashboard in repo (saleor.rocks)
env:
POOL_NAME: ${{ inputs.POOL_NAME }}
BASE_URL: ${{ inputs.BASE_URL }}
run: |
npx saleor env origins "$POOL_NAME" --origins="$BASE_URL"
3 changes: 3 additions & 0 deletions .github/actions/run-pw-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ runs:
- name: Run tests
shell: bash
env:
## backward compatibility for older versions
API_URI: ${{ inputs.API_URL }}

API_URL: ${{ inputs.API_URL }}
BASE_URL: ${{ inputs.BASE_URL }}
E2E_USER_NAME: ${{ inputs.E2E_USER_NAME }}
E2E_USER_PASSWORD: ${{ inputs.E2E_USER_PASSWORD }}
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/cypress-repeat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ jobs:
id: cypress
uses: cypress-io/github-action@v4
env:
## backward compatibility for older versions
API_URI: ${{ github.event.inputs.API_url}}

API_URL: ${{ github.event.inputs.API_url}}
APP_MOUNT_URI: ${{ secrets.APP_MOUNT_URI }}
BASE_URL: ${{ github.event.inputs.dashboard_url}}
CYPRESS_USER_NAME: ${{ secrets.CYPRESS_USER_NAME }}
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/deploy-and-run-cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ jobs:

- name: Run build
env:
## backward compatibility for older versions
API_URI: ${{github.event.inputs.api_url}}

API_URL: ${{github.event.inputs.api_url}}
APP_MOUNT_URI: /
STATIC_URL: /
IS_CLOUD_INSTANCE: true
Expand Down Expand Up @@ -108,7 +111,10 @@ jobs:
- name: Cypress run critical
uses: cypress-io/github-action@v4
env:
## backward compatibility for older versions
API_URI: ${{github.event.inputs.api_url}}

API_URL: ${{github.event.inputs.api_url}}
APP_MOUNT_URI: ${{ secrets.APP_MOUNT_URI }}
BASE_URL: https://${{needs.deploy.outputs.base_URL}}
CYPRESS_USER_NAME: ${{ secrets.CYPRESS_USER_NAME }}
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/deploy-cloud.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ jobs:
build:
runs-on: ubuntu-20.04
env:
## backward compatibility for older versions
APPS_MARKETPLACE_API_URI: "https://apps.saleor.io/api/v2/saleor-apps"
## backward compatibility for older versions
API_URI: /graphql/

API_URL: /graphql/
APP_MOUNT_URI: /dashboard/
STATIC_URL: /dashboard/static/
SENTRY_ORG: saleor
Expand All @@ -17,7 +22,7 @@ jobs:
REGION: ${{ github.event.client_payload.region }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
APPS_MARKETPLACE_API_URI: "https://apps.saleor.io/api/v2/saleor-apps"
APPS_MARKETPLACE_API_URL: "https://apps.saleor.io/api/v2/saleor-apps"
IS_CLOUD_INSTANCE: true
POSTHOG_KEY: ${{ secrets.POSTHOG_KEY }}
POSTHOG_HOST: ${{ secrets.POSTHOG_HOST }}
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/deploy-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,20 @@ jobs:
build:
runs-on: ubuntu-20.04
env:
## backward compatibility for older versions
APPS_MARKETPLACE_API_URI: "https://apps.staging.saleor.io/api/v2/saleor-apps"
## backward compatibility for older versions
API_URI: /graphql/

API_URL: /graphql/
APP_MOUNT_URI: /dashboard/
STATIC_URL: /dashboard/static/
SENTRY_ORG: saleor
SENTRY_PROJECT: dashboard
SENTRY_URL_PREFIX: "~/dashboard/static"
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
APPS_MARKETPLACE_API_URI: "https://apps.staging.saleor.io/api/v2/saleor-apps"
APPS_MARKETPLACE_API_URL: "https://apps.staging.saleor.io/api/v2/saleor-apps"
IS_CLOUD_INSTANCE: true
steps:
- uses: actions/checkout@v2
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/deploy-master-staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,20 @@ jobs:
build:
runs-on: ubuntu-20.04
env:
## backward compatibility for older versions
API_URI: /graphql/
## backward compatibility for older versions
APPS_MARKETPLACE_API_URI: "https://apps.staging.saleor.io/api/v2/saleor-apps"

API_URL: /graphql/
APP_MOUNT_URI: /dashboard/
STATIC_URL: /dashboard/static/
SENTRY_ORG: saleor
SENTRY_PROJECT: dashboard
SENTRY_URL_PREFIX: "~/dashboard/static"
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
APPS_MARKETPLACE_API_URI: "https://apps.staging.saleor.io/api/v2/saleor-apps"
APPS_MARKETPLACE_API_URL: "https://apps.staging.saleor.io/api/v2/saleor-apps"
IS_CLOUD_INSTANCE: true
POSTHOG_KEY: ${{ secrets.POSTHOG_KEY }}
POSTHOG_HOST: ${{ secrets.POSTHOG_HOST }}
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/deploy-staging-and-prepare-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,20 @@ jobs:
MINOR_VERSION: ${{ env.MINOR_VERSION }}
CUSTOM_VERSION: ${{ env.CUSTOM_VERSION || env.VERSION }}
env:
## backward compatibility for older versions
APPS_MARKETPLACE_API_URI: "https://apps.staging.saleor.io/api/v2/saleor-apps"
## backward compatibility for older versions
API_URI: /graphql/

API_URL: /graphql/
APP_MOUNT_URI: /dashboard/
STATIC_URL: /dashboard/static/
SENTRY_ORG: saleor
SENTRY_PROJECT: dashboard
SENTRY_URL_PREFIX: "~/dashboard/static"
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
APPS_MARKETPLACE_API_URI: "https://apps.staging.saleor.io/api/v2/saleor-apps"
APPS_MARKETPLACE_API_URL: "https://apps.staging.saleor.io/api/v2/saleor-apps"
VERSION: ${{ github.event.inputs.git_ref || github.ref_name }}
IS_CLOUD_INSTANCE: true
POSTHOG_KEY: ${{ secrets.POSTHOG_KEY }}
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ jobs:
id: set-domain
run: |
echo "domain=${{ env.GITHUB_HEAD_REF_SLUG_URL }}.dashboard.saleor.rocks" >> $GITHUB_OUTPUT

## backward compatibility for older versions
- name: Get API_URI
id: api_uri
# Search for API_URI in PR description and use default if not defined
Expand All @@ -107,13 +109,28 @@ jobs:
fallback_uri: ${{ secrets.CYPRESS_API_URI }}
run: |
echo "custom_api_uri=$(echo "$pull_request_body" | grep -Eo "$prefix$pattern" | sed s/$prefix// | head -n 1 | { read custom_uri; if [ -z "$custom_uri" ]; then echo "$fallback_uri"; else echo "$custom_uri"; fi })" >> $GITHUB_OUTPUT

- name: Get API_URL
id: api_url
env:
pull_request_body: ${{ github.event.pull_request.body }}
prefix: API_URL=
pattern: (http|https)://[a-zA-Z0-9.-]+/graphql/?
fallback_uri: ${{ secrets.CYPRESS_API_URL }}
run: |
echo "custom_api_url=$(echo "$pull_request_body" | grep -Eo "$prefix$pattern" | sed s/$prefix// | head -n 1 | { read custom_url; if [ -z "$custom_url" ]; then echo "$fallback_url"; else echo "$custom_url"; fi })" >> $GITHUB_OUTPUT


- name: Checkout
uses: actions/checkout@v2

- name: Cypress run
uses: cypress-io/github-action@v4
env:
## backward compatibility for older versions
API_URI: ${{ steps.api_uri.outputs.custom_api_uri }}

API_URL: ${{ steps.api_url.outputs.custom_api_url }}
APP_MOUNT_URI: ${{ secrets.APP_MOUNT_URI }}
BASE_URL: https://${{ steps.set-domain.outputs.domain }}/
CYPRESS_USER_NAME: ${{ secrets.CYPRESS_USER_NAME }}
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/pr-automation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,10 @@ jobs:

- name: Build dashboard
env:
## backward compatibility for older versions
API_URI: ${{ needs.initialize-cloud.outputs.API_URL }}

API_URL: ${{ needs.initialize-cloud.outputs.API_URL }}
APPS_MARKETPLACE_API_URI: "https://apps.staging.saleor.io/api/v2/saleor-apps"
APP_MOUNT_URI: /
STATIC_URL: /
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/tests-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -308,11 +308,14 @@ jobs:
continue-on-error: true
uses: cypress-io/github-action@v6
env:
## backward compatibility for older versions
API_URI: ${{ needs.get-environment-variables.outputs.url }}graphql/
APP_MOUNT_URI: ${{ secrets.APP_MOUNT_URI }}
BASE_URL: ${{ needs.get-environment-variables.outputs.url }}dashboard/
## backward compatibility requires CYPRESS_baseUrl as env var name - can be removed when version lower than 3.17 are no longer supported
CYPRESS_baseUrl: ${{ needs.get-environment-variables.outputs.url }}dashboard/

API_URL: ${{ needs.get-environment-variables.outputs.url }}graphql/
APP_MOUNT_URI: ${{ secrets.APP_MOUNT_URI }}
BASE_URL: ${{ needs.get-environment-variables.outputs.url }}dashboard/
CYPRESS_USER_NAME: ${{ secrets.CYPRESS_USER_NAME }}
CYPRESS_SECOND_USER_NAME: ${{ secrets.CYPRESS_SECOND_USER_NAME }}
CYPRESS_USER_PASSWORD: ${{ secrets.CYPRESS_USER_PASSWORD }}
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ COPY .featureFlags/ .featureFlags/

COPY src/ src/

ARG API_URI
ARG API_URL
ARG APP_MOUNT_URI
ARG APPS_MARKETPLACE_API_URI
ARG APPS_MARKETPLACE_API_URL
ARG APPS_TUNNEL_URL_KEYWORDS
ARG STATIC_URL
ARG SKIP_SOURCEMAPS
ARG LOCALE_CODE

ENV API_URI ${API_URI:-http://localhost:8000/graphql/}
ENV API_URL ${API_URL:-http://localhost:8000/graphql/}
ENV APP_MOUNT_URI ${APP_MOUNT_URI:-/dashboard/}
ENV APPS_MARKETPLACE_API_URI ${APPS_MARKETPLACE_API_URI:-https://apps.saleor.io/api/v2/saleor-apps}
ENV APPS_MARKETPLACE_API_URL ${APPS_MARKETPLACE_API_URL:-https://apps.saleor.io/api/v2/saleor-apps}
ENV APPS_TUNNEL_URL_KEYWORDS ${APPS_TUNNEL_URL_KEYWORDS}
ENV STATIC_URL ${STATIC_URL:-/dashboard/}
ENV SKIP_SOURCEMAPS ${SKIP_SOURCEMAPS:-true}
Expand Down
2 changes: 1 addition & 1 deletion app.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"logo": "https://mirumee.com/img/opensource_saleor.jpg",
"keywords": ["saleor", "e-commerce", "dashboard"],
"env": {
"API_URI": {
"API_URL": {
"description": "URI of a running instance of Saleor GraphQL API",
"value": "https://demo.getsaleor.com/graphql/"
},
Expand Down
Loading