diff --git a/apps/console/package.json b/apps/console/package.json
index c2b86e58e..392034d32 100644
--- a/apps/console/package.json
+++ b/apps/console/package.json
@@ -5,7 +5,9 @@
"type": "module",
"scripts": {
"dev": "vite",
- "relay": "find src -type d -name \"__generated__\" -exec rm -rf {} + && npx relay-compiler",
+ "relay-clean": "find src -type d -name \"__generated__\" -exec rm -rf {} +",
+ "relay-compile": "npx relay-compiler",
+ "relay": "npm run relay-clean && npm run relay-compile",
"build": "tsc -b && vite build",
"lint": "eslint .",
"check": "tsc --noEmit -p tsconfig.app.json",
diff --git a/apps/console/relay.config.json b/apps/console/relay.config.json
index c973efb97..2ea3bc32b 100644
--- a/apps/console/relay.config.json
+++ b/apps/console/relay.config.json
@@ -15,11 +15,22 @@
"eagerEsModules": true,
"noFutureProofEnums": true,
"output": "apps/console/src/__generated__/core",
- "relativizeJsModulePaths": false
+ "relativizeJsModulePaths": false,
+ "excludesExtensions": ["*.iam.ts"]
+ },
+ "inline-iam": {
+ "base": "core",
+ "schema": "pkg/server/api/connect/v1/schema.graphql",
+ "language": "typescript",
+ "eagerEsModules": true,
+ "noFutureProofEnums": true,
+ "output": "apps/console/src/__generated__/iam",
+ "relativizeJsModulePaths": false,
+ "excludesExtensions": ["*.tsx", "**/hooks/**.ts"]
}
},
"sources": {
"apps/console/src/pages/iam": "iam",
- "apps/console/src": "core"
+ "apps/console/src": ["core", "inline-iam"]
}
}
diff --git a/apps/console/src/__generated__/iam/domainSettingsPage_permissionsQuery.graphql.ts b/apps/console/src/__generated__/iam/domainSettingsPage_permissionsQuery.graphql.ts
new file mode 100644
index 000000000..b623d6399
--- /dev/null
+++ b/apps/console/src/__generated__/iam/domainSettingsPage_permissionsQuery.graphql.ts
@@ -0,0 +1,136 @@
+/**
+ * @generated SignedSource<<2c18e7bff6b76551479def8a10cce183>>
+ * @lightSyntaxTransform
+ * @nogrep
+ */
+
+/* tslint:disable */
+/* eslint-disable */
+// @ts-nocheck
+
+import { ConcreteRequest } from 'relay-runtime';
+export type domainSettingsPage_permissionsQuery$variables = {
+ organizationId: string;
+};
+export type domainSettingsPage_permissionsQuery$data = {
+ readonly viewer: {
+ readonly canCreateCustomDomain: boolean;
+ readonly canDeleteCustomDomain: boolean;
+ };
+};
+export type domainSettingsPage_permissionsQuery = {
+ response: domainSettingsPage_permissionsQuery$data;
+ variables: domainSettingsPage_permissionsQuery$variables;
+};
+
+const node: ConcreteRequest = (function(){
+var v0 = [
+ {
+ "defaultValue": null,
+ "kind": "LocalArgument",
+ "name": "organizationId"
+ }
+],
+v1 = {
+ "kind": "Variable",
+ "name": "id",
+ "variableName": "organizationId"
+},
+v2 = {
+ "alias": "canCreateCustomDomain",
+ "args": [
+ {
+ "kind": "Literal",
+ "name": "action",
+ "value": "core:custom-domain:create"
+ },
+ (v1/*: any*/)
+ ],
+ "kind": "ScalarField",
+ "name": "permission",
+ "storageKey": null
+},
+v3 = {
+ "alias": "canDeleteCustomDomain",
+ "args": [
+ {
+ "kind": "Literal",
+ "name": "action",
+ "value": "core:custom-domain:delete"
+ },
+ (v1/*: any*/)
+ ],
+ "kind": "ScalarField",
+ "name": "permission",
+ "storageKey": null
+};
+return {
+ "fragment": {
+ "argumentDefinitions": (v0/*: any*/),
+ "kind": "Fragment",
+ "metadata": null,
+ "name": "domainSettingsPage_permissionsQuery",
+ "selections": [
+ {
+ "kind": "RequiredField",
+ "field": {
+ "alias": null,
+ "args": null,
+ "concreteType": "Identity",
+ "kind": "LinkedField",
+ "name": "viewer",
+ "plural": false,
+ "selections": [
+ (v2/*: any*/),
+ (v3/*: any*/)
+ ],
+ "storageKey": null
+ },
+ "action": "THROW"
+ }
+ ],
+ "type": "Query",
+ "abstractKey": null
+ },
+ "kind": "Request",
+ "operation": {
+ "argumentDefinitions": (v0/*: any*/),
+ "kind": "Operation",
+ "name": "domainSettingsPage_permissionsQuery",
+ "selections": [
+ {
+ "alias": null,
+ "args": null,
+ "concreteType": "Identity",
+ "kind": "LinkedField",
+ "name": "viewer",
+ "plural": false,
+ "selections": [
+ (v2/*: any*/),
+ (v3/*: any*/),
+ {
+ "alias": null,
+ "args": null,
+ "kind": "ScalarField",
+ "name": "id",
+ "storageKey": null
+ }
+ ],
+ "storageKey": null
+ }
+ ]
+ },
+ "params": {
+ "cacheID": "bb016bc1f53b609efc4ac93a93653d08",
+ "id": null,
+ "metadata": {},
+ "name": "domainSettingsPage_permissionsQuery",
+ "operationKind": "query",
+ "text": "query domainSettingsPage_permissionsQuery(\n $organizationId: ID!\n) {\n viewer {\n canCreateCustomDomain: permission(action: \"core:custom-domain:create\", id: $organizationId)\n canDeleteCustomDomain: permission(action: \"core:custom-domain:delete\", id: $organizationId)\n id\n }\n}\n"
+ }
+};
+})();
+
+(node as any).hash = "f09bdc9336bf1ad1339bb3b60987f53f";
+
+export default node;
diff --git a/apps/console/src/pages/organizations/settings/DomainSettingsPage.tsx b/apps/console/src/pages/organizations/settings/DomainSettingsPage.tsx
index 83dd24260..1487ac2cf 100644
--- a/apps/console/src/pages/organizations/settings/DomainSettingsPage.tsx
+++ b/apps/console/src/pages/organizations/settings/DomainSettingsPage.tsx
@@ -5,6 +5,8 @@ import { useTranslate } from "@probo/i18n";
import { DomainCard } from "./_components/DomainCard";
import { NewDomainDialog } from "./_components/NewDomainDialog";
import { Button, Card, IconPlusLarge } from "@probo/ui";
+import { PermissionsContext } from "/providers/NewPermissionsContext";
+import { use } from "react";
export const domainSettingsPageQuery = graphql`
query DomainSettingsPageQuery($organizationId: ID!) {
@@ -27,6 +29,7 @@ export function DomainSettingsPage(props: {
const { queryRef } = props;
const { __ } = useTranslate();
+ const { canCreateCustomDomain } = use(PermissionsContext);
const { organization } = usePreloadedQuery