Use graphql-codegen (#1874)
* Use generated hooks in apps * Remove unused files * Use proper types in apps * Use generated hooks in attributes * Use generated hooks in auth module * Use generated hooks in categories * Use generated hooks in channels * Use generated types in collections * Remove legacy types from background tasks * Use generated hooks in customers * Use generated hooks in discounts * Use generated hook in file upload * Use generated types in gift cards * Use generated types in home * Use generated hooks in navigation * Use generated hooks in orders * Use generated hooks in pages * Use generated hooks in page types * Use generated hooks in permission groups * Use generated hooks in plugins * Use generated hooks in products * Use fragment to mark product variants * Improve code a bit * Use generated hooks in page types * Use generated types in searches * Use generated hooks in shipping * Use generated hooks in site settings * Use generated hooks in staff members * Use generated hooks in taxes * Place all gql generated files in one directory * Use generated hooks in translations * Use global types from new generated module * Use generated hooks in warehouses * Use generated hooks in webhooks * Use generated fragment types * Unclutter types * Remove hoc components * Split hooks and types * Fetch introspection file * Delete obsolete schema file * Fix rebase artifacts * Fix autoreplace * Fix auth provider tests * Fix urls * Remove leftover types * Fix rebase artifacts
This commit is contained in:
parent
29461658a2
commit
5b85d6c086
1420 changed files with 124333 additions and 74552 deletions
|
@ -84,6 +84,7 @@
|
||||||
"eqeqeq": ["error", "smart"],
|
"eqeqeq": ["error", "smart"],
|
||||||
"guard-for-in": "error",
|
"guard-for-in": "error",
|
||||||
"id-blacklist": "off",
|
"id-blacklist": "off",
|
||||||
|
"import/no-duplicates": "error",
|
||||||
"import/no-extraneous-dependencies": "off", // imports are handled by simple-import-sort/sort
|
"import/no-extraneous-dependencies": "off", // imports are handled by simple-import-sort/sort
|
||||||
"import/no-internal-modules": "off", // imports are handled by simple-import-sort/sort
|
"import/no-internal-modules": "off", // imports are handled by simple-import-sort/sort
|
||||||
"import/order": "off", // imports are handled by simple-import-sort/sort
|
"import/order": "off", // imports are handled by simple-import-sort/sort
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
types/
|
types/
|
||||||
schema.graphql
|
schema.graphql
|
||||||
src/type-policies.ts
|
*.generated.*
|
||||||
|
src/graphql/extendedTypes.ts
|
47
codegen.yml
47
codegen.yml
|
@ -1,12 +1,53 @@
|
||||||
overwrite: true
|
overwrite: true
|
||||||
schema: ./schema.graphql
|
schema: ./introspection.json
|
||||||
generates:
|
generates:
|
||||||
fragmentTypes.json:
|
./src/graphql/fragmentTypes.generated.ts:
|
||||||
plugins:
|
plugins:
|
||||||
|
- add:
|
||||||
|
content: /* eslint-disable */
|
||||||
- fragment-matcher
|
- fragment-matcher
|
||||||
config:
|
config:
|
||||||
minify: false
|
minify: false
|
||||||
apolloClientVersion: 3
|
apolloClientVersion: 3
|
||||||
./src/type-policies.ts:
|
./src/graphql/typePolicies.generated.ts:
|
||||||
plugins:
|
plugins:
|
||||||
|
- add:
|
||||||
|
content: /* eslint-disable */
|
||||||
- typescript-apollo-client-helpers
|
- typescript-apollo-client-helpers
|
||||||
|
./src/graphql/types.generated.ts:
|
||||||
|
documents:
|
||||||
|
- ./src/**/queries.ts
|
||||||
|
- ./src/**/mutations.ts
|
||||||
|
- ./src/**/fragments/*.ts
|
||||||
|
- ./src/searches/*.ts
|
||||||
|
config:
|
||||||
|
nonOptionalTypename: true
|
||||||
|
avoidOptionals:
|
||||||
|
field: true
|
||||||
|
inputValue: false
|
||||||
|
object: false
|
||||||
|
defaultValue: false
|
||||||
|
namingConvention:
|
||||||
|
enumValues: change-case-all#upperCase
|
||||||
|
onlyOperationTypes: true
|
||||||
|
plugins:
|
||||||
|
- add:
|
||||||
|
content: /* eslint-disable */
|
||||||
|
- typescript
|
||||||
|
- typescript-operations
|
||||||
|
./src/graphql/hooks.generated.ts:
|
||||||
|
documents:
|
||||||
|
- ./src/**/queries.ts
|
||||||
|
- ./src/**/mutations.ts
|
||||||
|
- ./src/**/fragments/*.ts
|
||||||
|
- ./src/searches/*.ts
|
||||||
|
preset: import-types
|
||||||
|
presetConfig:
|
||||||
|
typesPath: ./types.generated
|
||||||
|
config:
|
||||||
|
withHooks: true
|
||||||
|
apolloReactHooksImportFrom: "@saleor/hooks/graphql"
|
||||||
|
plugins:
|
||||||
|
- add:
|
||||||
|
content: /* eslint-disable */
|
||||||
|
- typescript-react-apollo
|
||||||
|
|
5
fetch-schema.yml
Normal file
5
fetch-schema.yml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
schema: ${API_URI}
|
||||||
|
generates:
|
||||||
|
./introspection.json:
|
||||||
|
plugins:
|
||||||
|
- introspection
|
88121
introspection.json
Normal file
88121
introspection.json
Normal file
File diff suppressed because it is too large
Load diff
460
package-lock.json
generated
460
package-lock.json
generated
|
@ -2112,6 +2112,59 @@
|
||||||
"integrity": "sha512-KWk80UPIzPmUg+P0rKh6TqspRw0G6eux1PuJr+zz47ftMaZ9QDwbGzHZbtzWkl5hgayM/qrKRutllRC7D/vVXQ==",
|
"integrity": "sha512-KWk80UPIzPmUg+P0rKh6TqspRw0G6eux1PuJr+zz47ftMaZ9QDwbGzHZbtzWkl5hgayM/qrKRutllRC7D/vVXQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"@graphql-codegen/add": {
|
||||||
|
"version": "3.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@graphql-codegen/add/-/add-3.1.1.tgz",
|
||||||
|
"integrity": "sha512-XkVwcqosa0CVBlL1HaQT0gp+EUfhuQE3LzrEpzMQLwchxaj/NPVYtOJL6MUHaYDsHzLqxWrufjfbeB3y2NQgRw==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"@graphql-codegen/plugin-helpers": "^2.3.2",
|
||||||
|
"tslib": "~2.3.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@graphql-codegen/plugin-helpers": {
|
||||||
|
"version": "2.4.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@graphql-codegen/plugin-helpers/-/plugin-helpers-2.4.0.tgz",
|
||||||
|
"integrity": "sha512-bQ2EwVU34wkTrWM4/LbXS4t+ROYFM3qzwrRX6aFNYwAPho/fubryBHmNuUTh4evACFMx1ymQ6QLnvOUAoXYZSQ==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"@graphql-tools/utils": "^8.5.2",
|
||||||
|
"change-case-all": "1.0.14",
|
||||||
|
"common-tags": "1.8.2",
|
||||||
|
"import-from": "4.0.0",
|
||||||
|
"lodash": "~4.17.0",
|
||||||
|
"tslib": "~2.3.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"@graphql-tools/utils": {
|
||||||
|
"version": "8.6.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@graphql-tools/utils/-/utils-8.6.1.tgz",
|
||||||
|
"integrity": "sha512-uxcfHCocp4ENoIiovPxUWZEHOnbXqj3ekWc0rm7fUhW93a1xheARNHcNKhwMTR+UKXVJbTFQdGI1Rl5XdyvDBg==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"tslib": "~2.3.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"common-tags": {
|
||||||
|
"version": "1.8.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/common-tags/-/common-tags-1.8.2.tgz",
|
||||||
|
"integrity": "sha512-gk/Z852D2Wtb//0I+kRFNKKE9dIIVirjoqPoA1wJU+XePVXZfGeBpk45+A1rKO4Q43prqWBNY/MiIeRLbPWUaA==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"import-from": {
|
||||||
|
"version": "4.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/import-from/-/import-from-4.0.0.tgz",
|
||||||
|
"integrity": "sha512-P9J71vT5nLlDeV8FHs5nNxaLbrpfAV5cF5srvbZfpwpcJoM/xZR3hiv+q+SAnuSmuGbXMWud063iIMx/V/EWZQ==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"tslib": {
|
||||||
|
"version": "2.3.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz",
|
||||||
|
"integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==",
|
||||||
|
"dev": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"@graphql-codegen/cli": {
|
"@graphql-codegen/cli": {
|
||||||
"version": "2.1.1",
|
"version": "2.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/@graphql-codegen/cli/-/cli-2.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/@graphql-codegen/cli/-/cli-2.1.1.tgz",
|
||||||
|
@ -2420,6 +2473,132 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"@graphql-codegen/import-types-preset": {
|
||||||
|
"version": "2.1.12",
|
||||||
|
"resolved": "https://registry.npmjs.org/@graphql-codegen/import-types-preset/-/import-types-preset-2.1.12.tgz",
|
||||||
|
"integrity": "sha512-nFipXzsLJnjZY06PKBovg1hxnueB5n/RSlBPYA29ymahEenNR1vMejbq8/+iuRoxexLuYVSVnJAEcqoBriUKrg==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"@graphql-codegen/add": "^3.1.1",
|
||||||
|
"@graphql-codegen/plugin-helpers": "^2.4.0",
|
||||||
|
"@graphql-codegen/visitor-plugin-common": "2.7.1",
|
||||||
|
"tslib": "~2.3.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@graphql-codegen/plugin-helpers": {
|
||||||
|
"version": "2.4.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@graphql-codegen/plugin-helpers/-/plugin-helpers-2.4.1.tgz",
|
||||||
|
"integrity": "sha512-OPMma7aUnES3Dh+M0BfiNBnJLmYuH60EnbULAhufxFDn/Y2OA0Ht/LQok9beX6VN4ASZEMCOAGItJezGJr5DJw==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"@graphql-tools/utils": "^8.5.2",
|
||||||
|
"change-case-all": "1.0.14",
|
||||||
|
"common-tags": "1.8.2",
|
||||||
|
"import-from": "4.0.0",
|
||||||
|
"lodash": "~4.17.0",
|
||||||
|
"tslib": "~2.3.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"@graphql-codegen/visitor-plugin-common": {
|
||||||
|
"version": "2.7.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@graphql-codegen/visitor-plugin-common/-/visitor-plugin-common-2.7.1.tgz",
|
||||||
|
"integrity": "sha512-Ew/+0GwGwL3ZSXS0cYz6lVvE7S5SkbTr7caRpLa4FpAdLGNskCgdA1n6W5tX5c7qsaYstqlxp30hJTfgTsYS6A==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"@graphql-codegen/plugin-helpers": "^2.4.0",
|
||||||
|
"@graphql-tools/optimize": "^1.0.1",
|
||||||
|
"@graphql-tools/relay-operation-optimizer": "^6.3.7",
|
||||||
|
"@graphql-tools/utils": "^8.3.0",
|
||||||
|
"auto-bind": "~4.0.0",
|
||||||
|
"change-case-all": "1.0.14",
|
||||||
|
"dependency-graph": "^0.11.0",
|
||||||
|
"graphql-tag": "^2.11.0",
|
||||||
|
"parse-filepath": "^1.0.2",
|
||||||
|
"tslib": "~2.3.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"@graphql-tools/utils": {
|
||||||
|
"version": "8.6.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@graphql-tools/utils/-/utils-8.6.1.tgz",
|
||||||
|
"integrity": "sha512-uxcfHCocp4ENoIiovPxUWZEHOnbXqj3ekWc0rm7fUhW93a1xheARNHcNKhwMTR+UKXVJbTFQdGI1Rl5XdyvDBg==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"tslib": "~2.3.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"common-tags": {
|
||||||
|
"version": "1.8.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/common-tags/-/common-tags-1.8.2.tgz",
|
||||||
|
"integrity": "sha512-gk/Z852D2Wtb//0I+kRFNKKE9dIIVirjoqPoA1wJU+XePVXZfGeBpk45+A1rKO4Q43prqWBNY/MiIeRLbPWUaA==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"import-from": {
|
||||||
|
"version": "4.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/import-from/-/import-from-4.0.0.tgz",
|
||||||
|
"integrity": "sha512-P9J71vT5nLlDeV8FHs5nNxaLbrpfAV5cF5srvbZfpwpcJoM/xZR3hiv+q+SAnuSmuGbXMWud063iIMx/V/EWZQ==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"tslib": {
|
||||||
|
"version": "2.3.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz",
|
||||||
|
"integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==",
|
||||||
|
"dev": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"@graphql-codegen/introspection": {
|
||||||
|
"version": "2.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@graphql-codegen/introspection/-/introspection-2.1.1.tgz",
|
||||||
|
"integrity": "sha512-O9zsy0IoFYDo37pBVF4pSvRMDx/AKdgOxyko4R/O+0DHEw9Nya/pQ3dbn+LDLj2n6X+xOXUBUfFvqhODTqU28w==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"@graphql-codegen/plugin-helpers": "^2.3.2",
|
||||||
|
"tslib": "~2.3.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@graphql-codegen/plugin-helpers": {
|
||||||
|
"version": "2.4.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@graphql-codegen/plugin-helpers/-/plugin-helpers-2.4.1.tgz",
|
||||||
|
"integrity": "sha512-OPMma7aUnES3Dh+M0BfiNBnJLmYuH60EnbULAhufxFDn/Y2OA0Ht/LQok9beX6VN4ASZEMCOAGItJezGJr5DJw==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"@graphql-tools/utils": "^8.5.2",
|
||||||
|
"change-case-all": "1.0.14",
|
||||||
|
"common-tags": "1.8.2",
|
||||||
|
"import-from": "4.0.0",
|
||||||
|
"lodash": "~4.17.0",
|
||||||
|
"tslib": "~2.3.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"@graphql-tools/utils": {
|
||||||
|
"version": "8.6.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@graphql-tools/utils/-/utils-8.6.1.tgz",
|
||||||
|
"integrity": "sha512-uxcfHCocp4ENoIiovPxUWZEHOnbXqj3ekWc0rm7fUhW93a1xheARNHcNKhwMTR+UKXVJbTFQdGI1Rl5XdyvDBg==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"tslib": "~2.3.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"common-tags": {
|
||||||
|
"version": "1.8.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/common-tags/-/common-tags-1.8.2.tgz",
|
||||||
|
"integrity": "sha512-gk/Z852D2Wtb//0I+kRFNKKE9dIIVirjoqPoA1wJU+XePVXZfGeBpk45+A1rKO4Q43prqWBNY/MiIeRLbPWUaA==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"import-from": {
|
||||||
|
"version": "4.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/import-from/-/import-from-4.0.0.tgz",
|
||||||
|
"integrity": "sha512-P9J71vT5nLlDeV8FHs5nNxaLbrpfAV5cF5srvbZfpwpcJoM/xZR3hiv+q+SAnuSmuGbXMWud063iIMx/V/EWZQ==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"tslib": {
|
||||||
|
"version": "2.3.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz",
|
||||||
|
"integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==",
|
||||||
|
"dev": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"@graphql-codegen/plugin-helpers": {
|
"@graphql-codegen/plugin-helpers": {
|
||||||
"version": "2.1.0",
|
"version": "2.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/@graphql-codegen/plugin-helpers/-/plugin-helpers-2.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/@graphql-codegen/plugin-helpers/-/plugin-helpers-2.1.0.tgz",
|
||||||
|
@ -2448,18 +2627,110 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@graphql-codegen/typescript": {
|
"@graphql-codegen/schema-ast": {
|
||||||
"version": "2.1.1",
|
"version": "2.4.1",
|
||||||
"resolved": "https://registry.npmjs.org/@graphql-codegen/typescript/-/typescript-2.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/@graphql-codegen/schema-ast/-/schema-ast-2.4.1.tgz",
|
||||||
"integrity": "sha512-FDTuFIvuP0wbwuEUfMw7PiNVE4qJkjpiAccaZTEm6A69Wcumt774qaHMQC2vIg2t5xi1t69n8lbIggdtgf6Xtw==",
|
"integrity": "sha512-bIWlKk/ShoVJfghA4Rt1OWnd34/dQmZM/vAe6fu6QKyOh44aAdqPtYQ2dbTyFXoknmu504etKJGEDllYNUJRfg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@graphql-codegen/plugin-helpers": "^2.1.0",
|
"@graphql-codegen/plugin-helpers": "^2.3.2",
|
||||||
"@graphql-codegen/visitor-plugin-common": "2.1.1",
|
"@graphql-tools/utils": "^8.1.1",
|
||||||
|
"tslib": "~2.3.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@graphql-codegen/plugin-helpers": {
|
||||||
|
"version": "2.4.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@graphql-codegen/plugin-helpers/-/plugin-helpers-2.4.0.tgz",
|
||||||
|
"integrity": "sha512-bQ2EwVU34wkTrWM4/LbXS4t+ROYFM3qzwrRX6aFNYwAPho/fubryBHmNuUTh4evACFMx1ymQ6QLnvOUAoXYZSQ==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"@graphql-tools/utils": "^8.5.2",
|
||||||
|
"change-case-all": "1.0.14",
|
||||||
|
"common-tags": "1.8.2",
|
||||||
|
"import-from": "4.0.0",
|
||||||
|
"lodash": "~4.17.0",
|
||||||
|
"tslib": "~2.3.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@graphql-tools/utils": {
|
||||||
|
"version": "8.6.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@graphql-tools/utils/-/utils-8.6.1.tgz",
|
||||||
|
"integrity": "sha512-uxcfHCocp4ENoIiovPxUWZEHOnbXqj3ekWc0rm7fUhW93a1xheARNHcNKhwMTR+UKXVJbTFQdGI1Rl5XdyvDBg==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"tslib": "~2.3.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"common-tags": {
|
||||||
|
"version": "1.8.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/common-tags/-/common-tags-1.8.2.tgz",
|
||||||
|
"integrity": "sha512-gk/Z852D2Wtb//0I+kRFNKKE9dIIVirjoqPoA1wJU+XePVXZfGeBpk45+A1rKO4Q43prqWBNY/MiIeRLbPWUaA==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"import-from": {
|
||||||
|
"version": "4.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/import-from/-/import-from-4.0.0.tgz",
|
||||||
|
"integrity": "sha512-P9J71vT5nLlDeV8FHs5nNxaLbrpfAV5cF5srvbZfpwpcJoM/xZR3hiv+q+SAnuSmuGbXMWud063iIMx/V/EWZQ==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"tslib": {
|
||||||
|
"version": "2.3.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz",
|
||||||
|
"integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==",
|
||||||
|
"dev": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"@graphql-codegen/typescript": {
|
||||||
|
"version": "2.4.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/@graphql-codegen/typescript/-/typescript-2.4.3.tgz",
|
||||||
|
"integrity": "sha512-5b+4EVA01kiKId6IbBvuvSs0/aGeuSU+Cg2pBbe9VZol49iid982p28k9knEH4Jzgu4tUp4UMQTWNNwkPB4tEQ==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"@graphql-codegen/plugin-helpers": "^2.4.0",
|
||||||
|
"@graphql-codegen/schema-ast": "^2.4.1",
|
||||||
|
"@graphql-codegen/visitor-plugin-common": "2.6.0",
|
||||||
"auto-bind": "~4.0.0",
|
"auto-bind": "~4.0.0",
|
||||||
"tslib": "~2.3.0"
|
"tslib": "~2.3.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@graphql-codegen/plugin-helpers": {
|
||||||
|
"version": "2.4.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@graphql-codegen/plugin-helpers/-/plugin-helpers-2.4.0.tgz",
|
||||||
|
"integrity": "sha512-bQ2EwVU34wkTrWM4/LbXS4t+ROYFM3qzwrRX6aFNYwAPho/fubryBHmNuUTh4evACFMx1ymQ6QLnvOUAoXYZSQ==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"@graphql-tools/utils": "^8.5.2",
|
||||||
|
"change-case-all": "1.0.14",
|
||||||
|
"common-tags": "1.8.2",
|
||||||
|
"import-from": "4.0.0",
|
||||||
|
"lodash": "~4.17.0",
|
||||||
|
"tslib": "~2.3.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"@graphql-tools/utils": {
|
||||||
|
"version": "8.6.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@graphql-tools/utils/-/utils-8.6.1.tgz",
|
||||||
|
"integrity": "sha512-uxcfHCocp4ENoIiovPxUWZEHOnbXqj3ekWc0rm7fUhW93a1xheARNHcNKhwMTR+UKXVJbTFQdGI1Rl5XdyvDBg==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"tslib": "~2.3.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"common-tags": {
|
||||||
|
"version": "1.8.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/common-tags/-/common-tags-1.8.2.tgz",
|
||||||
|
"integrity": "sha512-gk/Z852D2Wtb//0I+kRFNKKE9dIIVirjoqPoA1wJU+XePVXZfGeBpk45+A1rKO4Q43prqWBNY/MiIeRLbPWUaA==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"import-from": {
|
||||||
|
"version": "4.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/import-from/-/import-from-4.0.0.tgz",
|
||||||
|
"integrity": "sha512-P9J71vT5nLlDeV8FHs5nNxaLbrpfAV5cF5srvbZfpwpcJoM/xZR3hiv+q+SAnuSmuGbXMWud063iIMx/V/EWZQ==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"tslib": {
|
"tslib": {
|
||||||
"version": "2.3.1",
|
"version": "2.3.1",
|
||||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz",
|
||||||
|
@ -2542,16 +2813,146 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@graphql-codegen/visitor-plugin-common": {
|
"@graphql-codegen/typescript-operations": {
|
||||||
"version": "2.1.1",
|
"version": "2.2.4",
|
||||||
"resolved": "https://registry.npmjs.org/@graphql-codegen/visitor-plugin-common/-/visitor-plugin-common-2.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/@graphql-codegen/typescript-operations/-/typescript-operations-2.2.4.tgz",
|
||||||
"integrity": "sha512-FO8kMDL+Y1yw8DirhIsY97RjVKfmxxhK179njA46Vu85Rg4zCuLpGMyB0mkhl95QGfdfuJjbB1lz34U27Ce9Wg==",
|
"integrity": "sha512-PAunOSdl4avsaGLTBxZkxOBQNfp9bmobBOX5p6q99NMYwoXsmtyu0mD8jIbzM+LMbxrskNxKJ1sywZ11aYGCMA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@graphql-codegen/plugin-helpers": "^2.1.0",
|
"@graphql-codegen/plugin-helpers": "^2.4.0",
|
||||||
|
"@graphql-codegen/typescript": "^2.4.3",
|
||||||
|
"@graphql-codegen/visitor-plugin-common": "2.6.0",
|
||||||
|
"auto-bind": "~4.0.0",
|
||||||
|
"tslib": "~2.3.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@graphql-codegen/plugin-helpers": {
|
||||||
|
"version": "2.4.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@graphql-codegen/plugin-helpers/-/plugin-helpers-2.4.0.tgz",
|
||||||
|
"integrity": "sha512-bQ2EwVU34wkTrWM4/LbXS4t+ROYFM3qzwrRX6aFNYwAPho/fubryBHmNuUTh4evACFMx1ymQ6QLnvOUAoXYZSQ==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"@graphql-tools/utils": "^8.5.2",
|
||||||
|
"change-case-all": "1.0.14",
|
||||||
|
"common-tags": "1.8.2",
|
||||||
|
"import-from": "4.0.0",
|
||||||
|
"lodash": "~4.17.0",
|
||||||
|
"tslib": "~2.3.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"@graphql-tools/utils": {
|
||||||
|
"version": "8.6.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@graphql-tools/utils/-/utils-8.6.1.tgz",
|
||||||
|
"integrity": "sha512-uxcfHCocp4ENoIiovPxUWZEHOnbXqj3ekWc0rm7fUhW93a1xheARNHcNKhwMTR+UKXVJbTFQdGI1Rl5XdyvDBg==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"tslib": "~2.3.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"common-tags": {
|
||||||
|
"version": "1.8.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/common-tags/-/common-tags-1.8.2.tgz",
|
||||||
|
"integrity": "sha512-gk/Z852D2Wtb//0I+kRFNKKE9dIIVirjoqPoA1wJU+XePVXZfGeBpk45+A1rKO4Q43prqWBNY/MiIeRLbPWUaA==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"import-from": {
|
||||||
|
"version": "4.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/import-from/-/import-from-4.0.0.tgz",
|
||||||
|
"integrity": "sha512-P9J71vT5nLlDeV8FHs5nNxaLbrpfAV5cF5srvbZfpwpcJoM/xZR3hiv+q+SAnuSmuGbXMWud063iIMx/V/EWZQ==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"tslib": {
|
||||||
|
"version": "2.3.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz",
|
||||||
|
"integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==",
|
||||||
|
"dev": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"@graphql-codegen/typescript-react-apollo": {
|
||||||
|
"version": "3.2.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/@graphql-codegen/typescript-react-apollo/-/typescript-react-apollo-3.2.5.tgz",
|
||||||
|
"integrity": "sha512-ODOmONBfZpNpWXrF6TKfeEoaaU/mnQ9lLZ1rv1fu2FusREvpMITaLznYUDo1RsI+iSjsJYm7dmSJmFPv+lxZrg==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"@graphql-codegen/plugin-helpers": "^2.4.0",
|
||||||
|
"@graphql-codegen/visitor-plugin-common": "2.6.0",
|
||||||
|
"auto-bind": "~4.0.0",
|
||||||
|
"change-case-all": "1.0.14",
|
||||||
|
"tslib": "~2.3.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@graphql-codegen/plugin-helpers": {
|
||||||
|
"version": "2.4.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@graphql-codegen/plugin-helpers/-/plugin-helpers-2.4.0.tgz",
|
||||||
|
"integrity": "sha512-bQ2EwVU34wkTrWM4/LbXS4t+ROYFM3qzwrRX6aFNYwAPho/fubryBHmNuUTh4evACFMx1ymQ6QLnvOUAoXYZSQ==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"@graphql-tools/utils": "^8.5.2",
|
||||||
|
"change-case-all": "1.0.14",
|
||||||
|
"common-tags": "1.8.2",
|
||||||
|
"import-from": "4.0.0",
|
||||||
|
"lodash": "~4.17.0",
|
||||||
|
"tslib": "~2.3.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"@graphql-codegen/visitor-plugin-common": {
|
||||||
|
"version": "2.6.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@graphql-codegen/visitor-plugin-common/-/visitor-plugin-common-2.6.0.tgz",
|
||||||
|
"integrity": "sha512-MysdJ8L/dIn62D+BFbiu6HSVaZfkAt0EI1g5twkpKzLmG7qDJ8P7KemFVFU/sCW3SVuhs7XabkSjnFK9uBquwg==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"@graphql-codegen/plugin-helpers": "^2.4.0",
|
||||||
|
"@graphql-tools/optimize": "^1.0.1",
|
||||||
|
"@graphql-tools/relay-operation-optimizer": "^6.3.7",
|
||||||
|
"@graphql-tools/utils": "^8.3.0",
|
||||||
|
"auto-bind": "~4.0.0",
|
||||||
|
"change-case-all": "1.0.14",
|
||||||
|
"dependency-graph": "^0.11.0",
|
||||||
|
"graphql-tag": "^2.11.0",
|
||||||
|
"parse-filepath": "^1.0.2",
|
||||||
|
"tslib": "~2.3.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"@graphql-tools/utils": {
|
||||||
|
"version": "8.6.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@graphql-tools/utils/-/utils-8.6.1.tgz",
|
||||||
|
"integrity": "sha512-uxcfHCocp4ENoIiovPxUWZEHOnbXqj3ekWc0rm7fUhW93a1xheARNHcNKhwMTR+UKXVJbTFQdGI1Rl5XdyvDBg==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"tslib": "~2.3.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"common-tags": {
|
||||||
|
"version": "1.8.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/common-tags/-/common-tags-1.8.2.tgz",
|
||||||
|
"integrity": "sha512-gk/Z852D2Wtb//0I+kRFNKKE9dIIVirjoqPoA1wJU+XePVXZfGeBpk45+A1rKO4Q43prqWBNY/MiIeRLbPWUaA==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"import-from": {
|
||||||
|
"version": "4.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/import-from/-/import-from-4.0.0.tgz",
|
||||||
|
"integrity": "sha512-P9J71vT5nLlDeV8FHs5nNxaLbrpfAV5cF5srvbZfpwpcJoM/xZR3hiv+q+SAnuSmuGbXMWud063iIMx/V/EWZQ==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"tslib": {
|
||||||
|
"version": "2.3.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz",
|
||||||
|
"integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==",
|
||||||
|
"dev": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"@graphql-codegen/visitor-plugin-common": {
|
||||||
|
"version": "2.6.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@graphql-codegen/visitor-plugin-common/-/visitor-plugin-common-2.6.0.tgz",
|
||||||
|
"integrity": "sha512-MysdJ8L/dIn62D+BFbiu6HSVaZfkAt0EI1g5twkpKzLmG7qDJ8P7KemFVFU/sCW3SVuhs7XabkSjnFK9uBquwg==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"@graphql-codegen/plugin-helpers": "^2.4.0",
|
||||||
"@graphql-tools/optimize": "^1.0.1",
|
"@graphql-tools/optimize": "^1.0.1",
|
||||||
"@graphql-tools/relay-operation-optimizer": "^6.3.7",
|
"@graphql-tools/relay-operation-optimizer": "^6.3.7",
|
||||||
"array.prototype.flatmap": "^1.2.4",
|
"@graphql-tools/utils": "^8.3.0",
|
||||||
"auto-bind": "~4.0.0",
|
"auto-bind": "~4.0.0",
|
||||||
"change-case-all": "1.0.14",
|
"change-case-all": "1.0.14",
|
||||||
"dependency-graph": "^0.11.0",
|
"dependency-graph": "^0.11.0",
|
||||||
|
@ -2560,6 +2961,41 @@
|
||||||
"tslib": "~2.3.0"
|
"tslib": "~2.3.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@graphql-codegen/plugin-helpers": {
|
||||||
|
"version": "2.4.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@graphql-codegen/plugin-helpers/-/plugin-helpers-2.4.0.tgz",
|
||||||
|
"integrity": "sha512-bQ2EwVU34wkTrWM4/LbXS4t+ROYFM3qzwrRX6aFNYwAPho/fubryBHmNuUTh4evACFMx1ymQ6QLnvOUAoXYZSQ==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"@graphql-tools/utils": "^8.5.2",
|
||||||
|
"change-case-all": "1.0.14",
|
||||||
|
"common-tags": "1.8.2",
|
||||||
|
"import-from": "4.0.0",
|
||||||
|
"lodash": "~4.17.0",
|
||||||
|
"tslib": "~2.3.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"@graphql-tools/utils": {
|
||||||
|
"version": "8.6.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@graphql-tools/utils/-/utils-8.6.1.tgz",
|
||||||
|
"integrity": "sha512-uxcfHCocp4ENoIiovPxUWZEHOnbXqj3ekWc0rm7fUhW93a1xheARNHcNKhwMTR+UKXVJbTFQdGI1Rl5XdyvDBg==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"tslib": "~2.3.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"common-tags": {
|
||||||
|
"version": "1.8.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/common-tags/-/common-tags-1.8.2.tgz",
|
||||||
|
"integrity": "sha512-gk/Z852D2Wtb//0I+kRFNKKE9dIIVirjoqPoA1wJU+XePVXZfGeBpk45+A1rKO4Q43prqWBNY/MiIeRLbPWUaA==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"import-from": {
|
||||||
|
"version": "4.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/import-from/-/import-from-4.0.0.tgz",
|
||||||
|
"integrity": "sha512-P9J71vT5nLlDeV8FHs5nNxaLbrpfAV5cF5srvbZfpwpcJoM/xZR3hiv+q+SAnuSmuGbXMWud063iIMx/V/EWZQ==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"tslib": {
|
"tslib": {
|
||||||
"version": "2.3.1",
|
"version": "2.3.1",
|
||||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz",
|
||||||
|
|
15
package.json
15
package.json
|
@ -93,10 +93,15 @@
|
||||||
"@babel/preset-typescript": "^7.13.0",
|
"@babel/preset-typescript": "^7.13.0",
|
||||||
"@babel/runtime": "^7.7.6",
|
"@babel/runtime": "^7.7.6",
|
||||||
"@editorjs/embed": "^2.4.6",
|
"@editorjs/embed": "^2.4.6",
|
||||||
|
"@graphql-codegen/add": "^3.1.1",
|
||||||
"@graphql-codegen/cli": "^2.1.1",
|
"@graphql-codegen/cli": "^2.1.1",
|
||||||
"@graphql-codegen/fragment-matcher": "^3.1.0",
|
"@graphql-codegen/fragment-matcher": "^3.1.0",
|
||||||
"@graphql-codegen/typescript": "^2.1.1",
|
"@graphql-codegen/import-types-preset": "^2.1.12",
|
||||||
|
"@graphql-codegen/introspection": "^2.1.1",
|
||||||
|
"@graphql-codegen/typescript": "^2.4.3",
|
||||||
"@graphql-codegen/typescript-apollo-client-helpers": "^2.1.10",
|
"@graphql-codegen/typescript-apollo-client-helpers": "^2.1.10",
|
||||||
|
"@graphql-codegen/typescript-operations": "^2.2.4",
|
||||||
|
"@graphql-codegen/typescript-react-apollo": "^3.2.5",
|
||||||
"@pollyjs/adapter-node-http": "^5.0.0",
|
"@pollyjs/adapter-node-http": "^5.0.0",
|
||||||
"@pollyjs/core": "^5.0.0",
|
"@pollyjs/core": "^5.0.0",
|
||||||
"@pollyjs/persister-fs": "^5.0.0",
|
"@pollyjs/persister-fs": "^5.0.0",
|
||||||
|
@ -249,16 +254,16 @@
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build-storybook": "build-storybook -c src/storybook/ -o build/storybook",
|
"build-storybook": "build-storybook -c src/storybook/ -o build/storybook",
|
||||||
"generate-fragment-types": "graphql-codegen",
|
"build-types": "graphql-codegen",
|
||||||
"build-types": "npx apollo client:codegen --target=typescript types --globalTypesFile=src/types/globalTypes.ts && npm run generate-fragment-types",
|
"build": "npm run build-types && webpack -p",
|
||||||
"build": "npm run generate-fragment-types && webpack -p",
|
|
||||||
"check-strict-null-errors": "tsc --noEmit --strictNullChecks | node scripts/count-strict-null-check-errors.js",
|
"check-strict-null-errors": "tsc --noEmit --strictNullChecks | node scripts/count-strict-null-check-errors.js",
|
||||||
"check-types": "tsc --noEmit",
|
"check-types": "tsc --noEmit",
|
||||||
"extract-json-messages": "rimraf build/locale && cross-env NODE_ENV=extract babel src 'src/**/*.{ts,tsx}' -o build/dashboard.bundle.js",
|
"extract-json-messages": "rimraf build/locale && cross-env NODE_ENV=extract babel src 'src/**/*.{ts,tsx}' -o build/dashboard.bundle.js",
|
||||||
"extract-messages": "npm run extract-json-messages && npm run transpile-messages",
|
"extract-messages": "npm run extract-json-messages && npm run transpile-messages",
|
||||||
|
"fetch-schema": "graphql-codegen --config ./fetch-schema.yml",
|
||||||
"heroku-postbuild": "npm run build",
|
"heroku-postbuild": "npm run build",
|
||||||
"serve:lhci": "NODE_ENV=production npm run server",
|
"serve:lhci": "NODE_ENV=production npm run server",
|
||||||
"start": "npm run generate-fragment-types && webpack-dev-server -d",
|
"start": "npm run build-types && webpack-dev-server -d",
|
||||||
"storybook": "start-storybook -p 3000 -c src/storybook/",
|
"storybook": "start-storybook -p 3000 -c src/storybook/",
|
||||||
"cy:run": "cypress run",
|
"cy:run": "cypress run",
|
||||||
"cy:run:report": "cypress run --env tags=all --reporter cypress-mochawesome-reporter --reporter-options reportDir='cypress/reports',overwrite=true,charts=true",
|
"cy:run:report": "cypress run --env tags=all --reporter cypress-mochawesome-reporter --reporter-options reportDir='cypress/reports',overwrite=true,charts=true",
|
||||||
|
|
7669
schema.graphql
7669
schema.graphql
File diff suppressed because it is too large
Load diff
|
@ -5,6 +5,7 @@ import Container from "@saleor/components/Container";
|
||||||
import ExternalLink from "@saleor/components/ExternalLink";
|
import ExternalLink from "@saleor/components/ExternalLink";
|
||||||
import PageHeader from "@saleor/components/PageHeader";
|
import PageHeader from "@saleor/components/PageHeader";
|
||||||
import Skeleton from "@saleor/components/Skeleton";
|
import Skeleton from "@saleor/components/Skeleton";
|
||||||
|
import { AppQuery } from "@saleor/graphql";
|
||||||
import { sectionNames } from "@saleor/intl";
|
import { sectionNames } from "@saleor/intl";
|
||||||
import { Backlink, Button } from "@saleor/macaw-ui";
|
import { Backlink, Button } from "@saleor/macaw-ui";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
@ -16,12 +17,11 @@ import activateIcon from "../../../../assets/images/activate-icon.svg";
|
||||||
import settingsIcon from "../../../../assets/images/settings-icon.svg";
|
import settingsIcon from "../../../../assets/images/settings-icon.svg";
|
||||||
import supportIcon from "../../../../assets/images/support-icon.svg";
|
import supportIcon from "../../../../assets/images/support-icon.svg";
|
||||||
import { useStyles } from "../../styles";
|
import { useStyles } from "../../styles";
|
||||||
import { App_app } from "../../types/App";
|
|
||||||
import DeactivatedText from "../DeactivatedText";
|
import DeactivatedText from "../DeactivatedText";
|
||||||
|
|
||||||
export interface AppDetailsPageProps {
|
export interface AppDetailsPageProps {
|
||||||
loading: boolean;
|
loading: boolean;
|
||||||
data: App_app;
|
data: AppQuery["app"];
|
||||||
navigateToApp: () => void;
|
navigateToApp: () => void;
|
||||||
navigateToAppSettings: () => void;
|
navigateToAppSettings: () => void;
|
||||||
onAppActivateOpen: () => void;
|
onAppActivateOpen: () => void;
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
import saleorDarkLogoSmall from "@assets/images/logo-dark-small.svg";
|
import saleorDarkLogoSmall from "@assets/images/logo-dark-small.svg";
|
||||||
import plusIcon from "@assets/images/plus-icon.svg";
|
import plusIcon from "@assets/images/plus-icon.svg";
|
||||||
import { Card, CardContent, Grid, Typography } from "@material-ui/core";
|
import { Card, CardContent, Grid, Typography } from "@material-ui/core";
|
||||||
import { AppInstall_appInstall_errors } from "@saleor/apps/types/AppInstall";
|
|
||||||
import CardSpacer from "@saleor/components/CardSpacer";
|
import CardSpacer from "@saleor/components/CardSpacer";
|
||||||
import CardTitle from "@saleor/components/CardTitle";
|
import CardTitle from "@saleor/components/CardTitle";
|
||||||
import Container from "@saleor/components/Container";
|
import Container from "@saleor/components/Container";
|
||||||
import Hr from "@saleor/components/Hr";
|
import Hr from "@saleor/components/Hr";
|
||||||
import Skeleton from "@saleor/components/Skeleton";
|
import Skeleton from "@saleor/components/Skeleton";
|
||||||
|
import { AppFetchMutation, AppInstallMutation } from "@saleor/graphql";
|
||||||
import { SubmitPromise } from "@saleor/hooks/useForm";
|
import { SubmitPromise } from "@saleor/hooks/useForm";
|
||||||
import { buttonMessages } from "@saleor/intl";
|
import { buttonMessages } from "@saleor/intl";
|
||||||
import { Button } from "@saleor/macaw-ui";
|
import { Button } from "@saleor/macaw-ui";
|
||||||
|
@ -15,13 +15,12 @@ import React from "react";
|
||||||
import { FormattedMessage, useIntl } from "react-intl";
|
import { FormattedMessage, useIntl } from "react-intl";
|
||||||
|
|
||||||
import { useStyles } from "../../styles";
|
import { useStyles } from "../../styles";
|
||||||
import { AppFetch_appFetchManifest_manifest } from "../../types/AppFetch";
|
|
||||||
|
|
||||||
export interface AppInstallPageProps {
|
export interface AppInstallPageProps {
|
||||||
data: AppFetch_appFetchManifest_manifest;
|
data: AppFetchMutation["appFetchManifest"]["manifest"];
|
||||||
loading: boolean;
|
loading: boolean;
|
||||||
navigateToAppsList: () => void;
|
navigateToAppsList: () => void;
|
||||||
onSubmit: () => SubmitPromise<AppInstall_appInstall_errors[]>;
|
onSubmit: () => SubmitPromise<AppInstallMutation["appInstall"]["errors"]>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const AppInstallPage: React.FC<AppInstallPageProps> = ({
|
export const AppInstallPage: React.FC<AppInstallPageProps> = ({
|
||||||
|
|
|
@ -3,19 +3,19 @@ import CardSpacer from "@saleor/components/CardSpacer";
|
||||||
import Container from "@saleor/components/Container";
|
import Container from "@saleor/components/Container";
|
||||||
import Grid from "@saleor/components/Grid";
|
import Grid from "@saleor/components/Grid";
|
||||||
import Hr from "@saleor/components/Hr";
|
import Hr from "@saleor/components/Hr";
|
||||||
|
import { AppQuery } from "@saleor/graphql";
|
||||||
import { sectionNames } from "@saleor/intl";
|
import { sectionNames } from "@saleor/intl";
|
||||||
import { Backlink, Button } from "@saleor/macaw-ui";
|
import { Backlink, Button } from "@saleor/macaw-ui";
|
||||||
import classNames from "classnames";
|
import classNames from "classnames";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { FormattedMessage, useIntl } from "react-intl";
|
import { FormattedMessage, useIntl } from "react-intl";
|
||||||
|
|
||||||
import { App_app } from "../../types/App";
|
|
||||||
import { AppFrame } from "../AppFrame";
|
import { AppFrame } from "../AppFrame";
|
||||||
import { useStyles } from "./styles";
|
import { useStyles } from "./styles";
|
||||||
import useSettingsBreadcrumbs from "./useSettingsBreadcrumbs";
|
import useSettingsBreadcrumbs from "./useSettingsBreadcrumbs";
|
||||||
|
|
||||||
export interface AppPageProps {
|
export interface AppPageProps {
|
||||||
data: App_app;
|
data: AppQuery["app"];
|
||||||
url: string;
|
url: string;
|
||||||
navigateToAbout: () => void;
|
navigateToAbout: () => void;
|
||||||
onBack: () => void;
|
onBack: () => void;
|
||||||
|
|
|
@ -9,19 +9,22 @@ import {
|
||||||
} from "@material-ui/core";
|
} from "@material-ui/core";
|
||||||
import ErrorIcon from "@material-ui/icons/Error";
|
import ErrorIcon from "@material-ui/icons/Error";
|
||||||
import CardTitle from "@saleor/components/CardTitle";
|
import CardTitle from "@saleor/components/CardTitle";
|
||||||
import { DeleteIcon, ResponsiveTable } from "@saleor/macaw-ui";
|
import { AppsInstallationsQuery, JobStatusEnum } from "@saleor/graphql";
|
||||||
import { Button, IconButton } from "@saleor/macaw-ui";
|
import {
|
||||||
|
Button,
|
||||||
|
DeleteIcon,
|
||||||
|
IconButton,
|
||||||
|
ResponsiveTable
|
||||||
|
} from "@saleor/macaw-ui";
|
||||||
import { renderCollection, stopPropagation } from "@saleor/misc";
|
import { renderCollection, stopPropagation } from "@saleor/misc";
|
||||||
import classNames from "classnames";
|
import classNames from "classnames";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { FormattedMessage, useIntl } from "react-intl";
|
import { FormattedMessage, useIntl } from "react-intl";
|
||||||
|
|
||||||
import { JobStatusEnum } from "../../../types/globalTypes";
|
|
||||||
import { useStyles } from "../../styles";
|
import { useStyles } from "../../styles";
|
||||||
import { AppsInstallations_appsInstallations } from "../../types/AppsInstallations";
|
|
||||||
|
|
||||||
export interface AppsInProgressProps {
|
export interface AppsInProgressProps {
|
||||||
appsList: AppsInstallations_appsInstallations[];
|
appsList: AppsInstallationsQuery["appsInstallations"];
|
||||||
disabled: boolean;
|
disabled: boolean;
|
||||||
onAppInstallRetry: (id: string) => void;
|
onAppInstallRetry: (id: string) => void;
|
||||||
onRemove: (id: string) => void;
|
onRemove: (id: string) => void;
|
||||||
|
|
|
@ -18,7 +18,10 @@ const props: AppsListPageProps = {
|
||||||
...searchPageProps,
|
...searchPageProps,
|
||||||
...sortPageProps,
|
...sortPageProps,
|
||||||
...tabPageProps,
|
...tabPageProps,
|
||||||
appsInProgressList: { appsInstallations: appsInProgress },
|
appsInProgressList: {
|
||||||
|
__typename: "Query",
|
||||||
|
appsInstallations: appsInProgress
|
||||||
|
},
|
||||||
customAppsList,
|
customAppsList,
|
||||||
disabled: false,
|
disabled: false,
|
||||||
installedAppsList: appsList,
|
installedAppsList: appsList,
|
||||||
|
|
|
@ -1,22 +1,21 @@
|
||||||
import CardSpacer from "@saleor/components/CardSpacer";
|
import CardSpacer from "@saleor/components/CardSpacer";
|
||||||
import Container from "@saleor/components/Container";
|
import Container from "@saleor/components/Container";
|
||||||
import PageHeader from "@saleor/components/PageHeader";
|
import PageHeader from "@saleor/components/PageHeader";
|
||||||
|
import { AppsInstallationsQuery, AppsListQuery } from "@saleor/graphql";
|
||||||
import { sectionNames } from "@saleor/intl";
|
import { sectionNames } from "@saleor/intl";
|
||||||
import { ListProps } from "@saleor/types";
|
import { ListProps } from "@saleor/types";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { useIntl } from "react-intl";
|
import { useIntl } from "react-intl";
|
||||||
|
|
||||||
import { AppsInstallations } from "../../types/AppsInstallations";
|
|
||||||
import { AppsList_apps_edges } from "../../types/AppsList";
|
|
||||||
import AppsInProgress from "../AppsInProgress/AppsInProgress";
|
import AppsInProgress from "../AppsInProgress/AppsInProgress";
|
||||||
import CustomApps from "../CustomApps/CustomApps";
|
import CustomApps from "../CustomApps/CustomApps";
|
||||||
import InstalledApps from "../InstalledApps/InstalledApps";
|
import InstalledApps from "../InstalledApps/InstalledApps";
|
||||||
import Marketplace from "../Marketplace";
|
import Marketplace from "../Marketplace";
|
||||||
|
|
||||||
export interface AppsListPageProps extends ListProps {
|
export interface AppsListPageProps extends ListProps {
|
||||||
installedAppsList: AppsList_apps_edges[];
|
installedAppsList: AppsListQuery["apps"]["edges"];
|
||||||
customAppsList: AppsList_apps_edges[];
|
customAppsList: AppsListQuery["apps"]["edges"];
|
||||||
appsInProgressList?: AppsInstallations;
|
appsInProgressList?: AppsInstallationsQuery;
|
||||||
loadingAppsInProgress: boolean;
|
loadingAppsInProgress: boolean;
|
||||||
navigateToCustomApp: (id: string) => () => void;
|
navigateToCustomApp: (id: string) => () => void;
|
||||||
navigateToCustomAppCreate: () => void;
|
navigateToCustomAppCreate: () => void;
|
||||||
|
|
|
@ -4,13 +4,14 @@ import Form from "@saleor/components/Form";
|
||||||
import Grid from "@saleor/components/Grid";
|
import Grid from "@saleor/components/Grid";
|
||||||
import PageHeader from "@saleor/components/PageHeader";
|
import PageHeader from "@saleor/components/PageHeader";
|
||||||
import Savebar from "@saleor/components/Savebar";
|
import Savebar from "@saleor/components/Savebar";
|
||||||
import { ShopInfo_shop_permissions } from "@saleor/components/Shop/types/ShopInfo";
|
import {
|
||||||
import { AppErrorFragment } from "@saleor/fragments/types/AppErrorFragment";
|
AppErrorFragment,
|
||||||
|
PermissionEnum,
|
||||||
|
PermissionFragment
|
||||||
|
} from "@saleor/graphql";
|
||||||
import { SubmitPromise } from "@saleor/hooks/useForm";
|
import { SubmitPromise } from "@saleor/hooks/useForm";
|
||||||
import { sectionNames } from "@saleor/intl";
|
import { sectionNames } from "@saleor/intl";
|
||||||
import { ConfirmButtonTransitionState } from "@saleor/macaw-ui";
|
import { Backlink, ConfirmButtonTransitionState } from "@saleor/macaw-ui";
|
||||||
import { Backlink } from "@saleor/macaw-ui";
|
|
||||||
import { PermissionEnum } from "@saleor/types/globalTypes";
|
|
||||||
import { getFormErrors } from "@saleor/utils/errors";
|
import { getFormErrors } from "@saleor/utils/errors";
|
||||||
import getAppErrorMessage from "@saleor/utils/errors/app";
|
import getAppErrorMessage from "@saleor/utils/errors/app";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
@ -26,7 +27,7 @@ export interface CustomAppCreatePageFormData {
|
||||||
export interface CustomAppCreatePageProps {
|
export interface CustomAppCreatePageProps {
|
||||||
disabled: boolean;
|
disabled: boolean;
|
||||||
errors: AppErrorFragment[];
|
errors: AppErrorFragment[];
|
||||||
permissions: ShopInfo_shop_permissions[];
|
permissions: PermissionFragment[];
|
||||||
saveButtonBarState: ConfirmButtonTransitionState;
|
saveButtonBarState: ConfirmButtonTransitionState;
|
||||||
onBack: () => void;
|
onBack: () => void;
|
||||||
onSubmit: (
|
onSubmit: (
|
||||||
|
|
|
@ -5,13 +5,19 @@ import Form from "@saleor/components/Form";
|
||||||
import Grid from "@saleor/components/Grid";
|
import Grid from "@saleor/components/Grid";
|
||||||
import PageHeader from "@saleor/components/PageHeader";
|
import PageHeader from "@saleor/components/PageHeader";
|
||||||
import Savebar from "@saleor/components/Savebar";
|
import Savebar from "@saleor/components/Savebar";
|
||||||
import { ShopInfo_shop_permissions } from "@saleor/components/Shop/types/ShopInfo";
|
import {
|
||||||
import { AppErrorFragment } from "@saleor/fragments/types/AppErrorFragment";
|
AppErrorFragment,
|
||||||
|
AppUpdateMutation,
|
||||||
|
PermissionEnum,
|
||||||
|
ShopInfoQuery
|
||||||
|
} from "@saleor/graphql";
|
||||||
import { SubmitPromise } from "@saleor/hooks/useForm";
|
import { SubmitPromise } from "@saleor/hooks/useForm";
|
||||||
import { sectionNames } from "@saleor/intl";
|
import { sectionNames } from "@saleor/intl";
|
||||||
import { ConfirmButtonTransitionState } from "@saleor/macaw-ui";
|
import {
|
||||||
import { Backlink, Button } from "@saleor/macaw-ui";
|
Backlink,
|
||||||
import { PermissionEnum } from "@saleor/types/globalTypes";
|
Button,
|
||||||
|
ConfirmButtonTransitionState
|
||||||
|
} from "@saleor/macaw-ui";
|
||||||
import { getFormErrors } from "@saleor/utils/errors";
|
import { getFormErrors } from "@saleor/utils/errors";
|
||||||
import getAppErrorMessage from "@saleor/utils/errors/app";
|
import getAppErrorMessage from "@saleor/utils/errors/app";
|
||||||
import WebhooksList from "@saleor/webhooks/components/WebhooksList";
|
import WebhooksList from "@saleor/webhooks/components/WebhooksList";
|
||||||
|
@ -20,7 +26,6 @@ import { FormattedMessage, useIntl } from "react-intl";
|
||||||
|
|
||||||
import activateIcon from "../../../../assets/images/activate-icon.svg";
|
import activateIcon from "../../../../assets/images/activate-icon.svg";
|
||||||
import { useStyles } from "../../styles";
|
import { useStyles } from "../../styles";
|
||||||
import { AppUpdate_appUpdate_app } from "../../types/AppUpdate";
|
|
||||||
import CustomAppDefaultToken from "../CustomAppDefaultToken";
|
import CustomAppDefaultToken from "../CustomAppDefaultToken";
|
||||||
import CustomAppInformation from "../CustomAppInformation";
|
import CustomAppInformation from "../CustomAppInformation";
|
||||||
import CustomAppTokens from "../CustomAppTokens";
|
import CustomAppTokens from "../CustomAppTokens";
|
||||||
|
@ -35,9 +40,9 @@ export interface CustomAppDetailsPageProps {
|
||||||
apiUri: string;
|
apiUri: string;
|
||||||
disabled: boolean;
|
disabled: boolean;
|
||||||
errors: AppErrorFragment[];
|
errors: AppErrorFragment[];
|
||||||
permissions: ShopInfo_shop_permissions[];
|
permissions: ShopInfoQuery["shop"]["permissions"];
|
||||||
saveButtonBarState: ConfirmButtonTransitionState;
|
saveButtonBarState: ConfirmButtonTransitionState;
|
||||||
app: AppUpdate_appUpdate_app;
|
app: AppUpdateMutation["appUpdate"]["app"];
|
||||||
token: string;
|
token: string;
|
||||||
onApiUriClick: () => void;
|
onApiUriClick: () => void;
|
||||||
onBack: () => void;
|
onBack: () => void;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { Card, CardContent, TextField } from "@material-ui/core";
|
import { Card, CardContent, TextField } from "@material-ui/core";
|
||||||
import CardTitle from "@saleor/components/CardTitle";
|
import CardTitle from "@saleor/components/CardTitle";
|
||||||
import { AppErrorFragment } from "@saleor/fragments/types/AppErrorFragment";
|
import { AppErrorFragment } from "@saleor/graphql";
|
||||||
import { FormChange } from "@saleor/hooks/useForm";
|
import { FormChange } from "@saleor/hooks/useForm";
|
||||||
import { getFormErrors } from "@saleor/utils/errors";
|
import { getFormErrors } from "@saleor/utils/errors";
|
||||||
import getAppErrorMessage from "@saleor/utils/errors/app";
|
import getAppErrorMessage from "@saleor/utils/errors/app";
|
||||||
|
|
|
@ -8,16 +8,16 @@ import {
|
||||||
import CardTitle from "@saleor/components/CardTitle";
|
import CardTitle from "@saleor/components/CardTitle";
|
||||||
import ResponsiveTable from "@saleor/components/ResponsiveTable";
|
import ResponsiveTable from "@saleor/components/ResponsiveTable";
|
||||||
import Skeleton from "@saleor/components/Skeleton";
|
import Skeleton from "@saleor/components/Skeleton";
|
||||||
|
import { AppUpdateMutation } from "@saleor/graphql";
|
||||||
import { Button, DeleteIcon, IconButton } from "@saleor/macaw-ui";
|
import { Button, DeleteIcon, IconButton } from "@saleor/macaw-ui";
|
||||||
import { renderCollection } from "@saleor/misc";
|
import { renderCollection } from "@saleor/misc";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { FormattedMessage, useIntl } from "react-intl";
|
import { FormattedMessage, useIntl } from "react-intl";
|
||||||
|
|
||||||
import { AppUpdate_appUpdate_app_tokens } from "../../types/AppUpdate";
|
|
||||||
import { useStyles } from "./styles";
|
import { useStyles } from "./styles";
|
||||||
|
|
||||||
export interface CustomAppTokensProps {
|
export interface CustomAppTokensProps {
|
||||||
tokens: Array<AppUpdate_appUpdate_app_tokens | null> | null;
|
tokens: AppUpdateMutation["appUpdate"]["app"]["tokens"] | null;
|
||||||
onCreate: () => void;
|
onCreate: () => void;
|
||||||
onDelete: (id: string) => void;
|
onDelete: (id: string) => void;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,21 +6,24 @@ import {
|
||||||
Typography
|
Typography
|
||||||
} from "@material-ui/core";
|
} from "@material-ui/core";
|
||||||
import CardTitle from "@saleor/components/CardTitle";
|
import CardTitle from "@saleor/components/CardTitle";
|
||||||
|
import { AppsListQuery } from "@saleor/graphql";
|
||||||
import { commonMessages } from "@saleor/intl";
|
import { commonMessages } from "@saleor/intl";
|
||||||
import { DeleteIcon, ResponsiveTable } from "@saleor/macaw-ui";
|
import {
|
||||||
import { Button, IconButton } from "@saleor/macaw-ui";
|
Button,
|
||||||
|
DeleteIcon,
|
||||||
|
IconButton,
|
||||||
|
ResponsiveTable
|
||||||
|
} from "@saleor/macaw-ui";
|
||||||
import { renderCollection, stopPropagation } from "@saleor/misc";
|
import { renderCollection, stopPropagation } from "@saleor/misc";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { useIntl } from "react-intl";
|
import { FormattedMessage, useIntl } from "react-intl";
|
||||||
import { FormattedMessage } from "react-intl";
|
|
||||||
|
|
||||||
import { useStyles } from "../../styles";
|
import { useStyles } from "../../styles";
|
||||||
import { AppsList_apps_edges } from "../../types/AppsList";
|
|
||||||
import AppsSkeleton from "../AppsSkeleton";
|
import AppsSkeleton from "../AppsSkeleton";
|
||||||
import DeactivatedText from "../DeactivatedText";
|
import DeactivatedText from "../DeactivatedText";
|
||||||
|
|
||||||
export interface CustomAppsProps {
|
export interface CustomAppsProps {
|
||||||
appsList: AppsList_apps_edges[];
|
appsList: AppsListQuery["apps"]["edges"];
|
||||||
navigateToCustomApp: (id: string) => () => void;
|
navigateToCustomApp: (id: string) => () => void;
|
||||||
navigateToCustomAppCreate?: () => void;
|
navigateToCustomAppCreate?: () => void;
|
||||||
onRemove: (id: string) => void;
|
onRemove: (id: string) => void;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { appDeepUrl } from "@saleor/apps/urls";
|
import { appDeepUrl } from "@saleor/apps/urls";
|
||||||
|
import { AppExtensionTargetEnum } from "@saleor/graphql";
|
||||||
import useNavigator from "@saleor/hooks/useNavigator";
|
import useNavigator from "@saleor/hooks/useNavigator";
|
||||||
import { AppExtensionTargetEnum } from "@saleor/types/globalTypes";
|
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
import { AppDialog } from "../AppDialog";
|
import { AppDialog } from "../AppDialog";
|
||||||
|
|
|
@ -8,20 +8,24 @@ import {
|
||||||
} from "@material-ui/core";
|
} from "@material-ui/core";
|
||||||
import CardTitle from "@saleor/components/CardTitle";
|
import CardTitle from "@saleor/components/CardTitle";
|
||||||
import TablePagination from "@saleor/components/TablePagination";
|
import TablePagination from "@saleor/components/TablePagination";
|
||||||
import { DeleteIcon, ResponsiveTable } from "@saleor/macaw-ui";
|
import { AppsListQuery } from "@saleor/graphql";
|
||||||
import { Button, IconButton } from "@saleor/macaw-ui";
|
import {
|
||||||
|
Button,
|
||||||
|
DeleteIcon,
|
||||||
|
IconButton,
|
||||||
|
ResponsiveTable
|
||||||
|
} from "@saleor/macaw-ui";
|
||||||
import { renderCollection, stopPropagation } from "@saleor/misc";
|
import { renderCollection, stopPropagation } from "@saleor/misc";
|
||||||
import { ListProps } from "@saleor/types";
|
import { ListProps } from "@saleor/types";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { FormattedMessage, useIntl } from "react-intl";
|
import { FormattedMessage, useIntl } from "react-intl";
|
||||||
|
|
||||||
import { useStyles } from "../../styles";
|
import { useStyles } from "../../styles";
|
||||||
import { AppsList_apps_edges } from "../../types/AppsList";
|
|
||||||
import AppsSkeleton from "../AppsSkeleton";
|
import AppsSkeleton from "../AppsSkeleton";
|
||||||
import DeactivatedText from "../DeactivatedText";
|
import DeactivatedText from "../DeactivatedText";
|
||||||
|
|
||||||
export interface InstalledAppsProps extends ListProps {
|
export interface InstalledAppsProps extends ListProps {
|
||||||
appsList: AppsList_apps_edges[];
|
appsList: AppsListQuery["apps"]["edges"];
|
||||||
onRemove: (id: string) => void;
|
onRemove: (id: string) => void;
|
||||||
onRowAboutClick: (id: string) => () => void;
|
onRowAboutClick: (id: string) => () => void;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
import {
|
import {
|
||||||
|
AppFetchMutation,
|
||||||
|
AppQuery,
|
||||||
|
AppsInstallationsQuery,
|
||||||
|
AppsListQuery,
|
||||||
AppTypeEnum,
|
AppTypeEnum,
|
||||||
JobStatusEnum,
|
JobStatusEnum,
|
||||||
PermissionEnum
|
PermissionEnum
|
||||||
} from "../types/globalTypes";
|
} from "@saleor/graphql";
|
||||||
import { App_app } from "./types/App";
|
|
||||||
import { AppFetch_appFetchManifest_manifest } from "./types/AppFetch";
|
|
||||||
import { AppsInstallations_appsInstallations } from "./types/AppsInstallations";
|
|
||||||
import { AppsList_apps_edges } from "./types/AppsList";
|
|
||||||
|
|
||||||
export const appsList: AppsList_apps_edges[] = [
|
export const appsList: AppsListQuery["apps"]["edges"] = [
|
||||||
{
|
{
|
||||||
__typename: "AppCountableEdge",
|
__typename: "AppCountableEdge",
|
||||||
node: {
|
node: {
|
||||||
|
@ -31,7 +31,7 @@ export const appsList: AppsList_apps_edges[] = [
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
export const customAppsList: AppsList_apps_edges[] = [
|
export const customAppsList: AppsListQuery["apps"]["edges"] = [
|
||||||
{
|
{
|
||||||
__typename: "AppCountableEdge",
|
__typename: "AppCountableEdge",
|
||||||
node: {
|
node: {
|
||||||
|
@ -44,7 +44,7 @@ export const customAppsList: AppsList_apps_edges[] = [
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
export const appsInProgress: AppsInstallations_appsInstallations[] = [
|
export const appsInProgress: AppsInstallationsQuery["appsInstallations"] = [
|
||||||
{
|
{
|
||||||
__typename: "AppInstallation",
|
__typename: "AppInstallation",
|
||||||
appName: "app",
|
appName: "app",
|
||||||
|
@ -71,7 +71,7 @@ export const appsInProgress: AppsInstallations_appsInstallations[] = [
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
export const appDetails: App_app = {
|
export const appDetails: AppQuery["app"] = {
|
||||||
__typename: "App",
|
__typename: "App",
|
||||||
aboutApp: "Lorem ipsum",
|
aboutApp: "Lorem ipsum",
|
||||||
accessToken: "token",
|
accessToken: "token",
|
||||||
|
@ -105,9 +105,8 @@ export const appDetails: App_app = {
|
||||||
webhooks: []
|
webhooks: []
|
||||||
};
|
};
|
||||||
|
|
||||||
export const installApp: AppFetch_appFetchManifest_manifest = {
|
export const installApp: AppFetchMutation["appFetchManifest"]["manifest"] = {
|
||||||
__typename: "Manifest",
|
__typename: "Manifest",
|
||||||
|
|
||||||
about: "Lorem ipsum",
|
about: "Lorem ipsum",
|
||||||
appUrl: null,
|
appUrl: null,
|
||||||
configurationUrl: null,
|
configurationUrl: null,
|
||||||
|
|
|
@ -1,68 +1,33 @@
|
||||||
import { gql } from "@apollo/client";
|
import { gql } from "@apollo/client";
|
||||||
import { appFragment } from "@saleor/fragments/apps";
|
|
||||||
import { appErrorFragment } from "@saleor/fragments/errors";
|
|
||||||
import { webhooksFragment } from "@saleor/fragments/webhooks";
|
|
||||||
import makeMutation from "@saleor/hooks/makeMutation";
|
|
||||||
|
|
||||||
import { AppActivate, AppActivateVariables } from "./types/AppActivate";
|
|
||||||
import { AppCreate, AppCreateVariables } from "./types/AppCreate";
|
|
||||||
import { AppDeactivate, AppDeactivateVariables } from "./types/AppDeactivate";
|
|
||||||
import { AppDelete, AppDeleteVariables } from "./types/AppDelete";
|
|
||||||
import {
|
|
||||||
AppDeleteFailedInstallation,
|
|
||||||
AppDeleteFailedInstallationVariables
|
|
||||||
} from "./types/AppDeleteFailedInstallation";
|
|
||||||
import { AppFetch, AppFetchVariables } from "./types/AppFetch";
|
|
||||||
import { AppInstall, AppInstallVariables } from "./types/AppInstall";
|
|
||||||
import {
|
|
||||||
AppRetryInstall,
|
|
||||||
AppRetryInstallVariables
|
|
||||||
} from "./types/AppRetryInstall";
|
|
||||||
import {
|
|
||||||
AppTokenCreate,
|
|
||||||
AppTokenCreateVariables
|
|
||||||
} from "./types/AppTokenCreate";
|
|
||||||
import {
|
|
||||||
AppTokenDelete,
|
|
||||||
AppTokenDeleteVariables
|
|
||||||
} from "./types/AppTokenDelete";
|
|
||||||
import { AppUpdate, AppUpdateVariables } from "./types/AppUpdate";
|
|
||||||
|
|
||||||
export const appCreateMutation = gql`
|
export const appCreateMutation = gql`
|
||||||
${appFragment}
|
|
||||||
${webhooksFragment}
|
|
||||||
${appErrorFragment}
|
|
||||||
mutation AppCreate($input: AppInput!) {
|
mutation AppCreate($input: AppInput!) {
|
||||||
appCreate(input: $input) {
|
appCreate(input: $input) {
|
||||||
authToken
|
authToken
|
||||||
app {
|
app {
|
||||||
...AppFragment
|
...App
|
||||||
}
|
}
|
||||||
errors {
|
errors {
|
||||||
...AppErrorFragment
|
...AppError
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const appDeleteMutation = gql`
|
export const appDeleteMutation = gql`
|
||||||
${appFragment}
|
|
||||||
${webhooksFragment}
|
|
||||||
${appErrorFragment}
|
|
||||||
mutation AppDelete($id: ID!) {
|
mutation AppDelete($id: ID!) {
|
||||||
appDelete(id: $id) {
|
appDelete(id: $id) {
|
||||||
app {
|
app {
|
||||||
...AppFragment
|
...App
|
||||||
}
|
}
|
||||||
errors {
|
errors {
|
||||||
...AppErrorFragment
|
...AppError
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const appDeleteFailedInstallationMutation = gql`
|
export const appDeleteFailedInstallationMutation = gql`
|
||||||
${appErrorFragment}
|
|
||||||
mutation AppDeleteFailedInstallation($id: ID!) {
|
mutation AppDeleteFailedInstallation($id: ID!) {
|
||||||
appDeleteFailedInstallation(id: $id) {
|
appDeleteFailedInstallation(id: $id) {
|
||||||
appInstallation {
|
appInstallation {
|
||||||
|
@ -72,14 +37,13 @@ export const appDeleteFailedInstallationMutation = gql`
|
||||||
message
|
message
|
||||||
}
|
}
|
||||||
errors {
|
errors {
|
||||||
...AppErrorFragment
|
...AppError
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const appFetchMutation = gql`
|
export const appFetchMutation = gql`
|
||||||
${appErrorFragment}
|
|
||||||
mutation AppFetch($manifestUrl: String!) {
|
mutation AppFetch($manifestUrl: String!) {
|
||||||
appFetchManifest(manifestUrl: $manifestUrl) {
|
appFetchManifest(manifestUrl: $manifestUrl) {
|
||||||
manifest {
|
manifest {
|
||||||
|
@ -100,14 +64,13 @@ export const appFetchMutation = gql`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
errors {
|
errors {
|
||||||
...AppErrorFragment
|
...AppError
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const appInstallMutation = gql`
|
export const appInstallMutation = gql`
|
||||||
${appErrorFragment}
|
|
||||||
mutation AppInstall($input: AppInstallInput!) {
|
mutation AppInstall($input: AppInstallInput!) {
|
||||||
appInstall(input: $input) {
|
appInstall(input: $input) {
|
||||||
appInstallation {
|
appInstallation {
|
||||||
|
@ -117,14 +80,13 @@ export const appInstallMutation = gql`
|
||||||
manifestUrl
|
manifestUrl
|
||||||
}
|
}
|
||||||
errors {
|
errors {
|
||||||
...AppErrorFragment
|
...AppError
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const appRetryInstallMutation = gql`
|
export const appRetryInstallMutation = gql`
|
||||||
${appErrorFragment}
|
|
||||||
mutation AppRetryInstall($id: ID!) {
|
mutation AppRetryInstall($id: ID!) {
|
||||||
appRetryInstall(id: $id) {
|
appRetryInstall(id: $id) {
|
||||||
appInstallation {
|
appInstallation {
|
||||||
|
@ -134,27 +96,24 @@ export const appRetryInstallMutation = gql`
|
||||||
manifestUrl
|
manifestUrl
|
||||||
}
|
}
|
||||||
errors {
|
errors {
|
||||||
...AppErrorFragment
|
...AppError
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const appUpdateMutation = gql`
|
export const appUpdateMutation = gql`
|
||||||
${appErrorFragment}
|
|
||||||
${appFragment}
|
|
||||||
${webhooksFragment}
|
|
||||||
mutation AppUpdate($id: ID!, $input: AppInput!) {
|
mutation AppUpdate($id: ID!, $input: AppInput!) {
|
||||||
appUpdate(id: $id, input: $input) {
|
appUpdate(id: $id, input: $input) {
|
||||||
app {
|
app {
|
||||||
...AppFragment
|
...App
|
||||||
permissions {
|
permissions {
|
||||||
code
|
code
|
||||||
name
|
name
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
errors {
|
errors {
|
||||||
...AppErrorFragment
|
...AppError
|
||||||
message
|
message
|
||||||
permissions
|
permissions
|
||||||
}
|
}
|
||||||
|
@ -163,7 +122,6 @@ export const appUpdateMutation = gql`
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const appTokenCreateMutation = gql`
|
export const appTokenCreateMutation = gql`
|
||||||
${appErrorFragment}
|
|
||||||
mutation AppTokenCreate($input: AppTokenInput!) {
|
mutation AppTokenCreate($input: AppTokenInput!) {
|
||||||
appTokenCreate(input: $input) {
|
appTokenCreate(input: $input) {
|
||||||
appToken {
|
appToken {
|
||||||
|
@ -173,14 +131,13 @@ export const appTokenCreateMutation = gql`
|
||||||
}
|
}
|
||||||
authToken
|
authToken
|
||||||
errors {
|
errors {
|
||||||
...AppErrorFragment
|
...AppError
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const appTokenDeleteMutation = gql`
|
export const appTokenDeleteMutation = gql`
|
||||||
${appErrorFragment}
|
|
||||||
mutation AppTokenDelete($id: ID!) {
|
mutation AppTokenDelete($id: ID!) {
|
||||||
appTokenDelete(id: $id) {
|
appTokenDelete(id: $id) {
|
||||||
appToken {
|
appToken {
|
||||||
|
@ -189,82 +146,28 @@ export const appTokenDeleteMutation = gql`
|
||||||
id
|
id
|
||||||
}
|
}
|
||||||
errors {
|
errors {
|
||||||
...AppErrorFragment
|
...AppError
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const appActivateMutation = gql`
|
export const appActivateMutation = gql`
|
||||||
${appErrorFragment}
|
|
||||||
mutation AppActivate($id: ID!) {
|
mutation AppActivate($id: ID!) {
|
||||||
appActivate(id: $id) {
|
appActivate(id: $id) {
|
||||||
errors {
|
errors {
|
||||||
...AppErrorFragment
|
...AppError
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const appDeactivateMutation = gql`
|
export const appDeactivateMutation = gql`
|
||||||
${appErrorFragment}
|
|
||||||
mutation AppDeactivate($id: ID!) {
|
mutation AppDeactivate($id: ID!) {
|
||||||
appDeactivate(id: $id) {
|
appDeactivate(id: $id) {
|
||||||
errors {
|
errors {
|
||||||
...AppErrorFragment
|
...AppError
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const useAppCreateMutation = makeMutation<AppCreate, AppCreateVariables>(
|
|
||||||
appCreateMutation
|
|
||||||
);
|
|
||||||
|
|
||||||
export const useAppDeleteMutation = makeMutation<AppDelete, AppDeleteVariables>(
|
|
||||||
appDeleteMutation
|
|
||||||
);
|
|
||||||
|
|
||||||
export const useAppDeleteFailedInstallationMutation = makeMutation<
|
|
||||||
AppDeleteFailedInstallation,
|
|
||||||
AppDeleteFailedInstallationVariables
|
|
||||||
>(appDeleteFailedInstallationMutation);
|
|
||||||
|
|
||||||
export const useAppInstallMutation = makeMutation<
|
|
||||||
AppInstall,
|
|
||||||
AppInstallVariables
|
|
||||||
>(appInstallMutation);
|
|
||||||
|
|
||||||
export const useAppRetryInstallMutation = makeMutation<
|
|
||||||
AppRetryInstall,
|
|
||||||
AppRetryInstallVariables
|
|
||||||
>(appRetryInstallMutation);
|
|
||||||
|
|
||||||
export const useAppManifestFetchMutation = makeMutation<
|
|
||||||
AppFetch,
|
|
||||||
AppFetchVariables
|
|
||||||
>(appFetchMutation);
|
|
||||||
|
|
||||||
export const useAppActivateMutation = makeMutation<
|
|
||||||
AppActivate,
|
|
||||||
AppActivateVariables
|
|
||||||
>(appActivateMutation);
|
|
||||||
|
|
||||||
export const useAppDeactivateMutation = makeMutation<
|
|
||||||
AppDeactivate,
|
|
||||||
AppDeactivateVariables
|
|
||||||
>(appDeactivateMutation);
|
|
||||||
|
|
||||||
export const useAppUpdateMutation = makeMutation<AppUpdate, AppUpdateVariables>(
|
|
||||||
appUpdateMutation
|
|
||||||
);
|
|
||||||
|
|
||||||
export const useAppTokenCreateMutation = makeMutation<
|
|
||||||
AppTokenCreate,
|
|
||||||
AppTokenCreateVariables
|
|
||||||
>(appTokenCreateMutation);
|
|
||||||
|
|
||||||
export const useAppTokenDeleteMutation = makeMutation<
|
|
||||||
AppTokenDelete,
|
|
||||||
AppTokenDeleteVariables
|
|
||||||
>(appTokenDeleteMutation);
|
|
||||||
|
|
|
@ -1,14 +1,6 @@
|
||||||
import { gql } from "@apollo/client";
|
import { gql } from "@apollo/client";
|
||||||
import { appFragment } from "@saleor/fragments/apps";
|
|
||||||
import { webhooksFragment } from "@saleor/fragments/webhooks";
|
|
||||||
import makeQuery from "@saleor/hooks/makeQuery";
|
|
||||||
|
|
||||||
import { App, AppVariables } from "./types/App";
|
export const appsList = gql`
|
||||||
import { AppsInstallations } from "./types/AppsInstallations";
|
|
||||||
import { AppsList, AppsListVariables } from "./types/AppsList";
|
|
||||||
import { ExtensionList, ExtensionListVariables } from "./types/ExtensionList";
|
|
||||||
|
|
||||||
const appsList = gql`
|
|
||||||
query AppsList(
|
query AppsList(
|
||||||
$before: String
|
$before: String
|
||||||
$after: String
|
$after: String
|
||||||
|
@ -44,7 +36,7 @@ const appsList = gql`
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const appsInProgressList = gql`
|
export const appsInProgressList = gql`
|
||||||
query AppsInstallations {
|
query AppsInstallations {
|
||||||
appsInstallations {
|
appsInstallations {
|
||||||
status
|
status
|
||||||
|
@ -56,12 +48,10 @@ const appsInProgressList = gql`
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const appDetails = gql`
|
export const appDetails = gql`
|
||||||
${appFragment}
|
|
||||||
${webhooksFragment}
|
|
||||||
query App($id: ID!) {
|
query App($id: ID!) {
|
||||||
app(id: $id) {
|
app(id: $id) {
|
||||||
...AppFragment
|
...App
|
||||||
aboutApp
|
aboutApp
|
||||||
permissions {
|
permissions {
|
||||||
code
|
code
|
||||||
|
@ -96,18 +86,3 @@ export const extensionList = gql`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const useAppsListQuery = makeQuery<AppsList, AppsListVariables>(
|
|
||||||
appsList
|
|
||||||
);
|
|
||||||
|
|
||||||
export const useAppsInProgressListQuery = makeQuery<AppsInstallations, {}>(
|
|
||||||
appsInProgressList
|
|
||||||
);
|
|
||||||
|
|
||||||
export const useAppDetails = makeQuery<App, AppVariables>(appDetails);
|
|
||||||
|
|
||||||
export const useExtensionList = makeQuery<
|
|
||||||
ExtensionList,
|
|
||||||
ExtensionListVariables
|
|
||||||
>(extensionList);
|
|
||||||
|
|
|
@ -1,80 +0,0 @@
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
// @generated
|
|
||||||
// This file was automatically generated and should not be edited.
|
|
||||||
|
|
||||||
import { AppTypeEnum, PermissionEnum } from "./../../types/globalTypes";
|
|
||||||
|
|
||||||
// ====================================================
|
|
||||||
// GraphQL query operation: App
|
|
||||||
// ====================================================
|
|
||||||
|
|
||||||
export interface App_app_privateMetadata {
|
|
||||||
__typename: "MetadataItem";
|
|
||||||
key: string;
|
|
||||||
value: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface App_app_metadata {
|
|
||||||
__typename: "MetadataItem";
|
|
||||||
key: string;
|
|
||||||
value: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface App_app_tokens {
|
|
||||||
__typename: "AppToken";
|
|
||||||
authToken: string | null;
|
|
||||||
id: string;
|
|
||||||
name: string | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface App_app_webhooks_app {
|
|
||||||
__typename: "App";
|
|
||||||
id: string;
|
|
||||||
name: string | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface App_app_webhooks {
|
|
||||||
__typename: "Webhook";
|
|
||||||
id: string;
|
|
||||||
name: string;
|
|
||||||
isActive: boolean;
|
|
||||||
app: App_app_webhooks_app;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface App_app_permissions {
|
|
||||||
__typename: "Permission";
|
|
||||||
code: PermissionEnum;
|
|
||||||
name: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface App_app {
|
|
||||||
__typename: "App";
|
|
||||||
id: string;
|
|
||||||
name: string | null;
|
|
||||||
created: any | null;
|
|
||||||
isActive: boolean | null;
|
|
||||||
type: AppTypeEnum | null;
|
|
||||||
homepageUrl: string | null;
|
|
||||||
appUrl: string | null;
|
|
||||||
configurationUrl: string | null;
|
|
||||||
supportUrl: string | null;
|
|
||||||
version: string | null;
|
|
||||||
accessToken: string | null;
|
|
||||||
privateMetadata: (App_app_privateMetadata | null)[];
|
|
||||||
metadata: (App_app_metadata | null)[];
|
|
||||||
tokens: (App_app_tokens | null)[] | null;
|
|
||||||
webhooks: (App_app_webhooks | null)[] | null;
|
|
||||||
aboutApp: string | null;
|
|
||||||
permissions: (App_app_permissions | null)[] | null;
|
|
||||||
dataPrivacy: string | null;
|
|
||||||
dataPrivacyUrl: string | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface App {
|
|
||||||
app: App_app | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppVariables {
|
|
||||||
id: string;
|
|
||||||
}
|
|
|
@ -1,31 +0,0 @@
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
// @generated
|
|
||||||
// This file was automatically generated and should not be edited.
|
|
||||||
|
|
||||||
import { AppErrorCode, PermissionEnum } from "./../../types/globalTypes";
|
|
||||||
|
|
||||||
// ====================================================
|
|
||||||
// GraphQL mutation operation: AppActivate
|
|
||||||
// ====================================================
|
|
||||||
|
|
||||||
export interface AppActivate_appActivate_errors {
|
|
||||||
__typename: "AppError";
|
|
||||||
field: string | null;
|
|
||||||
message: string | null;
|
|
||||||
code: AppErrorCode;
|
|
||||||
permissions: PermissionEnum[] | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppActivate_appActivate {
|
|
||||||
__typename: "AppActivate";
|
|
||||||
errors: AppActivate_appActivate_errors[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppActivate {
|
|
||||||
appActivate: AppActivate_appActivate | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppActivateVariables {
|
|
||||||
id: string;
|
|
||||||
}
|
|
|
@ -1,85 +0,0 @@
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
// @generated
|
|
||||||
// This file was automatically generated and should not be edited.
|
|
||||||
|
|
||||||
import { AppInput, AppTypeEnum, AppErrorCode, PermissionEnum } from "./../../types/globalTypes";
|
|
||||||
|
|
||||||
// ====================================================
|
|
||||||
// GraphQL mutation operation: AppCreate
|
|
||||||
// ====================================================
|
|
||||||
|
|
||||||
export interface AppCreate_appCreate_app_privateMetadata {
|
|
||||||
__typename: "MetadataItem";
|
|
||||||
key: string;
|
|
||||||
value: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppCreate_appCreate_app_metadata {
|
|
||||||
__typename: "MetadataItem";
|
|
||||||
key: string;
|
|
||||||
value: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppCreate_appCreate_app_tokens {
|
|
||||||
__typename: "AppToken";
|
|
||||||
authToken: string | null;
|
|
||||||
id: string;
|
|
||||||
name: string | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppCreate_appCreate_app_webhooks_app {
|
|
||||||
__typename: "App";
|
|
||||||
id: string;
|
|
||||||
name: string | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppCreate_appCreate_app_webhooks {
|
|
||||||
__typename: "Webhook";
|
|
||||||
id: string;
|
|
||||||
name: string;
|
|
||||||
isActive: boolean;
|
|
||||||
app: AppCreate_appCreate_app_webhooks_app;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppCreate_appCreate_app {
|
|
||||||
__typename: "App";
|
|
||||||
id: string;
|
|
||||||
name: string | null;
|
|
||||||
created: any | null;
|
|
||||||
isActive: boolean | null;
|
|
||||||
type: AppTypeEnum | null;
|
|
||||||
homepageUrl: string | null;
|
|
||||||
appUrl: string | null;
|
|
||||||
configurationUrl: string | null;
|
|
||||||
supportUrl: string | null;
|
|
||||||
version: string | null;
|
|
||||||
accessToken: string | null;
|
|
||||||
privateMetadata: (AppCreate_appCreate_app_privateMetadata | null)[];
|
|
||||||
metadata: (AppCreate_appCreate_app_metadata | null)[];
|
|
||||||
tokens: (AppCreate_appCreate_app_tokens | null)[] | null;
|
|
||||||
webhooks: (AppCreate_appCreate_app_webhooks | null)[] | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppCreate_appCreate_errors {
|
|
||||||
__typename: "AppError";
|
|
||||||
field: string | null;
|
|
||||||
message: string | null;
|
|
||||||
code: AppErrorCode;
|
|
||||||
permissions: PermissionEnum[] | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppCreate_appCreate {
|
|
||||||
__typename: "AppCreate";
|
|
||||||
authToken: string | null;
|
|
||||||
app: AppCreate_appCreate_app | null;
|
|
||||||
errors: AppCreate_appCreate_errors[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppCreate {
|
|
||||||
appCreate: AppCreate_appCreate | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppCreateVariables {
|
|
||||||
input: AppInput;
|
|
||||||
}
|
|
|
@ -1,31 +0,0 @@
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
// @generated
|
|
||||||
// This file was automatically generated and should not be edited.
|
|
||||||
|
|
||||||
import { AppErrorCode, PermissionEnum } from "./../../types/globalTypes";
|
|
||||||
|
|
||||||
// ====================================================
|
|
||||||
// GraphQL mutation operation: AppDeactivate
|
|
||||||
// ====================================================
|
|
||||||
|
|
||||||
export interface AppDeactivate_appDeactivate_errors {
|
|
||||||
__typename: "AppError";
|
|
||||||
field: string | null;
|
|
||||||
message: string | null;
|
|
||||||
code: AppErrorCode;
|
|
||||||
permissions: PermissionEnum[] | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppDeactivate_appDeactivate {
|
|
||||||
__typename: "AppDeactivate";
|
|
||||||
errors: AppDeactivate_appDeactivate_errors[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppDeactivate {
|
|
||||||
appDeactivate: AppDeactivate_appDeactivate | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppDeactivateVariables {
|
|
||||||
id: string;
|
|
||||||
}
|
|
|
@ -1,84 +0,0 @@
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
// @generated
|
|
||||||
// This file was automatically generated and should not be edited.
|
|
||||||
|
|
||||||
import { AppTypeEnum, AppErrorCode, PermissionEnum } from "./../../types/globalTypes";
|
|
||||||
|
|
||||||
// ====================================================
|
|
||||||
// GraphQL mutation operation: AppDelete
|
|
||||||
// ====================================================
|
|
||||||
|
|
||||||
export interface AppDelete_appDelete_app_privateMetadata {
|
|
||||||
__typename: "MetadataItem";
|
|
||||||
key: string;
|
|
||||||
value: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppDelete_appDelete_app_metadata {
|
|
||||||
__typename: "MetadataItem";
|
|
||||||
key: string;
|
|
||||||
value: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppDelete_appDelete_app_tokens {
|
|
||||||
__typename: "AppToken";
|
|
||||||
authToken: string | null;
|
|
||||||
id: string;
|
|
||||||
name: string | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppDelete_appDelete_app_webhooks_app {
|
|
||||||
__typename: "App";
|
|
||||||
id: string;
|
|
||||||
name: string | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppDelete_appDelete_app_webhooks {
|
|
||||||
__typename: "Webhook";
|
|
||||||
id: string;
|
|
||||||
name: string;
|
|
||||||
isActive: boolean;
|
|
||||||
app: AppDelete_appDelete_app_webhooks_app;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppDelete_appDelete_app {
|
|
||||||
__typename: "App";
|
|
||||||
id: string;
|
|
||||||
name: string | null;
|
|
||||||
created: any | null;
|
|
||||||
isActive: boolean | null;
|
|
||||||
type: AppTypeEnum | null;
|
|
||||||
homepageUrl: string | null;
|
|
||||||
appUrl: string | null;
|
|
||||||
configurationUrl: string | null;
|
|
||||||
supportUrl: string | null;
|
|
||||||
version: string | null;
|
|
||||||
accessToken: string | null;
|
|
||||||
privateMetadata: (AppDelete_appDelete_app_privateMetadata | null)[];
|
|
||||||
metadata: (AppDelete_appDelete_app_metadata | null)[];
|
|
||||||
tokens: (AppDelete_appDelete_app_tokens | null)[] | null;
|
|
||||||
webhooks: (AppDelete_appDelete_app_webhooks | null)[] | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppDelete_appDelete_errors {
|
|
||||||
__typename: "AppError";
|
|
||||||
field: string | null;
|
|
||||||
message: string | null;
|
|
||||||
code: AppErrorCode;
|
|
||||||
permissions: PermissionEnum[] | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppDelete_appDelete {
|
|
||||||
__typename: "AppDelete";
|
|
||||||
app: AppDelete_appDelete_app | null;
|
|
||||||
errors: AppDelete_appDelete_errors[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppDelete {
|
|
||||||
appDelete: AppDelete_appDelete | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppDeleteVariables {
|
|
||||||
id: string;
|
|
||||||
}
|
|
|
@ -1,40 +0,0 @@
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
// @generated
|
|
||||||
// This file was automatically generated and should not be edited.
|
|
||||||
|
|
||||||
import { JobStatusEnum, AppErrorCode, PermissionEnum } from "./../../types/globalTypes";
|
|
||||||
|
|
||||||
// ====================================================
|
|
||||||
// GraphQL mutation operation: AppDeleteFailedInstallation
|
|
||||||
// ====================================================
|
|
||||||
|
|
||||||
export interface AppDeleteFailedInstallation_appDeleteFailedInstallation_appInstallation {
|
|
||||||
__typename: "AppInstallation";
|
|
||||||
id: string;
|
|
||||||
status: JobStatusEnum;
|
|
||||||
appName: string;
|
|
||||||
message: string | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppDeleteFailedInstallation_appDeleteFailedInstallation_errors {
|
|
||||||
__typename: "AppError";
|
|
||||||
field: string | null;
|
|
||||||
message: string | null;
|
|
||||||
code: AppErrorCode;
|
|
||||||
permissions: PermissionEnum[] | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppDeleteFailedInstallation_appDeleteFailedInstallation {
|
|
||||||
__typename: "AppDeleteFailedInstallation";
|
|
||||||
appInstallation: AppDeleteFailedInstallation_appDeleteFailedInstallation_appInstallation | null;
|
|
||||||
errors: AppDeleteFailedInstallation_appDeleteFailedInstallation_errors[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppDeleteFailedInstallation {
|
|
||||||
appDeleteFailedInstallation: AppDeleteFailedInstallation_appDeleteFailedInstallation | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppDeleteFailedInstallationVariables {
|
|
||||||
id: string;
|
|
||||||
}
|
|
|
@ -1,54 +0,0 @@
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
// @generated
|
|
||||||
// This file was automatically generated and should not be edited.
|
|
||||||
|
|
||||||
import { PermissionEnum, AppErrorCode } from "./../../types/globalTypes";
|
|
||||||
|
|
||||||
// ====================================================
|
|
||||||
// GraphQL mutation operation: AppFetch
|
|
||||||
// ====================================================
|
|
||||||
|
|
||||||
export interface AppFetch_appFetchManifest_manifest_permissions {
|
|
||||||
__typename: "Permission";
|
|
||||||
code: PermissionEnum;
|
|
||||||
name: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppFetch_appFetchManifest_manifest {
|
|
||||||
__typename: "Manifest";
|
|
||||||
identifier: string;
|
|
||||||
version: string;
|
|
||||||
about: string | null;
|
|
||||||
name: string;
|
|
||||||
appUrl: string | null;
|
|
||||||
configurationUrl: string | null;
|
|
||||||
tokenTargetUrl: string | null;
|
|
||||||
dataPrivacy: string | null;
|
|
||||||
dataPrivacyUrl: string | null;
|
|
||||||
homepageUrl: string | null;
|
|
||||||
supportUrl: string | null;
|
|
||||||
permissions: (AppFetch_appFetchManifest_manifest_permissions | null)[] | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppFetch_appFetchManifest_errors {
|
|
||||||
__typename: "AppError";
|
|
||||||
field: string | null;
|
|
||||||
message: string | null;
|
|
||||||
code: AppErrorCode;
|
|
||||||
permissions: PermissionEnum[] | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppFetch_appFetchManifest {
|
|
||||||
__typename: "AppFetchManifest";
|
|
||||||
manifest: AppFetch_appFetchManifest_manifest | null;
|
|
||||||
errors: AppFetch_appFetchManifest_errors[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppFetch {
|
|
||||||
appFetchManifest: AppFetch_appFetchManifest | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppFetchVariables {
|
|
||||||
manifestUrl: string;
|
|
||||||
}
|
|
|
@ -1,40 +0,0 @@
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
// @generated
|
|
||||||
// This file was automatically generated and should not be edited.
|
|
||||||
|
|
||||||
import { AppInstallInput, JobStatusEnum, AppErrorCode, PermissionEnum } from "./../../types/globalTypes";
|
|
||||||
|
|
||||||
// ====================================================
|
|
||||||
// GraphQL mutation operation: AppInstall
|
|
||||||
// ====================================================
|
|
||||||
|
|
||||||
export interface AppInstall_appInstall_appInstallation {
|
|
||||||
__typename: "AppInstallation";
|
|
||||||
id: string;
|
|
||||||
status: JobStatusEnum;
|
|
||||||
appName: string;
|
|
||||||
manifestUrl: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppInstall_appInstall_errors {
|
|
||||||
__typename: "AppError";
|
|
||||||
field: string | null;
|
|
||||||
message: string | null;
|
|
||||||
code: AppErrorCode;
|
|
||||||
permissions: PermissionEnum[] | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppInstall_appInstall {
|
|
||||||
__typename: "AppInstall";
|
|
||||||
appInstallation: AppInstall_appInstall_appInstallation | null;
|
|
||||||
errors: AppInstall_appInstall_errors[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppInstall {
|
|
||||||
appInstall: AppInstall_appInstall | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppInstallVariables {
|
|
||||||
input: AppInstallInput;
|
|
||||||
}
|
|
|
@ -1,40 +0,0 @@
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
// @generated
|
|
||||||
// This file was automatically generated and should not be edited.
|
|
||||||
|
|
||||||
import { JobStatusEnum, AppErrorCode, PermissionEnum } from "./../../types/globalTypes";
|
|
||||||
|
|
||||||
// ====================================================
|
|
||||||
// GraphQL mutation operation: AppRetryInstall
|
|
||||||
// ====================================================
|
|
||||||
|
|
||||||
export interface AppRetryInstall_appRetryInstall_appInstallation {
|
|
||||||
__typename: "AppInstallation";
|
|
||||||
id: string;
|
|
||||||
status: JobStatusEnum;
|
|
||||||
appName: string;
|
|
||||||
manifestUrl: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppRetryInstall_appRetryInstall_errors {
|
|
||||||
__typename: "AppError";
|
|
||||||
field: string | null;
|
|
||||||
message: string | null;
|
|
||||||
code: AppErrorCode;
|
|
||||||
permissions: PermissionEnum[] | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppRetryInstall_appRetryInstall {
|
|
||||||
__typename: "AppRetryInstall";
|
|
||||||
appInstallation: AppRetryInstall_appRetryInstall_appInstallation | null;
|
|
||||||
errors: AppRetryInstall_appRetryInstall_errors[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppRetryInstall {
|
|
||||||
appRetryInstall: AppRetryInstall_appRetryInstall | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppRetryInstallVariables {
|
|
||||||
id: string;
|
|
||||||
}
|
|
|
@ -1,40 +0,0 @@
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
// @generated
|
|
||||||
// This file was automatically generated and should not be edited.
|
|
||||||
|
|
||||||
import { AppTokenInput, AppErrorCode, PermissionEnum } from "./../../types/globalTypes";
|
|
||||||
|
|
||||||
// ====================================================
|
|
||||||
// GraphQL mutation operation: AppTokenCreate
|
|
||||||
// ====================================================
|
|
||||||
|
|
||||||
export interface AppTokenCreate_appTokenCreate_appToken {
|
|
||||||
__typename: "AppToken";
|
|
||||||
name: string | null;
|
|
||||||
authToken: string | null;
|
|
||||||
id: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppTokenCreate_appTokenCreate_errors {
|
|
||||||
__typename: "AppError";
|
|
||||||
field: string | null;
|
|
||||||
message: string | null;
|
|
||||||
code: AppErrorCode;
|
|
||||||
permissions: PermissionEnum[] | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppTokenCreate_appTokenCreate {
|
|
||||||
__typename: "AppTokenCreate";
|
|
||||||
appToken: AppTokenCreate_appTokenCreate_appToken | null;
|
|
||||||
authToken: string | null;
|
|
||||||
errors: AppTokenCreate_appTokenCreate_errors[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppTokenCreate {
|
|
||||||
appTokenCreate: AppTokenCreate_appTokenCreate | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppTokenCreateVariables {
|
|
||||||
input: AppTokenInput;
|
|
||||||
}
|
|
|
@ -1,39 +0,0 @@
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
// @generated
|
|
||||||
// This file was automatically generated and should not be edited.
|
|
||||||
|
|
||||||
import { AppErrorCode, PermissionEnum } from "./../../types/globalTypes";
|
|
||||||
|
|
||||||
// ====================================================
|
|
||||||
// GraphQL mutation operation: AppTokenDelete
|
|
||||||
// ====================================================
|
|
||||||
|
|
||||||
export interface AppTokenDelete_appTokenDelete_appToken {
|
|
||||||
__typename: "AppToken";
|
|
||||||
name: string | null;
|
|
||||||
authToken: string | null;
|
|
||||||
id: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppTokenDelete_appTokenDelete_errors {
|
|
||||||
__typename: "AppError";
|
|
||||||
field: string | null;
|
|
||||||
message: string | null;
|
|
||||||
code: AppErrorCode;
|
|
||||||
permissions: PermissionEnum[] | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppTokenDelete_appTokenDelete {
|
|
||||||
__typename: "AppTokenDelete";
|
|
||||||
appToken: AppTokenDelete_appTokenDelete_appToken | null;
|
|
||||||
errors: AppTokenDelete_appTokenDelete_errors[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppTokenDelete {
|
|
||||||
appTokenDelete: AppTokenDelete_appTokenDelete | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppTokenDeleteVariables {
|
|
||||||
id: string;
|
|
||||||
}
|
|
|
@ -1,92 +0,0 @@
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
// @generated
|
|
||||||
// This file was automatically generated and should not be edited.
|
|
||||||
|
|
||||||
import { AppInput, AppTypeEnum, PermissionEnum, AppErrorCode } from "./../../types/globalTypes";
|
|
||||||
|
|
||||||
// ====================================================
|
|
||||||
// GraphQL mutation operation: AppUpdate
|
|
||||||
// ====================================================
|
|
||||||
|
|
||||||
export interface AppUpdate_appUpdate_app_privateMetadata {
|
|
||||||
__typename: "MetadataItem";
|
|
||||||
key: string;
|
|
||||||
value: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppUpdate_appUpdate_app_metadata {
|
|
||||||
__typename: "MetadataItem";
|
|
||||||
key: string;
|
|
||||||
value: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppUpdate_appUpdate_app_tokens {
|
|
||||||
__typename: "AppToken";
|
|
||||||
authToken: string | null;
|
|
||||||
id: string;
|
|
||||||
name: string | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppUpdate_appUpdate_app_webhooks_app {
|
|
||||||
__typename: "App";
|
|
||||||
id: string;
|
|
||||||
name: string | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppUpdate_appUpdate_app_webhooks {
|
|
||||||
__typename: "Webhook";
|
|
||||||
id: string;
|
|
||||||
name: string;
|
|
||||||
isActive: boolean;
|
|
||||||
app: AppUpdate_appUpdate_app_webhooks_app;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppUpdate_appUpdate_app_permissions {
|
|
||||||
__typename: "Permission";
|
|
||||||
code: PermissionEnum;
|
|
||||||
name: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppUpdate_appUpdate_app {
|
|
||||||
__typename: "App";
|
|
||||||
id: string;
|
|
||||||
name: string | null;
|
|
||||||
created: any | null;
|
|
||||||
isActive: boolean | null;
|
|
||||||
type: AppTypeEnum | null;
|
|
||||||
homepageUrl: string | null;
|
|
||||||
appUrl: string | null;
|
|
||||||
configurationUrl: string | null;
|
|
||||||
supportUrl: string | null;
|
|
||||||
version: string | null;
|
|
||||||
accessToken: string | null;
|
|
||||||
privateMetadata: (AppUpdate_appUpdate_app_privateMetadata | null)[];
|
|
||||||
metadata: (AppUpdate_appUpdate_app_metadata | null)[];
|
|
||||||
tokens: (AppUpdate_appUpdate_app_tokens | null)[] | null;
|
|
||||||
webhooks: (AppUpdate_appUpdate_app_webhooks | null)[] | null;
|
|
||||||
permissions: (AppUpdate_appUpdate_app_permissions | null)[] | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppUpdate_appUpdate_errors {
|
|
||||||
__typename: "AppError";
|
|
||||||
field: string | null;
|
|
||||||
message: string | null;
|
|
||||||
code: AppErrorCode;
|
|
||||||
permissions: PermissionEnum[] | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppUpdate_appUpdate {
|
|
||||||
__typename: "AppUpdate";
|
|
||||||
app: AppUpdate_appUpdate_app | null;
|
|
||||||
errors: AppUpdate_appUpdate_errors[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppUpdate {
|
|
||||||
appUpdate: AppUpdate_appUpdate | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppUpdateVariables {
|
|
||||||
id: string;
|
|
||||||
input: AppInput;
|
|
||||||
}
|
|
|
@ -1,23 +0,0 @@
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
// @generated
|
|
||||||
// This file was automatically generated and should not be edited.
|
|
||||||
|
|
||||||
import { JobStatusEnum } from "./../../types/globalTypes";
|
|
||||||
|
|
||||||
// ====================================================
|
|
||||||
// GraphQL query operation: AppsInstallations
|
|
||||||
// ====================================================
|
|
||||||
|
|
||||||
export interface AppsInstallations_appsInstallations {
|
|
||||||
__typename: "AppInstallation";
|
|
||||||
status: JobStatusEnum;
|
|
||||||
message: string | null;
|
|
||||||
appName: string;
|
|
||||||
manifestUrl: string;
|
|
||||||
id: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppsInstallations {
|
|
||||||
appsInstallations: AppsInstallations_appsInstallations[];
|
|
||||||
}
|
|
|
@ -1,51 +0,0 @@
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
// @generated
|
|
||||||
// This file was automatically generated and should not be edited.
|
|
||||||
|
|
||||||
import { AppSortingInput, AppFilterInput, AppTypeEnum } from "./../../types/globalTypes";
|
|
||||||
|
|
||||||
// ====================================================
|
|
||||||
// GraphQL query operation: AppsList
|
|
||||||
// ====================================================
|
|
||||||
|
|
||||||
export interface AppsList_apps_pageInfo {
|
|
||||||
__typename: "PageInfo";
|
|
||||||
hasNextPage: boolean;
|
|
||||||
hasPreviousPage: boolean;
|
|
||||||
startCursor: string | null;
|
|
||||||
endCursor: string | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppsList_apps_edges_node {
|
|
||||||
__typename: "App";
|
|
||||||
id: string;
|
|
||||||
name: string | null;
|
|
||||||
isActive: boolean | null;
|
|
||||||
type: AppTypeEnum | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppsList_apps_edges {
|
|
||||||
__typename: "AppCountableEdge";
|
|
||||||
node: AppsList_apps_edges_node;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppsList_apps {
|
|
||||||
__typename: "AppCountableConnection";
|
|
||||||
pageInfo: AppsList_apps_pageInfo;
|
|
||||||
totalCount: number | null;
|
|
||||||
edges: AppsList_apps_edges[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppsList {
|
|
||||||
apps: AppsList_apps | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AppsListVariables {
|
|
||||||
before?: string | null;
|
|
||||||
after?: string | null;
|
|
||||||
first?: number | null;
|
|
||||||
last?: number | null;
|
|
||||||
sort?: AppSortingInput | null;
|
|
||||||
filter?: AppFilterInput | null;
|
|
||||||
}
|
|
|
@ -1,51 +0,0 @@
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
// @generated
|
|
||||||
// This file was automatically generated and should not be edited.
|
|
||||||
|
|
||||||
import { AppExtensionFilterInput, AppExtensionMountEnum, AppExtensionTargetEnum, PermissionEnum } from "./../../types/globalTypes";
|
|
||||||
|
|
||||||
// ====================================================
|
|
||||||
// GraphQL query operation: ExtensionList
|
|
||||||
// ====================================================
|
|
||||||
|
|
||||||
export interface ExtensionList_appExtensions_edges_node_permissions {
|
|
||||||
__typename: "Permission";
|
|
||||||
code: PermissionEnum;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ExtensionList_appExtensions_edges_node_app {
|
|
||||||
__typename: "App";
|
|
||||||
id: string;
|
|
||||||
appUrl: string | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ExtensionList_appExtensions_edges_node {
|
|
||||||
__typename: "AppExtension";
|
|
||||||
id: string;
|
|
||||||
label: string;
|
|
||||||
url: string;
|
|
||||||
mount: AppExtensionMountEnum;
|
|
||||||
target: AppExtensionTargetEnum;
|
|
||||||
accessToken: string | null;
|
|
||||||
permissions: ExtensionList_appExtensions_edges_node_permissions[];
|
|
||||||
app: ExtensionList_appExtensions_edges_node_app;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ExtensionList_appExtensions_edges {
|
|
||||||
__typename: "AppExtensionCountableEdge";
|
|
||||||
node: ExtensionList_appExtensions_edges_node;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ExtensionList_appExtensions {
|
|
||||||
__typename: "AppExtensionCountableConnection";
|
|
||||||
edges: ExtensionList_appExtensions_edges[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ExtensionList {
|
|
||||||
appExtensions: ExtensionList_appExtensions | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ExtensionListVariables {
|
|
||||||
filter: AppExtensionFilterInput;
|
|
||||||
}
|
|
|
@ -1,19 +1,17 @@
|
||||||
import {
|
import {
|
||||||
AppExtensionMountEnum,
|
AppExtensionMountEnum,
|
||||||
PermissionEnum
|
ExtensionListQuery,
|
||||||
} from "@saleor/types/globalTypes";
|
PermissionEnum,
|
||||||
|
useExtensionListQuery
|
||||||
|
} from "@saleor/graphql";
|
||||||
|
import { RelayToFlat } from "@saleor/types";
|
||||||
import { mapEdgesToItems } from "@saleor/utils/maps";
|
import { mapEdgesToItems } from "@saleor/utils/maps";
|
||||||
|
|
||||||
import { AppData, useExternalApp } from "./components/ExternalAppContext";
|
import { AppData, useExternalApp } from "./components/ExternalAppContext";
|
||||||
import { useExtensionList } from "./queries";
|
|
||||||
import {
|
|
||||||
ExtensionList_appExtensions_edges_node,
|
|
||||||
ExtensionList_appExtensions_edges_node_app
|
|
||||||
} from "./types/ExtensionList";
|
|
||||||
|
|
||||||
export interface Extension {
|
export interface Extension {
|
||||||
id: string;
|
id: string;
|
||||||
app: ExtensionList_appExtensions_edges_node_app;
|
app: RelayToFlat<ExtensionListQuery["appExtensions"]>[0]["app"];
|
||||||
accessToken: string;
|
accessToken: string;
|
||||||
permissions: PermissionEnum[];
|
permissions: PermissionEnum[];
|
||||||
label: string;
|
label: string;
|
||||||
|
@ -38,7 +36,7 @@ export const extensionMountPoints = {
|
||||||
};
|
};
|
||||||
|
|
||||||
const filterAndMapToTarget = (
|
const filterAndMapToTarget = (
|
||||||
extensions: ExtensionList_appExtensions_edges_node[],
|
extensions: RelayToFlat<ExtensionListQuery["appExtensions"]>,
|
||||||
openApp: (appData: AppData) => void
|
openApp: (appData: AppData) => void
|
||||||
): Extension[] =>
|
): Extension[] =>
|
||||||
extensions.map(
|
extensions.map(
|
||||||
|
@ -67,7 +65,7 @@ export const useExtensions = <T extends AppExtensionMountEnum>(
|
||||||
): Record<T, Extension[]> => {
|
): Record<T, Extension[]> => {
|
||||||
const { openApp } = useExternalApp();
|
const { openApp } = useExternalApp();
|
||||||
|
|
||||||
const { data } = useExtensionList({
|
const { data } = useExtensionListQuery({
|
||||||
fetchPolicy: "cache-first",
|
fetchPolicy: "cache-first",
|
||||||
variables: {
|
variables: {
|
||||||
filter: {
|
filter: {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { appMessages } from "@saleor/apps/messages";
|
import { appMessages } from "@saleor/apps/messages";
|
||||||
import NotFoundPage from "@saleor/components/NotFoundPage";
|
import NotFoundPage from "@saleor/components/NotFoundPage";
|
||||||
|
import { useAppQuery } from "@saleor/graphql";
|
||||||
import useNavigator from "@saleor/hooks/useNavigator";
|
import useNavigator from "@saleor/hooks/useNavigator";
|
||||||
import useNotifier from "@saleor/hooks/useNotifier";
|
import useNotifier from "@saleor/hooks/useNotifier";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
@ -7,7 +8,6 @@ import { useIntl } from "react-intl";
|
||||||
import { useLocation } from "react-router";
|
import { useLocation } from "react-router";
|
||||||
|
|
||||||
import AppPage from "../../components/AppPage";
|
import AppPage from "../../components/AppPage";
|
||||||
import { useAppDetails } from "../../queries";
|
|
||||||
import {
|
import {
|
||||||
appDetailsUrl,
|
appDetailsUrl,
|
||||||
appsListPath,
|
appsListPath,
|
||||||
|
@ -20,7 +20,7 @@ interface AppProps {
|
||||||
|
|
||||||
export const App: React.FC<AppProps> = ({ id }) => {
|
export const App: React.FC<AppProps> = ({ id }) => {
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
const { data } = useAppDetails({
|
const { data } = useAppQuery({
|
||||||
displayLoader: true,
|
displayLoader: true,
|
||||||
variables: { id }
|
variables: { id }
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,5 +1,10 @@
|
||||||
import { appMessages } from "@saleor/apps/messages";
|
import { appMessages } from "@saleor/apps/messages";
|
||||||
import NotFoundPage from "@saleor/components/NotFoundPage";
|
import NotFoundPage from "@saleor/components/NotFoundPage";
|
||||||
|
import {
|
||||||
|
useAppActivateMutation,
|
||||||
|
useAppDeactivateMutation,
|
||||||
|
useAppQuery
|
||||||
|
} from "@saleor/graphql";
|
||||||
import useNavigator from "@saleor/hooks/useNavigator";
|
import useNavigator from "@saleor/hooks/useNavigator";
|
||||||
import useNotifier from "@saleor/hooks/useNotifier";
|
import useNotifier from "@saleor/hooks/useNotifier";
|
||||||
import getAppErrorMessage from "@saleor/utils/errors/app";
|
import getAppErrorMessage from "@saleor/utils/errors/app";
|
||||||
|
@ -10,11 +15,6 @@ import { useIntl } from "react-intl";
|
||||||
import AppActivateDialog from "../../components/AppActivateDialog";
|
import AppActivateDialog from "../../components/AppActivateDialog";
|
||||||
import AppDeactivateDialog from "../../components/AppDeactivateDialog";
|
import AppDeactivateDialog from "../../components/AppDeactivateDialog";
|
||||||
import AppDetailsPage from "../../components/AppDetailsPage";
|
import AppDetailsPage from "../../components/AppDetailsPage";
|
||||||
import {
|
|
||||||
useAppActivateMutation,
|
|
||||||
useAppDeactivateMutation
|
|
||||||
} from "../../mutations";
|
|
||||||
import { useAppDetails } from "../../queries";
|
|
||||||
import {
|
import {
|
||||||
AppDetailsUrlDialog,
|
AppDetailsUrlDialog,
|
||||||
AppDetailsUrlQueryParams,
|
AppDetailsUrlQueryParams,
|
||||||
|
@ -29,7 +29,7 @@ interface AppDetailsProps {
|
||||||
}
|
}
|
||||||
|
|
||||||
export const AppDetails: React.FC<AppDetailsProps> = ({ id, params }) => {
|
export const AppDetails: React.FC<AppDetailsProps> = ({ id, params }) => {
|
||||||
const { data, loading, refetch } = useAppDetails({
|
const { data, loading, refetch } = useAppQuery({
|
||||||
displayLoader: true,
|
displayLoader: true,
|
||||||
variables: { id }
|
variables: { id }
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import { WindowTitle } from "@saleor/components/WindowTitle";
|
import { WindowTitle } from "@saleor/components/WindowTitle";
|
||||||
|
import { useAppFetchMutation, useAppInstallMutation } from "@saleor/graphql";
|
||||||
import useLocalStorage from "@saleor/hooks/useLocalStorage";
|
import useLocalStorage from "@saleor/hooks/useLocalStorage";
|
||||||
import useNavigator from "@saleor/hooks/useNavigator";
|
import useNavigator from "@saleor/hooks/useNavigator";
|
||||||
import useNotifier from "@saleor/hooks/useNotifier";
|
import useNotifier from "@saleor/hooks/useNotifier";
|
||||||
|
@ -10,10 +11,6 @@ import { RouteComponentProps } from "react-router-dom";
|
||||||
|
|
||||||
import AppInstallErrorPage from "../../components/AppInstallErrorPage";
|
import AppInstallErrorPage from "../../components/AppInstallErrorPage";
|
||||||
import AppInstallPage from "../../components/AppInstallPage";
|
import AppInstallPage from "../../components/AppInstallPage";
|
||||||
import {
|
|
||||||
useAppInstallMutation,
|
|
||||||
useAppManifestFetchMutation
|
|
||||||
} from "../../mutations";
|
|
||||||
import {
|
import {
|
||||||
AppInstallUrlQueryParams,
|
AppInstallUrlQueryParams,
|
||||||
appsListUrl,
|
appsListUrl,
|
||||||
|
@ -33,7 +30,7 @@ export const InstallAppCreate: React.FC<InstallAppCreateProps> = ({
|
||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
const manifestUrl = params[MANIFEST_ATTR];
|
const manifestUrl = params[MANIFEST_ATTR];
|
||||||
|
|
||||||
const [fetchManifest, fetchManifestOpts] = useAppManifestFetchMutation({
|
const [fetchManifest, fetchManifestOpts] = useAppFetchMutation({
|
||||||
onCompleted: data => {
|
onCompleted: data => {
|
||||||
if (data.appFetchManifest.errors.length) {
|
if (data.appFetchManifest.errors.length) {
|
||||||
data.appFetchManifest.errors.forEach(error => {
|
data.appFetchManifest.errors.forEach(error => {
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
import { appMessages } from "@saleor/apps/messages";
|
import { appMessages } from "@saleor/apps/messages";
|
||||||
import NotFoundPage from "@saleor/components/NotFoundPage";
|
import NotFoundPage from "@saleor/components/NotFoundPage";
|
||||||
|
import { useAppQuery } from "@saleor/graphql";
|
||||||
import useNavigator from "@saleor/hooks/useNavigator";
|
import useNavigator from "@saleor/hooks/useNavigator";
|
||||||
import useNotifier from "@saleor/hooks/useNotifier";
|
import useNotifier from "@saleor/hooks/useNotifier";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { useIntl } from "react-intl";
|
import { useIntl } from "react-intl";
|
||||||
|
|
||||||
import AppPage from "../../components/AppPage";
|
import AppPage from "../../components/AppPage";
|
||||||
import { useAppDetails } from "../../queries";
|
|
||||||
import { appDetailsUrl, appsListPath } from "../../urls";
|
import { appDetailsUrl, appsListPath } from "../../urls";
|
||||||
|
|
||||||
interface AppSettingsProps {
|
interface AppSettingsProps {
|
||||||
|
@ -14,7 +14,7 @@ interface AppSettingsProps {
|
||||||
}
|
}
|
||||||
|
|
||||||
export const AppSettings: React.FC<AppSettingsProps> = ({ id }) => {
|
export const AppSettings: React.FC<AppSettingsProps> = ({ id }) => {
|
||||||
const { data } = useAppDetails({
|
const { data } = useAppQuery({
|
||||||
displayLoader: true,
|
displayLoader: true,
|
||||||
variables: { id }
|
variables: { id }
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,3 +1,18 @@
|
||||||
|
import {
|
||||||
|
AppDeleteFailedInstallationMutation,
|
||||||
|
AppDeleteMutation,
|
||||||
|
AppsInstallationsQuery,
|
||||||
|
AppsListQuery,
|
||||||
|
AppSortField,
|
||||||
|
AppTypeEnum,
|
||||||
|
JobStatusEnum,
|
||||||
|
OrderDirection,
|
||||||
|
useAppDeleteFailedInstallationMutation,
|
||||||
|
useAppDeleteMutation,
|
||||||
|
useAppRetryInstallMutation,
|
||||||
|
useAppsInstallationsQuery,
|
||||||
|
useAppsListQuery
|
||||||
|
} from "@saleor/graphql";
|
||||||
import useListSettings from "@saleor/hooks/useListSettings";
|
import useListSettings from "@saleor/hooks/useListSettings";
|
||||||
import useLocalStorage from "@saleor/hooks/useLocalStorage";
|
import useLocalStorage from "@saleor/hooks/useLocalStorage";
|
||||||
import useNavigator from "@saleor/hooks/useNavigator";
|
import useNavigator from "@saleor/hooks/useNavigator";
|
||||||
|
@ -11,25 +26,9 @@ import createDialogActionHandlers from "@saleor/utils/handlers/dialogActionHandl
|
||||||
import React, { useEffect, useRef } from "react";
|
import React, { useEffect, useRef } from "react";
|
||||||
import { useIntl } from "react-intl";
|
import { useIntl } from "react-intl";
|
||||||
|
|
||||||
import {
|
|
||||||
AppSortField,
|
|
||||||
AppTypeEnum,
|
|
||||||
JobStatusEnum,
|
|
||||||
OrderDirection
|
|
||||||
} from "../../../types/globalTypes";
|
|
||||||
import AppDeleteDialog from "../../components/AppDeleteDialog";
|
import AppDeleteDialog from "../../components/AppDeleteDialog";
|
||||||
import AppInProgressDeleteDialog from "../../components/AppInProgressDeleteDialog";
|
import AppInProgressDeleteDialog from "../../components/AppInProgressDeleteDialog";
|
||||||
import AppsListPage from "../../components/AppsListPage";
|
import AppsListPage from "../../components/AppsListPage";
|
||||||
import {
|
|
||||||
useAppDeleteFailedInstallationMutation,
|
|
||||||
useAppDeleteMutation,
|
|
||||||
useAppRetryInstallMutation
|
|
||||||
} from "../../mutations";
|
|
||||||
import { useAppsInProgressListQuery, useAppsListQuery } from "../../queries";
|
|
||||||
import { AppDelete } from "../../types/AppDelete";
|
|
||||||
import { AppDeleteFailedInstallation } from "../../types/AppDeleteFailedInstallation";
|
|
||||||
import { AppsInstallations_appsInstallations } from "../../types/AppsInstallations";
|
|
||||||
import { AppsList_apps_edges } from "../../types/AppsList";
|
|
||||||
import {
|
import {
|
||||||
appDetailsUrl,
|
appDetailsUrl,
|
||||||
AppListUrlDialog,
|
AppListUrlDialog,
|
||||||
|
@ -41,12 +40,14 @@ import {
|
||||||
} from "../../urls";
|
} from "../../urls";
|
||||||
import { messages } from "./messages";
|
import { messages } from "./messages";
|
||||||
|
|
||||||
const getCurrentAppName = (id: string, collection?: AppsList_apps_edges[]) =>
|
const getCurrentAppName = (
|
||||||
collection?.find(edge => edge.node.id === id)?.node?.name;
|
id: string,
|
||||||
|
collection?: AppsListQuery["apps"]["edges"]
|
||||||
|
) => collection?.find(edge => edge.node.id === id)?.node?.name;
|
||||||
|
|
||||||
const getAppInProgressName = (
|
const getAppInProgressName = (
|
||||||
id: string,
|
id: string,
|
||||||
collection?: AppsInstallations_appsInstallations[]
|
collection?: AppsInstallationsQuery["appsInstallations"]
|
||||||
) => collection?.find(app => app.id === id)?.appName;
|
) => collection?.find(app => app.id === id)?.appName;
|
||||||
interface AppsListProps {
|
interface AppsListProps {
|
||||||
params: AppListUrlQueryParams;
|
params: AppListUrlQueryParams;
|
||||||
|
@ -80,7 +81,7 @@ export const AppsList: React.FC<AppsListProps> = ({ params }) => {
|
||||||
data: appsInProgressData,
|
data: appsInProgressData,
|
||||||
loading: loadingAppsInProgress,
|
loading: loadingAppsInProgress,
|
||||||
refetch: appsInProgressRefetch
|
refetch: appsInProgressRefetch
|
||||||
} = useAppsInProgressListQuery({
|
} = useAppsInstallationsQuery({
|
||||||
displayLoader: false
|
displayLoader: false
|
||||||
});
|
});
|
||||||
const { data, loading, refetch } = useAppsListQuery({
|
const { data, loading, refetch } = useAppsListQuery({
|
||||||
|
@ -143,7 +144,7 @@ export const AppsList: React.FC<AppsListProps> = ({ params }) => {
|
||||||
AppListUrlQueryParams
|
AppListUrlQueryParams
|
||||||
>(navigate, appsListUrl, params);
|
>(navigate, appsListUrl, params);
|
||||||
|
|
||||||
const onAppRemove = (data: AppDelete) => {
|
const onAppRemove = (data: AppDeleteMutation) => {
|
||||||
const errors = data.appDelete.errors;
|
const errors = data.appDelete.errors;
|
||||||
if (errors.length === 0) {
|
if (errors.length === 0) {
|
||||||
if (data.appDelete.app.type === AppTypeEnum.LOCAL) {
|
if (data.appDelete.app.type === AppTypeEnum.LOCAL) {
|
||||||
|
@ -242,7 +243,7 @@ export const AppsList: React.FC<AppsListProps> = ({ params }) => {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const onAppInProgressRemove = (data: AppDeleteFailedInstallation) => {
|
const onAppInProgressRemove = (data: AppDeleteFailedInstallationMutation) => {
|
||||||
const errors = data.appDeleteFailedInstallation.errors;
|
const errors = data.appDeleteFailedInstallation.errors;
|
||||||
if (errors.length === 0) {
|
if (errors.length === 0) {
|
||||||
removeAppNotify();
|
removeAppNotify();
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import { WindowTitle } from "@saleor/components/WindowTitle";
|
import { WindowTitle } from "@saleor/components/WindowTitle";
|
||||||
|
import { AppCreateMutation, useAppCreateMutation } from "@saleor/graphql";
|
||||||
import useNavigator from "@saleor/hooks/useNavigator";
|
import useNavigator from "@saleor/hooks/useNavigator";
|
||||||
import useNotifier from "@saleor/hooks/useNotifier";
|
import useNotifier from "@saleor/hooks/useNotifier";
|
||||||
import useShop from "@saleor/hooks/useShop";
|
import useShop from "@saleor/hooks/useShop";
|
||||||
|
@ -10,8 +11,6 @@ import { useIntl } from "react-intl";
|
||||||
import CustomAppCreatePage, {
|
import CustomAppCreatePage, {
|
||||||
CustomAppCreatePageFormData
|
CustomAppCreatePageFormData
|
||||||
} from "../../components/CustomAppCreatePage";
|
} from "../../components/CustomAppCreatePage";
|
||||||
import { useAppCreateMutation } from "../../mutations";
|
|
||||||
import { AppCreate } from "../../types/AppCreate";
|
|
||||||
import { appsListUrl, customAppUrl } from "../../urls";
|
import { appsListUrl, customAppUrl } from "../../urls";
|
||||||
import { messages } from "./messages";
|
import { messages } from "./messages";
|
||||||
|
|
||||||
|
@ -26,7 +25,7 @@ export const CustomAppCreate: React.FC<CustomAppCreateProps> = ({
|
||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
const shop = useShop();
|
const shop = useShop();
|
||||||
|
|
||||||
const onSubmit = (data: AppCreate) => {
|
const onSubmit = (data: AppCreateMutation) => {
|
||||||
if (data.appCreate.errors.length === 0) {
|
if (data.appCreate.errors.length === 0) {
|
||||||
notify({
|
notify({
|
||||||
status: "success",
|
status: "success",
|
||||||
|
|
|
@ -6,6 +6,19 @@ import { appMessages } from "@saleor/apps/messages";
|
||||||
import NotFoundPage from "@saleor/components/NotFoundPage";
|
import NotFoundPage from "@saleor/components/NotFoundPage";
|
||||||
import { WindowTitle } from "@saleor/components/WindowTitle";
|
import { WindowTitle } from "@saleor/components/WindowTitle";
|
||||||
import { API_URI } from "@saleor/config";
|
import { API_URI } from "@saleor/config";
|
||||||
|
import {
|
||||||
|
AppTokenCreateMutation,
|
||||||
|
AppTokenDeleteMutation,
|
||||||
|
AppUpdateMutation,
|
||||||
|
useAppActivateMutation,
|
||||||
|
useAppDeactivateMutation,
|
||||||
|
useAppQuery,
|
||||||
|
useAppTokenCreateMutation,
|
||||||
|
useAppTokenDeleteMutation,
|
||||||
|
useAppUpdateMutation,
|
||||||
|
useWebhookDeleteMutation,
|
||||||
|
WebhookDeleteMutation
|
||||||
|
} from "@saleor/graphql";
|
||||||
import useNavigator from "@saleor/hooks/useNavigator";
|
import useNavigator from "@saleor/hooks/useNavigator";
|
||||||
import useNotifier from "@saleor/hooks/useNotifier";
|
import useNotifier from "@saleor/hooks/useNotifier";
|
||||||
import useShop from "@saleor/hooks/useShop";
|
import useShop from "@saleor/hooks/useShop";
|
||||||
|
@ -14,8 +27,6 @@ import { extractMutationErrors, getStringOrPlaceholder } from "@saleor/misc";
|
||||||
import getAppErrorMessage from "@saleor/utils/errors/app";
|
import getAppErrorMessage from "@saleor/utils/errors/app";
|
||||||
import createDialogActionHandlers from "@saleor/utils/handlers/dialogActionHandlers";
|
import createDialogActionHandlers from "@saleor/utils/handlers/dialogActionHandlers";
|
||||||
import WebhookDeleteDialog from "@saleor/webhooks/components/WebhookDeleteDialog";
|
import WebhookDeleteDialog from "@saleor/webhooks/components/WebhookDeleteDialog";
|
||||||
import { useWebhookDeleteMutation } from "@saleor/webhooks/mutations";
|
|
||||||
import { WebhookDelete } from "@saleor/webhooks/types/WebhookDelete";
|
|
||||||
import { webhookAddPath, webhookPath } from "@saleor/webhooks/urls";
|
import { webhookAddPath, webhookPath } from "@saleor/webhooks/urls";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { useIntl } from "react-intl";
|
import { useIntl } from "react-intl";
|
||||||
|
@ -23,17 +34,6 @@ import { useIntl } from "react-intl";
|
||||||
import CustomAppDetailsPage, {
|
import CustomAppDetailsPage, {
|
||||||
CustomAppDetailsPageFormData
|
CustomAppDetailsPageFormData
|
||||||
} from "../../components/CustomAppDetailsPage";
|
} from "../../components/CustomAppDetailsPage";
|
||||||
import {
|
|
||||||
useAppActivateMutation,
|
|
||||||
useAppDeactivateMutation,
|
|
||||||
useAppTokenCreateMutation,
|
|
||||||
useAppTokenDeleteMutation,
|
|
||||||
useAppUpdateMutation
|
|
||||||
} from "../../mutations";
|
|
||||||
import { useAppDetails } from "../../queries";
|
|
||||||
import { AppTokenCreate } from "../../types/AppTokenCreate";
|
|
||||||
import { AppTokenDelete } from "../../types/AppTokenDelete";
|
|
||||||
import { AppUpdate } from "../../types/AppUpdate";
|
|
||||||
import {
|
import {
|
||||||
appsListUrl,
|
appsListUrl,
|
||||||
customAppUrl,
|
customAppUrl,
|
||||||
|
@ -66,7 +66,7 @@ export const CustomAppDetails: React.FC<OrderListProps> = ({
|
||||||
CustomAppUrlQueryParams
|
CustomAppUrlQueryParams
|
||||||
>(navigate, params => customAppUrl(id, params), params);
|
>(navigate, params => customAppUrl(id, params), params);
|
||||||
|
|
||||||
const { data, loading, refetch } = useAppDetails({
|
const { data, loading, refetch } = useAppQuery({
|
||||||
displayLoader: true,
|
displayLoader: true,
|
||||||
variables: { id }
|
variables: { id }
|
||||||
});
|
});
|
||||||
|
@ -111,7 +111,7 @@ export const CustomAppDetails: React.FC<OrderListProps> = ({
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const onWebhookDelete = (data: WebhookDelete) => {
|
const onWebhookDelete = (data: WebhookDeleteMutation) => {
|
||||||
if (data.webhookDelete.errors.length === 0) {
|
if (data.webhookDelete.errors.length === 0) {
|
||||||
notify({
|
notify({
|
||||||
status: "success",
|
status: "success",
|
||||||
|
@ -135,7 +135,7 @@ export const CustomAppDetails: React.FC<OrderListProps> = ({
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const onAppUpdate = (data: AppUpdate) => {
|
const onAppUpdate = (data: AppUpdateMutation) => {
|
||||||
if (data?.appUpdate?.errors?.length === 0) {
|
if (data?.appUpdate?.errors?.length === 0) {
|
||||||
notify({
|
notify({
|
||||||
status: "success",
|
status: "success",
|
||||||
|
@ -150,12 +150,12 @@ export const CustomAppDetails: React.FC<OrderListProps> = ({
|
||||||
return <NotFoundPage onBack={handleBack} />;
|
return <NotFoundPage onBack={handleBack} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
const onTokenCreate = (data: AppTokenCreate) => {
|
const onTokenCreate = (data: AppTokenCreateMutation) => {
|
||||||
if (data?.appTokenCreate?.errors.length === 0) {
|
if (data?.appTokenCreate?.errors.length === 0) {
|
||||||
refetch();
|
refetch();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const onTokenDelete = (data: AppTokenDelete) => {
|
const onTokenDelete = (data: AppTokenDeleteMutation) => {
|
||||||
if (data?.appTokenDelete?.errors.length === 0) {
|
if (data?.appTokenDelete?.errors.length === 0) {
|
||||||
notify({
|
notify({
|
||||||
status: "success",
|
status: "success",
|
||||||
|
|
|
@ -4,14 +4,14 @@ import CardTitle from "@saleor/components/CardTitle";
|
||||||
import ControlledCheckbox from "@saleor/components/ControlledCheckbox";
|
import ControlledCheckbox from "@saleor/components/ControlledCheckbox";
|
||||||
import FormSpacer from "@saleor/components/FormSpacer";
|
import FormSpacer from "@saleor/components/FormSpacer";
|
||||||
import SingleSelectField from "@saleor/components/SingleSelectField";
|
import SingleSelectField from "@saleor/components/SingleSelectField";
|
||||||
import { AttributeErrorFragment } from "@saleor/fragments/types/AttributeErrorFragment";
|
import {
|
||||||
|
AttributeEntityTypeEnum,
|
||||||
|
AttributeErrorFragment,
|
||||||
|
AttributeInputTypeEnum
|
||||||
|
} from "@saleor/graphql";
|
||||||
import { UseFormResult } from "@saleor/hooks/useForm";
|
import { UseFormResult } from "@saleor/hooks/useForm";
|
||||||
import { commonMessages } from "@saleor/intl";
|
import { commonMessages } from "@saleor/intl";
|
||||||
import { makeStyles } from "@saleor/macaw-ui";
|
import { makeStyles } from "@saleor/macaw-ui";
|
||||||
import {
|
|
||||||
AttributeEntityTypeEnum,
|
|
||||||
AttributeInputTypeEnum
|
|
||||||
} from "@saleor/types/globalTypes";
|
|
||||||
import { getFormErrors } from "@saleor/utils/errors";
|
import { getFormErrors } from "@saleor/utils/errors";
|
||||||
import getAttributeErrorMessage from "@saleor/utils/errors/attribute";
|
import getAttributeErrorMessage from "@saleor/utils/errors/attribute";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
import { AttributePageFormData } from "@saleor/attributes/components/AttributePage";
|
import { AttributePageFormData } from "@saleor/attributes/components/AttributePage";
|
||||||
import ControlledCheckbox from "@saleor/components/ControlledCheckbox";
|
import ControlledCheckbox from "@saleor/components/ControlledCheckbox";
|
||||||
import SingleSelectField from "@saleor/components/SingleSelectField";
|
import SingleSelectField from "@saleor/components/SingleSelectField";
|
||||||
|
import { MeasurementUnitsEnum } from "@saleor/graphql";
|
||||||
import { UseFormResult } from "@saleor/hooks/useForm";
|
import { UseFormResult } from "@saleor/hooks/useForm";
|
||||||
import { commonMessages } from "@saleor/intl";
|
import { commonMessages } from "@saleor/intl";
|
||||||
import { makeStyles } from "@saleor/macaw-ui";
|
import { makeStyles } from "@saleor/macaw-ui";
|
||||||
import { MeasurementUnitsEnum } from "@saleor/types/globalTypes";
|
|
||||||
import React, { useEffect, useMemo, useState } from "react";
|
import React, { useEffect, useMemo, useState } from "react";
|
||||||
import { useIntl } from "react-intl";
|
import { useIntl } from "react-intl";
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { Choice } from "@saleor/components/SingleSelectField";
|
import { Choice } from "@saleor/components/SingleSelectField";
|
||||||
import { MeasurementUnitsEnum } from "@saleor/types/globalTypes";
|
import { MeasurementUnitsEnum } from "@saleor/graphql";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { IntlShape, MessageDescriptor } from "react-intl";
|
import { IntlShape, MessageDescriptor } from "react-intl";
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@ import Skeleton from "@saleor/components/Skeleton";
|
||||||
import TableCellHeader from "@saleor/components/TableCellHeader";
|
import TableCellHeader from "@saleor/components/TableCellHeader";
|
||||||
import TableHead from "@saleor/components/TableHead";
|
import TableHead from "@saleor/components/TableHead";
|
||||||
import TablePagination from "@saleor/components/TablePagination";
|
import TablePagination from "@saleor/components/TablePagination";
|
||||||
|
import { AttributeFragment } from "@saleor/graphql";
|
||||||
import { translateBoolean } from "@saleor/intl";
|
import { translateBoolean } from "@saleor/intl";
|
||||||
import { makeStyles } from "@saleor/macaw-ui";
|
import { makeStyles } from "@saleor/macaw-ui";
|
||||||
import { maybe, renderCollection } from "@saleor/misc";
|
import { maybe, renderCollection } from "@saleor/misc";
|
||||||
|
@ -14,13 +15,11 @@ import { getArrowDirection } from "@saleor/utils/sort";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { FormattedMessage, useIntl } from "react-intl";
|
import { FormattedMessage, useIntl } from "react-intl";
|
||||||
|
|
||||||
import { AttributeList_attributes_edges_node } from "../../types/AttributeList";
|
|
||||||
|
|
||||||
export interface AttributeListProps
|
export interface AttributeListProps
|
||||||
extends ListProps,
|
extends ListProps,
|
||||||
ListActions,
|
ListActions,
|
||||||
SortPage<AttributeListUrlSortField> {
|
SortPage<AttributeListUrlSortField> {
|
||||||
attributes: AttributeList_attributes_edges_node[];
|
attributes: AttributeFragment[];
|
||||||
}
|
}
|
||||||
|
|
||||||
const useStyles = makeStyles(
|
const useStyles = makeStyles(
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { Card } from "@material-ui/core";
|
import { Card } from "@material-ui/core";
|
||||||
import { AttributeListUrlSortField } from "@saleor/attributes/urls";
|
import { AttributeListUrlSortField } from "@saleor/attributes/urls";
|
||||||
import FilterBar from "@saleor/components/FilterBar";
|
import FilterBar from "@saleor/components/FilterBar";
|
||||||
|
import { AttributeFragment } from "@saleor/graphql";
|
||||||
import { sectionNames } from "@saleor/intl";
|
import { sectionNames } from "@saleor/intl";
|
||||||
import { Backlink, Button } from "@saleor/macaw-ui";
|
import { Backlink, Button } from "@saleor/macaw-ui";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
@ -15,7 +16,6 @@ import {
|
||||||
SortPage,
|
SortPage,
|
||||||
TabPageProps
|
TabPageProps
|
||||||
} from "../../../types";
|
} from "../../../types";
|
||||||
import { AttributeList_attributes_edges_node } from "../../types/AttributeList";
|
|
||||||
import AttributeList from "../AttributeList/AttributeList";
|
import AttributeList from "../AttributeList/AttributeList";
|
||||||
import {
|
import {
|
||||||
AttributeFilterKeys,
|
AttributeFilterKeys,
|
||||||
|
@ -29,7 +29,7 @@ export interface AttributeListPageProps
|
||||||
FilterPageProps<AttributeFilterKeys, AttributeListFilterOpts>,
|
FilterPageProps<AttributeFilterKeys, AttributeListFilterOpts>,
|
||||||
SortPage<AttributeListUrlSortField>,
|
SortPage<AttributeListUrlSortField>,
|
||||||
TabPageProps {
|
TabPageProps {
|
||||||
attributes: AttributeList_attributes_edges_node[];
|
attributes: AttributeFragment[];
|
||||||
onBack: () => void;
|
onBack: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { Card, CardContent, Typography } from "@material-ui/core";
|
import { Card, CardContent, Typography } from "@material-ui/core";
|
||||||
import CardTitle from "@saleor/components/CardTitle";
|
import CardTitle from "@saleor/components/CardTitle";
|
||||||
import RadioGroupField from "@saleor/components/RadioGroupField";
|
import RadioGroupField from "@saleor/components/RadioGroupField";
|
||||||
|
import { AttributeTypeEnum } from "@saleor/graphql";
|
||||||
import { makeStyles } from "@saleor/macaw-ui";
|
import { makeStyles } from "@saleor/macaw-ui";
|
||||||
import { AttributeTypeEnum } from "@saleor/types/globalTypes";
|
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { defineMessages, FormattedMessage, useIntl } from "react-intl";
|
import { defineMessages, FormattedMessage, useIntl } from "react-intl";
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import { AttributeDetails_attribute_choices } from "@saleor/attributes/types/AttributeDetails";
|
|
||||||
import { ATTRIBUTE_TYPES_WITH_DEDICATED_VALUES } from "@saleor/attributes/utils/data";
|
import { ATTRIBUTE_TYPES_WITH_DEDICATED_VALUES } from "@saleor/attributes/utils/data";
|
||||||
import CardSpacer from "@saleor/components/CardSpacer";
|
import CardSpacer from "@saleor/components/CardSpacer";
|
||||||
import Container from "@saleor/components/Container";
|
import Container from "@saleor/components/Container";
|
||||||
|
@ -9,20 +8,20 @@ import { MetadataFormData } from "@saleor/components/Metadata/types";
|
||||||
import PageHeader from "@saleor/components/PageHeader";
|
import PageHeader from "@saleor/components/PageHeader";
|
||||||
import Savebar from "@saleor/components/Savebar";
|
import Savebar from "@saleor/components/Savebar";
|
||||||
import { ListSettingsUpdate } from "@saleor/components/TablePagination";
|
import { ListSettingsUpdate } from "@saleor/components/TablePagination";
|
||||||
import { AttributeDetailsFragment } from "@saleor/fragments/types/AttributeDetailsFragment";
|
|
||||||
import { AttributeErrorFragment } from "@saleor/fragments/types/AttributeErrorFragment";
|
|
||||||
import { SubmitPromise } from "@saleor/hooks/useForm";
|
|
||||||
import { sectionNames } from "@saleor/intl";
|
|
||||||
import { ConfirmButtonTransitionState } from "@saleor/macaw-ui";
|
|
||||||
import { Backlink } from "@saleor/macaw-ui";
|
|
||||||
import { maybe } from "@saleor/misc";
|
|
||||||
import { ListSettings, ReorderAction } from "@saleor/types";
|
|
||||||
import {
|
import {
|
||||||
|
AttributeDetailsFragment,
|
||||||
|
AttributeDetailsQuery,
|
||||||
AttributeEntityTypeEnum,
|
AttributeEntityTypeEnum,
|
||||||
|
AttributeErrorFragment,
|
||||||
AttributeInputTypeEnum,
|
AttributeInputTypeEnum,
|
||||||
AttributeTypeEnum,
|
AttributeTypeEnum,
|
||||||
MeasurementUnitsEnum
|
MeasurementUnitsEnum
|
||||||
} from "@saleor/types/globalTypes";
|
} from "@saleor/graphql";
|
||||||
|
import { SubmitPromise } from "@saleor/hooks/useForm";
|
||||||
|
import { sectionNames } from "@saleor/intl";
|
||||||
|
import { Backlink, ConfirmButtonTransitionState } from "@saleor/macaw-ui";
|
||||||
|
import { maybe } from "@saleor/misc";
|
||||||
|
import { ListSettings, ReorderAction } from "@saleor/types";
|
||||||
import { mapEdgesToItems, mapMetadataItemToInput } from "@saleor/utils/maps";
|
import { mapEdgesToItems, mapMetadataItemToInput } from "@saleor/utils/maps";
|
||||||
import useMetadataChangeTrigger from "@saleor/utils/metadata/useMetadataChangeTrigger";
|
import useMetadataChangeTrigger from "@saleor/utils/metadata/useMetadataChangeTrigger";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
@ -39,7 +38,7 @@ export interface AttributePageProps {
|
||||||
disabled: boolean;
|
disabled: boolean;
|
||||||
errors: AttributeErrorFragment[];
|
errors: AttributeErrorFragment[];
|
||||||
saveButtonBarState: ConfirmButtonTransitionState;
|
saveButtonBarState: ConfirmButtonTransitionState;
|
||||||
values: AttributeDetails_attribute_choices;
|
values: AttributeDetailsQuery["attribute"]["choices"];
|
||||||
onBack: () => void;
|
onBack: () => void;
|
||||||
onDelete: () => void;
|
onDelete: () => void;
|
||||||
onSubmit: (data: AttributePageFormData) => SubmitPromise;
|
onSubmit: (data: AttributePageFormData) => SubmitPromise;
|
||||||
|
|
|
@ -6,9 +6,8 @@ import ControlledCheckbox from "@saleor/components/ControlledCheckbox";
|
||||||
import ControlledSwitch from "@saleor/components/ControlledSwitch";
|
import ControlledSwitch from "@saleor/components/ControlledSwitch";
|
||||||
import FormSpacer from "@saleor/components/FormSpacer";
|
import FormSpacer from "@saleor/components/FormSpacer";
|
||||||
import Hr from "@saleor/components/Hr";
|
import Hr from "@saleor/components/Hr";
|
||||||
import { AttributeErrorFragment } from "@saleor/fragments/types/AttributeErrorFragment";
|
import { AttributeErrorFragment, AttributeTypeEnum } from "@saleor/graphql";
|
||||||
import { commonMessages } from "@saleor/intl";
|
import { commonMessages } from "@saleor/intl";
|
||||||
import { AttributeTypeEnum } from "@saleor/types/globalTypes";
|
|
||||||
import { getFormErrors } from "@saleor/utils/errors";
|
import { getFormErrors } from "@saleor/utils/errors";
|
||||||
import getAttributeErrorMessage from "@saleor/utils/errors/attribute";
|
import getAttributeErrorMessage from "@saleor/utils/errors/attribute";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { AttributeValueEditDialogFormData } from "@saleor/attributes/utils/data"
|
||||||
import { ColorPicker } from "@saleor/components/ColorPicker";
|
import { ColorPicker } from "@saleor/components/ColorPicker";
|
||||||
import FileUploadField from "@saleor/components/FileUploadField";
|
import FileUploadField from "@saleor/components/FileUploadField";
|
||||||
import { RadioGroupField } from "@saleor/components/RadioGroupField";
|
import { RadioGroupField } from "@saleor/components/RadioGroupField";
|
||||||
import { useFileUploadMutation } from "@saleor/files/mutations";
|
import { useFileUploadMutation } from "@saleor/graphql";
|
||||||
import { UseFormResult } from "@saleor/hooks/useForm";
|
import { UseFormResult } from "@saleor/hooks/useForm";
|
||||||
import useNotifier from "@saleor/hooks/useNotifier";
|
import useNotifier from "@saleor/hooks/useNotifier";
|
||||||
import { errorMessages } from "@saleor/intl";
|
import { errorMessages } from "@saleor/intl";
|
||||||
|
|
|
@ -9,11 +9,13 @@ import { getAttributeValueErrorMessage } from "@saleor/attributes/errors";
|
||||||
import BackButton from "@saleor/components/BackButton";
|
import BackButton from "@saleor/components/BackButton";
|
||||||
import ConfirmButton from "@saleor/components/ConfirmButton";
|
import ConfirmButton from "@saleor/components/ConfirmButton";
|
||||||
import Form from "@saleor/components/Form";
|
import Form from "@saleor/components/Form";
|
||||||
import { AttributeErrorFragment } from "@saleor/fragments/types/AttributeErrorFragment";
|
import {
|
||||||
|
AttributeErrorFragment,
|
||||||
|
AttributeInputTypeEnum
|
||||||
|
} from "@saleor/graphql";
|
||||||
import useModalDialogErrors from "@saleor/hooks/useModalDialogErrors";
|
import useModalDialogErrors from "@saleor/hooks/useModalDialogErrors";
|
||||||
import { buttonMessages } from "@saleor/intl";
|
import { buttonMessages } from "@saleor/intl";
|
||||||
import { ConfirmButtonTransitionState } from "@saleor/macaw-ui";
|
import { ConfirmButtonTransitionState } from "@saleor/macaw-ui";
|
||||||
import { AttributeInputTypeEnum } from "@saleor/types/globalTypes";
|
|
||||||
import { getFormErrors } from "@saleor/utils/errors";
|
import { getFormErrors } from "@saleor/utils/errors";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { FormattedMessage, useIntl } from "react-intl";
|
import { FormattedMessage, useIntl } from "react-intl";
|
||||||
|
|
|
@ -13,18 +13,20 @@ import {
|
||||||
SortableTableRow
|
SortableTableRow
|
||||||
} from "@saleor/components/SortableTable";
|
} from "@saleor/components/SortableTable";
|
||||||
import TablePagination from "@saleor/components/TablePagination";
|
import TablePagination from "@saleor/components/TablePagination";
|
||||||
import { AttributeValueListFragment_edges_node } from "@saleor/fragments/types/AttributeValueListFragment";
|
import {
|
||||||
|
AttributeInputTypeEnum,
|
||||||
|
AttributeValueListFragment
|
||||||
|
} from "@saleor/graphql";
|
||||||
import { Button, DeleteIcon, IconButton, makeStyles } from "@saleor/macaw-ui";
|
import { Button, DeleteIcon, IconButton, makeStyles } from "@saleor/macaw-ui";
|
||||||
import { renderCollection, stopPropagation } from "@saleor/misc";
|
import { renderCollection, stopPropagation } from "@saleor/misc";
|
||||||
import { ListProps, ReorderAction } from "@saleor/types";
|
import { ListProps, RelayToFlat, ReorderAction } from "@saleor/types";
|
||||||
import { AttributeInputTypeEnum } from "@saleor/types/globalTypes";
|
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { FormattedMessage, useIntl } from "react-intl";
|
import { FormattedMessage, useIntl } from "react-intl";
|
||||||
|
|
||||||
export interface AttributeValuesProps
|
export interface AttributeValuesProps
|
||||||
extends Pick<ListProps, Exclude<keyof ListProps, "onRowClick">> {
|
extends Pick<ListProps, Exclude<keyof ListProps, "onRowClick">> {
|
||||||
disabled: boolean;
|
disabled: boolean;
|
||||||
values: AttributeValueListFragment_edges_node[];
|
values: RelayToFlat<AttributeValueListFragment>;
|
||||||
onValueAdd: () => void;
|
onValueAdd: () => void;
|
||||||
onValueDelete: (id: string) => void;
|
onValueDelete: (id: string) => void;
|
||||||
onValueReorder: ReorderAction;
|
onValueReorder: ReorderAction;
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import { AttributeErrorFragment } from "@saleor/fragments/types/AttributeErrorFragment";
|
import { AttributeErrorCode, AttributeErrorFragment } from "@saleor/graphql";
|
||||||
import { AttributeErrorCode } from "@saleor/types/globalTypes";
|
|
||||||
import getAttributeErrorMessage from "@saleor/utils/errors/attribute";
|
import getAttributeErrorMessage from "@saleor/utils/errors/attribute";
|
||||||
import { defineMessages, IntlShape } from "react-intl";
|
import { defineMessages, IntlShape } from "react-intl";
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,97 +1,39 @@
|
||||||
import { gql } from "@apollo/client";
|
import { gql } from "@apollo/client";
|
||||||
import {
|
|
||||||
attributeDetailsFragment,
|
|
||||||
attributeValueListFragment
|
|
||||||
} from "@saleor/fragments/attributes";
|
|
||||||
import { attributeErrorFragment } from "@saleor/fragments/errors";
|
|
||||||
import { pageInfoFragment } from "@saleor/fragments/pageInfo";
|
|
||||||
import makeMutation from "@saleor/hooks/makeMutation";
|
|
||||||
|
|
||||||
import {
|
export const attributeBulkDelete = gql`
|
||||||
AttributeBulkDelete,
|
|
||||||
AttributeBulkDeleteVariables
|
|
||||||
} from "./types/AttributeBulkDelete";
|
|
||||||
import {
|
|
||||||
AttributeCreate,
|
|
||||||
AttributeCreateVariables
|
|
||||||
} from "./types/AttributeCreate";
|
|
||||||
import {
|
|
||||||
AttributeDelete,
|
|
||||||
AttributeDeleteVariables
|
|
||||||
} from "./types/AttributeDelete";
|
|
||||||
import {
|
|
||||||
AttributeUpdate,
|
|
||||||
AttributeUpdateVariables
|
|
||||||
} from "./types/AttributeUpdate";
|
|
||||||
import {
|
|
||||||
AttributeValueCreate,
|
|
||||||
AttributeValueCreateVariables
|
|
||||||
} from "./types/AttributeValueCreate";
|
|
||||||
import {
|
|
||||||
AttributeValueDelete,
|
|
||||||
AttributeValueDeleteVariables
|
|
||||||
} from "./types/AttributeValueDelete";
|
|
||||||
import {
|
|
||||||
AttributeValueReorder,
|
|
||||||
AttributeValueReorderVariables
|
|
||||||
} from "./types/AttributeValueReorder";
|
|
||||||
import {
|
|
||||||
AttributeValueUpdate,
|
|
||||||
AttributeValueUpdateVariables
|
|
||||||
} from "./types/AttributeValueUpdate";
|
|
||||||
|
|
||||||
const attributeBulkDelete = gql`
|
|
||||||
${attributeErrorFragment}
|
|
||||||
mutation AttributeBulkDelete($ids: [ID!]!) {
|
mutation AttributeBulkDelete($ids: [ID!]!) {
|
||||||
attributeBulkDelete(ids: $ids) {
|
attributeBulkDelete(ids: $ids) {
|
||||||
errors {
|
errors {
|
||||||
...AttributeErrorFragment
|
...AttributeError
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
export const useAttributeBulkDeleteMutation = makeMutation<
|
|
||||||
AttributeBulkDelete,
|
|
||||||
AttributeBulkDeleteVariables
|
|
||||||
>(attributeBulkDelete);
|
|
||||||
|
|
||||||
const attributeDelete = gql`
|
export const attributeDelete = gql`
|
||||||
${attributeErrorFragment}
|
|
||||||
mutation AttributeDelete($id: ID!) {
|
mutation AttributeDelete($id: ID!) {
|
||||||
attributeDelete(id: $id) {
|
attributeDelete(id: $id) {
|
||||||
errors {
|
errors {
|
||||||
...AttributeErrorFragment
|
...AttributeError
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
export const useAttributeDeleteMutation = makeMutation<
|
|
||||||
AttributeDelete,
|
|
||||||
AttributeDeleteVariables
|
|
||||||
>(attributeDelete);
|
|
||||||
|
|
||||||
export const attributeUpdateMutation = gql`
|
export const attributeUpdateMutation = gql`
|
||||||
${attributeDetailsFragment}
|
|
||||||
${attributeErrorFragment}
|
|
||||||
mutation AttributeUpdate($id: ID!, $input: AttributeUpdateInput!) {
|
mutation AttributeUpdate($id: ID!, $input: AttributeUpdateInput!) {
|
||||||
attributeUpdate(id: $id, input: $input) {
|
attributeUpdate(id: $id, input: $input) {
|
||||||
attribute {
|
attribute {
|
||||||
...AttributeDetailsFragment
|
...AttributeDetails
|
||||||
}
|
}
|
||||||
errors {
|
errors {
|
||||||
...AttributeErrorFragment
|
...AttributeError
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
export const useAttributeUpdateMutation = makeMutation<
|
|
||||||
AttributeUpdate,
|
|
||||||
AttributeUpdateVariables
|
|
||||||
>(attributeUpdateMutation);
|
|
||||||
|
|
||||||
const attributeValueDelete = gql`
|
export const attributeValueDelete = gql`
|
||||||
${attributeValueListFragment}
|
|
||||||
${attributeErrorFragment}
|
|
||||||
mutation AttributeValueDelete(
|
mutation AttributeValueDelete(
|
||||||
$id: ID!
|
$id: ID!
|
||||||
$firstValues: Int
|
$firstValues: Int
|
||||||
|
@ -108,23 +50,17 @@ const attributeValueDelete = gql`
|
||||||
last: $lastValues
|
last: $lastValues
|
||||||
before: $beforeValues
|
before: $beforeValues
|
||||||
) {
|
) {
|
||||||
...AttributeValueListFragment
|
...AttributeValueList
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
errors {
|
errors {
|
||||||
...AttributeErrorFragment
|
...AttributeError
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
export const useAttributeValueDeleteMutation = makeMutation<
|
|
||||||
AttributeValueDelete,
|
|
||||||
AttributeValueDeleteVariables
|
|
||||||
>(attributeValueDelete);
|
|
||||||
|
|
||||||
export const attributeValueUpdateMutation = gql`
|
export const attributeValueUpdateMutation = gql`
|
||||||
${attributeValueListFragment}
|
|
||||||
${attributeErrorFragment}
|
|
||||||
mutation AttributeValueUpdate(
|
mutation AttributeValueUpdate(
|
||||||
$id: ID!
|
$id: ID!
|
||||||
$input: AttributeValueUpdateInput!
|
$input: AttributeValueUpdateInput!
|
||||||
|
@ -142,23 +78,17 @@ export const attributeValueUpdateMutation = gql`
|
||||||
last: $lastValues
|
last: $lastValues
|
||||||
before: $beforeValues
|
before: $beforeValues
|
||||||
) {
|
) {
|
||||||
...AttributeValueListFragment
|
...AttributeValueList
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
errors {
|
errors {
|
||||||
...AttributeErrorFragment
|
...AttributeError
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
export const useAttributeValueUpdateMutation = makeMutation<
|
|
||||||
AttributeValueUpdate,
|
|
||||||
AttributeValueUpdateVariables
|
|
||||||
>(attributeValueUpdateMutation);
|
|
||||||
|
|
||||||
export const attributeValueCreateMutation = gql`
|
export const attributeValueCreateMutation = gql`
|
||||||
${attributeValueListFragment}
|
|
||||||
${attributeErrorFragment}
|
|
||||||
mutation AttributeValueCreate(
|
mutation AttributeValueCreate(
|
||||||
$id: ID!
|
$id: ID!
|
||||||
$input: AttributeValueCreateInput!
|
$input: AttributeValueCreateInput!
|
||||||
|
@ -176,41 +106,30 @@ export const attributeValueCreateMutation = gql`
|
||||||
last: $lastValues
|
last: $lastValues
|
||||||
before: $beforeValues
|
before: $beforeValues
|
||||||
) {
|
) {
|
||||||
...AttributeValueListFragment
|
...AttributeValueList
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
errors {
|
errors {
|
||||||
...AttributeErrorFragment
|
...AttributeError
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
export const useAttributeValueCreateMutation = makeMutation<
|
|
||||||
AttributeValueCreate,
|
|
||||||
AttributeValueCreateVariables
|
|
||||||
>(attributeValueCreateMutation);
|
|
||||||
|
|
||||||
export const attributeCreateMutation = gql`
|
export const attributeCreateMutation = gql`
|
||||||
${attributeErrorFragment}
|
|
||||||
mutation AttributeCreate($input: AttributeCreateInput!) {
|
mutation AttributeCreate($input: AttributeCreateInput!) {
|
||||||
attributeCreate(input: $input) {
|
attributeCreate(input: $input) {
|
||||||
attribute {
|
attribute {
|
||||||
id
|
id
|
||||||
}
|
}
|
||||||
errors {
|
errors {
|
||||||
...AttributeErrorFragment
|
...AttributeError
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
export const useAttributeCreateMutation = makeMutation<
|
|
||||||
AttributeCreate,
|
|
||||||
AttributeCreateVariables
|
|
||||||
>(attributeCreateMutation);
|
|
||||||
|
|
||||||
const attributeValueReorderMutation = gql`
|
export const attributeValueReorderMutation = gql`
|
||||||
${attributeErrorFragment}
|
|
||||||
${pageInfoFragment}
|
|
||||||
mutation AttributeValueReorder(
|
mutation AttributeValueReorder(
|
||||||
$id: ID!
|
$id: ID!
|
||||||
$move: ReorderInput!
|
$move: ReorderInput!
|
||||||
|
@ -229,7 +148,7 @@ const attributeValueReorderMutation = gql`
|
||||||
before: $beforeValues
|
before: $beforeValues
|
||||||
) {
|
) {
|
||||||
pageInfo {
|
pageInfo {
|
||||||
...PageInfoFragment
|
...PageInfo
|
||||||
}
|
}
|
||||||
edges {
|
edges {
|
||||||
cursor
|
cursor
|
||||||
|
@ -240,12 +159,8 @@ const attributeValueReorderMutation = gql`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
errors {
|
errors {
|
||||||
...AttributeErrorFragment
|
...AttributeError
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
export const useAttributeValueReorderMutation = makeMutation<
|
|
||||||
AttributeValueReorder,
|
|
||||||
AttributeValueReorderVariables
|
|
||||||
>(attributeValueReorderMutation);
|
|
||||||
|
|
|
@ -1,21 +1,6 @@
|
||||||
import { gql } from "@apollo/client";
|
import { gql } from "@apollo/client";
|
||||||
import {
|
|
||||||
attributeDetailsFragment,
|
|
||||||
attributeFragment,
|
|
||||||
attributeValueListFragment
|
|
||||||
} from "@saleor/fragments/attributes";
|
|
||||||
import { pageInfoFragment } from "@saleor/fragments/pageInfo";
|
|
||||||
import makeQuery from "@saleor/hooks/makeQuery";
|
|
||||||
|
|
||||||
import {
|
export const attributeDetails = gql`
|
||||||
AttributeDetails,
|
|
||||||
AttributeDetailsVariables
|
|
||||||
} from "./types/AttributeDetails";
|
|
||||||
import { AttributeList, AttributeListVariables } from "./types/AttributeList";
|
|
||||||
|
|
||||||
const attributeDetails = gql`
|
|
||||||
${attributeDetailsFragment}
|
|
||||||
${attributeValueListFragment}
|
|
||||||
query AttributeDetails(
|
query AttributeDetails(
|
||||||
$id: ID!
|
$id: ID!
|
||||||
$firstValues: Int
|
$firstValues: Int
|
||||||
|
@ -24,26 +9,20 @@ const attributeDetails = gql`
|
||||||
$beforeValues: String
|
$beforeValues: String
|
||||||
) {
|
) {
|
||||||
attribute(id: $id) {
|
attribute(id: $id) {
|
||||||
...AttributeDetailsFragment
|
...AttributeDetails
|
||||||
choices(
|
choices(
|
||||||
first: $firstValues
|
first: $firstValues
|
||||||
after: $afterValues
|
after: $afterValues
|
||||||
last: $lastValues
|
last: $lastValues
|
||||||
before: $beforeValues
|
before: $beforeValues
|
||||||
) {
|
) {
|
||||||
...AttributeValueListFragment
|
...AttributeValueList
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
export const useAttributeDetailsQuery = makeQuery<
|
|
||||||
AttributeDetails,
|
|
||||||
AttributeDetailsVariables
|
|
||||||
>(attributeDetails);
|
|
||||||
|
|
||||||
const attributeList = gql`
|
export const attributeList = gql`
|
||||||
${attributeFragment}
|
|
||||||
${pageInfoFragment}
|
|
||||||
query AttributeList(
|
query AttributeList(
|
||||||
$filter: AttributeFilterInput
|
$filter: AttributeFilterInput
|
||||||
$before: String
|
$before: String
|
||||||
|
@ -62,16 +41,12 @@ const attributeList = gql`
|
||||||
) {
|
) {
|
||||||
edges {
|
edges {
|
||||||
node {
|
node {
|
||||||
...AttributeFragment
|
...Attribute
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pageInfo {
|
pageInfo {
|
||||||
...PageInfoFragment
|
...PageInfo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
export const useAttributeListQuery = makeQuery<
|
|
||||||
AttributeList,
|
|
||||||
AttributeListVariables
|
|
||||||
>(attributeList);
|
|
||||||
|
|
|
@ -1,30 +0,0 @@
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
// @generated
|
|
||||||
// This file was automatically generated and should not be edited.
|
|
||||||
|
|
||||||
import { AttributeErrorCode } from "./../../types/globalTypes";
|
|
||||||
|
|
||||||
// ====================================================
|
|
||||||
// GraphQL mutation operation: AttributeBulkDelete
|
|
||||||
// ====================================================
|
|
||||||
|
|
||||||
export interface AttributeBulkDelete_attributeBulkDelete_errors {
|
|
||||||
__typename: "AttributeError";
|
|
||||||
code: AttributeErrorCode;
|
|
||||||
field: string | null;
|
|
||||||
message: string | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeBulkDelete_attributeBulkDelete {
|
|
||||||
__typename: "AttributeBulkDelete";
|
|
||||||
errors: AttributeBulkDelete_attributeBulkDelete_errors[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeBulkDelete {
|
|
||||||
attributeBulkDelete: AttributeBulkDelete_attributeBulkDelete | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeBulkDeleteVariables {
|
|
||||||
ids: string[];
|
|
||||||
}
|
|
|
@ -1,36 +0,0 @@
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
// @generated
|
|
||||||
// This file was automatically generated and should not be edited.
|
|
||||||
|
|
||||||
import { AttributeCreateInput, AttributeErrorCode } from "./../../types/globalTypes";
|
|
||||||
|
|
||||||
// ====================================================
|
|
||||||
// GraphQL mutation operation: AttributeCreate
|
|
||||||
// ====================================================
|
|
||||||
|
|
||||||
export interface AttributeCreate_attributeCreate_attribute {
|
|
||||||
__typename: "Attribute";
|
|
||||||
id: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeCreate_attributeCreate_errors {
|
|
||||||
__typename: "AttributeError";
|
|
||||||
code: AttributeErrorCode;
|
|
||||||
field: string | null;
|
|
||||||
message: string | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeCreate_attributeCreate {
|
|
||||||
__typename: "AttributeCreate";
|
|
||||||
attribute: AttributeCreate_attributeCreate_attribute | null;
|
|
||||||
errors: AttributeCreate_attributeCreate_errors[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeCreate {
|
|
||||||
attributeCreate: AttributeCreate_attributeCreate | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeCreateVariables {
|
|
||||||
input: AttributeCreateInput;
|
|
||||||
}
|
|
|
@ -1,30 +0,0 @@
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
// @generated
|
|
||||||
// This file was automatically generated and should not be edited.
|
|
||||||
|
|
||||||
import { AttributeErrorCode } from "./../../types/globalTypes";
|
|
||||||
|
|
||||||
// ====================================================
|
|
||||||
// GraphQL mutation operation: AttributeDelete
|
|
||||||
// ====================================================
|
|
||||||
|
|
||||||
export interface AttributeDelete_attributeDelete_errors {
|
|
||||||
__typename: "AttributeError";
|
|
||||||
code: AttributeErrorCode;
|
|
||||||
field: string | null;
|
|
||||||
message: string | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeDelete_attributeDelete {
|
|
||||||
__typename: "AttributeDelete";
|
|
||||||
errors: AttributeDelete_attributeDelete_errors[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeDelete {
|
|
||||||
attributeDelete: AttributeDelete_attributeDelete | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeDeleteVariables {
|
|
||||||
id: string;
|
|
||||||
}
|
|
|
@ -1,94 +0,0 @@
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
// @generated
|
|
||||||
// This file was automatically generated and should not be edited.
|
|
||||||
|
|
||||||
import { AttributeTypeEnum, MeasurementUnitsEnum, AttributeInputTypeEnum, AttributeEntityTypeEnum } from "./../../types/globalTypes";
|
|
||||||
|
|
||||||
// ====================================================
|
|
||||||
// GraphQL query operation: AttributeDetails
|
|
||||||
// ====================================================
|
|
||||||
|
|
||||||
export interface AttributeDetails_attribute_metadata {
|
|
||||||
__typename: "MetadataItem";
|
|
||||||
key: string;
|
|
||||||
value: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeDetails_attribute_privateMetadata {
|
|
||||||
__typename: "MetadataItem";
|
|
||||||
key: string;
|
|
||||||
value: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeDetails_attribute_choices_pageInfo {
|
|
||||||
__typename: "PageInfo";
|
|
||||||
endCursor: string | null;
|
|
||||||
hasNextPage: boolean;
|
|
||||||
hasPreviousPage: boolean;
|
|
||||||
startCursor: string | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeDetails_attribute_choices_edges_node_file {
|
|
||||||
__typename: "File";
|
|
||||||
url: string;
|
|
||||||
contentType: string | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeDetails_attribute_choices_edges_node {
|
|
||||||
__typename: "AttributeValue";
|
|
||||||
id: string;
|
|
||||||
name: string | null;
|
|
||||||
slug: string | null;
|
|
||||||
file: AttributeDetails_attribute_choices_edges_node_file | null;
|
|
||||||
reference: string | null;
|
|
||||||
boolean: boolean | null;
|
|
||||||
date: any | null;
|
|
||||||
dateTime: any | null;
|
|
||||||
value: string | null;
|
|
||||||
richText: any | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeDetails_attribute_choices_edges {
|
|
||||||
__typename: "AttributeValueCountableEdge";
|
|
||||||
cursor: string;
|
|
||||||
node: AttributeDetails_attribute_choices_edges_node;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeDetails_attribute_choices {
|
|
||||||
__typename: "AttributeValueCountableConnection";
|
|
||||||
pageInfo: AttributeDetails_attribute_choices_pageInfo;
|
|
||||||
edges: AttributeDetails_attribute_choices_edges[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeDetails_attribute {
|
|
||||||
__typename: "Attribute";
|
|
||||||
id: string;
|
|
||||||
name: string | null;
|
|
||||||
slug: string | null;
|
|
||||||
type: AttributeTypeEnum | null;
|
|
||||||
visibleInStorefront: boolean;
|
|
||||||
filterableInDashboard: boolean;
|
|
||||||
filterableInStorefront: boolean;
|
|
||||||
unit: MeasurementUnitsEnum | null;
|
|
||||||
inputType: AttributeInputTypeEnum | null;
|
|
||||||
metadata: (AttributeDetails_attribute_metadata | null)[];
|
|
||||||
privateMetadata: (AttributeDetails_attribute_privateMetadata | null)[];
|
|
||||||
availableInGrid: boolean;
|
|
||||||
entityType: AttributeEntityTypeEnum | null;
|
|
||||||
storefrontSearchPosition: number;
|
|
||||||
valueRequired: boolean;
|
|
||||||
choices: AttributeDetails_attribute_choices | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeDetails {
|
|
||||||
attribute: AttributeDetails_attribute | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeDetailsVariables {
|
|
||||||
id: string;
|
|
||||||
firstValues?: number | null;
|
|
||||||
afterValues?: string | null;
|
|
||||||
lastValues?: number | null;
|
|
||||||
beforeValues?: string | null;
|
|
||||||
}
|
|
|
@ -1,55 +0,0 @@
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
// @generated
|
|
||||||
// This file was automatically generated and should not be edited.
|
|
||||||
|
|
||||||
import { AttributeFilterInput, AttributeSortingInput, AttributeTypeEnum, MeasurementUnitsEnum, AttributeInputTypeEnum } from "./../../types/globalTypes";
|
|
||||||
|
|
||||||
// ====================================================
|
|
||||||
// GraphQL query operation: AttributeList
|
|
||||||
// ====================================================
|
|
||||||
|
|
||||||
export interface AttributeList_attributes_edges_node {
|
|
||||||
__typename: "Attribute";
|
|
||||||
id: string;
|
|
||||||
name: string | null;
|
|
||||||
slug: string | null;
|
|
||||||
type: AttributeTypeEnum | null;
|
|
||||||
visibleInStorefront: boolean;
|
|
||||||
filterableInDashboard: boolean;
|
|
||||||
filterableInStorefront: boolean;
|
|
||||||
unit: MeasurementUnitsEnum | null;
|
|
||||||
inputType: AttributeInputTypeEnum | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeList_attributes_edges {
|
|
||||||
__typename: "AttributeCountableEdge";
|
|
||||||
node: AttributeList_attributes_edges_node;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeList_attributes_pageInfo {
|
|
||||||
__typename: "PageInfo";
|
|
||||||
endCursor: string | null;
|
|
||||||
hasNextPage: boolean;
|
|
||||||
hasPreviousPage: boolean;
|
|
||||||
startCursor: string | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeList_attributes {
|
|
||||||
__typename: "AttributeCountableConnection";
|
|
||||||
edges: AttributeList_attributes_edges[];
|
|
||||||
pageInfo: AttributeList_attributes_pageInfo;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeList {
|
|
||||||
attributes: AttributeList_attributes | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeListVariables {
|
|
||||||
filter?: AttributeFilterInput | null;
|
|
||||||
before?: string | null;
|
|
||||||
after?: string | null;
|
|
||||||
first?: number | null;
|
|
||||||
last?: number | null;
|
|
||||||
sort?: AttributeSortingInput | null;
|
|
||||||
}
|
|
|
@ -1,3 +0,0 @@
|
||||||
import { AttributeValueInput } from "@saleor/types/globalTypes";
|
|
||||||
|
|
||||||
export type AtributesOfFiles = Pick<AttributeValueInput, "file" | "id" | "values" | "contentType">
|
|
|
@ -1,63 +0,0 @@
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
// @generated
|
|
||||||
// This file was automatically generated and should not be edited.
|
|
||||||
|
|
||||||
import { AttributeUpdateInput, AttributeTypeEnum, MeasurementUnitsEnum, AttributeInputTypeEnum, AttributeEntityTypeEnum, AttributeErrorCode } from "./../../types/globalTypes";
|
|
||||||
|
|
||||||
// ====================================================
|
|
||||||
// GraphQL mutation operation: AttributeUpdate
|
|
||||||
// ====================================================
|
|
||||||
|
|
||||||
export interface AttributeUpdate_attributeUpdate_attribute_metadata {
|
|
||||||
__typename: "MetadataItem";
|
|
||||||
key: string;
|
|
||||||
value: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeUpdate_attributeUpdate_attribute_privateMetadata {
|
|
||||||
__typename: "MetadataItem";
|
|
||||||
key: string;
|
|
||||||
value: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeUpdate_attributeUpdate_attribute {
|
|
||||||
__typename: "Attribute";
|
|
||||||
id: string;
|
|
||||||
name: string | null;
|
|
||||||
slug: string | null;
|
|
||||||
type: AttributeTypeEnum | null;
|
|
||||||
visibleInStorefront: boolean;
|
|
||||||
filterableInDashboard: boolean;
|
|
||||||
filterableInStorefront: boolean;
|
|
||||||
unit: MeasurementUnitsEnum | null;
|
|
||||||
inputType: AttributeInputTypeEnum | null;
|
|
||||||
metadata: (AttributeUpdate_attributeUpdate_attribute_metadata | null)[];
|
|
||||||
privateMetadata: (AttributeUpdate_attributeUpdate_attribute_privateMetadata | null)[];
|
|
||||||
availableInGrid: boolean;
|
|
||||||
entityType: AttributeEntityTypeEnum | null;
|
|
||||||
storefrontSearchPosition: number;
|
|
||||||
valueRequired: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeUpdate_attributeUpdate_errors {
|
|
||||||
__typename: "AttributeError";
|
|
||||||
code: AttributeErrorCode;
|
|
||||||
field: string | null;
|
|
||||||
message: string | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeUpdate_attributeUpdate {
|
|
||||||
__typename: "AttributeUpdate";
|
|
||||||
attribute: AttributeUpdate_attributeUpdate_attribute | null;
|
|
||||||
errors: AttributeUpdate_attributeUpdate_errors[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeUpdate {
|
|
||||||
attributeUpdate: AttributeUpdate_attributeUpdate | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeUpdateVariables {
|
|
||||||
id: string;
|
|
||||||
input: AttributeUpdateInput;
|
|
||||||
}
|
|
|
@ -1,82 +0,0 @@
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
// @generated
|
|
||||||
// This file was automatically generated and should not be edited.
|
|
||||||
|
|
||||||
import { AttributeValueCreateInput, AttributeErrorCode } from "./../../types/globalTypes";
|
|
||||||
|
|
||||||
// ====================================================
|
|
||||||
// GraphQL mutation operation: AttributeValueCreate
|
|
||||||
// ====================================================
|
|
||||||
|
|
||||||
export interface AttributeValueCreate_attributeValueCreate_attribute_choices_pageInfo {
|
|
||||||
__typename: "PageInfo";
|
|
||||||
endCursor: string | null;
|
|
||||||
hasNextPage: boolean;
|
|
||||||
hasPreviousPage: boolean;
|
|
||||||
startCursor: string | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeValueCreate_attributeValueCreate_attribute_choices_edges_node_file {
|
|
||||||
__typename: "File";
|
|
||||||
url: string;
|
|
||||||
contentType: string | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeValueCreate_attributeValueCreate_attribute_choices_edges_node {
|
|
||||||
__typename: "AttributeValue";
|
|
||||||
id: string;
|
|
||||||
name: string | null;
|
|
||||||
slug: string | null;
|
|
||||||
file: AttributeValueCreate_attributeValueCreate_attribute_choices_edges_node_file | null;
|
|
||||||
reference: string | null;
|
|
||||||
boolean: boolean | null;
|
|
||||||
date: any | null;
|
|
||||||
dateTime: any | null;
|
|
||||||
value: string | null;
|
|
||||||
richText: any | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeValueCreate_attributeValueCreate_attribute_choices_edges {
|
|
||||||
__typename: "AttributeValueCountableEdge";
|
|
||||||
cursor: string;
|
|
||||||
node: AttributeValueCreate_attributeValueCreate_attribute_choices_edges_node;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeValueCreate_attributeValueCreate_attribute_choices {
|
|
||||||
__typename: "AttributeValueCountableConnection";
|
|
||||||
pageInfo: AttributeValueCreate_attributeValueCreate_attribute_choices_pageInfo;
|
|
||||||
edges: AttributeValueCreate_attributeValueCreate_attribute_choices_edges[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeValueCreate_attributeValueCreate_attribute {
|
|
||||||
__typename: "Attribute";
|
|
||||||
id: string;
|
|
||||||
choices: AttributeValueCreate_attributeValueCreate_attribute_choices | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeValueCreate_attributeValueCreate_errors {
|
|
||||||
__typename: "AttributeError";
|
|
||||||
code: AttributeErrorCode;
|
|
||||||
field: string | null;
|
|
||||||
message: string | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeValueCreate_attributeValueCreate {
|
|
||||||
__typename: "AttributeValueCreate";
|
|
||||||
attribute: AttributeValueCreate_attributeValueCreate_attribute | null;
|
|
||||||
errors: AttributeValueCreate_attributeValueCreate_errors[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeValueCreate {
|
|
||||||
attributeValueCreate: AttributeValueCreate_attributeValueCreate | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeValueCreateVariables {
|
|
||||||
id: string;
|
|
||||||
input: AttributeValueCreateInput;
|
|
||||||
firstValues?: number | null;
|
|
||||||
afterValues?: string | null;
|
|
||||||
lastValues?: number | null;
|
|
||||||
beforeValues?: string | null;
|
|
||||||
}
|
|
|
@ -1,81 +0,0 @@
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
// @generated
|
|
||||||
// This file was automatically generated and should not be edited.
|
|
||||||
|
|
||||||
import { AttributeErrorCode } from "./../../types/globalTypes";
|
|
||||||
|
|
||||||
// ====================================================
|
|
||||||
// GraphQL mutation operation: AttributeValueDelete
|
|
||||||
// ====================================================
|
|
||||||
|
|
||||||
export interface AttributeValueDelete_attributeValueDelete_attribute_choices_pageInfo {
|
|
||||||
__typename: "PageInfo";
|
|
||||||
endCursor: string | null;
|
|
||||||
hasNextPage: boolean;
|
|
||||||
hasPreviousPage: boolean;
|
|
||||||
startCursor: string | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeValueDelete_attributeValueDelete_attribute_choices_edges_node_file {
|
|
||||||
__typename: "File";
|
|
||||||
url: string;
|
|
||||||
contentType: string | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeValueDelete_attributeValueDelete_attribute_choices_edges_node {
|
|
||||||
__typename: "AttributeValue";
|
|
||||||
id: string;
|
|
||||||
name: string | null;
|
|
||||||
slug: string | null;
|
|
||||||
file: AttributeValueDelete_attributeValueDelete_attribute_choices_edges_node_file | null;
|
|
||||||
reference: string | null;
|
|
||||||
boolean: boolean | null;
|
|
||||||
date: any | null;
|
|
||||||
dateTime: any | null;
|
|
||||||
value: string | null;
|
|
||||||
richText: any | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeValueDelete_attributeValueDelete_attribute_choices_edges {
|
|
||||||
__typename: "AttributeValueCountableEdge";
|
|
||||||
cursor: string;
|
|
||||||
node: AttributeValueDelete_attributeValueDelete_attribute_choices_edges_node;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeValueDelete_attributeValueDelete_attribute_choices {
|
|
||||||
__typename: "AttributeValueCountableConnection";
|
|
||||||
pageInfo: AttributeValueDelete_attributeValueDelete_attribute_choices_pageInfo;
|
|
||||||
edges: AttributeValueDelete_attributeValueDelete_attribute_choices_edges[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeValueDelete_attributeValueDelete_attribute {
|
|
||||||
__typename: "Attribute";
|
|
||||||
id: string;
|
|
||||||
choices: AttributeValueDelete_attributeValueDelete_attribute_choices | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeValueDelete_attributeValueDelete_errors {
|
|
||||||
__typename: "AttributeError";
|
|
||||||
code: AttributeErrorCode;
|
|
||||||
field: string | null;
|
|
||||||
message: string | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeValueDelete_attributeValueDelete {
|
|
||||||
__typename: "AttributeValueDelete";
|
|
||||||
attribute: AttributeValueDelete_attributeValueDelete_attribute | null;
|
|
||||||
errors: AttributeValueDelete_attributeValueDelete_errors[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeValueDelete {
|
|
||||||
attributeValueDelete: AttributeValueDelete_attributeValueDelete | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeValueDeleteVariables {
|
|
||||||
id: string;
|
|
||||||
firstValues?: number | null;
|
|
||||||
afterValues?: string | null;
|
|
||||||
lastValues?: number | null;
|
|
||||||
beforeValues?: string | null;
|
|
||||||
}
|
|
|
@ -1,67 +0,0 @@
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
// @generated
|
|
||||||
// This file was automatically generated and should not be edited.
|
|
||||||
|
|
||||||
import { ReorderInput, AttributeErrorCode } from "./../../types/globalTypes";
|
|
||||||
|
|
||||||
// ====================================================
|
|
||||||
// GraphQL mutation operation: AttributeValueReorder
|
|
||||||
// ====================================================
|
|
||||||
|
|
||||||
export interface AttributeValueReorder_attributeReorderValues_attribute_choices_pageInfo {
|
|
||||||
__typename: "PageInfo";
|
|
||||||
endCursor: string | null;
|
|
||||||
hasNextPage: boolean;
|
|
||||||
hasPreviousPage: boolean;
|
|
||||||
startCursor: string | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeValueReorder_attributeReorderValues_attribute_choices_edges_node {
|
|
||||||
__typename: "AttributeValue";
|
|
||||||
id: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeValueReorder_attributeReorderValues_attribute_choices_edges {
|
|
||||||
__typename: "AttributeValueCountableEdge";
|
|
||||||
cursor: string;
|
|
||||||
node: AttributeValueReorder_attributeReorderValues_attribute_choices_edges_node;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeValueReorder_attributeReorderValues_attribute_choices {
|
|
||||||
__typename: "AttributeValueCountableConnection";
|
|
||||||
pageInfo: AttributeValueReorder_attributeReorderValues_attribute_choices_pageInfo;
|
|
||||||
edges: AttributeValueReorder_attributeReorderValues_attribute_choices_edges[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeValueReorder_attributeReorderValues_attribute {
|
|
||||||
__typename: "Attribute";
|
|
||||||
id: string;
|
|
||||||
choices: AttributeValueReorder_attributeReorderValues_attribute_choices | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeValueReorder_attributeReorderValues_errors {
|
|
||||||
__typename: "AttributeError";
|
|
||||||
code: AttributeErrorCode;
|
|
||||||
field: string | null;
|
|
||||||
message: string | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeValueReorder_attributeReorderValues {
|
|
||||||
__typename: "AttributeReorderValues";
|
|
||||||
attribute: AttributeValueReorder_attributeReorderValues_attribute | null;
|
|
||||||
errors: AttributeValueReorder_attributeReorderValues_errors[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeValueReorder {
|
|
||||||
attributeReorderValues: AttributeValueReorder_attributeReorderValues | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeValueReorderVariables {
|
|
||||||
id: string;
|
|
||||||
move: ReorderInput;
|
|
||||||
firstValues?: number | null;
|
|
||||||
afterValues?: string | null;
|
|
||||||
lastValues?: number | null;
|
|
||||||
beforeValues?: string | null;
|
|
||||||
}
|
|
|
@ -1,82 +0,0 @@
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
// @generated
|
|
||||||
// This file was automatically generated and should not be edited.
|
|
||||||
|
|
||||||
import { AttributeValueUpdateInput, AttributeErrorCode } from "./../../types/globalTypes";
|
|
||||||
|
|
||||||
// ====================================================
|
|
||||||
// GraphQL mutation operation: AttributeValueUpdate
|
|
||||||
// ====================================================
|
|
||||||
|
|
||||||
export interface AttributeValueUpdate_attributeValueUpdate_attribute_choices_pageInfo {
|
|
||||||
__typename: "PageInfo";
|
|
||||||
endCursor: string | null;
|
|
||||||
hasNextPage: boolean;
|
|
||||||
hasPreviousPage: boolean;
|
|
||||||
startCursor: string | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeValueUpdate_attributeValueUpdate_attribute_choices_edges_node_file {
|
|
||||||
__typename: "File";
|
|
||||||
url: string;
|
|
||||||
contentType: string | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeValueUpdate_attributeValueUpdate_attribute_choices_edges_node {
|
|
||||||
__typename: "AttributeValue";
|
|
||||||
id: string;
|
|
||||||
name: string | null;
|
|
||||||
slug: string | null;
|
|
||||||
file: AttributeValueUpdate_attributeValueUpdate_attribute_choices_edges_node_file | null;
|
|
||||||
reference: string | null;
|
|
||||||
boolean: boolean | null;
|
|
||||||
date: any | null;
|
|
||||||
dateTime: any | null;
|
|
||||||
value: string | null;
|
|
||||||
richText: any | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeValueUpdate_attributeValueUpdate_attribute_choices_edges {
|
|
||||||
__typename: "AttributeValueCountableEdge";
|
|
||||||
cursor: string;
|
|
||||||
node: AttributeValueUpdate_attributeValueUpdate_attribute_choices_edges_node;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeValueUpdate_attributeValueUpdate_attribute_choices {
|
|
||||||
__typename: "AttributeValueCountableConnection";
|
|
||||||
pageInfo: AttributeValueUpdate_attributeValueUpdate_attribute_choices_pageInfo;
|
|
||||||
edges: AttributeValueUpdate_attributeValueUpdate_attribute_choices_edges[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeValueUpdate_attributeValueUpdate_attribute {
|
|
||||||
__typename: "Attribute";
|
|
||||||
id: string;
|
|
||||||
choices: AttributeValueUpdate_attributeValueUpdate_attribute_choices | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeValueUpdate_attributeValueUpdate_errors {
|
|
||||||
__typename: "AttributeError";
|
|
||||||
code: AttributeErrorCode;
|
|
||||||
field: string | null;
|
|
||||||
message: string | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeValueUpdate_attributeValueUpdate {
|
|
||||||
__typename: "AttributeValueUpdate";
|
|
||||||
attribute: AttributeValueUpdate_attributeValueUpdate_attribute | null;
|
|
||||||
errors: AttributeValueUpdate_attributeValueUpdate_errors[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeValueUpdate {
|
|
||||||
attributeValueUpdate: AttributeValueUpdate_attributeValueUpdate | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AttributeValueUpdateVariables {
|
|
||||||
id: string;
|
|
||||||
input: AttributeValueUpdateInput;
|
|
||||||
firstValues?: number | null;
|
|
||||||
afterValues?: string | null;
|
|
||||||
lastValues?: number | null;
|
|
||||||
beforeValues?: string | null;
|
|
||||||
}
|
|
|
@ -3,22 +3,25 @@ import {
|
||||||
AttributeInput,
|
AttributeInput,
|
||||||
AttributeInputData
|
AttributeInputData
|
||||||
} from "@saleor/components/Attributes";
|
} from "@saleor/components/Attributes";
|
||||||
import { FileUpload } from "@saleor/files/types/FileUpload";
|
|
||||||
import { AttributeErrorFragment } from "@saleor/fragments/types/AttributeErrorFragment";
|
|
||||||
import { AttributeValueFragment } from "@saleor/fragments/types/AttributeValueFragment";
|
|
||||||
import { SelectedVariantAttributeFragment } from "@saleor/fragments/types/SelectedVariantAttributeFragment";
|
|
||||||
import { UploadErrorFragment } from "@saleor/fragments/types/UploadErrorFragment";
|
|
||||||
import { VariantAttributeFragment } from "@saleor/fragments/types/VariantAttributeFragment";
|
|
||||||
import { FormsetData } from "@saleor/hooks/useFormset";
|
|
||||||
import { PageDetails_page_attributes } from "@saleor/pages/types/PageDetails";
|
|
||||||
import { ProductDetails_product_attributes } from "@saleor/products/types/ProductDetails";
|
|
||||||
import { SearchPages_search_edges_node } from "@saleor/searches/types/SearchPages";
|
|
||||||
import { SearchProducts_search_edges_node } from "@saleor/searches/types/SearchProducts";
|
|
||||||
import {
|
import {
|
||||||
AttributeEntityTypeEnum,
|
AttributeEntityTypeEnum,
|
||||||
|
AttributeErrorFragment,
|
||||||
AttributeInputTypeEnum,
|
AttributeInputTypeEnum,
|
||||||
AttributeValueInput
|
AttributeValueDeleteMutation,
|
||||||
} from "@saleor/types/globalTypes";
|
AttributeValueFragment,
|
||||||
|
AttributeValueInput,
|
||||||
|
FileUploadMutation,
|
||||||
|
Node,
|
||||||
|
PageSelectedAttributeFragment,
|
||||||
|
ProductFragment,
|
||||||
|
SearchPagesQuery,
|
||||||
|
SearchProductsQuery,
|
||||||
|
SelectedVariantAttributeFragment,
|
||||||
|
UploadErrorFragment,
|
||||||
|
VariantAttributeFragment
|
||||||
|
} from "@saleor/graphql";
|
||||||
|
import { FormsetData } from "@saleor/hooks/useFormset";
|
||||||
|
import { RelayToFlat } from "@saleor/types";
|
||||||
import {
|
import {
|
||||||
mapEdgesToItems,
|
mapEdgesToItems,
|
||||||
mapNodeToChoice,
|
mapNodeToChoice,
|
||||||
|
@ -26,8 +29,11 @@ import {
|
||||||
} from "@saleor/utils/maps";
|
} from "@saleor/utils/maps";
|
||||||
|
|
||||||
import { AttributePageFormData } from "../components/AttributePage";
|
import { AttributePageFormData } from "../components/AttributePage";
|
||||||
import { AtributesOfFiles } from "../types/AttributeOfUploadedFile";
|
|
||||||
import { AttributeValueDelete } from "../types/AttributeValueDelete";
|
type AtributesOfFiles = Pick<
|
||||||
|
AttributeValueInput,
|
||||||
|
"file" | "id" | "values" | "contentType"
|
||||||
|
>;
|
||||||
|
|
||||||
export const ATTRIBUTE_TYPES_WITH_DEDICATED_VALUES = [
|
export const ATTRIBUTE_TYPES_WITH_DEDICATED_VALUES = [
|
||||||
AttributeInputTypeEnum.DROPDOWN,
|
AttributeInputTypeEnum.DROPDOWN,
|
||||||
|
@ -145,8 +151,8 @@ export function getDefaultAttributeValues(attribute: VariantAttributeFragment) {
|
||||||
|
|
||||||
export function getSelectedAttributeValues(
|
export function getSelectedAttributeValues(
|
||||||
attribute:
|
attribute:
|
||||||
| PageDetails_page_attributes
|
| PageSelectedAttributeFragment
|
||||||
| ProductDetails_product_attributes
|
| ProductFragment["attributes"][0]
|
||||||
| SelectedVariantAttributeFragment
|
| SelectedVariantAttributeFragment
|
||||||
) {
|
) {
|
||||||
switch (attribute.attribute.inputType) {
|
switch (attribute.attribute.inputType) {
|
||||||
|
@ -176,8 +182,8 @@ export function getSelectedAttributeValues(
|
||||||
export const isFileValueUnused = (
|
export const isFileValueUnused = (
|
||||||
attributesWithNewFileValue: FormsetData<null, File>,
|
attributesWithNewFileValue: FormsetData<null, File>,
|
||||||
existingAttribute:
|
existingAttribute:
|
||||||
| PageDetails_page_attributes
|
| PageSelectedAttributeFragment
|
||||||
| ProductDetails_product_attributes
|
| ProductFragment["attributes"][0]
|
||||||
| SelectedVariantAttributeFragment
|
| SelectedVariantAttributeFragment
|
||||||
) => {
|
) => {
|
||||||
if (existingAttribute.attribute.inputType !== AttributeInputTypeEnum.FILE) {
|
if (existingAttribute.attribute.inputType !== AttributeInputTypeEnum.FILE) {
|
||||||
|
@ -195,7 +201,7 @@ export const isFileValueUnused = (
|
||||||
};
|
};
|
||||||
|
|
||||||
export const mergeFileUploadErrors = (
|
export const mergeFileUploadErrors = (
|
||||||
uploadFilesResult: Array<FetchResult<FileUpload>>
|
uploadFilesResult: Array<FetchResult<FileUploadMutation>>
|
||||||
): UploadErrorFragment[] =>
|
): UploadErrorFragment[] =>
|
||||||
uploadFilesResult.reduce((errors, uploadFileResult) => {
|
uploadFilesResult.reduce((errors, uploadFileResult) => {
|
||||||
const uploadErrors = uploadFileResult?.data?.fileUpload?.errors;
|
const uploadErrors = uploadFileResult?.data?.fileUpload?.errors;
|
||||||
|
@ -206,7 +212,7 @@ export const mergeFileUploadErrors = (
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
export const mergeAttributeValueDeleteErrors = (
|
export const mergeAttributeValueDeleteErrors = (
|
||||||
deleteAttributeValuesResult: Array<FetchResult<AttributeValueDelete>>
|
deleteAttributeValuesResult: Array<FetchResult<AttributeValueDeleteMutation>>
|
||||||
): AttributeErrorFragment[] =>
|
): AttributeErrorFragment[] =>
|
||||||
deleteAttributeValuesResult.reduce((errors, deleteValueResult) => {
|
deleteAttributeValuesResult.reduce((errors, deleteValueResult) => {
|
||||||
const deleteErrors = deleteValueResult?.data?.attributeValueDelete?.errors;
|
const deleteErrors = deleteValueResult?.data?.attributeValueDelete?.errors;
|
||||||
|
@ -218,8 +224,8 @@ export const mergeAttributeValueDeleteErrors = (
|
||||||
|
|
||||||
export const mergeChoicesWithValues = (
|
export const mergeChoicesWithValues = (
|
||||||
attribute:
|
attribute:
|
||||||
| ProductDetails_product_attributes
|
| ProductFragment["attributes"][0]
|
||||||
| PageDetails_page_attributes
|
| PageSelectedAttributeFragment
|
||||||
| SelectedVariantAttributeFragment
|
| SelectedVariantAttributeFragment
|
||||||
) => {
|
) => {
|
||||||
const choices = mapEdgesToItems(attribute.attribute.choices) || [];
|
const choices = mapEdgesToItems(attribute.attribute.choices) || [];
|
||||||
|
@ -262,7 +268,7 @@ export const getAttributesOfRemovedFiles = (
|
||||||
|
|
||||||
export const getAttributesOfUploadedFiles = (
|
export const getAttributesOfUploadedFiles = (
|
||||||
fileValuesToUpload: FormsetData<null, File>,
|
fileValuesToUpload: FormsetData<null, File>,
|
||||||
uploadFilesResult: Array<FetchResult<FileUpload>>
|
uploadFilesResult: Array<FetchResult<FileUploadMutation>>
|
||||||
): AtributesOfFiles[] =>
|
): AtributesOfFiles[] =>
|
||||||
uploadFilesResult.map((uploadFileResult, index) => {
|
uploadFilesResult.map((uploadFileResult, index) => {
|
||||||
const attribute = fileValuesToUpload[index];
|
const attribute = fileValuesToUpload[index];
|
||||||
|
@ -277,7 +283,7 @@ export const getAttributesOfUploadedFiles = (
|
||||||
|
|
||||||
export const getAttributesAfterFileAttributesUpdate = (
|
export const getAttributesAfterFileAttributesUpdate = (
|
||||||
attributesWithNewFileValue: FormsetData<null, File>,
|
attributesWithNewFileValue: FormsetData<null, File>,
|
||||||
uploadFilesResult: Array<FetchResult<FileUpload>>
|
uploadFilesResult: Array<FetchResult<FileUploadMutation>>
|
||||||
): AttributeValueInput[] => {
|
): AttributeValueInput[] => {
|
||||||
const removedFileValues = getFileValuesRemovedFromAttributes(
|
const removedFileValues = getFileValuesRemovedFromAttributes(
|
||||||
attributesWithNewFileValue
|
attributesWithNewFileValue
|
||||||
|
@ -316,7 +322,7 @@ export const getFileAttributeDisplayData = (
|
||||||
|
|
||||||
export const getPageReferenceAttributeDisplayData = (
|
export const getPageReferenceAttributeDisplayData = (
|
||||||
attribute: AttributeInput,
|
attribute: AttributeInput,
|
||||||
referencePages: SearchPages_search_edges_node[]
|
referencePages: RelayToFlat<SearchPagesQuery["search"]>
|
||||||
) => ({
|
) => ({
|
||||||
...attribute,
|
...attribute,
|
||||||
data: {
|
data: {
|
||||||
|
@ -337,7 +343,7 @@ export const getPageReferenceAttributeDisplayData = (
|
||||||
|
|
||||||
export const getProductReferenceAttributeDisplayData = (
|
export const getProductReferenceAttributeDisplayData = (
|
||||||
attribute: AttributeInput,
|
attribute: AttributeInput,
|
||||||
referenceProducts: SearchProducts_search_edges_node[]
|
referenceProducts: RelayToFlat<SearchProductsQuery["search"]>
|
||||||
) => ({
|
) => ({
|
||||||
...attribute,
|
...attribute,
|
||||||
data: {
|
data: {
|
||||||
|
@ -358,8 +364,8 @@ export const getProductReferenceAttributeDisplayData = (
|
||||||
|
|
||||||
export const getReferenceAttributeDisplayData = (
|
export const getReferenceAttributeDisplayData = (
|
||||||
attribute: AttributeInput,
|
attribute: AttributeInput,
|
||||||
referencePages: SearchPages_search_edges_node[],
|
referencePages: RelayToFlat<SearchPagesQuery["search"]>,
|
||||||
referenceProducts: SearchProducts_search_edges_node[]
|
referenceProducts: RelayToFlat<SearchProductsQuery["search"]>
|
||||||
) => {
|
) => {
|
||||||
if (attribute.data.entityType === AttributeEntityTypeEnum.PAGE) {
|
if (attribute.data.entityType === AttributeEntityTypeEnum.PAGE) {
|
||||||
return getPageReferenceAttributeDisplayData(attribute, referencePages);
|
return getPageReferenceAttributeDisplayData(attribute, referencePages);
|
||||||
|
@ -374,8 +380,8 @@ export const getReferenceAttributeDisplayData = (
|
||||||
export const getAttributesDisplayData = (
|
export const getAttributesDisplayData = (
|
||||||
attributes: AttributeInput[],
|
attributes: AttributeInput[],
|
||||||
attributesWithNewFileValue: FormsetData<null, File>,
|
attributesWithNewFileValue: FormsetData<null, File>,
|
||||||
referencePages: SearchPages_search_edges_node[],
|
referencePages: RelayToFlat<SearchPagesQuery["search"]>,
|
||||||
referenceProducts: SearchProducts_search_edges_node[]
|
referenceProducts: RelayToFlat<SearchProductsQuery["search"]>
|
||||||
) =>
|
) =>
|
||||||
attributes.map(attribute => {
|
attributes.map(attribute => {
|
||||||
if (attribute.data.inputType === AttributeInputTypeEnum.REFERENCE) {
|
if (attribute.data.inputType === AttributeInputTypeEnum.REFERENCE) {
|
||||||
|
@ -391,11 +397,9 @@ export const getAttributesDisplayData = (
|
||||||
return attribute;
|
return attribute;
|
||||||
});
|
});
|
||||||
|
|
||||||
export const getSelectedReferencesFromAttribute = <
|
export const getSelectedReferencesFromAttribute = <T extends Node>(
|
||||||
Node extends SearchPages_search_edges_node | SearchProducts_search_edges_node
|
|
||||||
>(
|
|
||||||
attribute?: AttributeInput,
|
attribute?: AttributeInput,
|
||||||
references?: Node[]
|
references?: T[]
|
||||||
) =>
|
) =>
|
||||||
references?.filter(
|
references?.filter(
|
||||||
value =>
|
value =>
|
||||||
|
@ -405,8 +409,8 @@ export const getSelectedReferencesFromAttribute = <
|
||||||
export const getAttributeValuesFromReferences = (
|
export const getAttributeValuesFromReferences = (
|
||||||
attributeId: string,
|
attributeId: string,
|
||||||
attributes?: AttributeInput[],
|
attributes?: AttributeInput[],
|
||||||
referencePages?: SearchPages_search_edges_node[],
|
referencePages?: RelayToFlat<SearchPagesQuery["search"]>,
|
||||||
referenceProducts?: SearchProducts_search_edges_node[]
|
referenceProducts?: RelayToFlat<SearchProductsQuery["search"]>
|
||||||
) => {
|
) => {
|
||||||
const attribute = attributes?.find(attribute => attribute.id === attributeId);
|
const attribute = attributes?.find(attribute => attribute.id === attributeId);
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { createAttributeMultiChangeHandler } from "@saleor/attributes/utils/handlers";
|
import { createAttributeMultiChangeHandler } from "@saleor/attributes/utils/handlers";
|
||||||
import { AttributeInputData } from "@saleor/components/Attributes";
|
import { AttributeInputData } from "@saleor/components/Attributes";
|
||||||
|
import { AttributeInputTypeEnum } from "@saleor/graphql";
|
||||||
import { FormsetData } from "@saleor/hooks/useFormset";
|
import { FormsetData } from "@saleor/hooks/useFormset";
|
||||||
import { AttributeInputTypeEnum } from "@saleor/types/globalTypes";
|
|
||||||
|
|
||||||
const attributes: FormsetData<AttributeInputData, string[]> = [
|
const attributes: FormsetData<AttributeInputData, string[]> = [
|
||||||
{
|
{
|
||||||
|
|
|
@ -4,29 +4,25 @@ import {
|
||||||
AttributeInputData
|
AttributeInputData
|
||||||
} from "@saleor/components/Attributes";
|
} from "@saleor/components/Attributes";
|
||||||
import {
|
import {
|
||||||
FileUpload,
|
AttributeEntityTypeEnum,
|
||||||
FileUploadVariables
|
AttributeInputTypeEnum,
|
||||||
} from "@saleor/files/types/FileUpload";
|
AttributeValueDeleteMutation,
|
||||||
|
AttributeValueDeleteMutationVariables,
|
||||||
|
AttributeValueInput,
|
||||||
|
FileUploadMutation,
|
||||||
|
FileUploadMutationVariables,
|
||||||
|
PageSelectedAttributeFragment,
|
||||||
|
ProductFragment,
|
||||||
|
ProductVariantDetailsQuery
|
||||||
|
} from "@saleor/graphql";
|
||||||
import {
|
import {
|
||||||
FormsetAtomicData,
|
FormsetAtomicData,
|
||||||
FormsetChange,
|
FormsetChange,
|
||||||
FormsetData
|
FormsetData
|
||||||
} from "@saleor/hooks/useFormset";
|
} from "@saleor/hooks/useFormset";
|
||||||
import { PageDetails_page_attributes } from "@saleor/pages/types/PageDetails";
|
|
||||||
import { ProductDetails_product_attributes } from "@saleor/products/types/ProductDetails";
|
|
||||||
import { ProductVariantDetails_productVariant_nonSelectionAttributes } from "@saleor/products/types/ProductVariantDetails";
|
|
||||||
import { FetchMoreProps, ReorderEvent } from "@saleor/types";
|
import { FetchMoreProps, ReorderEvent } from "@saleor/types";
|
||||||
import {
|
|
||||||
AttributeEntityTypeEnum,
|
|
||||||
AttributeInputTypeEnum,
|
|
||||||
AttributeValueInput
|
|
||||||
} from "@saleor/types/globalTypes";
|
|
||||||
import { move, toggle } from "@saleor/utils/lists";
|
import { move, toggle } from "@saleor/utils/lists";
|
||||||
|
|
||||||
import {
|
|
||||||
AttributeValueDelete,
|
|
||||||
AttributeValueDeleteVariables
|
|
||||||
} from "../types/AttributeValueDelete";
|
|
||||||
import { getFileValuesToUploadFromAttributes, isFileValueUnused } from "./data";
|
import { getFileValuesToUploadFromAttributes, isFileValueUnused } from "./data";
|
||||||
|
|
||||||
export function createAttributeChangeHandler(
|
export function createAttributeChangeHandler(
|
||||||
|
@ -275,8 +271,8 @@ export const prepareAttributesInput = ({
|
||||||
export const handleUploadMultipleFiles = async (
|
export const handleUploadMultipleFiles = async (
|
||||||
attributesWithNewFileValue: FormsetData<null, File>,
|
attributesWithNewFileValue: FormsetData<null, File>,
|
||||||
uploadFile: (
|
uploadFile: (
|
||||||
variables: FileUploadVariables
|
variables: FileUploadMutationVariables
|
||||||
) => Promise<FetchResult<FileUpload>>
|
) => Promise<FetchResult<FileUploadMutation>>
|
||||||
) =>
|
) =>
|
||||||
Promise.all(
|
Promise.all(
|
||||||
getFileValuesToUploadFromAttributes(attributesWithNewFileValue).map(
|
getFileValuesToUploadFromAttributes(attributesWithNewFileValue).map(
|
||||||
|
@ -290,13 +286,13 @@ export const handleUploadMultipleFiles = async (
|
||||||
export const handleDeleteMultipleAttributeValues = async (
|
export const handleDeleteMultipleAttributeValues = async (
|
||||||
attributesWithNewFileValue: FormsetData<null, File>,
|
attributesWithNewFileValue: FormsetData<null, File>,
|
||||||
attributes: Array<
|
attributes: Array<
|
||||||
| PageDetails_page_attributes
|
| PageSelectedAttributeFragment
|
||||||
| ProductDetails_product_attributes
|
| ProductFragment["attributes"][0]
|
||||||
| ProductVariantDetails_productVariant_nonSelectionAttributes
|
| ProductVariantDetailsQuery["productVariant"]["nonSelectionAttributes"][0]
|
||||||
>,
|
>,
|
||||||
deleteAttributeValue: (
|
deleteAttributeValue: (
|
||||||
variables: AttributeValueDeleteVariables
|
variables: AttributeValueDeleteMutationVariables
|
||||||
) => Promise<FetchResult<AttributeValueDelete>>
|
) => Promise<FetchResult<AttributeValueDeleteMutation>>
|
||||||
) =>
|
) =>
|
||||||
Promise.all(
|
Promise.all(
|
||||||
attributes.map(existingAttribute => {
|
attributes.map(existingAttribute => {
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
import { AttributeErrorFragment } from "@saleor/fragments/types/AttributeErrorFragment";
|
import {
|
||||||
|
AttributeErrorCode,
|
||||||
|
AttributeErrorFragment,
|
||||||
|
useAttributeCreateMutation,
|
||||||
|
useUpdateMetadataMutation,
|
||||||
|
useUpdatePrivateMetadataMutation
|
||||||
|
} from "@saleor/graphql";
|
||||||
import useListSettings from "@saleor/hooks/useListSettings";
|
import useListSettings from "@saleor/hooks/useListSettings";
|
||||||
import useLocalPageInfo, { getMaxPage } from "@saleor/hooks/useLocalPageInfo";
|
import useLocalPageInfo, { getMaxPage } from "@saleor/hooks/useLocalPageInfo";
|
||||||
import useNavigator from "@saleor/hooks/useNavigator";
|
import useNavigator from "@saleor/hooks/useNavigator";
|
||||||
import useNotifier from "@saleor/hooks/useNotifier";
|
import useNotifier from "@saleor/hooks/useNotifier";
|
||||||
import { getMutationErrors, getStringOrPlaceholder } from "@saleor/misc";
|
import { getMutationErrors, getStringOrPlaceholder } from "@saleor/misc";
|
||||||
import { ListViews, ReorderEvent } from "@saleor/types";
|
import { ListViews, ReorderEvent } from "@saleor/types";
|
||||||
import { AttributeErrorCode } from "@saleor/types/globalTypes";
|
|
||||||
import createDialogActionHandlers from "@saleor/utils/handlers/dialogActionHandlers";
|
import createDialogActionHandlers from "@saleor/utils/handlers/dialogActionHandlers";
|
||||||
import createMetadataCreateHandler from "@saleor/utils/handlers/metadataCreateHandler";
|
import createMetadataCreateHandler from "@saleor/utils/handlers/metadataCreateHandler";
|
||||||
import {
|
import {
|
||||||
|
@ -15,10 +20,6 @@ import {
|
||||||
remove,
|
remove,
|
||||||
updateAtIndex
|
updateAtIndex
|
||||||
} from "@saleor/utils/lists";
|
} from "@saleor/utils/lists";
|
||||||
import {
|
|
||||||
useMetadataUpdate,
|
|
||||||
usePrivateMetadataUpdate
|
|
||||||
} from "@saleor/utils/metadata/updateMetadata";
|
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { useIntl } from "react-intl";
|
import { useIntl } from "react-intl";
|
||||||
import slugify from "slugify";
|
import slugify from "slugify";
|
||||||
|
@ -28,7 +29,6 @@ import AttributePage, {
|
||||||
} from "../../components/AttributePage";
|
} from "../../components/AttributePage";
|
||||||
import AttributeValueDeleteDialog from "../../components/AttributeValueDeleteDialog";
|
import AttributeValueDeleteDialog from "../../components/AttributeValueDeleteDialog";
|
||||||
import AttributeValueEditDialog from "../../components/AttributeValueEditDialog";
|
import AttributeValueEditDialog from "../../components/AttributeValueEditDialog";
|
||||||
import { useAttributeCreateMutation } from "../../mutations";
|
|
||||||
import {
|
import {
|
||||||
attributeAddUrl,
|
attributeAddUrl,
|
||||||
AttributeAddUrlDialog,
|
AttributeAddUrlDialog,
|
||||||
|
@ -96,8 +96,8 @@ const AttributeDetails: React.FC<AttributeDetailsProps> = ({ params }) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
const [updateMetadata] = useMetadataUpdate({});
|
const [updateMetadata] = useUpdateMetadataMutation({});
|
||||||
const [updatePrivateMetadata] = usePrivateMetadataUpdate({});
|
const [updatePrivateMetadata] = useUpdatePrivateMetadataMutation({});
|
||||||
|
|
||||||
const id = params.id
|
const id = params.id
|
||||||
? parseInt(params.id, 0) + pageInfo.startCursor
|
? parseInt(params.id, 0) + pageInfo.startCursor
|
||||||
|
|
|
@ -1,4 +1,15 @@
|
||||||
import { attributeValueFragmentToFormData } from "@saleor/attributes/utils/data";
|
import { attributeValueFragmentToFormData } from "@saleor/attributes/utils/data";
|
||||||
|
import {
|
||||||
|
useAttributeDeleteMutation,
|
||||||
|
useAttributeDetailsQuery,
|
||||||
|
useAttributeUpdateMutation,
|
||||||
|
useAttributeValueCreateMutation,
|
||||||
|
useAttributeValueDeleteMutation,
|
||||||
|
useAttributeValueReorderMutation,
|
||||||
|
useAttributeValueUpdateMutation,
|
||||||
|
useUpdateMetadataMutation,
|
||||||
|
useUpdatePrivateMetadataMutation
|
||||||
|
} from "@saleor/graphql";
|
||||||
import useListSettings from "@saleor/hooks/useListSettings";
|
import useListSettings from "@saleor/hooks/useListSettings";
|
||||||
import useLocalPaginator, {
|
import useLocalPaginator, {
|
||||||
useLocalPaginationState
|
useLocalPaginationState
|
||||||
|
@ -12,10 +23,6 @@ import getAttributeErrorMessage from "@saleor/utils/errors/attribute";
|
||||||
import createDialogActionHandlers from "@saleor/utils/handlers/dialogActionHandlers";
|
import createDialogActionHandlers from "@saleor/utils/handlers/dialogActionHandlers";
|
||||||
import createMetadataUpdateHandler from "@saleor/utils/handlers/metadataUpdateHandler";
|
import createMetadataUpdateHandler from "@saleor/utils/handlers/metadataUpdateHandler";
|
||||||
import { move } from "@saleor/utils/lists";
|
import { move } from "@saleor/utils/lists";
|
||||||
import {
|
|
||||||
useMetadataUpdate,
|
|
||||||
usePrivateMetadataUpdate
|
|
||||||
} from "@saleor/utils/metadata/updateMetadata";
|
|
||||||
import omit from "lodash/omit";
|
import omit from "lodash/omit";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { useIntl } from "react-intl";
|
import { useIntl } from "react-intl";
|
||||||
|
@ -26,15 +33,6 @@ import AttributePage, {
|
||||||
} from "../../components/AttributePage";
|
} from "../../components/AttributePage";
|
||||||
import AttributeValueDeleteDialog from "../../components/AttributeValueDeleteDialog";
|
import AttributeValueDeleteDialog from "../../components/AttributeValueDeleteDialog";
|
||||||
import AttributeValueEditDialog from "../../components/AttributeValueEditDialog";
|
import AttributeValueEditDialog from "../../components/AttributeValueEditDialog";
|
||||||
import {
|
|
||||||
useAttributeDeleteMutation,
|
|
||||||
useAttributeUpdateMutation,
|
|
||||||
useAttributeValueCreateMutation,
|
|
||||||
useAttributeValueDeleteMutation,
|
|
||||||
useAttributeValueReorderMutation,
|
|
||||||
useAttributeValueUpdateMutation
|
|
||||||
} from "../../mutations";
|
|
||||||
import { useAttributeDetailsQuery } from "../../queries";
|
|
||||||
import {
|
import {
|
||||||
attributeListUrl,
|
attributeListUrl,
|
||||||
attributeUrl,
|
attributeUrl,
|
||||||
|
@ -51,8 +49,8 @@ const AttributeDetails: React.FC<AttributeDetailsProps> = ({ id, params }) => {
|
||||||
const navigate = useNavigator();
|
const navigate = useNavigator();
|
||||||
const notify = useNotifier();
|
const notify = useNotifier();
|
||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
const [updateMetadata] = useMetadataUpdate({});
|
const [updateMetadata] = useUpdateMetadataMutation({});
|
||||||
const [updatePrivateMetadata] = usePrivateMetadataUpdate({});
|
const [updatePrivateMetadata] = useUpdatePrivateMetadataMutation({});
|
||||||
|
|
||||||
const [openModal, closeModal] = createDialogActionHandlers<
|
const [openModal, closeModal] = createDialogActionHandlers<
|
||||||
AttributeUrlDialog,
|
AttributeUrlDialog,
|
||||||
|
@ -178,6 +176,7 @@ const AttributeDetails: React.FC<AttributeDetailsProps> = ({ id, params }) => {
|
||||||
const handleValueReorder = ({ newIndex, oldIndex }: ReorderEvent) =>
|
const handleValueReorder = ({ newIndex, oldIndex }: ReorderEvent) =>
|
||||||
attributeValueReorder({
|
attributeValueReorder({
|
||||||
optimisticResponse: {
|
optimisticResponse: {
|
||||||
|
__typename: "Mutation",
|
||||||
attributeReorderValues: {
|
attributeReorderValues: {
|
||||||
__typename: "AttributeReorderValues",
|
__typename: "AttributeReorderValues",
|
||||||
attribute: {
|
attribute: {
|
||||||
|
|
|
@ -12,6 +12,10 @@ import SaveFilterTabDialog, {
|
||||||
SaveFilterTabDialogFormData
|
SaveFilterTabDialogFormData
|
||||||
} from "@saleor/components/SaveFilterTabDialog";
|
} from "@saleor/components/SaveFilterTabDialog";
|
||||||
import { configurationMenuUrl } from "@saleor/configuration";
|
import { configurationMenuUrl } from "@saleor/configuration";
|
||||||
|
import {
|
||||||
|
useAttributeBulkDeleteMutation,
|
||||||
|
useAttributeListQuery
|
||||||
|
} from "@saleor/graphql";
|
||||||
import useNavigator from "@saleor/hooks/useNavigator";
|
import useNavigator from "@saleor/hooks/useNavigator";
|
||||||
import useNotifier from "@saleor/hooks/useNotifier";
|
import useNotifier from "@saleor/hooks/useNotifier";
|
||||||
import usePaginator, {
|
import usePaginator, {
|
||||||
|
@ -31,8 +35,6 @@ import useBulkActions from "../../../hooks/useBulkActions";
|
||||||
import { maybe } from "../../../misc";
|
import { maybe } from "../../../misc";
|
||||||
import AttributeBulkDeleteDialog from "../../components/AttributeBulkDeleteDialog";
|
import AttributeBulkDeleteDialog from "../../components/AttributeBulkDeleteDialog";
|
||||||
import AttributeListPage from "../../components/AttributeListPage";
|
import AttributeListPage from "../../components/AttributeListPage";
|
||||||
import { useAttributeBulkDeleteMutation } from "../../mutations";
|
|
||||||
import { useAttributeListQuery } from "../../queries";
|
|
||||||
import {
|
import {
|
||||||
attributeAddUrl,
|
attributeAddUrl,
|
||||||
attributeListUrl,
|
attributeListUrl,
|
||||||
|
|
|
@ -3,8 +3,8 @@ import {
|
||||||
AttributeListFilterOpts
|
AttributeListFilterOpts
|
||||||
} from "@saleor/attributes/components/AttributeListPage";
|
} from "@saleor/attributes/components/AttributeListPage";
|
||||||
import { IFilterElement } from "@saleor/components/Filter";
|
import { IFilterElement } from "@saleor/components/Filter";
|
||||||
|
import { AttributeFilterInput } from "@saleor/graphql";
|
||||||
import { maybe, parseBoolean } from "@saleor/misc";
|
import { maybe, parseBoolean } from "@saleor/misc";
|
||||||
import { AttributeFilterInput } from "@saleor/types/globalTypes";
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
createFilterTabUtils,
|
createFilterTabUtils,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { AttributeListUrlSortField } from "@saleor/attributes/urls";
|
import { AttributeListUrlSortField } from "@saleor/attributes/urls";
|
||||||
import { AttributeSortField } from "@saleor/types/globalTypes";
|
import { AttributeSortField } from "@saleor/graphql";
|
||||||
import { createGetSortQueryVariables } from "@saleor/utils/sort";
|
import { createGetSortQueryVariables } from "@saleor/utils/sort";
|
||||||
|
|
||||||
export function getSortQueryField(
|
export function getSortQueryField(
|
||||||
|
|
|
@ -2,6 +2,7 @@ import { createSaleorClient, SaleorProvider } from "@saleor/sdk";
|
||||||
import setupApi from "@test/api";
|
import setupApi from "@test/api";
|
||||||
import { act, renderHook } from "@testing-library/react-hooks";
|
import { act, renderHook } from "@testing-library/react-hooks";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
import { IntlProvider } from "react-intl";
|
||||||
import { MemoryRouter as Router } from "react-router-dom";
|
import { MemoryRouter as Router } from "react-router-dom";
|
||||||
|
|
||||||
import { useAuthProvider } from "./hooks/useAuthProvider";
|
import { useAuthProvider } from "./hooks/useAuthProvider";
|
||||||
|
@ -18,9 +19,11 @@ function renderAuthProvider() {
|
||||||
channel: ""
|
channel: ""
|
||||||
});
|
});
|
||||||
const wrapper = ({ children }) => (
|
const wrapper = ({ children }) => (
|
||||||
<Router>
|
<IntlProvider defaultLocale="en" locale="en">
|
||||||
<SaleorProvider client={saleorClient}>{children}</SaleorProvider>
|
<Router>
|
||||||
</Router>
|
<SaleorProvider client={saleorClient}>{children}</SaleorProvider>
|
||||||
|
</Router>
|
||||||
|
</IntlProvider>
|
||||||
);
|
);
|
||||||
|
|
||||||
const { result } = renderHook(
|
const { result } = renderHook(
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
import backgroundArt from "@assets/images/login-background.svg";
|
import backgroundArt from "@assets/images/login-background.svg";
|
||||||
import saleorDarkLogo from "@assets/images/logo-dark.svg";
|
import saleorDarkLogo from "@assets/images/logo-dark.svg";
|
||||||
import saleorLightLogo from "@assets/images/logo-light.svg";
|
import saleorLightLogo from "@assets/images/logo-light.svg";
|
||||||
import { useTheme } from "@saleor/macaw-ui";
|
import { makeStyles, useTheme } from "@saleor/macaw-ui";
|
||||||
import { makeStyles } from "@saleor/macaw-ui";
|
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import SVG from "react-inlinesvg";
|
import SVG from "react-inlinesvg";
|
||||||
|
|
||||||
|
|
|
@ -5,8 +5,8 @@ import {
|
||||||
Typography
|
Typography
|
||||||
} from "@material-ui/core";
|
} from "@material-ui/core";
|
||||||
import { UserContextError } from "@saleor/auth/types";
|
import { UserContextError } from "@saleor/auth/types";
|
||||||
import { AvailableExternalAuthentications_shop_availableExternalAuthentications } from "@saleor/auth/types/AvailableExternalAuthentications";
|
|
||||||
import { FormSpacer } from "@saleor/components/FormSpacer";
|
import { FormSpacer } from "@saleor/components/FormSpacer";
|
||||||
|
import { AvailableExternalAuthenticationsQuery } from "@saleor/graphql";
|
||||||
import { SubmitPromise } from "@saleor/hooks/useForm";
|
import { SubmitPromise } from "@saleor/hooks/useForm";
|
||||||
import { commonMessages } from "@saleor/intl";
|
import { commonMessages } from "@saleor/intl";
|
||||||
import { Button, EyeIcon, IconButton } from "@saleor/macaw-ui";
|
import { Button, EyeIcon, IconButton } from "@saleor/macaw-ui";
|
||||||
|
@ -21,7 +21,7 @@ export interface LoginCardProps {
|
||||||
error?: UserContextError;
|
error?: UserContextError;
|
||||||
disabled: boolean;
|
disabled: boolean;
|
||||||
loading: boolean;
|
loading: boolean;
|
||||||
externalAuthentications?: AvailableExternalAuthentications_shop_availableExternalAuthentications[];
|
externalAuthentications?: AvailableExternalAuthenticationsQuery["shop"]["availableExternalAuthentications"];
|
||||||
onExternalAuthentication: (pluginId: string) => void;
|
onExternalAuthentication: (pluginId: string) => void;
|
||||||
onPasswordRecovery: () => void;
|
onPasswordRecovery: () => void;
|
||||||
onSubmit?: (event: LoginFormData) => SubmitPromise;
|
onSubmit?: (event: LoginFormData) => SubmitPromise;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
|
import { AccountErrorCode } from "@saleor/graphql";
|
||||||
import CardDecorator from "@saleor/storybook//CardDecorator";
|
import CardDecorator from "@saleor/storybook//CardDecorator";
|
||||||
import Decorator from "@saleor/storybook//Decorator";
|
import Decorator from "@saleor/storybook//Decorator";
|
||||||
import { AccountErrorCode } from "@saleor/types/globalTypes";
|
|
||||||
import { storiesOf } from "@storybook/react";
|
import { storiesOf } from "@storybook/react";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { TextField, Typography } from "@material-ui/core";
|
import { TextField, Typography } from "@material-ui/core";
|
||||||
import { RequestPasswordReset_requestPasswordReset_errors } from "@saleor/auth/types/RequestPasswordReset";
|
|
||||||
import Form from "@saleor/components/Form";
|
import Form from "@saleor/components/Form";
|
||||||
import FormSpacer from "@saleor/components/FormSpacer";
|
import FormSpacer from "@saleor/components/FormSpacer";
|
||||||
|
import { RequestPasswordResetMutation } from "@saleor/graphql";
|
||||||
import { SubmitPromise } from "@saleor/hooks/useForm";
|
import { SubmitPromise } from "@saleor/hooks/useForm";
|
||||||
import { commonMessages } from "@saleor/intl";
|
import { commonMessages } from "@saleor/intl";
|
||||||
import { ArrowRightIcon, Button, IconButton } from "@saleor/macaw-ui";
|
import { ArrowRightIcon, Button, IconButton } from "@saleor/macaw-ui";
|
||||||
|
@ -19,7 +19,9 @@ export interface ResetPasswordPageProps {
|
||||||
onBack: () => void;
|
onBack: () => void;
|
||||||
onSubmit: (
|
onSubmit: (
|
||||||
data: ResetPasswordPageFormData
|
data: ResetPasswordPageFormData
|
||||||
) => SubmitPromise<RequestPasswordReset_requestPasswordReset_errors[]>;
|
) => SubmitPromise<
|
||||||
|
RequestPasswordResetMutation["requestPasswordReset"]["errors"]
|
||||||
|
>;
|
||||||
}
|
}
|
||||||
|
|
||||||
const ResetPasswordPage: React.FC<ResetPasswordPageProps> = props => {
|
const ResetPasswordPage: React.FC<ResetPasswordPageProps> = props => {
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
|
import { PermissionEnum } from "@saleor/graphql";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { Route, RouteProps } from "react-router-dom";
|
import { Route, RouteProps } from "react-router-dom";
|
||||||
|
|
||||||
import { useUser } from "..";
|
import { useUser } from "..";
|
||||||
import NotFound from "../../NotFound";
|
import NotFound from "../../NotFound";
|
||||||
import { PermissionEnum } from "../../types/globalTypes";
|
|
||||||
import { hasAllPermissions, hasAnyPermissions } from "../misc";
|
import { hasAllPermissions, hasAnyPermissions } from "../misc";
|
||||||
|
|
||||||
type MatchPermissionType = "all" | "any";
|
type MatchPermissionType = "all" | "any";
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { ApolloClient, useQuery } from "@apollo/client";
|
import { ApolloClient } from "@apollo/client";
|
||||||
import { IMessageContext } from "@saleor/components/messages";
|
import { IMessageContext } from "@saleor/components/messages";
|
||||||
import { APP_DEFAULT_URI, APP_MOUNT_URI, DEMO_MODE } from "@saleor/config";
|
import { APP_DEFAULT_URI, APP_MOUNT_URI, DEMO_MODE } from "@saleor/config";
|
||||||
|
import { useUserDetailsQuery } from "@saleor/graphql";
|
||||||
import useLocalStorage from "@saleor/hooks/useLocalStorage";
|
import useLocalStorage from "@saleor/hooks/useLocalStorage";
|
||||||
import useNavigator from "@saleor/hooks/useNavigator";
|
import useNavigator from "@saleor/hooks/useNavigator";
|
||||||
import { commonMessages } from "@saleor/intl";
|
import { commonMessages } from "@saleor/intl";
|
||||||
|
@ -19,7 +20,6 @@ import { useEffect, useRef, useState } from "react";
|
||||||
import { IntlShape } from "react-intl";
|
import { IntlShape } from "react-intl";
|
||||||
import urlJoin from "url-join";
|
import urlJoin from "url-join";
|
||||||
|
|
||||||
import { userDetailsQuery } from "../queries";
|
|
||||||
import {
|
import {
|
||||||
ExternalLoginInput,
|
ExternalLoginInput,
|
||||||
RequestExternalLoginInput,
|
RequestExternalLoginInput,
|
||||||
|
@ -27,7 +27,6 @@ import {
|
||||||
UserContext,
|
UserContext,
|
||||||
UserContextError
|
UserContextError
|
||||||
} from "../types";
|
} from "../types";
|
||||||
import { UserDetails } from "../types/UserDetails";
|
|
||||||
import { displayDemoMessage } from "../utils";
|
import { displayDemoMessage } from "../utils";
|
||||||
|
|
||||||
export interface UseAuthProviderOpts {
|
export interface UseAuthProviderOpts {
|
||||||
|
@ -80,7 +79,7 @@ export function useAuthProvider({
|
||||||
}
|
}
|
||||||
}, [authenticated, authenticating]);
|
}, [authenticated, authenticating]);
|
||||||
|
|
||||||
const userDetails = useQuery<UserDetails>(userDetailsQuery, {
|
const userDetails = useUserDetailsQuery({
|
||||||
client: apolloClient,
|
client: apolloClient,
|
||||||
skip: !authenticated,
|
skip: !authenticated,
|
||||||
// Don't change this to 'network-only' - update of intl provider's
|
// Don't change this to 'network-only' - update of intl provider's
|
||||||
|
|
|
@ -1,12 +1,14 @@
|
||||||
import { User } from "@saleor/fragments/types/User";
|
import { PermissionEnum, UserFragment } from "@saleor/graphql";
|
||||||
|
|
||||||
import { PermissionEnum } from "../types/globalTypes";
|
export const hasPermission = (permission: PermissionEnum, user: UserFragment) =>
|
||||||
|
|
||||||
export const hasPermission = (permission: PermissionEnum, user: User) =>
|
|
||||||
user.userPermissions.map(perm => perm.code).includes(permission);
|
user.userPermissions.map(perm => perm.code).includes(permission);
|
||||||
|
|
||||||
export const hasAnyPermissions = (permissions: PermissionEnum[], user: User) =>
|
export const hasAnyPermissions = (
|
||||||
permissions?.some(permission => hasPermission(permission, user)) || false;
|
permissions: PermissionEnum[],
|
||||||
|
user: UserFragment
|
||||||
|
) => permissions?.some(permission => hasPermission(permission, user)) || false;
|
||||||
|
|
||||||
export const hasAllPermissions = (permissions: PermissionEnum[], user: User) =>
|
export const hasAllPermissions = (
|
||||||
permissions?.every(permission => hasPermission(permission, user)) || false;
|
permissions: PermissionEnum[],
|
||||||
|
user: UserFragment
|
||||||
|
) => permissions?.every(permission => hasPermission(permission, user)) || false;
|
||||||
|
|
|
@ -1,23 +1,11 @@
|
||||||
import { gql } from "@apollo/client";
|
import { gql } from "@apollo/client";
|
||||||
import { accountErrorFragment } from "@saleor/fragments/errors";
|
|
||||||
|
|
||||||
import { TypedMutation } from "../mutations";
|
|
||||||
import {
|
|
||||||
RequestPasswordReset,
|
|
||||||
RequestPasswordResetVariables
|
|
||||||
} from "./types/RequestPasswordReset";
|
|
||||||
|
|
||||||
export const requestPasswordReset = gql`
|
export const requestPasswordReset = gql`
|
||||||
${accountErrorFragment}
|
|
||||||
mutation RequestPasswordReset($email: String!, $redirectUrl: String!) {
|
mutation RequestPasswordReset($email: String!, $redirectUrl: String!) {
|
||||||
requestPasswordReset(email: $email, redirectUrl: $redirectUrl) {
|
requestPasswordReset(email: $email, redirectUrl: $redirectUrl) {
|
||||||
errors {
|
errors {
|
||||||
...AccountErrorFragment
|
...AccountError
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
export const RequestPasswordResetMutation = TypedMutation<
|
|
||||||
RequestPasswordReset,
|
|
||||||
RequestPasswordResetVariables
|
|
||||||
>(requestPasswordReset);
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import { gql } from "@apollo/client";
|
import { gql } from "@apollo/client";
|
||||||
import { fragmentUser } from "@saleor/fragments/auth";
|
|
||||||
|
|
||||||
export const availableExternalAuthentications = gql`
|
export const availableExternalAuthentications = gql`
|
||||||
query AvailableExternalAuthentications {
|
query AvailableExternalAuthentications {
|
||||||
|
@ -13,7 +12,6 @@ export const availableExternalAuthentications = gql`
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const userDetailsQuery = gql`
|
export const userDetailsQuery = gql`
|
||||||
${fragmentUser}
|
|
||||||
query UserDetails {
|
query UserDetails {
|
||||||
me {
|
me {
|
||||||
...User
|
...User
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { User } from "@saleor/fragments/types/User";
|
import { UserFragment } from "@saleor/graphql";
|
||||||
import {
|
import {
|
||||||
GetExternalAccessTokenData,
|
GetExternalAccessTokenData,
|
||||||
GetExternalAuthUrlData,
|
GetExternalAuthUrlData,
|
||||||
|
@ -34,7 +34,7 @@ export interface UserContext {
|
||||||
pluginId: string,
|
pluginId: string,
|
||||||
input: RequestExternalLoginInput
|
input: RequestExternalLoginInput
|
||||||
) => Promise<GetExternalAuthUrlData>;
|
) => Promise<GetExternalAuthUrlData>;
|
||||||
user?: User;
|
user?: UserFragment;
|
||||||
authenticating: boolean;
|
authenticating: boolean;
|
||||||
authenticated: boolean;
|
authenticated: boolean;
|
||||||
error?: UserContextError;
|
error?: UserContextError;
|
||||||
|
|
|
@ -1,23 +0,0 @@
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
// @generated
|
|
||||||
// This file was automatically generated and should not be edited.
|
|
||||||
|
|
||||||
// ====================================================
|
|
||||||
// GraphQL query operation: AvailableExternalAuthentications
|
|
||||||
// ====================================================
|
|
||||||
|
|
||||||
export interface AvailableExternalAuthentications_shop_availableExternalAuthentications {
|
|
||||||
__typename: "ExternalAuthentication";
|
|
||||||
id: string;
|
|
||||||
name: string | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AvailableExternalAuthentications_shop {
|
|
||||||
__typename: "Shop";
|
|
||||||
availableExternalAuthentications: AvailableExternalAuthentications_shop_availableExternalAuthentications[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AvailableExternalAuthentications {
|
|
||||||
shop: AvailableExternalAuthentications_shop;
|
|
||||||
}
|
|
|
@ -1,32 +0,0 @@
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
// @generated
|
|
||||||
// This file was automatically generated and should not be edited.
|
|
||||||
|
|
||||||
import { AccountErrorCode, AddressTypeEnum } from "./../../types/globalTypes";
|
|
||||||
|
|
||||||
// ====================================================
|
|
||||||
// GraphQL mutation operation: ExternalAuthenticationUrl
|
|
||||||
// ====================================================
|
|
||||||
|
|
||||||
export interface ExternalAuthenticationUrl_externalAuthenticationUrl_errors {
|
|
||||||
__typename: "AccountError";
|
|
||||||
code: AccountErrorCode;
|
|
||||||
field: string | null;
|
|
||||||
addressType: AddressTypeEnum | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ExternalAuthenticationUrl_externalAuthenticationUrl {
|
|
||||||
__typename: "ExternalAuthenticationUrl";
|
|
||||||
authenticationData: any | null;
|
|
||||||
errors: ExternalAuthenticationUrl_externalAuthenticationUrl_errors[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ExternalAuthenticationUrl {
|
|
||||||
externalAuthenticationUrl: ExternalAuthenticationUrl_externalAuthenticationUrl | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ExternalAuthenticationUrlVariables {
|
|
||||||
pluginId: string;
|
|
||||||
input: any;
|
|
||||||
}
|
|
|
@ -1,56 +0,0 @@
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
// @generated
|
|
||||||
// This file was automatically generated and should not be edited.
|
|
||||||
|
|
||||||
import { PermissionEnum, AccountErrorCode, AddressTypeEnum } from "./../../types/globalTypes";
|
|
||||||
|
|
||||||
// ====================================================
|
|
||||||
// GraphQL mutation operation: ExternalObtainAccessTokens
|
|
||||||
// ====================================================
|
|
||||||
|
|
||||||
export interface ExternalObtainAccessTokens_externalObtainAccessTokens_user_userPermissions {
|
|
||||||
__typename: "UserPermission";
|
|
||||||
code: PermissionEnum;
|
|
||||||
name: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ExternalObtainAccessTokens_externalObtainAccessTokens_user_avatar {
|
|
||||||
__typename: "Image";
|
|
||||||
url: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ExternalObtainAccessTokens_externalObtainAccessTokens_user {
|
|
||||||
__typename: "User";
|
|
||||||
id: string;
|
|
||||||
email: string;
|
|
||||||
firstName: string;
|
|
||||||
lastName: string;
|
|
||||||
isStaff: boolean;
|
|
||||||
userPermissions: (ExternalObtainAccessTokens_externalObtainAccessTokens_user_userPermissions | null)[] | null;
|
|
||||||
avatar: ExternalObtainAccessTokens_externalObtainAccessTokens_user_avatar | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ExternalObtainAccessTokens_externalObtainAccessTokens_errors {
|
|
||||||
__typename: "AccountError";
|
|
||||||
code: AccountErrorCode;
|
|
||||||
field: string | null;
|
|
||||||
addressType: AddressTypeEnum | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ExternalObtainAccessTokens_externalObtainAccessTokens {
|
|
||||||
__typename: "ExternalObtainAccessTokens";
|
|
||||||
token: string | null;
|
|
||||||
csrfToken: string | null;
|
|
||||||
user: ExternalObtainAccessTokens_externalObtainAccessTokens_user | null;
|
|
||||||
errors: ExternalObtainAccessTokens_externalObtainAccessTokens_errors[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ExternalObtainAccessTokens {
|
|
||||||
externalObtainAccessTokens: ExternalObtainAccessTokens_externalObtainAccessTokens | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ExternalObtainAccessTokensVariables {
|
|
||||||
pluginId: string;
|
|
||||||
input: any;
|
|
||||||
}
|
|
|
@ -1,22 +0,0 @@
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
// @generated
|
|
||||||
// This file was automatically generated and should not be edited.
|
|
||||||
|
|
||||||
// ====================================================
|
|
||||||
// GraphQL mutation operation: ExternalRefreshToken
|
|
||||||
// ====================================================
|
|
||||||
|
|
||||||
export interface ExternalRefreshToken_externalRefresh {
|
|
||||||
__typename: "ExternalRefresh";
|
|
||||||
token: string | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ExternalRefreshToken {
|
|
||||||
externalRefresh: ExternalRefreshToken_externalRefresh | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ExternalRefreshTokenVariables {
|
|
||||||
pluginId: string;
|
|
||||||
input: any;
|
|
||||||
}
|
|
|
@ -1,47 +0,0 @@
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
// @generated
|
|
||||||
// This file was automatically generated and should not be edited.
|
|
||||||
|
|
||||||
import { PermissionEnum } from "./../../types/globalTypes";
|
|
||||||
|
|
||||||
// ====================================================
|
|
||||||
// GraphQL mutation operation: ExternalVerifyToken
|
|
||||||
// ====================================================
|
|
||||||
|
|
||||||
export interface ExternalVerifyToken_externalVerify_user_userPermissions {
|
|
||||||
__typename: "UserPermission";
|
|
||||||
code: PermissionEnum;
|
|
||||||
name: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ExternalVerifyToken_externalVerify_user_avatar {
|
|
||||||
__typename: "Image";
|
|
||||||
url: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ExternalVerifyToken_externalVerify_user {
|
|
||||||
__typename: "User";
|
|
||||||
id: string;
|
|
||||||
email: string;
|
|
||||||
firstName: string;
|
|
||||||
lastName: string;
|
|
||||||
isStaff: boolean;
|
|
||||||
userPermissions: (ExternalVerifyToken_externalVerify_user_userPermissions | null)[] | null;
|
|
||||||
avatar: ExternalVerifyToken_externalVerify_user_avatar | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ExternalVerifyToken_externalVerify {
|
|
||||||
__typename: "ExternalVerify";
|
|
||||||
verifyData: any | null;
|
|
||||||
user: ExternalVerifyToken_externalVerify_user | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ExternalVerifyToken {
|
|
||||||
externalVerify: ExternalVerifyToken_externalVerify | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ExternalVerifyTokenVariables {
|
|
||||||
pluginId: string;
|
|
||||||
input: any;
|
|
||||||
}
|
|
|
@ -1,21 +0,0 @@
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
// @generated
|
|
||||||
// This file was automatically generated and should not be edited.
|
|
||||||
|
|
||||||
// ====================================================
|
|
||||||
// GraphQL mutation operation: RefreshToken
|
|
||||||
// ====================================================
|
|
||||||
|
|
||||||
export interface RefreshToken_tokenRefresh {
|
|
||||||
__typename: "RefreshToken";
|
|
||||||
token: string | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface RefreshToken {
|
|
||||||
tokenRefresh: RefreshToken_tokenRefresh | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface RefreshTokenVariables {
|
|
||||||
token: string;
|
|
||||||
}
|
|
|
@ -1,32 +0,0 @@
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
// @generated
|
|
||||||
// This file was automatically generated and should not be edited.
|
|
||||||
|
|
||||||
import { AccountErrorCode, AddressTypeEnum } from "./../../types/globalTypes";
|
|
||||||
|
|
||||||
// ====================================================
|
|
||||||
// GraphQL mutation operation: RequestPasswordReset
|
|
||||||
// ====================================================
|
|
||||||
|
|
||||||
export interface RequestPasswordReset_requestPasswordReset_errors {
|
|
||||||
__typename: "AccountError";
|
|
||||||
code: AccountErrorCode;
|
|
||||||
field: string | null;
|
|
||||||
addressType: AddressTypeEnum | null;
|
|
||||||
message: string | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface RequestPasswordReset_requestPasswordReset {
|
|
||||||
__typename: "RequestPasswordReset";
|
|
||||||
errors: RequestPasswordReset_requestPasswordReset_errors[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface RequestPasswordReset {
|
|
||||||
requestPasswordReset: RequestPasswordReset_requestPasswordReset | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface RequestPasswordResetVariables {
|
|
||||||
email: string;
|
|
||||||
redirectUrl: string;
|
|
||||||
}
|
|
|
@ -1,58 +0,0 @@
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
// @generated
|
|
||||||
// This file was automatically generated and should not be edited.
|
|
||||||
|
|
||||||
import { AccountErrorCode, AddressTypeEnum, PermissionEnum } from "./../../types/globalTypes";
|
|
||||||
|
|
||||||
// ====================================================
|
|
||||||
// GraphQL mutation operation: SetPassword
|
|
||||||
// ====================================================
|
|
||||||
|
|
||||||
export interface SetPassword_setPassword_errors {
|
|
||||||
__typename: "AccountError";
|
|
||||||
code: AccountErrorCode;
|
|
||||||
field: string | null;
|
|
||||||
addressType: AddressTypeEnum | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface SetPassword_setPassword_user_userPermissions {
|
|
||||||
__typename: "UserPermission";
|
|
||||||
code: PermissionEnum;
|
|
||||||
name: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface SetPassword_setPassword_user_avatar {
|
|
||||||
__typename: "Image";
|
|
||||||
url: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface SetPassword_setPassword_user {
|
|
||||||
__typename: "User";
|
|
||||||
id: string;
|
|
||||||
email: string;
|
|
||||||
firstName: string;
|
|
||||||
lastName: string;
|
|
||||||
isStaff: boolean;
|
|
||||||
userPermissions: (SetPassword_setPassword_user_userPermissions | null)[] | null;
|
|
||||||
avatar: SetPassword_setPassword_user_avatar | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface SetPassword_setPassword {
|
|
||||||
__typename: "SetPassword";
|
|
||||||
errors: SetPassword_setPassword_errors[];
|
|
||||||
csrfToken: string | null;
|
|
||||||
refreshToken: string | null;
|
|
||||||
token: string | null;
|
|
||||||
user: SetPassword_setPassword_user | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface SetPassword {
|
|
||||||
setPassword: SetPassword_setPassword | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface SetPasswordVariables {
|
|
||||||
email: string;
|
|
||||||
password: string;
|
|
||||||
token: string;
|
|
||||||
}
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue