Skip to content

Commit

Permalink
Merge branch 'main' into e2e-reusable-workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
wojteknowacki committed Sep 26, 2023
2 parents 2165038 + 327008a commit a59760d
Show file tree
Hide file tree
Showing 230 changed files with 19,565 additions and 4,074 deletions.
64 changes: 0 additions & 64 deletions .changeset/README.md

This file was deleted.

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

New column picker for variant datagrid
5 changes: 5 additions & 0 deletions .changeset/pink-beans-begin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"saleor-dashboard": minor
---

Add metadata column to order details datagrid
5 changes: 5 additions & 0 deletions .changeset/serious-starfishes-develop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"saleor-dashboard": patch
---

Capitalised the "Export products" button
5 changes: 5 additions & 0 deletions .changeset/three-boats-protect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"saleor-dashboard": minor
---

Add datagrid on shipping zones view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Bug report
description: Create a report to help us improve
title: "[Bug]: "
labels: ["bug"]
labels: ["bug", "triage"]

body:
- type: textarea
Expand Down
30 changes: 30 additions & 0 deletions .github/ISSUE_TEMPLATE/epic_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Epic request
description: Publish a new group of issues
title: "[Epic]: "
labels: ["epic"]

body:
- type: textarea
id: description
attributes:
label: Description of an epic
description: Describe overall goal, provide context, explain what goal it represents
placeholder: |
Example: Users needs to have variant edition functionality. This is essential for managing eCommerce and needs lots of configuration for each variant.
We must consider its attributes, quantities, correlated channels and more.
validations:
required: true
- type: textarea
id: additional-info
attributes:
label: Additional information
description: Attach some additional context.
placeholder: |
Example:
Here are the example mockups for variant edition.
Let's consider what options it supposed to have.
Please look at the attached references - it explains how marked use it.
...
validations:
required: false

2 changes: 2 additions & 0 deletions .github/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ onlyLabels: []

# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
exemptLabels:
- epic
- triage
- bug
- blocker
- backlog
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/deploy-demo-staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ jobs:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_DASHBOARD_STAGING_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_DASHBOARD_STAGING_SECRET_ACCESS_KEY }}
aws-access-key-id: ${{ secrets.AWS_DEMO_STAGING_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_DEMO_STAGING_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Deploy
run: |
aws s3 sync build/dashboard s3://${{ secrets.AWS_DEMO_STAGING_DEPLOYMENT_BUCKET }}/dashboard/static/
aws s3 cp build/dashboard/index.html s3://${{ secrets.AWS_DEMO_STAGING_DEPLOYMENT_BUCKET }}/dashboard/
for i in {1..3}; do aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_DEMO_STAGING_CF_DIST_ID }} --paths "/dashboard*" && break || sleep 5; done
for i in {1..3}; do aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_DEMO_STAGING_CDN_DISTRIBUTION }} --paths "/dashboard*" && break || sleep 5; done
- name: Prepare Demo release pull request
run: |
export GITHUB_TOKEN=$( \
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/deploy-demo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ jobs:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_DASHBOARD_PROD_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_DASHBOARD_PROD_SECRET_ACCESS_KEY }}
aws-access-key-id: ${{ secrets.AWS_DEMO_PROD_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_DEMO_PROD_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Deploy
run: |
aws s3 sync build/dashboard s3://${{ secrets.AWS_DEMO_DEPLOYMENT_BUCKET }}/dashboard/static/
aws s3 cp build/dashboard/index.html s3://${{ secrets.AWS_DEMO_DEPLOYMENT_BUCKET }}/dashboard/
for i in {1..3}; do aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_DEMO_CF_DIST_ID }} --paths "/dashboard*" && break || sleep 5; done
aws s3 sync build/dashboard s3://${{ secrets.AWS_DEMO_PROD_DEPLOYMENT_BUCKET }}/dashboard/static/
aws s3 cp build/dashboard/index.html s3://${{ secrets.AWS_DEMO_PROD_DEPLOYMENT_BUCKET }}/dashboard/
for i in {1..3}; do aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_DEMO_PROD_CDN_DISTRIBUTION }} --paths "/dashboard*" && break || sleep 5; done
- name: Notify Slack
if: ${{ always() }}
env:
Expand Down
66 changes: 63 additions & 3 deletions .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ on:
concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
release:
prepare:
name: Prepare release with Changesets
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
outputs:
hasChangesets: ${{ steps.changesets.outputs.hasChangesets }}
permissions:
contents: write
pull-requests: write
Expand All @@ -24,7 +26,7 @@ jobs:
node-version-file: ".nvmrc"
- name: Install Dependencies
run: npm ci
- name: Create Release Pull Request
- name: Publishing version
uses: changesets/action@d89c1de63c7f28ac47ec85ed395f5f1d045d4697 # v1.4.4
id: changesets
with:
Expand All @@ -33,3 +35,61 @@ jobs:
publish: "npm run release"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

