Skip to content

Commit

Permalink
Merge branch 'develop' into fix/totals-gift-cart-calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
olivermrbl authored Oct 25, 2023
2 parents 87f2490 + 8bb8eb5 commit 8f913fa
Show file tree
Hide file tree
Showing 23 changed files with 253 additions and 51 deletions.
5 changes: 5 additions & 0 deletions .changeset/fuzzy-trees-push.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@medusajs/admin-ui": patch
---

fix(admin-ui): fix analytics config not being saved in invite form
5 changes: 5 additions & 0 deletions .changeset/witty-rocks-heal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@medusajs/orchestration": patch
---

fix(orchestration): field alias should represent the isList in the result
4 changes: 3 additions & 1 deletion packages/admin-ui/ui/src/pages/invite.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,10 @@ const InvitePage = () => {
!data.analytics.opt_out &&
token?.user_email

if (isFeatureEnabled("analytics")) {
try {
await createAnalyticsConfig(data.analytics)
} catch (e) {
// gracefully handle error if analytics are disabled
}

if (shouldTrackEmail) {
Expand Down
10 changes: 8 additions & 2 deletions packages/orchestration/src/joiner/remote-joiner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export class RemoteJoiner {
location: string[]
property: string
path: string[]
isList?: boolean
}[] = []

private static filterFields(
Expand Down Expand Up @@ -389,13 +390,15 @@ export class RemoteJoiner {
}

if (Array.isArray(currentItems)) {
if (currentItems.length < 2) {
if (currentItems.length < 2 && !alias.isList) {
locationItem[alias.property] = currentItems.shift()
} else {
locationItem[alias.property] = currentItems
}
} else {
locationItem[alias.property] = currentItems
locationItem[alias.property] = alias.isList
? [currentItems]
: currentItems
}

if (parentRemoveItems !== null) {
Expand Down Expand Up @@ -596,6 +599,9 @@ export class RemoteJoiner {
location: currentPath,
property: prop,
path: fullPath,
isList: !!serviceConfig.relationships?.find(
(relationship) => relationship.alias === fullPath[0]
)?.isList,
})

const extMapping = expands as unknown[]
Expand Down
2 changes: 1 addition & 1 deletion www/apps/docs/announcement.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"id":"https://github.com/medusajs/medusa/releases/tag/v1.17.2","content":"v1.17.2 is out","isCloseable":true}
{}
4 changes: 2 additions & 2 deletions www/apps/docs/content/admin/quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ addHowToData: true
---

import Feedback from '@site/src/components/Feedback';
import Troubleshooting from '@site/src/components/Troubleshooting'
import DetailsList from '@site/src/components/DetailsList'
import AdminLoginSection from '../troubleshooting/signing-in-to-admin.md'
import CorsSection from '../troubleshooting/cors-issues.md'

Expand Down Expand Up @@ -179,7 +179,7 @@ Can't find your language? Learn how you can contribute by translating the admin

## Troubleshooting Installation

<Troubleshooting
<DetailsList
sections={[
{
title: 'Signing into Admin',
Expand Down
2 changes: 1 addition & 1 deletion www/apps/docs/content/cli/reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ medusa --help

## Troubleshooting Installation

<TroubleshootingSection />
<DetailsListSection />

---

Expand Down
35 changes: 19 additions & 16 deletions www/apps/docs/content/create-medusa-app.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import TabItem from '@theme/TabItem';
import Feedback from '@site/src/components/Feedback';
import DocCardList from '@theme/DocCardList';
import Icons from '@theme/Icon';
import Troubleshooting from '@site/src/components/Troubleshooting'
import DetailsList from '@site/src/components/DetailsList'
import TypeErrorSection from "./troubleshooting/create-medusa-app-errors/_typeerror.md"
import OtherErrorsSection from "./troubleshooting/create-medusa-app-errors/_other-errors.mdx"
import EagainError from "./troubleshooting/create-medusa-app-errors/_eagain-error.md"
Expand All @@ -19,16 +19,6 @@ import InvalidTokenError from './troubleshooting/create-medusa-app-errors/_no-br

# Install Medusa with create-medusa-app

In this document, you’ll learn how to use create-medusa-app to set up a Medusa backend and an admin dashboard.

:::tip

`create-medusa-app` allows you to install and setup a Medusa backend project with minimal configurations. If you're more familiar with Medusa or you need to have more control over the configurations of the Medusa backend, such as database connection details, you can either use the [command's options](#command-options) to customize the setup, or use the [backend quickstart instead](./development/backend/install.mdx).

:::

## Overview

Medusa is a toolkit for developers to create digital commerce applications. In its simplest form, Medusa is a Node.js backend with the core API, plugins, and modules installed through npm.

`create-medusa-app` is a command that facilitates creating a Medusa ecosystem. It installs the Medusa backend and admin dashboard, along with the necessary configurations to run the backend.
Expand Down Expand Up @@ -73,7 +63,10 @@ In your terminal, run the following command:
</TabItem>
</Tabs>

### Command Options
<details>
<summary>
Command Options
</summary>

The `create-medusa-app` command can accept the following options:

Expand All @@ -87,7 +80,12 @@ The `create-medusa-app` command can accept the following options:
- `--directory-path <path>`: Allows specifying the parent directory path to create the directory of the new project in.
- `--with-nextjs-starter`: Installs the Next.js starter storefront under the `<PROJECT_NAME>-storefront` directory, where `<PROJECT_NAME>` is the name of the project you enter in the first question. If the `<PROJECT_NAME>-storefront` directory already exists, random characters are added at the end of `<PROJECT_NAME>-storefront`.

### Example: Connect to a Vercel PostgreSQL Database
</details>

<details className="border-t-0">
<summary>
Example: Connect to a Vercel PostgreSQL Database
</summary>

If you want to use a PostgreSQL database hosted on Vercel, you must use the `--db-url` option and add to the end of your connection URL `?sslmode=require`. For example:

Expand All @@ -101,7 +99,12 @@ If the database already has the necessary migrations and you don't need the comm

:::

### Example: Connect to a Supabase Database
</details>

<details className="border-t-0">
<summary>
Example: Connect to a Supabase Database
</summary>

If you want to connect to a Supabase database, you must use the `--db-url` option with its value beign the connection URL to your Supabase database. For example:

Expand All @@ -115,7 +118,7 @@ If the database already has the necessary migrations and you don't need the comm

:::

---
</details>

## Step 2: Specify Project Name

Expand Down Expand Up @@ -220,7 +223,7 @@ Based on what you're building, you can find a development path for you in the Re

## Troubleshooting

<Troubleshooting
<DetailsList
sections={[
{
title: 'Error: EADDRINUSE',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: 'Learn step-by-step.'
addHowToData: true
---

import Troubleshooting from '@site/src/components/Troubleshooting'
import DetailsList from '@site/src/components/DetailsList'
import CorsErrorSection from '../../troubleshooting/cors-issues.md'

# Deploy Admin to Vercel
Expand Down Expand Up @@ -196,7 +196,7 @@ Then, restart your Medusa backend. Once the backend is running again, you can us

## Troubleshooting

<Troubleshooting
<DetailsList
sections={[
{
title: 'CORS Error',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: 'Learn step-by-step.'
addHowToData: true
---

import Troubleshooting from '@site/src/components/Troubleshooting'
import DetailsList from '@site/src/components/DetailsList'
import CorsErrorSection from '../../troubleshooting/cors-issues.md'

# Deploy Next.js Starter Template on Vercel
Expand Down Expand Up @@ -166,7 +166,7 @@ Then, restart your Medusa backend. Once the backend is running again, you can us

## Troubleshooting

<Troubleshooting
<DetailsList
sections={[
{
title: 'CORS Error',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
addHowToData: true
---

import Troubleshooting from '@site/src/components/Troubleshooting'
import DetailsList from '@site/src/components/DetailsList'
import ServiceLifetimeSection from '../../troubleshooting/awilix-resolution-error/_service-lifetime.md'
import CustomRegistrationSection from '../../troubleshooting/awilix-resolution-error/_custom-registration.md'

Expand Down Expand Up @@ -200,7 +200,7 @@ export default ProductService

## Troubleshooting

<Troubleshooting
<DetailsList
sections={[
{
title: 'AwilixResolutionError: Could Not Resolve X',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
addHowToData: true
---

import Troubleshooting from '@site/src/components/Troubleshooting'
import DetailsList from '@site/src/components/DetailsList'
import ServiceLifetimeSection from '../../troubleshooting/awilix-resolution-error/_service-lifetime.md'
import CustomRegistrationSection from '../../troubleshooting/awilix-resolution-error/_custom-registration.md'

Expand Down Expand Up @@ -193,7 +193,7 @@ export default ProductService

## Troubleshooting

<Troubleshooting
<DetailsList
sections={[
{
title: 'AwilixResolutionError: Could Not Resolve X',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
addHowToData: true
---

import Troubleshooting from '@site/src/components/Troubleshooting'
import DetailsList from '@site/src/components/DetailsList'
import ServiceLifetimeSection from '../../troubleshooting/awilix-resolution-error/_service-lifetime.md'
import CustomRegistrationSection from '../../troubleshooting/awilix-resolution-error/_custom-registration.md'

Expand Down Expand Up @@ -157,7 +157,7 @@ If you try accessing the API Routes you added the middleware to, you should see

## Troubleshooting

<Troubleshooting
<DetailsList
sections={[
{
title: 'AwilixResolutionError: Could Not Resolve X',
Expand Down
4 changes: 2 additions & 2 deletions www/apps/docs/content/development/backend/install.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ addHowToData: true
import Feedback from '@site/src/components/Feedback';
import DocCardList from '@theme/DocCardList';
import Icons from '@theme/Icon';
import Troubleshooting from '@site/src/components/Troubleshooting'
import DetailsList from '@site/src/components/DetailsList'
import SaslSection from '../../troubleshooting/database-errors/_sasl.md'
import ConnectionErrorSection from '../../troubleshooting/database-errors/_connection-error.md'
import FreshInstallationSection from '../../troubleshooting/awilix-resolution-error/_fresh-installation.md'
Expand Down Expand Up @@ -92,7 +92,7 @@ curl localhost:9000/store/products

## Troubleshooting Installation

<Troubleshooting
<DetailsList
sections={[
{
title: 'Error: SASL: SCRAM-SERVER-FIRST-MESSAGE: Client password must be a string',
Expand Down
Loading

0 comments on commit 8f913fa

Please sign in to comment.