Browse Source

feat(admin-ui): Add sku to Collection contents table

Michael Bromley 3 years ago
parent
commit
8c2263c3d4

+ 1 - 0
packages/admin-ui/src/lib/catalog/src/components/collection-contents/collection-contents.component.html

@@ -23,6 +23,7 @@
     >
         <ng-template let-variant="item">
             <td class="left align-middle">{{ variant.name }}</td>
+            <td class="left align-middle"><small class="sku">{{ variant.sku }}</small></td>
             <td class="right align-middle">
                 <vdr-table-row-action
                     iconShape="edit"

+ 3 - 0
packages/admin-ui/src/lib/catalog/src/components/collection-contents/collection-contents.component.scss

@@ -46,3 +46,6 @@ vdr-data-table {
         opacity: 1;
     }
 }
+.sku {
+    color: var(--color-text-200)
+}

+ 2 - 2
packages/admin-ui/src/lib/core/src/common/generated-types.ts

@@ -5831,7 +5831,7 @@ export type GetCollectionContentsQuery = { collection?: Maybe<(
       & Pick<ProductVariantList, 'totalItems'>
       & { items: Array<(
         { __typename?: 'ProductVariant' }
-        & Pick<ProductVariant, 'id' | 'productId' | 'name'>
+        & Pick<ProductVariant, 'id' | 'productId' | 'name' | 'sku'>
       )> }
     ) }
   )> };
@@ -5847,7 +5847,7 @@ export type PreviewCollectionContentsQuery = { previewCollectionVariants: (
     & Pick<ProductVariantList, 'totalItems'>
     & { items: Array<(
       { __typename?: 'ProductVariant' }
-      & Pick<ProductVariant, 'id' | 'productId' | 'name'>
+      & Pick<ProductVariant, 'id' | 'productId' | 'name' | 'sku'>
     )> }
   ) };
 

+ 2 - 0
packages/admin-ui/src/lib/core/src/data/definitions/collection-definitions.ts

@@ -128,6 +128,7 @@ export const GET_COLLECTION_CONTENTS = gql`
                     id
                     productId
                     name
+                    sku
                 }
                 totalItems
             }
@@ -145,6 +146,7 @@ export const PREVIEW_COLLECTION_CONTENTS = gql`
                 id
                 productId
                 name
+                sku
             }
             totalItems
         }