release:
name: Deploy and release to sandbox
needs: prepare
if: needs.prepare.outputs.hasChangesets == 'false'
runs-on: ubuntu-22.04
env:
API_URI: /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"
VERSION: ${{ github.event.inputs.git_ref || github.ref_name }}
IS_CLOUD_INSTANCE: true
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
- name: Install Dependencies
run: npm ci
- name: Build
run: |
npm run build
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_DASHBOARD_STAGING_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_DASHBOARD_STAGING_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Deploy
run: |
aws s3 sync build/dashboard s3://${{ secrets.AWS_STAGING_DEPLOYMENT_BUCKET }}/${ENVIRONMENT}/static/
aws s3 cp build/dashboard/index.html s3://${{ secrets.AWS_STAGING_DEPLOYMENT_BUCKET }}/${ENVIRONMENT}/
for i in {1..3}; do aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_STAGING_CF_DIST_ID }} --paths "/dashboard*" && break || sleep 5; done
- name: Prepare Sandbox release pull request
run: |
export GITHUB_TOKEN=$( \
curl --request GET --url ${{ secrets.VAULT_URL}} --header "Authorization: JWT ${{ secrets.VAULT_JWT }}" | jq -r .token \
)
version=$(cat package.json | jq -r .version)
payload=$(jq --null-input --arg version "$version" '{
"event_type": "open-release-pull-request",
"client_payload": {
"project": "DASHBOARD",
"environment": "SANDBOX",
"version": $version
}
}')
gh api /repos/saleor/saleor-cloud-deployments/dispatches --input - <<< $payload
6 changes: 2 additions & 4 deletions .github/workflows/publish-containers.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
name: Publish container image

on:
push:
tags:
# Matches stable and pre-releases
- "[0-9]+.[0-9]+.[0-9]+*"
release:
types: [published]

jobs:
docker:
Expand Down
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ RUN npm ci --legacy-peer-deps
COPY nginx/ nginx/
COPY assets/ assets/
COPY locale/ locale/
COPY scripts/removeSourcemaps.js scripts/
COPY scripts/build-types.js scripts/
COPY scripts/ scripts/
COPY vite.config.js ./
COPY tsconfig.json ./
COPY sw.js ./
Expand Down
17 changes: 4 additions & 13 deletions cypress/e2e/catalog/categories.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,18 @@

import faker from "faker";

import {
CATEGORIES_LIST_SELECTORS,
} from "../../elements/catalog/categories/categories-list";
import {
CATEGORY_DETAILS_SELECTORS,
} from "../../elements/catalog/categories/category-details";
import { CATEGORIES_LIST_SELECTORS } from "../../elements/catalog/categories/categories-list";
import { CATEGORY_DETAILS_SELECTORS } from "../../elements/catalog/categories/category-details";
import { BUTTON_SELECTORS } from "../../elements/shared/button-selectors";
import { SHARED_ELEMENTS } from "../../elements/shared/sharedElements";
import {
categoryDetailsUrl,
urlList,
} from "../../fixtures/urlList";
import { categoryDetailsUrl, urlList } from "../../fixtures/urlList";
import {
createCategory as createCategoryRequest,
getCategory,
} from "../../support/api/requests/Category";
import * as channelsUtils from "../../support/api/utils/channelsUtils";
import * as productsUtils from "../../support/api/utils/products/productsUtils";
import {
ensureCanvasStatic,
} from "../../support/customCommands/sharedElementsOperations/canvas";
import { ensureCanvasStatic } from "../../support/customCommands/sharedElementsOperations/canvas";
import {
createCategory,
updateCategory,
Expand Down
4 changes: 1 addition & 3 deletions cypress/e2e/configuration/plugins/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@

import faker from "faker";

import {
PLUGINS_DETAILS_SELECTORS,
} from "../../../elements/plugins/pluginDetails";
import { PLUGINS_DETAILS_SELECTORS } from "../../../elements/plugins/pluginDetails";
import { PLUGINS_LIST_SELECTORS } from "../../../elements/plugins/pluginsList";
import { BUTTON_SELECTORS } from "../../../elements/shared/button-selectors";
import { urlList } from "../../../fixtures/urlList";
Expand Down
11 changes: 3 additions & 8 deletions cypress/e2e/configuration/shippingMethods/channelsInShipping.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
import faker from "faker";

import { SHARED_ELEMENTS } from "../../../elements/shared/sharedElements";
import {
SHIPPING_ZONE_DETAILS,
} from "../../../elements/shipping/shipping-zone-details";
import { SHIPPING_ZONE_DETAILS } from "../../../elements/shipping/shipping-zone-details";
import { urlList } from "../../../fixtures/urlList";
import { ONE_PERMISSION_USERS } from "../../../fixtures/users";
import { createChannel } from "../../../support/api/requests/Channels";
import {
Expand All @@ -15,10 +14,6 @@ import {
} from "../../../support/api/requests/ShippingMethod";
import * as shippingUtils from "../../../support/api/utils/shippingUtils";
import { selectChannelInHeader } from "../../../support/pages/channelsPage";
import {
enterAndSelectShippings,
enterShippingZone,
} from "../../../support/pages/shippingZones";

describe("As a staff user I want have different shipping method prices for each channel", () => {
const startsWith = "ChannelShippingMethod";
Expand Down Expand Up @@ -74,7 +69,7 @@ describe("As a staff user I want have different shipping method prices for each
"auth",
ONE_PERMISSION_USERS.shipping,
);
enterAndSelectShippings(shippingZone.id, enterShippingZone);
cy.visit(`${urlList.shippingMethods}${shippingZone.id}`);
selectChannelInHeader(defaultChannel.name);
cy.waitForProgressBarToNotBeVisible()
.get(SHARED_ELEMENTS.skeleton)
Expand Down
Loading

0 comments on commit a59760d

Please sign in to comment.