Przeglądaj źródła

Merge branch 'master' into minor

Michael Bromley 3 lat temu
rodzic
commit
43e37ec567

+ 2 - 1
docs/content/plugins/extending-the-admin-ui/using-other-frameworks/_index.md

@@ -94,6 +94,7 @@ export const config: VendureConfig = {
   // ...
   plugins: [
     AdminUiPlugin.init({
+      route: "admin",
       port: 3002,
       app: compileUiExtensions({
         outputPath: path.join(__dirname, '../admin-ui'),
@@ -120,7 +121,7 @@ export const config: VendureConfig = {
             // artifacts over to the Admin UI's `/static` directory. In this case we
             // also rename "build" to "react-app". This is why the `extensionUrl`
             // in the module config points to './assets/react-app/index.html'.
-            { path: path.join(__dirname, 'react-app/build'), rename: 'react-app' },
+            { path: path.join(__dirname, 'ui-extension/react-app/build'), rename: 'react-app' },
           ],
         }],
         devMode: true,

+ 29 - 4
packages/asset-server-plugin/src/s3-asset-storage-strategy.ts

@@ -82,6 +82,32 @@ export interface S3Config {
  * }),
  * ```
  *
+ * ## Usage with MinIO
+ *
+ * Reference: [How to use AWS SDK for Javascript with MinIO Server](https://docs.min.io/docs/how-to-use-aws-sdk-for-javascript-with-minio-server.html)
+ *
+ * @example
+ * ```TypeScript
+ * plugins: [
+ *   AssetServerPlugin.init({
+ *     route: 'assets',
+ *     assetUploadDir: path.join(__dirname, 'assets'),
+ *     port: 5002,
+ *     namingStrategy: new DefaultAssetNamingStrategy(),
+ *     storageStrategyFactory: configureS3AssetStorage({
+ *       bucket: 'my-minio-bucket',
+ *       credentials: {
+ *         accessKeyId: process.env.MINIO_ACCESS_KEY_ID,
+ *         secretAccessKey: process.env.MINIO_SECRET_ACCESS_KEY,
+ *       },
+ *       nativeS3Configuration: {
+ *         endpoint: process.env.MINIO_ENDPOINT ?? 'http://localhost:9000',
+ *         s3ForcePathStyle: true,
+ *         signatureVersion: 'v4',
+ *       },
+ *     }),
+ * }),
+ * ```
  * @docsCategory asset-server-plugin
  * @docsPage S3AssetStorageStrategy
  */
@@ -114,10 +140,9 @@ export function configureS3AssetStorage(s3Config: S3Config) {
  *
  * **Note:** Rather than instantiating this manually, use the {@link configureS3AssetStorage} function.
  *
- * ## Use with S3-compatible services
- * This strategy will also work with any S3-compatible object storage solutions, such as [MinIO](https://min.io/):
- *
- * * [How to use AWS SDK for Javascript with MinIO Server](https://docs.min.io/docs/how-to-use-aws-sdk-for-javascript-with-minio-server.html)
+ * ## Use with S3-compatible services (MinIO)
+ * This strategy will also work with any S3-compatible object storage solutions, such as [MinIO](https://min.io/).
+ * See the {@link configureS3AssetStorage} for an example with MinIO.
  *
  * @docsCategory asset-server-plugin
  * @docsPage S3AssetStorageStrategy

+ 2 - 1
packages/core/src/api/resolvers/admin/global-settings.resolver.ts

@@ -11,6 +11,7 @@ import {
     GraphQLOutputType,
     GraphQLResolveInfo,
     isEnumType,
+    isInterfaceType,
     isListType,
     isNonNullType,
     isObjectType,
@@ -118,7 +119,7 @@ export class GlobalSettingsResolver {
     private getScalarFieldsOfType(info: GraphQLResolveInfo, typeName: string): string[] {
         const type = info.schema.getType(typeName);
 
-        if (type && isObjectType(type)) {
+        if (type && (isObjectType(type) || isInterfaceType(type))) {
             return Object.values(type.getFields())
                 .filter(field => {
                     const namedType = this.getNamedType(field.type);