Prechádzať zdrojové kódy

fix(admin-ui): Fix build error

Michael Bromley 9 mesiacov pred
rodič
commit
fbbcc3e755

+ 1 - 1
packages/admin-ui/package.json

@@ -91,7 +91,7 @@
         "@types/jasmine": "~4.3.5",
         "@types/jasminewd2": "~2.0.10",
         "@types/node": "^18.17.9",
-        "@types/react": "^18.2.21",
+        "@types/react": "^19.0.12",
         "@typescript-eslint/eslint-plugin": "^5.59.2",
         "@typescript-eslint/parser": "^5.59.2",
         "@vendure/ngx-translate-extract": "^8.2.2",

+ 2 - 2
packages/admin-ui/src/lib/core/src/data/providers/base-data.service.ts

@@ -1,5 +1,5 @@
 import { Injectable } from '@angular/core';
-import { MutationUpdaterFn, SingleExecutionResult, WatchQueryFetchPolicy } from '@apollo/client/core';
+import { MutationUpdaterFunction, SingleExecutionResult, WatchQueryFetchPolicy } from '@apollo/client/core';
 import { TypedDocumentNode } from '@graphql-typed-document-node/core';
 import { simpleDeepClone } from '@vendure/common/lib/simple-deep-clone';
 import { Apollo } from 'apollo-angular';
@@ -69,7 +69,7 @@ export class BaseDataService {
     mutate<T, V extends Record<string, any> = Record<string, any>>(
         mutation: DocumentNode | TypedDocumentNode<T, V>,
         variables?: V,
-        update?: MutationUpdaterFn<T>,
+        update?: MutationUpdaterFunction<T, V, any, any>,
         options: ExtendedQueryOptions = {},
     ): Observable<T> {
         const withCustomFields = addCustomFields(mutation, this.customFields, options.includeCustomFields);

+ 3 - 2
packages/admin-ui/src/lib/core/src/data/providers/data.service.ts

@@ -1,5 +1,6 @@
+/* eslint-disable @typescript-eslint/no-explicit-any */
 import { Injectable } from '@angular/core';
-import { MutationUpdaterFn, WatchQueryFetchPolicy } from '@apollo/client/core';
+import { MutationUpdaterFunction, WatchQueryFetchPolicy } from '@apollo/client/core';
 import { TypedDocumentNode } from '@graphql-typed-document-node/core';
 import { DocumentNode } from 'graphql';
 import { Observable } from 'rxjs';
@@ -107,7 +108,7 @@ export class DataService {
     mutate<T, V extends Record<string, any> = Record<string, any>>(
         mutation: DocumentNode | TypedDocumentNode<T, V>,
         variables?: V,
-        update?: MutationUpdaterFn<T>,
+        update?: MutationUpdaterFunction<T, V, any, any>,
         options: ExtendedQueryOptions = {},
     ): Observable<T> {
         return this.baseDataService.mutate(mutation, variables, update, options);

+ 1 - 1
packages/admin-ui/src/lib/react/src/directives/react-component-host.directive.ts

@@ -45,7 +45,7 @@ export class ReactComponentHostDirective<Comp extends ElementType> {
                     },
                 },
                 createElement(Comp, this.props),
-            ),
+            ) as any,
         );
     }
 

+ 1 - 1
packages/admin-ui/src/lib/react/src/react-components/CdsIcon.tsx

@@ -15,7 +15,7 @@ export interface CdsIconProps {
     badge: 'info' | 'success' | 'warning' | 'danger';
 }
 
-declare global {
+declare module 'react' {
     namespace JSX {
         interface IntrinsicElements {
             ['cds-icon']: CustomElement<CdsIconProps>;