Skip to content

Commit

Permalink
Fix new links for environments (#5116)
Browse files Browse the repository at this point in the history
* Set new domain

* Changeset
  • Loading branch information
andrzejewsky committed Aug 20, 2024
1 parent 8edada8 commit f8e6049
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/fast-trees-complain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"saleor-dashboard": patch
---

Now staging environments have changed domain, that means "staging-cloud.saleor.io" is no longer referenced in our pipelines
2 changes: 1 addition & 1 deletion .github/actions/cli-login/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ runs:
run: |
jq --null-input \
--arg token "Token $ACCESS_TOKEN" \
'{"token":$token,"telemetry":"false","saleor_env":"staging","cloud_api_url":"https://staging-cloud.saleor.io/platform/api","organization_slug":"saleor","organization_name":"Saleor"}' > ~/.config/saleor.json
'{"token":$token,"telemetry":"false","saleor_env":"staging","cloud_api_url":"https://cloud.staging.saleor.io/platform/api","organization_slug":"saleor","organization_name":"Saleor"}' > ~/.config/saleor.json
2 changes: 1 addition & 1 deletion .github/workflows/cleanEnvironments.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const core = require("@actions/core");

const program = new Command();

const pathToCloudAPI = "https://staging-cloud.saleor.io/platform/api/";
const pathToCloudAPI = "https://cloud.staging.saleor.io/platform/api/";

const snapshotName = "snapshot-automation-tests";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ async function getTheNewestVersion(token) {
async function getServices(token) {
// us-east-1
const response = await fetch(
`https://staging-cloud.saleor.io/platform/api/regions/us-east-1/services`,
`https://cloud.staging.saleor.io/platform/api/regions/us-east-1/services`,
{
method: "GET",
headers: {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Sidebar/menu/hooks/useEnvLink.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe("useEnvLink", () => {
it("should return link to the cloud environment on staging", () => {
// Arrange
const stagingHref =
"https://staging-cloud.saleor.io/env/test.staging.com?utm_source=dashboard&utm_content=sidebar_button";
"https://cloud.staging.saleor.io/env/test.staging.com?utm_source=dashboard&utm_content=sidebar_button";

delete (window as { location?: unknown }).location;
// @ts-expect-error error
Expand Down
5 changes: 4 additions & 1 deletion src/components/Sidebar/menu/hooks/useEnvLink.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
const UTM_PARAMS = "?utm_source=dashboard&utm_content=sidebar_button";

// TODO: Refactor it, get rid of hardcoded links
const stagingLink = (hostname: string) =>
`https://staging-cloud.saleor.io/env/${hostname}${UTM_PARAMS}`;
`https://cloud.staging.saleor.io/env/${hostname}${UTM_PARAMS}`;

const prodLink = (hostname: string) => `https://cloud.saleor.io/env/${hostname}${UTM_PARAMS}`;

export const useEnvLink = () => {
Expand Down

0 comments on commit f8e6049

Please sign in to comment.