Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

feat: migrate to vertical sidebar for navigation

Scott Wilson98d049529c10
diff --git a/backend/src/ee/services/license/license-fns.ts b/backend/src/ee/services/license/license-fns.ts
index e94f89113d..8f6cd3510d 100644
--- a/backend/src/ee/services/license/license-fns.ts
+++ b/backend/src/ee/services/license/license-fns.ts
@@ -71,7 +71,7 @@ export const getDefaultOnPremFeatures = (): TFeatureSet => ({
rbac: false,
githubOrgSync: false,
customRateLimits: false,
- subOrganization: false,
+ subOrganization: true,
customAlerts: false,
secretAccessInsights: false,
auditLogs: false,
@@ -81,14 +81,15 @@ export const getDefaultOnPremFeatures = (): TFeatureSet => ({
samlSSO: false,
enforceGoogleSSO: false,
hsm: false,
+
oidcSSO: false,
scim: false,
ldap: false,
- groups: false,
+ groups: true,
status: null,
trial_end: null,
has_used_trial: true,
- secretApproval: false,
+ secretApproval: true,
secretRotation: false,
caCrl: false,
instanceUserManagement: false,
@@ -105,7 +106,7 @@ export const getDefaultOnPremFeatures = (): TFeatureSet => ({
kmip: false,
gateway: false,
sshHostGroups: false,
- secretScanning: false,
+ secretScanning: true,
enterpriseSecretSyncs: false,
enterpriseCertificateSyncs: false,
enterpriseAppConnections: false,
diff --git a/frontend/package-lock.json b/frontend/package-lock.json
index 8701a628fb..cb2933d6b3 100644
--- a/frontend/package-lock.json
+++ b/frontend/package-lock.json
@@ -166,7 +166,8 @@
"resolved": "https://registry.npmjs.org/@adobe/css-tools/-/css-tools-4.4.4.tgz",
"integrity": "sha512-Elp+iwUx5rN5+Y8xLt5/GRoG20WGoDCQ/1Fb+1LiGtvwbDavuSk0jhD/eZdckHAuzcDzccnkv+rEjyWfRx18gg==",
"dev": true,
- "license": "MIT"
+ "license": "MIT",
+ "peer": true
},
"node_modules/@alloc/quick-lru": {
"version": "5.2.0",
@@ -211,7 +212,6 @@
"integrity": "sha512-2BCOP7TN8M+gVDj7/ht3hsaO/B/n5oDbiAyyvnRlNOs+u1o+JWNYTQrmpuNp1/Wq2gcFrI01JAW+paEKDMx/CA==",
"dev": true,
"license": "MIT",
- "peer": true,
"dependencies": {
"@babel/code-frame": "^7.27.1",
"@babel/generator": "^7.28.3",
@@ -504,7 +504,6 @@
"resolved": "https://registry.npmjs.org/@casl/ability/-/ability-6.7.2.tgz",
"integrity": "sha512-KjKXlcjKbUz8dKw7PY56F7qlfOFgxTU6tnlJ8YrbDyWkJMIlHa6VRWzCD8RU20zbJUC1hExhOFggZjm6tf1mUw==",
"license": "MIT",
- "peer": true,
"dependencies": {
"@ucast/mongo2js": "^1.3.0"
},
@@ -585,7 +584,6 @@
"resolved": "https://registry.npmjs.org/@dnd-kit/core/-/core-6.3.1.tgz",
"integrity": "sha512-xkGBRQQab4RLwgXxoqETICr6S5JlogafbhNsidmrkVv2YRs5MLwpjoF2qpiGjQt8S9AoxtIV603s0GIUpY5eYQ==",
"license": "MIT",
- "peer": true,
"dependencies": {
"@dnd-kit/accessibility": "^3.1.1",
"@dnd-kit/utilities": "^3.2.2",
@@ -1412,7 +1410,6 @@
"resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-6.7.1.tgz",
"integrity": "sha512-8dBIHbfsKlCk2jHQ9PoRBg2Z+4TwyE3vZICSnoDlnsHA6SiMlTwfmW6yX0lHsRmWJugkeb92sA0hZdkXJhuz+g==",
"license": "MIT",
- "peer": true,
"dependencies": {
"@fortawesome/fontawesome-common-types": "6.7.1"
},
@@ -2103,7 +2100,6 @@
"resolved": "https://registry.npmjs.org/@octokit/core/-/core-6.1.2.tgz",
"integrity": "sha512-hEb7Ma4cGJGEUNOAVmyfdB/3WirWMg5hDuNFVejGEDFqupeOysLc2sG6HJxY2etBp5YQu5Wtxwi020jS9xlUwg==",
"license": "MIT",
- "peer": true,
"dependencies": {
"@octokit/auth-token": "^5.0.0",
"@octokit/graphql": "^8.0.0",
@@ -2249,7 +2245,6 @@
"resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.9.0.tgz",
"integrity": "sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg==",
"license": "Apache-2.0",
- "peer": true,
"engines": {
"node": ">=8.0.0"
}
@@ -5534,7 +5529,6 @@
"integrity": "sha512-RnO1SaiCFHn666wNz2QfZEFxvmiNRqhzaMXHXxXXKt+MEP7aajlPxUSMIQpKAaJfverpovEYqjBOXDq6dDcaOQ==",
"dev": true,
"license": "MIT",
- "peer": true,
"dependencies": {
"@typescript-eslint/utils": "^8.13.0",
"eslint-visitor-keys": "^4.2.0",
@@ -6160,7 +6154,6 @@
"resolved": "https://registry.npmjs.org/@tanstack/react-router/-/react-router-1.95.1.tgz",
"integrity": "sha512-P5x4yNhcdkYsCEoYeGZP8Q9Jlxf0WXJa4G/xvbmM905seZc9FqJqvCSRvX3dWTPOXRABhl4g+8DHqfft0c/AvQ==",
"license": "MIT",
- "peer": true,
"dependencies": {
"@tanstack/history": "1.95.0",
"@tanstack/react-store": "^0.7.0",
@@ -6405,6 +6398,7 @@
"integrity": "sha512-o4PXJQidqJl82ckFaXUeoAW+XysPLauYI43Abki5hABd853iMhitooc6znOnczgbTYmEP6U6/y1ZyKAIsvMKGg==",
"dev": true,
"license": "MIT",
+ "peer": true,
"dependencies": {
"@babel/code-frame": "^7.10.4",
"@babel/runtime": "^7.12.5",
@@ -6425,6 +6419,7 @@
"integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==",
"dev": true,
"license": "Apache-2.0",
+ "peer": true,
"dependencies": {
"dequal": "^2.0.3"
}
@@ -6435,6 +6430,7 @@
"integrity": "sha512-zIcONa+hVtVSSep9UT3jZ5rizo2BsxgyDYU7WFD5eICBE7no3881HGeb/QkGfsJs6JTkY1aQhT7rIPC7e+0nnA==",
"dev": true,
"license": "MIT",
+ "peer": true,
"dependencies": {
"@adobe/css-tools": "^4.4.0",
"aria-query": "^5.0.0",
@@ -6454,7 +6450,8 @@
"resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.6.3.tgz",
"integrity": "sha512-7ZgogeTnjuHbo+ct10G9Ffp0mif17idi0IyWNVA/wcwcm7NPOD/WEHVP3n7n3MhXqxoIYm8d6MuZohYWIZ4T3w==",
"dev": true,
- "license": "MIT"
+ "license": "MIT",
+ "peer": true
},
"node_modules/@testing-library/user-event": {
"version": "14.6.1",
@@ -6462,6 +6459,7 @@
"integrity": "sha512-vq7fv0rnt+QTXgPxr5Hjc210p6YKq2kmdziLgnsZGgLJ9e6VAShx1pACLuRjd/AS/sr7phAR58OIIpf0LlmQNw==",
"dev": true,
"license": "MIT",
+ "peer": true,
"engines": {
"node": ">=12",
"npm": ">=6"
@@ -6482,7 +6480,8 @@
"resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-5.0.4.tgz",
"integrity": "sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw==",
"dev": true,
- "license": "MIT"
+ "license": "MIT",
+ "peer": true
},
"node_modules/@types/babel__core": {
"version": "7.20.5",
@@ -6535,6 +6534,7 @@
"integrity": "sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==",
"dev": true,
"license": "MIT",
+ "peer": true,
"dependencies": {
"@types/deep-eql": "*",
"assertion-error": "^2.0.1"
@@ -6608,7 +6608,8 @@
"resolved": "https://registry.npmjs.org/@types/deep-eql/-/deep-eql-4.0.2.tgz",
"integrity": "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==",
"dev": true,
- "license": "MIT"
+ "license": "MIT",
+ "peer": true
},
"node_modules/@types/doctrine": {
"version": "0.0.9",
@@ -6743,7 +6744,6 @@
"resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.16.tgz",
"integrity": "sha512-oh8AMIC4Y2ciKufU8hnKgs+ufgbA/dhPTACaZPM86AbwX9QwnFtSoPWEeRUj8fge+v6kFt78BXcDhAU1SrrAsw==",
"license": "MIT",
- "peer": true,
"dependencies": {
"@types/prop-types": "*",
"csstype": "^3.0.2"
@@ -6755,7 +6755,6 @@
"integrity": "sha512-P4t6saawp+b/dFrUr2cvkVsfvPguwsxtH6dNIYRllMsefqFzkZk5UIjzyDOv5g1dXIPdG4Sp1yCR4Z6RCUsG/Q==",
"devOptional": true,
"license": "MIT",
- "peer": true,
"peerDependencies": {
"@types/react": "^18.0.0"
}
@@ -6803,7 +6802,6 @@
"integrity": "sha512-QXwAlHlbcAwNlEEMKQS2RCgJsgXrTJdjXT08xEgbPFa2yYQgVjBymxP5DrfrE7X7iodSzd9qBUHUycdyVJTW1w==",
"dev": true,
"license": "MIT",
- "peer": true,
"dependencies": {
"@eslint-community/regexpp": "^4.10.0",
"@typescript-eslint/scope-manager": "8.34.0",
@@ -6844,7 +6842,6 @@
"integrity": "sha512-vxXJV1hVFx3IXz/oy2sICsJukaBrtDEQSBiV48/YIV5KWjX1dO+bcIr/kCPrW6weKXvsaGKFNlwH0v2eYdRRbA==",
"dev": true,
"license": "MIT",
- "peer": true,
"dependencies": {
"@typescript-eslint/scope-manager": "8.34.0",
"@typescript-eslint/types": "8.34.0",
@@ -7116,6 +7113,7 @@
"integrity": "sha512-Io0yyORnB6sikFlt8QW5K7slY4OjqNX9jmJQ02QDda8lyM6B5oNgVWoSoKPac8/kgnCUzuHQKrSLtu/uOqqrig==",
"dev": true,
"license": "MIT",
+ "peer": true,
"dependencies": {
"@types/chai": "^5.2.2",
"@vitest/spy": "3.2.4",
@@ -7133,6 +7131,7 @@
"integrity": "sha512-46ryTE9RZO/rfDd7pEqFl7etuyzekzEhUbTW3BvmeO/BcCMEgq59BKhek3dXDWgAj4oMK6OZi+vRr1wPW6qjEQ==",
"dev": true,
"license": "MIT",
+ "peer": true,
"dependencies": {
"@vitest/spy": "3.2.4",
"estree-walker": "^3.0.3",
@@ -7160,6 +7159,7 @@
"integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==",
"dev": true,
"license": "MIT",
+ "peer": true,
"dependencies": {
"@types/estree": "^1.0.0"
}
@@ -7170,6 +7170,7 @@
"integrity": "sha512-IVNZik8IVRJRTr9fxlitMKeJeXFFFN0JaB9PHPGQ8NKQbGpfjlTx9zO4RefN8gp7eqjNy8nyK3NZmBzOPeIxtA==",
"dev": true,
"license": "MIT",
+ "peer": true,
"dependencies": {
"tinyrainbow": "^2.0.0"
},
@@ -7183,6 +7184,7 @@
"integrity": "sha512-vAfasCOe6AIK70iP5UD11Ac4siNUNJ9i/9PZ3NKx07sG6sUxeag1LWdNrMWeKKYBLlzuK+Gn65Yd5nyL6ds+nw==",
"dev": true,
"license": "MIT",
+ "peer": true,
"dependencies": {
"tinyspy": "^4.0.3"
},
@@ -7196,6 +7198,7 @@
"integrity": "sha512-fB2V0JFrQSMsCo9HiSq3Ezpdv4iYaXRG1Sx8edX3MwxfyNn83mKiGzOcH+Fkxt4MHxr3y42fQi1oeAInqgX2QA==",
"dev": true,
"license": "MIT",
+ "peer": true,
"dependencies": {
"@vitest/pretty-format": "3.2.4",
"loupe": "^3.1.4",
@@ -7224,8 +7227,7 @@
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/@xterm/xterm/-/xterm-5.5.0.tgz",
"integrity": "sha512-hqJHYaQb5OptNunnyAnkHyM8aCjZ1MEIDTQu1iIbbTD/xops91NB5yq1ZK/dC2JDbVWtF23zUtl9JE2NqwT87A==",
- "license": "MIT",
- "peer": true
+ "license": "MIT"
},
"node_modules/@xyflow/react": {
"version": "12.4.4",
@@ -7291,7 +7293,6 @@
"integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==",
"dev": true,
"license": "MIT",
- "peer": true,
"bin": {
"acorn": "bin/acorn"
},
@@ -7408,6 +7409,7 @@
"integrity": "sha512-COROpnaoap1E2F000S62r6A60uHZnmlvomhfyT2DlTcrY1OrBKn2UhH7qn5wTC9zMvD0AY7csdPSNwKP+7WiQw==",
"dev": true,
"license": "Apache-2.0",
+ "peer": true,
"engines": {
"node": ">= 0.4"
}
@@ -7456,6 +7458,7 @@
"integrity": "sha512-CVvd6FHg1Z3POpBLxO6E6zr+rSKEQ9L6rZHAaY7lLfhKsWYUBBOuMs0e9o24oopj6H+geRCX0YJ+TJLBK2eHyQ==",
"dev": true,
"license": "MIT",
+ "peer": true,
"dependencies": {
"call-bind": "^1.0.7",
"define-properties": "^1.2.1",
@@ -7536,6 +7539,7 @@
"integrity": "sha512-p6Fx8B7b7ZhL/gmUsAy0D15WhvDccw3mnGNbZpi3pmeJdxtWsj2jEaI4Y6oo3XiHfzuSgPwKc04MYt6KgvC/wA==",
"dev": true,
"license": "MIT",
+ "peer": true,
"dependencies": {
"call-bind": "^1.0.7",
"define-properties": "^1.2.1",
@@ -7623,6 +7627,7 @@
"integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==",
"dev": true,
"license": "MIT",
+ "peer": true,
"engines": {
"node": ">=12"
}
@@ -7633,6 +7638,7 @@
"integrity": "sha512-6t10qk83GOG8p0vKmaCr8eiilZwO171AvbROMtvvNiwrTly62t+7XkA8RdIIVbpMhCASAsxgAzdRSwh6nw/5Dg==",
"dev": true,
"license": "MIT",
+ "peer": true,
"dependencies": {
"tslib": "^2.0.1"
},
@@ -7645,7 +7651,8 @@
"resolved": "https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.8.tgz",
"integrity": "sha512-OH/2E5Fg20h2aPrbe+QL8JZQFko0YZaF+j4mnQ7BGhfavO7OpSLa8a0y9sBwomHdSbkhTS8TQNayBfnW5DwbvQ==",
"dev": true,
- "license": "MIT"
+ "license": "MIT",
+ "peer": true
},
"node_modules/asynckit": {
"version": "0.4.0",
@@ -7695,6 +7702,7 @@
"integrity": "sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ==",
"dev": true,
"license": "Apache-2.0",
+ "peer": true,
"engines": {
"node": ">= 0.4"
}
@@ -7796,6 +7804,7 @@
"integrity": "sha512-aVNobHnJqLiUelTaHat9DZ1qM2w0C0Eym4LPI/3JxOnSokGVdsl1T1kN7TFvsEAD8G47A6VKQ0TVHqbBnYMJlQ==",
"dev": true,
"license": "MIT",
+ "peer": true,
"dependencies": {
"open": "^8.0.4"
},
@@ -8032,7 +8041,6 @@
}
],
"license": "MIT",
- "peer": true,
"dependencies": {
"baseline-browser-mapping": "^2.8.9",
"caniuse-lite": "^1.0.30001746",
@@ -8214,6 +8222,7 @@
"integrity": "sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw==",
"dev": true,
"license": "MIT",
+ "peer": true,
"dependencies": {
"assertion-error": "^2.0.1",
"check-error": "^2.1.1",
@@ -8284,6 +8293,7 @@
"integrity": "sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==",
"dev": true,
"license": "MIT",
+ "peer": true,
"engines": {
"node": ">= 16"
}
@@ -9114,7 +9124,8 @@
"resolved": "https://registry.npmjs.org/css.escape/-/css.escape-1.5.1.tgz",
"integrity": "sha512-YUifsXXuknHlUsmlgyY0PKzgPOr7/FjCePfHNt0jxm83wHZi44VDMQ7/fGNkjY3/jV1MC+1CmZbaHzugyeRtpg==",
"dev": true,
- "license": "MIT"
+ "license": "MIT",
+ "peer": true
},
"node_modules/cssesc": {
"version": "3.0.0",
@@ -9133,8 +9144,7 @@
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz",
"integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==",
- "license": "MIT",
- "peer": true
+ "license": "MIT"
},
"node_modules/cva": {
"name": "class-variance-authority",
@@ -9206,7 +9216,6 @@
"resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-3.0.0.tgz",
"integrity": "sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ==",
"license": "ISC",
- "peer": true,
"engines": {
"node": ">=12"
}
@@ -9260,7 +9269,8 @@
"resolved": "https://registry.npmjs.org/damerau-levenshtein/-/damerau-levenshtein-1.0.8.tgz",
"integrity": "sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA==",
"dev": true,
- "license": "BSD-2-Clause"
+ "license": "BSD-2-Clause",
+ "peer": true
},
"node_modules/data-view-buffer": {
"version": "1.0.1",
@@ -9376,6 +9386,7 @@
"integrity": "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==",
"dev": true,
"license": "MIT",
+ "peer": true,
"engines": {
"node": ">=6"
}
@@ -9410,6 +9421,7 @@
"integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==",
"dev": true,
"license": "MIT",
+ "peer": true,
"engines": {
"node": ">=8"
}
@@ -9540,7 +9552,8 @@
"resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.5.16.tgz",
"integrity": "sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==",
"dev": true,
- "license": "MIT"
+ "license": "MIT",
+ "peer": true
},
"node_modules/dom-helpers": {
"version": "5.2.1",
@@ -9751,6 +9764,7 @@
"integrity": "sha512-tpxqxncxnpw3c93u8n3VOzACmRFoVmWJqbWXvX/JfKbkhBw1oslgPrUfeSt2psuqyEJFD6N/9lg5i7bsKpoq+Q==",
"dev": true,
"license": "MIT",
+ "peer": true,
"dependencies": {
"call-bind": "^1.0.7",
"define-properties": "^1.2.1",
@@ -9834,7 +9848,6 @@
"dev": true,
"hasInstallScript": true,
"license": "MIT",
- "peer": true,
"bin": {
"esbuild": "bin/esbuild"
},
@@ -9876,6 +9889,7 @@
"integrity": "sha512-H2/S7Pm8a9CL1uhp9OvjwrBh5Pvx0H8qVOxNu8Wed9Y7qv56MPtq+GGM8RJpq6glYJn9Wspr8uw7l55uyinNeg==",
"dev": true,
"license": "MIT",
+ "peer": true,
"dependencies": {
"debug": "^4.3.4"
},
@@ -9912,7 +9926,6 @@
"deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.",
"dev": true,
"license": "MIT",
- "peer": true,
"dependencies": {
"@eslint-community/eslint-utils": "^4.2.0",
"@eslint-community/regexpp": "^4.6.1",
@@ -9969,7 +9982,6 @@
"integrity": "sha512-T75QYQVQX57jiNgpF9r1KegMICE94VYwoFQyMGhrvc+lB8YF2E/M/PYDaQe1AJcWaEgqLE+ErXV1Og/+6Vyzew==",
"dev": true,
"license": "MIT",
- "peer": true,
"dependencies": {
"eslint-config-airbnb-base": "^15.0.0",
"object.assign": "^4.1.2",
@@ -9992,7 +10004,6 @@
"integrity": "sha512-xaX3z4ZZIcFLvh2oUNvcX5oEofXda7giYmuplVxoOg5A7EXJMrUyqRgR+mhDhPK8LZ4PttFOBvCYDbX3sUoUig==",
"dev": true,
"license": "MIT",
- "peer": true,
"dependencies": {
"confusing-browser-globals": "^1.0.10",
"object.assign": "^4.1.2",
@@ -10023,7 +10034,6 @@
"integrity": "sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==",
"dev": true,
"license": "MIT",
- "peer": true,
"bin": {
"eslint-config-prettier": "bin/cli.js"
},
@@ -10123,7 +10133,6 @@
"integrity": "sha512-ixmkI62Rbc2/w8Vfxyh1jQRTdRTF52VxwRVHl/ykPAmqG+Nb7/kNn+byLP0LxPgI7zWA16Jt82SybJInmMia3A==",
"dev": true,
"license": "MIT",
- "peer": true,
"dependencies": {
"@rtsao/scc": "^1.1.0",
"array-includes": "^3.1.8",
@@ -10253,6 +10262,7 @@
"integrity": "sha512-EsTAnj9fLVr/GZleBLFbj/sSuXeWmp1eXIN60ceYnZveqEaUCyW4X+Vh4WTdUhCkW4xutXYqTXCUSyqD4rB75w==",
"dev": true,
"license": "MIT",
+ "peer": true,
"dependencies": {
"array-includes": "^3.1.8",
"array.prototype.findlast": "^1.2.5",
@@ -10286,7 +10296,6 @@
"integrity": "sha512-QzliNJq4GinDBcD8gPB5v0wh6g8q3SUi6EFF0x8N/BL9PoVs0atuGc47ozMRyOWAKdwaZ5OnbOEa3WR+dSGKuQ==",
"dev": true,
"license": "MIT",
- "peer": true,
"engines": {
"node": ">=10"
},
@@ -10310,6 +10319,7 @@
"integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==",
"dev": true,
"license": "Apache-2.0",
+ "peer": true,
"dependencies": {
"esutils": "^2.0.2"
},
@@ -10323,6 +10333,7 @@
"integrity": "sha512-U7WjGVG9sH8tvjW5SmGbQuui75FiyjAX72HX15DwBBwF9dNiQZRQAg9nnPhYy+TUnE0+VcrttuvNI8oSxZcocA==",
"dev": true,
"license": "MIT",
+ "peer": true,
"dependencies": {
"is-core-module": "^2.13.0",
"path-parse": "^1.0.7",
@@ -10341,6 +10352,7 @@
"integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
"dev": true,
"license": "ISC",
+ "peer": true,
"bin": {
"semver": "bin/semver.js"
}
@@ -10502,6 +10514,7 @@
"integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==",
"dev": true,
"license": "BSD-2-Clause",
+ "peer": true,
"bin": {
"esparse": "bin/esparse.js",
"esvalidate": "bin/esvalidate.js"
@@ -11532,7 +11545,6 @@
}
],
"license": "MIT",
- "peer": true,
"dependencies": {
"@babel/runtime": "^7.23.2"
},
@@ -11626,6 +11638,7 @@
"integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==",
"dev": true,
"license": "MIT",
+ "peer": true,
"engines": {
"node": ">=8"
}
@@ -11893,6 +11906,7 @@
"integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==",
"dev": true,
"license": "MIT",
+ "peer": true,
"bin": {
"is-docker": "cli.js"
},
@@ -12214,6 +12228,7 @@
"integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==",
"dev": true,
"license": "MIT",
+ "peer": true,
"dependencies": {
"is-docker": "^2.0.0"
},
@@ -12248,6 +12263,7 @@
"resolved": "https://registry.npmjs.org/isomorphic.js/-/isomorphic.js-0.2.5.tgz",
"integrity": "sha512-PIeMbHqMt4DnUP3MA/Flc0HElYjMXArsw1qwJZcm9sqR8mq3l8NYizFMty0pWwE/tzIGH3EKK5+jes5mAr85yw==",
"license": "MIT",
+ "peer": true,
"funding": {
"type": "GitHub Sponsors ❤",
"url": "https://github.com/sponsors/dmonad"
@@ -12259,6 +12275,7 @@
"integrity": "sha512-x4WH0BWmrMmg4oHHl+duwubhrvczGlyuGAZu3nvrf0UXOfPu8IhZObFEr7DE/iv01YgVZrsOiRcqw2srkKEDIA==",
"dev": true,
"license": "MIT",
+ "peer": true,
"dependencies": {
"define-data-property": "^1.1.4",
"es-object-atoms": "^1.0.0",
@@ -12408,6 +12425,7 @@
"integrity": "sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ==",
"dev": true,
"license": "MIT",
+ "peer": true,
"dependencies": {
"array-includes": "^3.1.6",
"array.prototype.flat": "^1.3.1",
@@ -12442,7 +12460,8 @@
"resolved": "https://registry.npmjs.org/language-subtag-registry/-/language-subtag-registry-0.3.23.tgz",
"integrity": "sha512-0K65Lea881pHotoGEa5gDlMxt3pctLi2RplBb7Ezh4rRdLEOtgi7n4EwK9lamnUCkKBqaeKRVebTq6BAxSkpXQ==",
"dev": true,
- "license": "CC0-1.0"
+ "license": "CC0-1.0",
+ "peer": true
},
"node_modules/language-tags": {
"version": "1.0.9",
@@ -12450,6 +12469,7 @@
"integrity": "sha512-MbjN408fEndfiQXbFQ1vnd+1NoLDsnQW41410oQBXiyXDMYH5z505juWa4KUE1LqxRC7DgOgZDbKLxHIwm27hA==",
"dev": true,
"license": "MIT",
+ "peer": true,
"dependencies": {
"language-subtag-registry": "^0.3.20"
},
@@ -12482,6 +12502,7 @@
"resolved": "https://registry.npmjs.org/lib0/-/lib0-0.2.102.tgz",
"integrity": "sha512-g70kydI0I1sZU0ChO8mBbhw0oUW/8U0GHzygpvEIx8k+jgOpqnTSb/E+70toYVqHxBhrERD21TwD5QcZJQ40ZQ==",
"license": "MIT",
+ "peer": true,
"dependencies": {
"isomorphic.js": "^0.2.4"
},
@@ -12812,7 +12833,8 @@
"resolved": "https://registry.npmjs.org/loupe/-/loupe-3.2.1.tgz",
"integrity": "sha512-CdzqowRJCeLU72bHvWqwRBBlLcMEtIvGrlvef74kMnV2AolS9Y8xUv1I0U/MNAWMhBlKIoyuEgoJ0t/bbwHbLQ==",
"dev": true,
- "license": "MIT"
+ "license": "MIT",
+ "peer": true
},
"node_modules/lru-cache": {
"version": "5.1.1",
@@ -12839,6 +12861,7 @@
"integrity": "sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==",
"dev": true,
"license": "MIT",
+ "peer": true,
"bin": {
"lz-string": "bin/bin.js"
}
@@ -13530,6 +13553,7 @@
"integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==",
"dev": true,
"license": "MIT",
+ "peer": true,
"engines": {
"node": ">=4"
}
@@ -13878,6 +13902,7 @@
"integrity": "sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==",
"dev": true,
"license": "MIT",
+ "peer": true,
"dependencies": {
"define-lazy-prop": "^2.0.0",
"is-docker": "^2.1.1",
@@ -14146,6 +14171,7 @@
"integrity": "sha512-//nshmD55c46FuFw26xV/xFAaB5HF9Xdap7HJBBnrKdAd6/GxDBaNA1870O79+9ueg61cZLSVc+OaFlfmObYVQ==",
"dev": true,
"license": "MIT",
+ "peer": true,
"engines": {
"node": ">= 14.16"
}
@@ -14306,7 +14332,6 @@
"integrity": "sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==",
"dev": true,
"license": "MIT",
- "peer": true,
"bin": {
"prettier": "bin/prettier.cjs"
},
@@ -14423,6 +14448,7 @@
"integrity": "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==",
"dev": true,
"license": "MIT",
+ "peer": true,
"dependencies": {
"ansi-regex": "^5.0.1",
"ansi-styles": "^5.0.0",
@@ -14438,6 +14464,7 @@
"integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==",
"dev": true,
"license": "MIT",
+ "peer": true,
"engines": {
"node": ">=10"
},
@@ -14450,7 +14477,8 @@
"resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz",
"integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==",
"dev": true,
- "license": "MIT"
+ "license": "MIT",
+ "peer": true
},
"node_modules/prismjs": {
"version": "1.30.0",
@@ -14681,7 +14709,6 @@
"resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz",
"integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==",
"license": "MIT",
- "peer": true,
"dependencies": {
"loose-envify": "^1.1.0"
},
@@ -14709,7 +14736,6 @@
"resolved": "https://registry.npmjs.org/react/-/react-16.14.0.tgz",
"integrity": "sha512-0X2CImDkJGApiAlcf0ODKIneSwBPhqJawOa5wCtKbu7ZECrmS26NvtSILynQ66cgkT/RJ4LidJOc3bUESwmU8g==",
"license": "MIT",
- "peer": true,
"dependencies": {
"loose-envify": "^1.1.0",
"object-assign": "^4.1.1",
@@ -14814,7 +14840,6 @@
"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz",
"integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==",
"license": "MIT",
- "peer": true,
"dependencies": {
"loose-envify": "^1.1.0",
"scheduler": "^0.23.2"
@@ -14865,7 +14890,6 @@
"resolved": "https://registry.npmjs.org/react-hook-form/-/react-hook-form-7.56.3.tgz",
"integrity": "sha512-IK18V6GVbab4TAo1/cz3kqajxbDPGofdF0w7VHdCo0Nt8PrPlOZcuuDq9YYIV1BtjcX78x0XsldbQRQnQXWXmw==",
"license": "MIT",
- "peer": true,
"engines": {
"node": ">=18.0.0"
},
@@ -15115,6 +15139,7 @@
"integrity": "sha512-YTUo+Flmw4ZXiWfQKGcwwc11KnoRAYgzAE2E7mXKCjSviTKShtxBsN6YUUBB2gtaBzKzeKunxhUwNHQuRryhWA==",
"dev": true,
"license": "MIT",
+ "peer": true,
"dependencies": {
"ast-types": "^0.16.1",
"esprima": "~4.0.0",
@@ -15132,6 +15157,7 @@
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
"dev": true,
"license": "BSD-3-Clause",
+ "peer": true,
"engines": {
"node": ">=0.10.0"
}
@@ -15148,6 +15174,7 @@
"integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==",
"dev": true,
"license": "MIT",
+ "peer": true,
"dependencies": {
"indent-string": "^4.0.0",
"strip-indent": "^3.0.0"
@@ -15162,6 +15189,7 @@
"integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==",
"dev": true,
"license": "MIT",
+ "peer": true,
"dependencies": {
"min-indent": "^1.0.0"
},
@@ -15376,7 +15404,6 @@
"integrity": "sha512-3GuObel8h7Kqdjt0gxkEzaifHTqLVW56Y/bjN7PSQtkKr0w3V/QYSdt6QWYtd7A1xUtYQigtdUfgj1RvWVtorw==",
"dev": true,
"license": "MIT",
- "peer": true,
"dependencies": {
"@types/estree": "1.0.8"
},
@@ -15895,6 +15922,7 @@
"integrity": "sha512-o7+c9bW6zpAdJHTtujeePODAhkuicdAryFsfVKwA+wGw89wJ4GTY484WTucM9hLtDEOpOvI+aHnzqnC5lHp4Rg==",
"dev": true,
"license": "MIT",
+ "peer": true,
"dependencies": {
"call-bind": "^1.0.7",
"define-properties": "^1.2.1",
@@ -15910,6 +15938,7 @@
"integrity": "sha512-NUdh0aDavY2og7IbBPenWqR9exH+E26Sv8e0/eTe1tltDGZL+GtBkDAnnyBtmekfK6/Dq3MkcGtzXFEd1LQrtg==",
"dev": true,
"license": "MIT",
+ "peer": true,
"dependencies": {
"call-bind": "^1.0.7",
"define-properties": "^1.2.1",
@@ -15937,6 +15966,7 @@
"integrity": "sha512-0u/TldDbKD8bFCQ/4f5+mNRrXwZ8hg2w7ZR8wa16e8z9XpePWl3eGEcUD0OXpEH/VJH/2G3gjUtR3ZOiBe2S/w==",
"dev": true,
"license": "MIT",
+ "peer": true,
"dependencies": {
"define-properties": "^1.1.3",
"es-abstract": "^1.17.5"
@@ -16157,8 +16187,7 @@
"resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.1.14.tgz",
"integrity": "sha512-b7pCxjGO98LnxVkKjaZSDeNuljC4ueKUddjENJOADtubtdo8llTaJy7HwBMeLNSSo2N5QIAgklslK1+Ir8r6CA==",
"dev": true,
- "license": "MIT",
- "peer": true
+ "license": "MIT"
},
"node_modules/tapable": {
"version": "2.2.1",
@@ -16262,6 +16291,7 @@
"integrity": "sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw==",
"dev": true,
"license": "MIT",
+ "peer": true,
"engines": {
"node": ">=14.0.0"
}
@@ -16272,6 +16302,7 @@
"integrity": "sha512-azl+t0z7pw/z958Gy9svOTuzqIk6xq+NSheJzn5MMWtWTFywIacg2wUlzKFGtt3cthx0r2SxMK0yzJOR0IES7Q==",
"dev": true,
"license": "MIT",
+ "peer": true,
"engines": {
"node": ">=14.0.0"
}
@@ -16566,7 +16597,6 @@
"integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==",
"devOptional": true,
"license": "Apache-2.0",
- "peer": true,
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
@@ -16951,7 +16981,6 @@
"integrity": "sha512-+Oxm7q9hDoLMyJOYfUYBuHQo+dkAloi33apOPP56pzj+vsdJDzr+j1NISE5pyaAuKL4A3UD34qd0lx5+kfKp2g==",
"dev": true,
"license": "MIT",
- "peer": true,
"dependencies": {
"esbuild": "^0.25.0",
"fdir": "^6.4.4",
@@ -17368,6 +17397,7 @@
"integrity": "sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==",
"dev": true,
"license": "MIT",
+ "peer": true,
"engines": {
"node": ">=10.0.0"
},
@@ -17444,7 +17474,6 @@
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.6.1.tgz",
"integrity": "sha512-7r0XPzioN/Q9kXBro/XPnA6kznR73DHq+GXh5ON7ZozRO6aMjbmiBuKste2wslTFkC5d1dw0GooOCepZXJ2SAg==",
"license": "ISC",
- "peer": true,
"bin": {
"yaml": "bin.mjs"
},
@@ -17595,7 +17624,6 @@
"resolved": "https://registry.npmjs.org/zod/-/zod-3.24.1.tgz",
"integrity": "sha512-muH7gBL9sI1nciMZV67X5fTKKBLtwpZ5VBp1vsOQzj1MhrBZ4wlVCm3gedKZWLp0Oyel8sIGfeiz54Su+OVT+A==",
"license": "MIT",
- "peer": true,
"funding": {
"url": "https://github.com/sponsors/colinhacks"
}
diff --git a/frontend/src/components/v3/generic/Command/Command.tsx b/frontend/src/components/v3/generic/Command/Command.tsx
index 16f6640993..c6f400e926 100644
--- a/frontend/src/components/v3/generic/Command/Command.tsx
+++ b/frontend/src/components/v3/generic/Command/Command.tsx
@@ -104,7 +104,7 @@ function CommandGroup({
<CommandPrimitive.Group
data-slot="command-group"
className={cn(
- "[&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",
+ "overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted",
className
)}
{...props}
diff --git a/frontend/src/components/v3/generic/Sidebar/Sidebar.tsx b/frontend/src/components/v3/generic/Sidebar/Sidebar.tsx
new file mode 100644
index 0000000000..9cb0527465
--- /dev/null
+++ b/frontend/src/components/v3/generic/Sidebar/Sidebar.tsx
@@ -0,0 +1,703 @@
+/* eslint-disable react/prop-types */
+
+import * as React from "react";
+import { Slot } from "@radix-ui/react-slot";
+import { cva, type VariantProps } from "cva";
+import { PanelLeftIcon } from "lucide-react";
+
+import { cn } from "../../utils";
+import { UnstableIconButton } from "../IconButton";
+import { UnstableInput as Input } from "../Input";
+import { UnstableSeparator as Separator } from "../Separator";
+import { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle } from "../Sheet";
+import { Skeleton } from "../Skeleton";
+import { Tooltip, TooltipContent, TooltipTrigger } from "../Tooltip";
+
+const SIDEBAR_COOKIE_NAME = "sidebar_state";
+const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
+const SIDEBAR_WIDTH = "16rem";
+const SIDEBAR_WIDTH_MOBILE = "18rem";
+const SIDEBAR_WIDTH_ICON = "3rem";
+const SIDEBAR_KEYBOARD_SHORTCUT = "b";
+
+type SidebarScope = "org" | "sub-org" | "project" | "admin";
+
+const SidebarScopeContext = React.createContext<SidebarScope>("org");
+
+function useSidebarScope() {
+ return React.useContext(SidebarScopeContext);
+}
+
+type SidebarContextProps = {
+ state: "expanded" | "collapsed";
+ open: boolean;
+ setOpen: (open: boolean) => void;
+ openMobile: boolean;
+ setOpenMobile: (open: boolean) => void;
+ isMobile: boolean;
+ toggleSidebar: () => void;
+};
+
+const SidebarContext = React.createContext<SidebarContextProps | null>(null);
+
+function useSidebar() {
+ const context = React.useContext(SidebarContext);
+ if (!context) {
+ throw new Error("useSidebar must be used within a SidebarProvider.");
+ }
+
+ return context;
+}
+
+function SidebarProvider({
+ defaultOpen = true,
+ open: openProp,
+ onOpenChange: setOpenProp,
+ className,
+ style,
+ children,
+ ...props
+}: React.ComponentProps<"div"> & {
+ defaultOpen?: boolean;
+ open?: boolean;
+ onOpenChange?: (open: boolean) => void;
+}) {
+ const isMobile = false;
+ const [openMobile, setOpenMobile] = React.useState(false);
+
+ // This is the internal state of the sidebar.
+ // We use openProp and setOpenProp for control from outside the component.
+ // eslint-disable-next-line @typescript-eslint/naming-convention
+ const [_open, _setOpen] = React.useState(defaultOpen);
+ const open = openProp ?? _open;
+ const setOpen = React.useCallback(
+ (value: boolean | ((value: boolean) => boolean)) => {
+ const openState = typeof value === "function" ? value(open) : value;
+ if (setOpenProp) {
+ setOpenProp(openState);
+ } else {
+ _setOpen(openState);
+ }
+
+ // This sets the cookie to keep the sidebar state.
+ document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
+ },
+ [setOpenProp, open]
+ );
+
+ // Helper to toggle the sidebar.
+ const toggleSidebar = React.useCallback(() => {
+ return isMobile ? setOpenMobile((isOpen) => !isOpen) : setOpen((isOpen) => !isOpen);
+ }, [isMobile, setOpen, setOpenMobile]);
+
+ // Adds a keyboard shortcut to toggle the sidebar.
+ React.useEffect(() => {
+ const handleKeyDown = (event: KeyboardEvent) => {
+ if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
+ event.preventDefault();
+ toggleSidebar();
+ }
+ };
+
+ window.addEventListener("keydown", handleKeyDown);
+ return () => window.removeEventListener("keydown", handleKeyDown);
+ }, [toggleSidebar]);
+
+ // We add a state so that we can do data-state="expanded" or "collapsed".
+ // This makes it easier to style the sidebar with Tailwind classes.
+ const state = open ? "expanded" : "collapsed";
+
+ const contextValue = React.useMemo<SidebarContextProps>(
+ () => ({
+ state,
+ open,
+ setOpen,
+ isMobile,
+ openMobile,
+ setOpenMobile,
+ toggleSidebar
+ }),
+ [state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]
+ );
+
+ return (
+ <SidebarContext.Provider value={contextValue}>
+ <div
+ data-slot="sidebar-wrapper"
+ style={
+ {
+ "--sidebar-width": SIDEBAR_WIDTH,
+ "--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
+ ...style
+ } as React.CSSProperties
+ }
+ className={cn(
+ "group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar",
+ className
+ )}
+ {...props}
+ >
+ {children}
+ </div>
+ </SidebarContext.Provider>
+ );
+}
+
+function Sidebar({
+ side = "left",
+ variant = "sidebar",
+ collapsible = "offcanvas",
+ className,
+ children,
+ dir,
+ scope,
+ ...props
+}: React.ComponentProps<"div"> & {
+ side?: "left" | "right";
+ scope: SidebarScope;
+ variant?: "sidebar" | "floating" | "inset";
+ collapsible?: "offcanvas" | "icon" | "none";
+}) {
+ const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
+
+ if (collapsible === "none") {
+ return (
+ <SidebarScopeContext.Provider value={scope}>
+ <div
+ data-slot="sidebar"
+ className={cn(
+ "to flex h-full w-(--sidebar-width) flex-col border-r border-border bg-gradient-to-r to-transparent text-foreground",
+ scope === "project" && "from-project/5",
+ scope === "sub-org" && "from-sub-org/5",
+ scope === "org" && "from-org/5",
+ scope === "admin" && "from-admin/5",
+ className
+ )}
+ {...props}
+ >
+ {children}
+ </div>
+ </SidebarScopeContext.Provider>
+ );
+ }
+
+ if (isMobile) {
+ return (
+ <SidebarScopeContext.Provider value={scope}>
+ <Sheet open={openMobile} onOpenChange={setOpenMobile} {...props}>
+ <SheetContent
+ dir={dir}
+ data-sidebar="sidebar"
+ data-slot="sidebar"
+ data-mobile="true"
+ className="w-(--sidebar-width) bg-card p-0 text-foreground [&>button]:hidden"
+ style={
+ {
+ "--sidebar-width": SIDEBAR_WIDTH_MOBILE
+ } as React.CSSProperties
+ }
+ side={side}
+ >
+ <SheetHeader className="sr-only">
+ <SheetTitle>Sidebar</SheetTitle>
+ <SheetDescription>Displays the mobile sidebar.</SheetDescription>
+ </SheetHeader>
+ <div className="flex h-full w-full flex-col">{children}</div>
+ </SheetContent>
+ </Sheet>
+ </SidebarScopeContext.Provider>
+ );
+ }
+
+ return (
+ <SidebarScopeContext.Provider value={scope}>
+ <div
+ className="group peer hidden text-foreground md:block"
+ data-state={state}
+ data-collapsible={state === "collapsed" ? collapsible : ""}
+ data-variant={variant}
+ data-side={side}
+ data-slot="sidebar"
+ >
+ {/* This is what handles the sidebar gap on desktop */}
+ <div
+ data-slot="sidebar-gap"
+ className={cn(
+ "relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear",
+ "group-data-[collapsible=offcanvas]:w-0",
+ "group-data-[side=right]:rotate-180",
+ variant === "floating" || variant === "inset"
+ ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]"
+ : "group-data-[collapsible=icon]:w-(--sidebar-width-icon)"
+ )}
+ />
+ <div
+ data-slot="sidebar-container"
+ data-side={side}
+ className={cn(
+ "fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) border-border transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex",
+ // Adjust the padding for floating and inset variants.
+ variant === "floating" || variant === "inset"
+ ? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]"
+ : "group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",
+ className
+ )}
+ {...props}
+ >
+ <div
+ data-sidebar="sidebar"
+ data-slot="sidebar-inner"
+ className="flex size-full flex-col bg-card group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border"
+ >
+ {children}
+ </div>
+ </div>
+ </div>
+ </SidebarScopeContext.Provider>
+ );
+}
+
+function SidebarTrigger({
+ className,
+ onClick,
+ ...props
+}: React.ComponentProps<typeof UnstableIconButton>) {
+ const { toggleSidebar } = useSidebar();
+
+ return (
+ <UnstableIconButton
+ data-sidebar="trigger"
+ data-slot="sidebar-trigger"
+ size="sm"
+ className={cn(className)}
+ onClick={(event) => {
+ onClick?.(event);
+ toggleSidebar();
+ }}
+ {...props}
+ >
+ <PanelLeftIcon className="cn-rtl-flip" />
+ <span className="sr-only">Toggle Sidebar</span>
+ </UnstableIconButton>
+ );
+}
+
+function SidebarRail({ className, ...props }: React.ComponentProps<"button">) {
+ const { toggleSidebar } = useSidebar();
+
+ return (
+ <button
+ type="button"
+ data-sidebar="rail"
+ data-slot="sidebar-rail"
+ aria-label="Toggle Sidebar"
+ tabIndex={-1}
+ onClick={toggleSidebar}
+ title="Toggle Sidebar"
+ className={cn(
+ "absolute inset-y-0 z-20 hidden w-4 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:start-1/2 after:w-[2px] hover:after:bg-sidebar-border sm:flex ltr:-translate-x-1/2 rtl:-translate-x-1/2",
+ "in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize",
+ "[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize",
+ "group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar",
+ "[[data-side=left][data-collapsible=offcanvas]_&]:-right-2",
+ "[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",
+ className
+ )}
+ {...props}
+ />
+ );
+}
+
+function SidebarInset({ className, ...props }: React.ComponentProps<"main">) {
+ return (
+ <main
+ data-slot="sidebar-inset"
+ className={cn(
+ "relative flex w-full flex-1 flex-col bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",
+ className
+ )}
+ {...props}
+ />
+ );
+}
+
+function SidebarInput({ className, ...props }: React.ComponentProps<typeof Input>) {
+ return (
+ <Input
+ data-slot="sidebar-input"
+ data-sidebar="input"
+ className={cn("h-8 w-full bg-background shadow-none", className)}
+ {...props}
+ />
+ );
+}
+
+function SidebarHeader({ className, ...props }: React.ComponentProps<"div">) {
+ return (
+ <div
+ data-slot="sidebar-header"
+ data-sidebar="header"
+ className={cn("flex flex-col gap-2 p-2", className)}
+ {...props}
+ />
+ );
+}
+
+function SidebarFooter({ className, ...props }: React.ComponentProps<"div">) {
+ return (
+ <div
+ data-slot="sidebar-footer"
+ data-sidebar="footer"
+ className={cn("flex flex-col gap-2 p-2", className)}
+ {...props}
+ />
+ );
+}
+
+function SidebarSeparator({ className, ...props }: React.ComponentProps<typeof Separator>) {
+ return (
+ <Separator
+ data-slot="sidebar-separator"
+ data-sidebar="separator"
+ className={cn("mx-2 w-auto bg-sidebar-border", className)}
+ {...props}
+ />
+ );
+}
+
+function SidebarContent({ className, ...props }: React.ComponentProps<"div">) {
+ return (
+ <div
+ data-slot="sidebar-content"
+ data-sidebar="content"
+ className={cn(
+ "no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden",
+ className
+ )}
+ {...props}
+ />
+ );
+}
+
+function SidebarGroup({ className, ...props }: React.ComponentProps<"div">) {
+ return (
+ <div
+ data-slot="sidebar-group"
+ data-sidebar="group"
+ className={cn("relative flex w-full min-w-0 flex-col", className)}
+ {...props}
+ />
+ );
+}
+
+function SidebarGroupLabel({
+ className,
+ asChild = false,
+ ...props
+}: React.ComponentProps<"div"> & { asChild?: boolean }) {
+ const Comp = asChild ? Slot : "div";
+
+ return (
+ <Comp
+ data-slot="sidebar-group-label"
+ data-sidebar="group-label"
+ className={cn(
+ "flex h-10 shrink-0 items-center rounded-md px-4 text-xs font-medium text-muted ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 hover:text-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
+ className
+ )}
+ {...props}
+ />
+ );
+}
+
+function SidebarGroupAction({
+ className,
+ asChild = false,
+ ...props
+}: React.ComponentProps<"button"> & { asChild?: boolean }) {
+ const Comp = asChild ? Slot : "button";
+
+ return (
+ <Comp
+ data-slot="sidebar-group-action"
+ data-sidebar="group-action"
+ className={cn(
+ "absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform group-data-[collapsible=icon]:hidden after:absolute after:-inset-2 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0",
+ className
+ )}
+ {...props}
+ />
+ );
+}
+
+function SidebarGroupContent({ className, ...props }: React.ComponentProps<"div">) {
+ return (
+ <div
+ data-slot="sidebar-group-content"
+ data-sidebar="group-content"
+ className={cn("w-full text-sm", className)}
+ {...props}
+ />
+ );
+}
+
+function SidebarMenu({ className, ...props }: React.ComponentProps<"ul">) {
+ return (
+ <ul
+ data-slot="sidebar-menu"
+ data-sidebar="menu"
+ className={cn("flex w-full min-w-0 flex-col gap-0", className)}
+ {...props}
+ />
+ );
+}
+
+function SidebarMenuItem({ className, ...props }: React.ComponentProps<"li">) {
+ return (
+ <li
+ data-slot="sidebar-menu-item"
+ data-sidebar="menu-item"
+ className={cn("group/menu-item relative", className)}
+ {...props}
+ />
+ );
+}
+
+const sidebarMenuButtonVariants = cva(
+ "ring-sidebar-ring cursor-pointer hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-foreground/5 active:text-foreground data-active:bg-foreground/5 data-active:text-foreground data-open:hover:bg-foreground/5 data-open:hover:text-foreground gap-2 p-2 text-left text-sm transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! focus-visible:ring-2 data-active:font-medium peer/menu-button group/menu-button px-4 border-l-2 border-transparent flex w-full text-label items-center overflow-hidden outline-hidden disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate",
+ {
+ variants: {
+ variant: {
+ default: "hover:bg-foreground/[0.025] hover:text-foreground",
+ outline:
+ "bg-background hover:bg-sidebar-accent hover:text-sidebar-accent-foreground shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"
+ },
+ size: {
+ default: "h-8 text-sm",
+ sm: "h-7 text-xs",
+ lg: "h-10 text-sm group-data-[collapsible=icon]:p-0!"
+ },
+ scope: {
+ org: "data-active:border-l-org data-active:[&_svg]:text-org",
+ "sub-org": "data-active:border-l-sub-org data-active:[&_svg]:text-sub-org",
+ project: "data-active:border-l-project data-active:[&_svg]:text-project",
+ admin: "data-active:border-l-admin data-active:[&_svg]:text-admin"
+ }
+ },
+ defaultVariants: {
+ variant: "default",
+ size: "default",
+ scope: "org"
+ }
+ }
+);
+
+function SidebarMenuButton({
+ asChild = false,
+ isActive = false,
+ variant = "default",
+ size = "default",
+ scope: scopeProp,
+ tooltip,
+ className,
+ ...props
+}: React.ComponentProps<"button"> & {
+ asChild?: boolean;
+ isActive?: boolean;
+ tooltip?: string | React.ComponentProps<typeof TooltipContent>;
+} & VariantProps<typeof sidebarMenuButtonVariants>) {
+ const Comp = asChild ? Slot : "button";
+ const { isMobile, state } = useSidebar();
+ const contextScope = useSidebarScope();
+ const scope = scopeProp ?? contextScope;
+
+ const button = (
+ <Comp
+ data-slot="sidebar-menu-button"
+ data-sidebar="menu-button"
+ data-size={size}
+ data-active={isActive || undefined}
+ className={cn(sidebarMenuButtonVariants({ variant, size, scope }), className)}
+ {...props}
+ />
+ );
+
+ if (!tooltip) {
+ return button;
+ }
+
+ if (typeof tooltip === "string") {
+ // eslint-disable-next-line no-param-reassign
+ tooltip = {
+ children: tooltip
+ };
+ }
+
+ return (
+ <Tooltip>
+ <TooltipTrigger asChild>{button}</TooltipTrigger>
+ <TooltipContent
+ side="right"
+ align="center"
+ hidden={state !== "collapsed" || isMobile}
+ {...tooltip}
+ />
+ </Tooltip>
+ );
+}
+
+function SidebarMenuAction({
+ className,
+ asChild = false,
+ showOnHover = false,
+ ...props
+}: React.ComponentProps<"button"> & {
+ asChild?: boolean;
+ showOnHover?: boolean;
+}) {
+ const Comp = asChild ? Slot : "button";
+
+ return (
+ <Comp
+ data-slot="sidebar-menu-action"
+ data-sidebar="menu-action"
+ className={cn(
+ "absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform group-data-[collapsible=icon]:hidden peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 after:absolute after:-inset-2 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0",
+ showOnHover &&
+ "group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 peer-data-active/menu-button:text-sidebar-accent-foreground aria-expanded:opacity-100 md:opacity-0",
+ className
+ )}
+ {...props}
+ />
+ );
+}
+
+function SidebarMenuBadge({ className, ...props }: React.ComponentProps<"div">) {
+ return (
+ <div
+ data-slot="sidebar-menu-badge"
+ data-sidebar="menu-badge"
+ className={cn(
+ "pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md border-warning/15 bg-warning/5 px-1 text-xs font-medium text-sidebar-foreground tabular-nums select-none group-data-[collapsible=icon]:hidden peer-hover/menu-button:text-sidebar-accent-foreground peer-data-active/menu-button:text-sidebar-accent-foreground peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1",
+ className
+ )}
+ {...props}
+ />
+ );
+}
+
+function SidebarMenuSkeleton({
+ className,
+ showIcon = false,
+ ...props
+}: React.ComponentProps<"div"> & {
+ showIcon?: boolean;
+}) {
+ // Random width between 50 to 90%.
+ const [width] = React.useState(() => {
+ return `${Math.floor(Math.random() * 40) + 50}%`;
+ });
+
+ return (
+ <div
+ data-slot="sidebar-menu-skeleton"
+ data-sidebar="menu-skeleton"
+ className={cn("flex h-8 items-center gap-2 rounded-md px-2", className)}
+ {...props}
+ >
+ {showIcon && <Skeleton className="size-4 rounded-md" data-sidebar="menu-skeleton-icon" />}
+ <Skeleton
+ className="h-4 max-w-(--skeleton-width) flex-1"
+ data-sidebar="menu-skeleton-text"
+ style={
+ {
+ "--skeleton-width": width
+ } as React.CSSProperties
+ }
+ />
+ </div>
+ );
+}
+
+function SidebarMenuSub({ className, ...props }: React.ComponentProps<"ul">) {
+ return (
+ <ul
+ data-slot="sidebar-menu-sub"
+ data-sidebar="menu-sub"
+ className={cn(
+ "mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5 group-data-[collapsible=icon]:hidden",
+ className
+ )}
+ {...props}
+ />
+ );
+}
+
+function SidebarMenuSubItem({ className, ...props }: React.ComponentProps<"li">) {
+ return (
+ <li
+ data-slot="sidebar-menu-sub-item"
+ data-sidebar="menu-sub-item"
+ className={cn("group/menu-sub-item relative", className)}
+ {...props}
+ />
+ );
+}
+
+function SidebarMenuSubButton({
+ asChild = false,
+ size = "md",
+ isActive = false,
+ className,
+ ...props
+}: React.ComponentProps<"a"> & {
+ asChild?: boolean;
+ size?: "sm" | "md";
+ isActive?: boolean;
+}) {
+ const Comp = asChild ? Slot : "a";
+
+ return (
+ <Comp
+ data-slot="sidebar-menu-sub-button"
+ data-sidebar="menu-sub-button"
+ data-size={size}
+ data-active={isActive || undefined}
+ className={cn(
+ "flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground ring-sidebar-ring outline-hidden group-data-[collapsible=icon]:hidden hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground data-[size=md]:text-sm data-[size=sm]:text-xs [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground",
+ className
+ )}
+ {...props}
+ />
+ );
+}
+
+export {
+ Sidebar,
+ SidebarContent,
+ SidebarFooter,
+ SidebarGroup,
+ SidebarGroupAction,
+ SidebarGroupContent,
+ SidebarGroupLabel,
+ SidebarHeader,
+ SidebarInput,
+ SidebarInset,
+ SidebarMenu,
+ SidebarMenuAction,
+ SidebarMenuBadge,
+ SidebarMenuButton,
+ SidebarMenuItem,
+ SidebarMenuSkeleton,
+ SidebarMenuSub,
+ SidebarMenuSubButton,
+ SidebarMenuSubItem,
+ SidebarProvider,
+ SidebarRail,
+ SidebarSeparator,
+ SidebarTrigger,
+ useSidebar,
+ useSidebarScope
+};
+
+export type { SidebarScope };
diff --git a/frontend/src/components/v3/generic/Sidebar/index.ts b/frontend/src/components/v3/generic/Sidebar/index.ts
new file mode 100644
index 0000000000..d678998972
--- /dev/null
+++ b/frontend/src/components/v3/generic/Sidebar/index.ts
@@ -0,0 +1 @@
+export * from "./Sidebar";
diff --git a/frontend/src/components/v3/generic/index.ts b/frontend/src/components/v3/generic/index.ts
index a9885b76e6..180111b383 100644
--- a/frontend/src/components/v3/generic/index.ts
+++ b/frontend/src/components/v3/generic/index.ts
@@ -29,6 +29,7 @@ export * from "./SecretInput";
export * from "./Select";
export * from "./Separator";
export * from "./Sheet";
+export * from "./Sidebar";
export * from "./Skeleton";
export * from "./Switch";
export * from "./Table";
diff --git a/frontend/src/const/routes.ts b/frontend/src/const/routes.ts
index 51d9f8d816..8892e7d070 100644
--- a/frontend/src/const/routes.ts
+++ b/frontend/src/const/routes.ts
@@ -104,6 +104,10 @@ export const ROUTE_PATHS = Object.freeze({
"/organizations/$orgId/projects/secret-management/$projectId/integrations",
"/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-management/$projectId/_secret-manager-layout/integrations/"
),
+ SettingsPage: setRoute(
+ "/organizations/$orgId/projects/secret-management/$projectId/settings",
+ "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-management/$projectId/_secret-manager-layout/settings"
+ ),
IntegrationDetailsByIDPage: setRoute(
"/organizations/$orgId/projects/secret-management/$projectId/integrations/$integrationId",
"/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-management/$projectId/_secret-manager-layout/integrations/$integrationId"
diff --git a/frontend/src/index.css b/frontend/src/index.css
index f887ad1e1f..c23c90139c 100644
--- a/frontend/src/index.css
+++ b/frontend/src/index.css
@@ -70,6 +70,7 @@
--color-org: #30b3ff;
--color-sub-org: #96ff59;
--color-project: #e0ed34;
+ --color-admin: #c0c0c8;
--color-neutral: #adaeb0;
--color-border: #2b2c30;
--color-label: #adaeb0;
@@ -81,6 +82,14 @@
--color-container: #1a1c1e;
--color-container-hover: #1f2123;
+ /* Sidebar */
+ --color-sidebar: #19191c;
+ --color-sidebar-foreground: #ebebeb;
+ --color-sidebar-border: #2b2c30;
+ --color-sidebar-accent: #1e1f22;
+ --color-sidebar-accent-foreground: #ebebeb;
+ --color-sidebar-ring: #2d2f33;
+
/* secret management product colors */
--color-folder: #a4873e;
--color-secret: #7d7f80;
diff --git a/frontend/src/layouts/AILayout/AILayout.tsx b/frontend/src/layouts/AILayout/AILayout.tsx
index 58f2972b90..7703a3241f 100644
--- a/frontend/src/layouts/AILayout/AILayout.tsx
+++ b/frontend/src/layouts/AILayout/AILayout.tsx
@@ -1,83 +1,14 @@
-import { Link, Outlet, useLocation } from "@tanstack/react-router";
-import { motion } from "framer-motion";
+import { Outlet } from "@tanstack/react-router";
-import { Tab, TabList, Tabs } from "@app/components/v2";
-import { useOrganization, useProject, useProjectPermission } from "@app/context";
+import { useProjectPermission } from "@app/context";
import { AssumePrivilegeModeBanner } from "../ProjectLayout/components/AssumePrivilegeModeBanner";
export const AILayout = () => {
- const { currentOrg } = useOrganization();
- const { currentProject } = useProject();
const { assumedPrivilegeDetails } = useProjectPermission();
- const location = useLocation();
return (
- <div className="dark flex h-full w-full flex-col overflow-x-hidden bg-mineshaft-900">
- <div className="border-y border-t-project/10 border-b-project/5 bg-gradient-to-b from-project/[0.075] to-project/[0.025] px-4 pt-0.5">
- <motion.div
- key="menu-project-items"
- initial={{ x: -150 }}
- animate={{ x: 0 }}
- exit={{ x: -150 }}
- transition={{ duration: 0.2 }}
- className="px-4"
- >
- <nav className="w-full">
- <Tabs value="selected">
- <TabList className="border-b-0">
- <Link
- to="/organizations/$orgId/projects/ai/$projectId/overview"
- params={{
- orgId: currentOrg.id,
- projectId: currentProject.id
- }}
- >
- {({ isActive }) => <Tab value={isActive ? "selected" : ""}>MCP</Tab>}
- </Link>
- <Link
- to="/organizations/$orgId/projects/ai/$projectId/access-management"
- params={{
- orgId: currentOrg.id,
- projectId: currentProject.id
- }}
- >
- {({ isActive }) => (
- <Tab
- value={
- isActive ||
- location.pathname.match(/\/groups\/|\/identities\/|\/members\/|\/roles\//)
- ? "selected"
- : ""
- }
- >
- Access Control
- </Tab>
- )}
- </Link>
- <Link
- to="/organizations/$orgId/projects/ai/$projectId/audit-logs"
- params={{
- orgId: currentOrg.id,
- projectId: currentProject.id
- }}
- >
- {({ isActive }) => <Tab value={isActive ? "selected" : ""}>Audit Logs</Tab>}
- </Link>
- <Link
- to="/organizations/$orgId/projects/ai/$projectId/settings"
- params={{
- orgId: currentOrg.id,
- projectId: currentProject.id
- }}
- >
- {({ isActive }) => <Tab value={isActive ? "selected" : ""}>Settings</Tab>}
- </Link>
- </TabList>
- </Tabs>
- </nav>
- </motion.div>
- </div>
+ <div className="flex h-full w-full flex-col overflow-x-hidden">
{assumedPrivilegeDetails && <AssumePrivilegeModeBanner />}
<div className="flex-1 overflow-x-hidden overflow-y-auto bg-bunker-800 px-12 pt-10 pb-4">
<Outlet />
diff --git a/frontend/src/layouts/AdminLayout/AdminLayout.tsx b/frontend/src/layouts/AdminLayout/AdminLayout.tsx
index 9ab8c876d7..017fc3e9a0 100644
--- a/frontend/src/layouts/AdminLayout/AdminLayout.tsx
+++ b/frontend/src/layouts/AdminLayout/AdminLayout.tsx
@@ -1,6 +1,7 @@
import { Outlet } from "@tanstack/react-router";
import { Banner } from "@app/components/page-frames/Banner";
+import { SidebarProvider } from "@app/components/v3/generic/Sidebar";
import { useServerConfig, useSubscription } from "@app/context";
import { useFetchServerStatus } from "@app/hooks/api";
import { AuditLogBanner } from "@app/layouts/OrganizationLayout/components/AuditLogBanner";
@@ -9,7 +10,7 @@ import { RedisBanner } from "@app/layouts/OrganizationLayout/components/RedisBan
import { SmtpBanner } from "@app/layouts/OrganizationLayout/components/SmtpBanner";
import { InsecureConnectionBanner } from "../OrganizationLayout/components/InsecureConnectionBanner";
-import { AdminNavBar } from "./AdminNavBar";
+import { AdminSidebar } from "./AdminSidebar";
export const AdminLayout = () => {
const { config } = useServerConfig();
@@ -22,19 +23,21 @@ export const AdminLayout = () => {
<>
<Banner />
<div
- className={`dark ${containerHeight} flex w-full flex-col overflow-x-hidden bg-bunker-800 transition-all`}
+ className={`dark ${containerHeight} flex w-full flex-col overflow-hidden bg-bunker-800 transition-all`}
>
<Navbar />
{!isLoading && !serverDetails?.redisConfigured && <RedisBanner />}
{!isLoading && !serverDetails?.emailConfigured && <SmtpBanner />}
{!isLoading && subscription.auditLogs && <AuditLogBanner />}
{!window.isSecureContext && <InsecureConnectionBanner />}
- <div className="flex grow flex-col overflow-y-hidden">
- <AdminNavBar />
- <div className="flex-1 overflow-x-hidden overflow-y-auto bg-bunker-800 px-12 pt-10 pb-4 dark:scheme-dark">
- <Outlet />
+ <SidebarProvider>
+ <div className="flex min-h-0 flex-1">
+ <AdminSidebar />
+ <div className="min-h-0 flex-1 overflow-y-auto bg-bunker-800 px-12 pt-10 pb-4 dark:scheme-dark">
+ <Outlet />
+ </div>
</div>
- </div>
+ </SidebarProvider>
</div>
<Banner />
</>
diff --git a/frontend/src/layouts/AdminLayout/AdminSidebar.tsx b/frontend/src/layouts/AdminLayout/AdminSidebar.tsx
new file mode 100644
index 0000000000..0563fd7b0e
--- /dev/null
+++ b/frontend/src/layouts/AdminLayout/AdminSidebar.tsx
@@ -0,0 +1,204 @@
+import { useState } from "react";
+import { Link, useLocation, useMatchRoute, useNavigate, useSearch } from "@tanstack/react-router";
+import { AnimatePresence, motion } from "framer-motion";
+import {
+ Building,
+ ChevronLeft,
+ ChevronRight,
+ Cog,
+ Database,
+ HardDrive,
+ Key,
+ Lock,
+ Plug,
+ Shield,
+ ShieldCheck,
+ User
+} from "lucide-react";
+
+import {
+ Sidebar,
+ SidebarContent,
+ SidebarGroup,
+ SidebarGroupLabel,
+ SidebarMenu,
+ SidebarMenuButton,
+ SidebarMenuItem
+} from "@app/components/v3/generic/Sidebar";
+
+type AdminSubmenuItem = {
+ label: string;
+ icon: React.ComponentType<{ className?: string }>;
+ tab: string;
+};
+
+type AdminSubmenu = {
+ title: string;
+ link: string;
+ defaultTab: string;
+ items: AdminSubmenuItem[];
+};
+
+const RESOURCE_OVERVIEW_SUBMENU: AdminSubmenu = {
+ title: "Resource Overview",
+ link: "/admin/resources/overview",
+ defaultTab: "organizations",
+ items: [
+ { label: "Organizations", icon: Building, tab: "organizations" },
+ { label: "Users", icon: User, tab: "users" },
+ { label: "Machine Identities", icon: HardDrive, tab: "identities" }
+ ]
+};
+
+type AdminNavItem = {
+ label: string;
+ icon: React.ComponentType<{ className?: string }>;
+ link: string;
+ submenu?: AdminSubmenu;
+};
+
+const adminNavItems: AdminNavItem[] = [
+ { label: "General", icon: Cog, link: "/admin/" },
+ {
+ label: "Resource Overview",
+ icon: Building,
+ link: "/admin/resources/overview",
+ submenu: RESOURCE_OVERVIEW_SUBMENU
+ },
+ { label: "Access Control", icon: Shield, link: "/admin/access-management" },
+ { label: "Encryption", icon: Lock, link: "/admin/encryption" },
+ { label: "Authentication", icon: ShieldCheck, link: "/admin/authentication" },
+ { label: "Integrations", icon: Plug, link: "/admin/integrations" },
+ { label: "Caching", icon: Database, link: "/admin/caching" },
+ { label: "Environment Variables", icon: Key, link: "/admin/environment" }
+];
+
+const AdminSubmenuView = ({ submenu, onBack }: { submenu: AdminSubmenu; onBack: () => void }) => {
+ const { pathname } = useLocation();
+ const searchParams = useSearch({ strict: false }) as Record<string, string>;
+ const isOnPage = pathname.startsWith(submenu.link);
+ const currentTab = searchParams?.selectedTab;
+
+ return (
+ <SidebarGroup>
+ <SidebarGroupLabel asChild>
+ <button
+ className="cursor-pointer hover:bg-foreground/[0.025]"
+ type="button"
+ onClick={onBack}
+ >
+ <ChevronLeft />
+ <span>{submenu.title}</span>
+ </button>
+ </SidebarGroupLabel>
+ <SidebarMenu>
+ {submenu.items.map((sub) => {
+ const isActive =
+ isOnPage && (currentTab === sub.tab || (!currentTab && sub.tab === submenu.defaultTab));
+
+ return (
+ <SidebarMenuItem key={sub.label}>
+ <SidebarMenuButton size="lg" asChild isActive={isActive} tooltip={sub.label}>
+ <Link to={submenu.link} search={{ selectedTab: sub.tab }}>
+ <sub.icon className="size-4" />
+ <span>{sub.label}</span>
+ </Link>
+ </SidebarMenuButton>
+ </SidebarMenuItem>
+ );
+ })}
+ </SidebarMenu>
+ </SidebarGroup>
+ );
+};
+
+const AdminNav = ({ onSubmenuOpen }: { onSubmenuOpen: (submenu: AdminSubmenu) => void }) => {
+ const matchRoute = useMatchRoute();
+
+ return (
+ <SidebarMenu>
+ {adminNavItems.map((item) => {
+ const isActive = Boolean(matchRoute({ to: item.link, fuzzy: false }));
+
+ if (item.submenu) {
+ return (
+ <SidebarMenuItem key={item.link}>
+ <SidebarMenuButton
+ size="lg"
+ isActive={isActive}
+ tooltip={item.label}
+ onClick={() => onSubmenuOpen(item.submenu!)}
+ >
+ <item.icon className="size-4" />
+ <span>{item.label}</span>
+ <ChevronRight className="ml-auto size-4 !text-foreground opacity-50" />
+ </SidebarMenuButton>
+ </SidebarMenuItem>
+ );
+ }
+
+ return (
+ <SidebarMenuItem key={item.link}>
+ <SidebarMenuButton asChild isActive={isActive} size="lg" tooltip={item.label}>
+ <Link to={item.link}>
+ <item.icon className="size-4" />
+ <span>{item.label}</span>
+ </Link>
+ </SidebarMenuButton>
+ </SidebarMenuItem>
+ );
+ })}
+ </SidebarMenu>
+ );
+};
+
+export const AdminSidebar = () => {
+ const { pathname } = useLocation();
+ const navigate = useNavigate();
+
+ const isOnResources = pathname.startsWith("/admin/resources");
+
+ const [activeSubmenu, setActiveSubmenu] = useState<AdminSubmenu | null>(
+ isOnResources ? RESOURCE_OVERVIEW_SUBMENU : null
+ );
+
+ const handleSubmenuOpen = (submenu: AdminSubmenu) => {
+ setActiveSubmenu(submenu);
+ navigate({
+ to: submenu.link,
+ search: { selectedTab: submenu.defaultTab }
+ });
+ };
+
+ return (
+ <Sidebar scope="admin" collapsible="none" side="left">
+ <SidebarContent>
+ <AnimatePresence mode="wait" initial={false}>
+ {activeSubmenu ? (
+ <motion.div
+ key="submenu"
+ initial={{ x: 30, opacity: 0 }}
+ animate={{ x: 0, opacity: 1 }}
+ exit={{ x: 30, opacity: 0 }}
+ transition={{ duration: 0.15, ease: "easeOut" }}
+ >
+ <AdminSubmenuView submenu={activeSubmenu} onBack={() => setActiveSubmenu(null)} />
+ </motion.div>
+ ) : (
+ <motion.div
+ key="main"
+ initial={{ x: -30, opacity: 0 }}
+ animate={{ x: 0, opacity: 1 }}
+ exit={{ x: -30, opacity: 0 }}
+ transition={{ duration: 0.15, ease: "easeOut" }}
+ >
+ <SidebarGroup>
+ <AdminNav onSubmenuOpen={handleSubmenuOpen} />
+ </SidebarGroup>
+ </motion.div>
+ )}
+ </AnimatePresence>
+ </SidebarContent>
+ </Sidebar>
+ );
+};
diff --git a/frontend/src/layouts/KmsLayout/KmsLayout.tsx b/frontend/src/layouts/KmsLayout/KmsLayout.tsx
index 8ffe0da446..c698e17fe9 100644
--- a/frontend/src/layouts/KmsLayout/KmsLayout.tsx
+++ b/frontend/src/layouts/KmsLayout/KmsLayout.tsx
@@ -1,93 +1,14 @@
-import { Link, Outlet, useLocation } from "@tanstack/react-router";
-import { motion } from "framer-motion";
+import { Outlet } from "@tanstack/react-router";
-import { Tab, TabList, Tabs } from "@app/components/v2";
-import { useOrganization, useProject, useProjectPermission } from "@app/context";
+import { useProjectPermission } from "@app/context";
import { AssumePrivilegeModeBanner } from "../ProjectLayout/components/AssumePrivilegeModeBanner";
export const KmsLayout = () => {
- const { currentProject } = useProject();
- const { currentOrg } = useOrganization();
const { assumedPrivilegeDetails } = useProjectPermission();
- const location = useLocation();
-
return (
- <div className="dark flex h-full w-full flex-col overflow-x-hidden bg-mineshaft-900">
- <div className="border-y border-t-project/10 border-b-project/5 bg-gradient-to-b from-project/[0.075] to-project/[0.025] px-4 pt-0.5">
- <motion.div
- key="menu-project-items"
- initial={{ x: -150 }}
- animate={{ x: 0 }}
- exit={{ x: -150 }}
- transition={{ duration: 0.2 }}
- className="px-4"
- >
- <nav className="w-full">
- <Tabs value="selected">
- <TabList className="border-b-0">
- <Link
- to="/organizations/$orgId/projects/kms/$projectId/overview"
- params={{
- orgId: currentOrg.id,
- projectId: currentProject.id
- }}
- >
- {({ isActive }) => <Tab value={isActive ? "selected" : ""}>Overview</Tab>}
- </Link>
- <Link
- to="/organizations/$orgId/projects/kms/$projectId/kmip"
- params={{
- orgId: currentOrg.id,
- projectId: currentProject.id
- }}
- >
- {({ isActive }) => <Tab value={isActive ? "selected" : ""}>KMIP</Tab>}
- </Link>
- <Link
- to="/organizations/$orgId/projects/kms/$projectId/access-management"
- params={{
- orgId: currentOrg.id,
- projectId: currentProject.id
- }}
- >
- {({ isActive }) => (
- <Tab
- value={
- isActive ||
- location.pathname.match(/\/groups\/|\/identities\/|\/members\/|\/roles\//)
- ? "selected"
- : ""
- }
- >
- Access Control
- </Tab>
- )}
- </Link>
- <Link
- to="/organizations/$orgId/projects/kms/$projectId/audit-logs"
- params={{
- orgId: currentOrg.id,
- projectId: currentProject.id
- }}
- >
- {({ isActive }) => <Tab value={isActive ? "selected" : ""}>Audit Logs</Tab>}
- </Link>
- <Link
- to="/organizations/$orgId/projects/kms/$projectId/settings"
- params={{
- orgId: currentOrg.id,
- projectId: currentProject.id
- }}
- >
- {({ isActive }) => <Tab value={isActive ? "selected" : ""}>Settings</Tab>}
- </Link>
- </TabList>
- </Tabs>
- </nav>
- </motion.div>
- </div>
+ <div className="flex h-full w-full flex-col overflow-x-hidden">
{assumedPrivilegeDetails && <AssumePrivilegeModeBanner />}
<div className="flex-1 overflow-x-hidden overflow-y-auto bg-bunker-800 px-12 pt-10 pb-4">
<Outlet />
diff --git a/frontend/src/layouts/OrganizationLayout/OrganizationLayout.tsx b/frontend/src/layouts/OrganizationLayout/OrganizationLayout.tsx
index c91917423b..ee26332179 100644
--- a/frontend/src/layouts/OrganizationLayout/OrganizationLayout.tsx
+++ b/frontend/src/layouts/OrganizationLayout/OrganizationLayout.tsx
@@ -3,6 +3,7 @@ import { twMerge } from "tailwind-merge";
import { CreateOrgModal } from "@app/components/organization/CreateOrgModal";
import { Banner } from "@app/components/page-frames/Banner";
+import { SidebarInset, SidebarProvider } from "@app/components/v3";
import { useServerConfig, useSubscription } from "@app/context";
import { usePopUp } from "@app/hooks";
import { useFetchServerStatus } from "@app/hooks/api";
@@ -10,7 +11,7 @@ import { useFetchServerStatus } from "@app/hooks/api";
import { AuditLogBanner } from "./components/AuditLogBanner";
import { InsecureConnectionBanner } from "./components/InsecureConnectionBanner";
import { Navbar } from "./components/NavBar";
-import { OrgNavBar } from "./components/OrgNavBar";
+import { OrgSidebar } from "./components/OrgSidebar";
import { RedisBanner } from "./components/RedisBanner";
import { SmtpBanner } from "./components/SmtpBanner";
@@ -33,24 +34,26 @@ export const OrganizationLayout = () => {
<>
<Banner />
<div
- className={`dark ${containerHeight} flex w-full flex-col overflow-x-hidden bg-bunker-800 transition-all`}
+ className={`dark ${containerHeight} flex w-full flex-col overflow-hidden bg-bunker-800 transition-all`}
>
<Navbar />
- <div className="flex grow flex-col overflow-y-hidden">
- <OrgNavBar isHidden={isInsideProject} />
- {!isLoading && !isInsideProject && !serverDetails?.redisConfigured && <RedisBanner />}
- {!isLoading && !isInsideProject && !serverDetails?.emailConfigured && <SmtpBanner />}
- {!isLoading && !isInsideProject && subscription.auditLogs && <AuditLogBanner />}
- {!window.isSecureContext && !isInsideProject && <InsecureConnectionBanner />}
- <main
- className={twMerge(
- "flex-1 overflow-x-hidden bg-bunker-800 px-12 pt-10 pb-4 dark:scheme-dark",
- isInsideProject ? "overflow-y-hidden p-0" : "overflow-y-auto"
- )}
- >
- <Outlet />
- </main>
- </div>
+ <SidebarProvider className="!min-h-0 flex-1 overflow-hidden">
+ <OrgSidebar />
+ <SidebarInset className="flex flex-col overflow-hidden">
+ {!isLoading && !isInsideProject && !serverDetails?.redisConfigured && <RedisBanner />}
+ {!isLoading && !isInsideProject && !serverDetails?.emailConfigured && <SmtpBanner />}
+ {!isLoading && !isInsideProject && subscription.auditLogs && <AuditLogBanner />}
+ {!window.isSecureContext && !isInsideProject && <InsecureConnectionBanner />}
+ <div
+ className={twMerge(
+ "flex-1 overflow-x-hidden bg-bunker-800 dark:scheme-dark",
+ isInsideProject ? "overflow-y-hidden" : "overflow-y-auto px-12 pt-10 pb-4"
+ )}
+ >
+ <Outlet />
+ </div>
+ </SidebarInset>
+ </SidebarProvider>
</div>
<CreateOrgModal
isOpen={popUp?.createOrg?.isOpen}
diff --git a/frontend/src/layouts/OrganizationLayout/components/NavBar/Navbar.tsx b/frontend/src/layouts/OrganizationLayout/components/NavBar/Navbar.tsx
index 743b11b30f..fb83cb1c8c 100644
--- a/frontend/src/layouts/OrganizationLayout/components/NavBar/Navbar.tsx
+++ b/frontend/src/layouts/OrganizationLayout/components/NavBar/Navbar.tsx
@@ -1,52 +1,64 @@
import { useEffect, useState } from "react";
-import { faGithub, faSlack } from "@fortawesome/free-brands-svg-icons";
-import { faCircleQuestion, faUserCircle } from "@fortawesome/free-regular-svg-icons";
-import {
- faArrowUpRightFromSquare,
- faBook,
- faCaretDown,
- faCheck,
- faChevronRight,
- faEnvelope,
- faExclamationTriangle,
- faInfinity,
- faInfo,
- faInfoCircle,
- faMagnifyingGlass,
- faPlus,
- faSignOut,
- faToolbox,
- faUser,
- faUserCog,
- faUserPlus,
- faUsers
-} from "@fortawesome/free-solid-svg-icons";
+import { faExclamationTriangle } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { useQuery, useQueryClient } from "@tanstack/react-query";
-import { Link, useLocation, useNavigate, useRouter } from "@tanstack/react-router";
-import { ChevronRight, UserPlusIcon } from "lucide-react";
+import { Link, useLocation, useNavigate } from "@tanstack/react-router";
+import {
+ Book,
+ Check,
+ ChevronLeft,
+ ChevronsUpDown,
+ CircleHelp,
+ Clipboard,
+ ExternalLink,
+ Github,
+ Infinity,
+ Info,
+ LogOut,
+ Mail,
+ Plus,
+ Settings,
+ Slack,
+ User,
+ UserPlus,
+ Users,
+ Wrench
+} from "lucide-react";
import { twMerge } from "tailwind-merge";
import { Mfa } from "@app/components/auth/Mfa";
import { createNotification } from "@app/components/notifications";
import { OrgPermissionCan } from "@app/components/permissions";
import SecurityClient from "@app/components/utilities/SecurityClient";
+import { Button as V2Button, Modal, ModalContent, Tooltip } from "@app/components/v2";
import {
+ Badge,
Button,
- DropdownMenu,
- DropdownMenuContent,
- DropdownMenuItem,
- DropdownMenuTrigger,
- DropdownSubMenu,
- DropdownSubMenuContent,
- DropdownSubMenuTrigger,
- IconButton,
- Input,
- Modal,
- ModalContent,
- Tooltip
-} from "@app/components/v2";
-import { Badge, InstanceIcon, OrgIcon, SubOrgIcon } from "@app/components/v3";
+ Command,
+ CommandEmpty,
+ CommandGroup,
+ CommandInput,
+ CommandItem,
+ CommandList,
+ CommandSeparator,
+ InstanceIcon,
+ OrgIcon,
+ Popover,
+ PopoverAnchor,
+ PopoverContent,
+ PopoverTrigger,
+ SubOrgIcon,
+ Tooltip as V3Tooltip,
+ TooltipContent as V3TooltipContent,
+ TooltipTrigger as V3TooltipTrigger,
+ UnstableButtonGroup,
+ UnstableDropdownMenu,
+ UnstableDropdownMenuContent,
+ UnstableDropdownMenuItem,
+ UnstableDropdownMenuSeparator,
+ UnstableDropdownMenuTrigger,
+ UnstableIconButton
+} from "@app/components/v3";
import { envConfig } from "@app/config/env";
import {
OrgPermissionActions,
@@ -77,84 +89,6 @@ import { ServerAdminsPanel } from "../ServerAdminsPanel/ServerAdminsPanel";
import { NewSubOrganizationForm } from "./NewSubOrganizationForm";
import { NotificationDropdown } from "./NotificationDropdown";
-type SubOrgFilterListProps = {
- search: string;
- onSearchChange: (value: string) => void;
- subOrganizations: { id: string; name: string }[];
- currentOrgId: string | undefined;
- onSelect: (orgId: string) => void;
- onCreateSubOrg: () => void;
-};
-
-const SubOrgFilterList = ({
- search,
- onSearchChange,
- subOrganizations,
- currentOrgId,
- onSelect,
- onCreateSubOrg
-}: SubOrgFilterListProps) => {
- const filtered = subOrganizations.filter((s) =>
- s.name.toLowerCase().includes(search.toLowerCase())
- );
-
- return (
- <>
- <div className="mb-1 border-b border-b-mineshaft-600 py-1 pb-1">
- <Input
- value={search}
- onChange={(e) => onSearchChange(e.target.value)}
- leftIcon={<FontAwesomeIcon icon={faMagnifyingGlass} />}
- size="xs"
- variant="plain"
- placeholder="Filter sub-orgs..."
- className="text-bunker-100 placeholder-mineshaft-300"
- onKeyDown={(e) => e.stopPropagation()}
- onClick={(e) => e.stopPropagation()}
- />
- </div>
- <div className="max-h-48 thin-scrollbar overflow-y-auto">
- {filtered.map((subOrg) => (
- <DropdownMenuItem
- onClick={() => onSelect(subOrg.id)}
- className="cursor-pointer font-normal"
- key={subOrg.id}
- >
- <div className="flex w-full max-w-48 cursor-pointer items-center gap-x-2">
- {currentOrgId === subOrg.id && (
- <FontAwesomeIcon icon={faCheck} className="shrink-0 text-primary" />
- )}
- <p className="truncate">{subOrg.name}</p>
- </div>
- </DropdownMenuItem>
- ))}
- {filtered.length === 0 && (
- <p className="px-2 py-1.5 text-xs text-mineshaft-400">No sub-organizations found.</p>
- )}
- </div>
- <OrgPermissionCan
- I={OrgPermissionSubOrgActions.Create}
- a={OrgPermissionSubjects.SubOrganization}
- >
- {(isAllowed) =>
- isAllowed ? (
- <>
- <div className="mt-1 h-px border-t border-mineshaft-600" />
- <DropdownMenuItem
- className="cursor-pointer"
- icon={<FontAwesomeIcon icon={faPlus} />}
- onClick={onCreateSubOrg}
- >
- New Sub-Organization
- </DropdownMenuItem>
- </>
- ) : null
- }
- </OrgPermissionCan>
- </>
- );
-};
-
const getPlan = (subscription: SubscriptionPlan) => {
if (subscription.groups) return "Enterprise";
if (subscription.pitRecovery) return "Pro";
@@ -189,36 +123,16 @@ Thank you,
};
export const INFISICAL_SUPPORT_OPTIONS = [
+ [Slack, "Support Forum", () => "https://infisical.com/slack"],
[
- <FontAwesomeIcon key={1} className="pr-4 text-sm" icon={faSlack} />,
- "Support Forum",
- () => "https://infisical.com/slack"
- ],
- [
- <FontAwesomeIcon key={2} className="pr-4 text-sm" icon={faBook} />,
+ Book,
"Read Docs",
() => "https://infisical.com/docs/documentation/getting-started/introduction"
],
- [
- <FontAwesomeIcon key={3} className="pr-4 text-sm" icon={faGithub} />,
- "GitHub Issues",
- () => "https://github.com/Infisical/infisical/issues"
- ],
- [
- <FontAwesomeIcon key={4} className="pr-4 text-sm" icon={faEnvelope} />,
- "Email Support",
- getFormattedSupportEmailLink
- ],
- [
- <FontAwesomeIcon key={5} className="pr-4 text-sm" icon={faUsers} />,
- "Instance Admins",
- () => "server-admins"
- ],
- [
- <FontAwesomeIcon key={6} className="pr-4 text-sm" icon={faToolbox} />,
- "Version Upgrade Tool",
- () => "/upgrade-path"
- ]
+ [Github, "GitHub Issues", () => "https://github.com/Infisical/infisical/issues"],
+ [Mail, "Email Support", getFormattedSupportEmailLink],
+ [Users, "Instance Admins", () => "server-admins"],
+ [Wrench, "Version Upgrade Tool", () => "/upgrade-path"]
] as const;
export const Navbar = () => {
@@ -229,8 +143,6 @@ export const Navbar = () => {
const [showAdminsModal, setShowAdminsModal] = useState(false);
const [showSubOrgForm, setShowSubOrgForm] = useState(false);
const [showCardDeclinedModal, setShowCardDeclinedModal] = useState(false);
- const [subOrgMenuSearch, setSubOrgMenuSearch] = useState("");
- const [subOrgBreadcrumbSearch, setSubOrgBreadcrumbSearch] = useState("");
const subOrgQuery = subOrganizationsQuery.list({ isAccessible: true });
const { data: subOrganizations = [] } = useQuery({
@@ -249,7 +161,6 @@ export const Navbar = () => {
const [requiredMfaMethod, setRequiredMfaMethod] = useState(MfaMethod.EMAIL);
const [mfaSuccessCallback, setMfaSuccessCallback] = useState<() => void>(() => {});
const [shouldShowMfa, toggleShowMfa] = useToggle(false);
- const router = useRouter();
const queryClient = useQueryClient();
const [isOrgSelectOpen, setIsOrgSelectOpen] = useState(false);
@@ -423,60 +334,84 @@ export const Navbar = () => {
};
return (
- <div className="z-10 flex min-h-12 items-center bg-mineshaft-900 px-4">
+ <div
+ className={twMerge(
+ "z-10 flex min-h-12 items-center border-b border-border bg-gradient-to-br to-transparent",
+ isServerAdminPanel && "from-admin/5",
+ !isServerAdminPanel && isProjectScope && "from-project/5",
+ !isServerAdminPanel && !isProjectScope && isSubOrganization && "from-sub-org/5",
+ !isServerAdminPanel && !isProjectScope && !isSubOrganization && "from-org/5"
+ )}
+ >
<div className="mr-auto flex h-full min-w-34 items-center">
- <div className="mt-0.5 shrink-0">
- <Link to="/organizations/$orgId/projects" params={{ orgId: currentOrg.id }}>
- <img alt="infisical logo" src="/images/logotransparent.png" className="h-4" />
- </Link>
- </div>
- <ChevronRight size={18} className="mx-3 mt-[3px] text-mineshaft-400/70" />
{isServerAdminPanel ? (
- <Link
- to="/admin"
- className="group flex cursor-pointer items-center gap-2 text-sm text-white transition-all duration-100 hover:text-primary"
- >
- <InstanceIcon className="size-3.5 text-xs text-bunker-300" />
- <div className="whitespace-nowrap">Server Console</div>
- </Link>
+ <div className="flex h-full items-center">
+ <V3Tooltip>
+ <V3TooltipTrigger asChild>
+ <Link
+ to="/organizations/$orgId/projects"
+ params={{ orgId: currentOrg.id }}
+ className="flex h-full items-center gap-x-1 border-r border-border pr-4 pl-2 text-muted transition-colors hover:text-foreground"
+ >
+ <ChevronLeft className="size-4" />
+ <OrgIcon className="size-3.5" />
+ </Link>
+ </V3TooltipTrigger>
+ <V3TooltipContent side="bottom">Back to organization</V3TooltipContent>
+ </V3Tooltip>
+ <Link
+ to="/admin"
+ className="group flex cursor-pointer items-center gap-2 pl-4 text-sm text-white transition-all duration-100"
+ >
+ <InstanceIcon className="size-3.5 text-admin" />
+ <div className="whitespace-nowrap">Server Console</div>
+ </Link>
+ </div>
) : (
<>
<div
className={twMerge(
- "relative flex min-w-16 items-center self-end rounded-t-md border-x border-t pt-1.5 pr-2 pb-2.5 pl-3",
- !isProjectScope && !isSubOrganization
- ? "border-org/15 bg-gradient-to-b from-org/10 to-org/[0.075]"
- : "border-transparent"
+ "flex h-full min-w-0 items-center overflow-hidden border-border pr-2 pl-4 transition-all duration-300 ease-in-out",
+ isProjectScope ? "mr-2 w-[72px] border-r" : "mr-4 w-96 max-w-96"
)}
>
- {/* scott: the below is used to hide the top border from the org nav bar */}
- {!isProjectScope && !isSubOrganization && (
- <div className="absolute -bottom-px left-0 h-px w-full bg-mineshaft-900">
- <div className="h-full bg-org/[0.075]" />
- </div>
- )}
- <DropdownMenu modal={false} open={isOrgSelectOpen} onOpenChange={setIsOrgSelectOpen}>
+ <Popover open={isOrgSelectOpen} onOpenChange={setIsOrgSelectOpen}>
+ <PopoverAnchor className="absolute left-2" />
<div className="group mr-1 flex min-w-0 cursor-pointer items-center gap-2 overflow-hidden text-sm text-white transition-all duration-100">
<button
className="flex cursor-pointer items-center gap-x-2 truncate whitespace-nowrap"
type="button"
- onClick={async () => {
- if (isSubOrganization) {
- await handleOrgSelection({
- organizationId: currentOrg.rootOrgId as string
- });
- } else {
- navigate({
- to: "/organizations/$orgId/projects",
- params: { orgId: currentOrg.id }
- });
- }
+ onClick={() => {
+ navigate({
+ to: "/organizations/$orgId/projects",
+ params: { orgId: currentOrg.id }
+ });
}}
>
- <OrgIcon className={twMerge("size-[14px] shrink-0 text-org")} />
- <span className="truncate">{rootOrg?.name}</span>
- <Badge variant="org" className="hidden lg:inline-flex">
- Organization
+ {isSubOrganization ? (
+ <SubOrgIcon
+ className={twMerge(
+ "size-[14px] shrink-0",
+ !isProjectScope ? "text-sub-org" : "text-muted"
+ )}
+ />
+ ) : (
+ <OrgIcon
+ className={twMerge(
+ "size-[14px] shrink-0",
+ !isProjectScope ? "text-org" : "text-muted"
+ )}
+ />
+ )}
+
+ <span className="truncate">
+ {isSubOrganization ? currentOrg?.name : rootOrg?.name}
+ </span>
+ <Badge
+ variant={isSubOrganization ? "sub-org" : "org"}
+ className="hidden lg:inline-flex"
+ >
+ {isSubOrganization ? "Sub-Organization" : "Organization"}
</Badge>
</button>
{subscription.cardDeclined && (
@@ -493,172 +428,117 @@ export const Navbar = () => {
</Tooltip>
)}
</div>
- <DropdownMenuTrigger asChild>
- <div>
- <IconButton
- variant="plain"
- colorSchema="secondary"
- ariaLabel="switch-org"
- className="px-2 py-1"
- >
- <FontAwesomeIcon icon={faCaretDown} className="text-xs text-bunker-300" />
- </IconButton>
- </div>
- </DropdownMenuTrigger>
- <DropdownMenuContent
- align="center"
- side="bottom"
- className="mt-6 cursor-default p-1 shadow-mineshaft-600 drop-shadow-md"
- style={{ minWidth: "220px" }}
- >
- <div className="px-2 py-1 text-xs text-mineshaft-400 capitalize">
- Organizations
- </div>
- {orgs?.map((org) => {
- if (
- subscription.subOrganization &&
- (org.id === currentOrg?.id || org.id === currentOrg?.parentOrgId)
- ) {
- return (
- <DropdownSubMenu key={`${org.id}-sub-orgs`}>
- <DropdownSubMenuTrigger
- onClick={() => {
- setIsOrgSelectOpen(false);
- handleOrgNav(org);
- }}
- className="cursor-pointer font-normal"
- >
- <div className="flex w-full max-w-48 cursor-pointer items-center gap-x-2">
- {currentOrg?.id === org.id && (
- <FontAwesomeIcon icon={faCheck} className="shrink-0 text-primary" />
- )}
- <p className="truncate">{org.name}</p>
- <FontAwesomeIcon className="ml-auto shrink-0" icon={faChevronRight} />
- </div>
- </DropdownSubMenuTrigger>
- <DropdownSubMenuContent
- sideOffset={8}
- alignOffset={-24}
- className="mt-6 cursor-default p-1 shadow-mineshaft-600 drop-shadow-md"
- style={{ minWidth: "220px" }}
- >
- <SubOrgFilterList
- search={subOrgMenuSearch}
- onSearchChange={setSubOrgMenuSearch}
- subOrganizations={subOrganizations}
- currentOrgId={currentOrg?.id}
- onSelect={(orgId) => handleOrgSelection({ organizationId: orgId })}
- onCreateSubOrg={() => setShowSubOrgForm(true)}
- />
- </DropdownSubMenuContent>
- </DropdownSubMenu>
- );
- }
-
- return (
- <DropdownMenuItem
- onClick={() => handleOrgNav(org)}
- className="cursor-pointer font-normal"
- key={org.id}
- >
- <div className="flex w-full max-w-48 cursor-pointer items-center gap-x-2">
- {currentOrg?.id === org.id && (
- <FontAwesomeIcon icon={faCheck} className="shrink-0 text-primary" />
- )}
- <p className="truncate">{org.name}</p>
- </div>
- </DropdownMenuItem>
- );
- })}
- <div className="mt-1 h-1 border-t border-mineshaft-600" />
- <DropdownMenuItem
- icon={<FontAwesomeIcon icon={faSignOut} />}
- onClick={logOutUser}
- >
- Log Out
- </DropdownMenuItem>
- </DropdownMenuContent>
- </DropdownMenu>
- </div>
- {isSubOrganization && (
- <>
- <ChevronRight size={18} className="mt-[3px] mr-3 text-mineshaft-400/70" />
- <div
- className={twMerge(
- "relative flex min-w-16 items-center self-end rounded-t-md border-x border-t pt-1.5 pr-2 pb-2.5 pl-3",
- !isProjectScope && isSubOrganization
- ? "border-sub-org/15 bg-gradient-to-b from-sub-org/10 to-sub-org/[0.075]"
- : "border-transparent"
- )}
- >
- {/* scott: the below is used to hide the top border from the org nav bar */}
- {!isProjectScope && isSubOrganization && (
- <div className="absolute -bottom-px left-0 h-px w-full bg-mineshaft-900">
- <div className="h-full bg-sub-org/[0.075]" />
- </div>
- )}
- <DropdownMenu
- modal={false}
- onOpenChange={(open) => {
- if (!open) setSubOrgBreadcrumbSearch("");
- }}
- >
- <div className="group mr-1 flex min-w-0 cursor-pointer items-center gap-2 overflow-hidden text-sm text-white transition-all duration-100">
+ <PopoverTrigger asChild>
+ <UnstableIconButton variant="ghost" size="xs" aria-label="switch-org">
+ <ChevronsUpDown />
+ </UnstableIconButton>
+ </PopoverTrigger>
+ <PopoverContent align="start" sideOffset={20} className="w-96 p-0">
+ <Command>
+ <CommandInput placeholder="Search organizations..." />
+ <CommandList>
+ <CommandEmpty>No organizations found.</CommandEmpty>
+ {/* Current Organization */}
+ <CommandGroup heading="Current Organization">
+ <CommandItem
+ value={rootOrg.name}
+ onSelect={() => {
+ setIsOrgSelectOpen(false);
+ if (isSubOrganization) {
+ handleOrgSelection({ organizationId: rootOrg.id });
+ } else {
+ navigate({
+ to: "/organizations/$orgId/projects",
+ params: { orgId: rootOrg.id }
+ });
+ }
+ }}
+ >
+ <Check className={!isSubOrganization ? "opacity-100" : "opacity-0"} />
+ <span className="truncate">{rootOrg.name}</span>
+ </CommandItem>
+ </CommandGroup>
+ {/* Sub-Organizations */}
+ {subscription.subOrganization && subOrganizations.length > 0 && (
+ <>
+ <CommandGroup className="ml-6" heading="Sub-Organizations">
+ {subOrganizations.map((subOrg) => (
+ <CommandItem
+ key={subOrg.id}
+ value={subOrg.name}
+ onSelect={() => {
+ setIsOrgSelectOpen(false);
+ handleOrgSelection({ organizationId: subOrg.id });
+ }}
+ >
+ <Check
+ className={
+ currentOrg?.id === subOrg.id ? "opacity-100" : "opacity-0"
+ }
+ />
+ <span className="truncate">{subOrg.name}</span>
+ </CommandItem>
+ ))}
+ <OrgPermissionCan
+ I={OrgPermissionSubOrgActions.Create}
+ a={OrgPermissionSubjects.SubOrganization}
+ >
+ {(isAllowed) =>
+ isAllowed ? (
+ <CommandItem
+ className="text-muted"
+ onSelect={() => {
+ setIsOrgSelectOpen(false);
+ setShowSubOrgForm(true);
+ }}
+ >
+ <Plus />
+ <span>New Sub-Organization</span>
+ </CommandItem>
+ ) : null
+ }
+ </OrgPermissionCan>
+ </CommandGroup>
+ <CommandSeparator />
+ </>
+ )}
+ {/* Other Organizations */}
+ {orgs && orgs.filter((o) => o.id !== rootOrg.id).length > 0 && (
+ <CommandGroup heading="Other Organizations">
+ {orgs
+ .filter((o) => o.id !== rootOrg.id)
+ .map((org) => (
+ <CommandItem
+ key={org.id}
+ value={org.name}
+ onSelect={() => {
+ setIsOrgSelectOpen(false);
+ handleOrgNav(org);
+ }}
+ >
+ <span className="truncate">{org.name}</span>
+ </CommandItem>
+ ))}
+ </CommandGroup>
+ )}
+ </CommandList>
+ <div className="border-t border-border p-1">
<button
- className="flex cursor-pointer items-center gap-x-2 truncate whitespace-nowrap"
type="button"
- onClick={async () => {
- navigate({
- to: "/organizations/$orgId/projects",
- params: { orgId: currentOrg.id }
- });
- if (isSubOrganization) {
- await router.invalidate({ sync: true }).catch(() => null);
- }
- }}
+ className="flex w-full cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm text-foreground hover:bg-foreground/5"
+ onClick={logOutUser}
>
- <SubOrgIcon className={twMerge("size-[14px] shrink-0 text-sub-org")} />
- <span className="truncate">{currentOrg?.name}</span>
- <Badge variant="sub-org" className="hidden lg:inline-flex">
- Sub-Organization
- </Badge>
+ <LogOut className="size-4" />
+ <span>Log Out</span>
</button>
</div>
- <DropdownMenuTrigger asChild>
- <div>
- <IconButton
- variant="plain"
- colorSchema="secondary"
- ariaLabel="switch-org"
- className="px-2 py-1"
- >
- <FontAwesomeIcon icon={faCaretDown} className="text-xs text-bunker-300" />
- </IconButton>
- </div>
- </DropdownMenuTrigger>
- <DropdownMenuContent
- align="center"
- side="bottom"
- className="mt-6 cursor-default p-1 shadow-mineshaft-600 drop-shadow-md"
- style={{ minWidth: "220px" }}
- onCloseAutoFocus={(e) => e.preventDefault()}
- >
- <SubOrgFilterList
- search={subOrgBreadcrumbSearch}
- onSearchChange={setSubOrgBreadcrumbSearch}
- subOrganizations={subOrganizations}
- currentOrgId={currentOrg?.id}
- onSelect={(orgId) => handleOrgSelection({ organizationId: orgId })}
- onCreateSubOrg={() => setShowSubOrgForm(true)}
- />
- </DropdownMenuContent>
- </DropdownMenu>
- </div>
- </>
- )}
+ </Command>
+ </PopoverContent>
+ </Popover>
+ </div>
{isProjectScope && (
<>
- <ChevronRight size={18} className="mx-3 mt-[3px] text-mineshaft-400/70" />
+ {/* <ChevronRight size={18} className="mx-3 mt-[3px] text-mineshaft-400/70" /> */}
<ProjectSelect />
</>
)}
@@ -669,46 +549,41 @@ export const Navbar = () => {
{subscription && subscription.slug === "starter" && !subscription.has_used_trial ? (
<Tooltip content="Start Free Pro Trial">
<Button
- variant="plain"
- className="mr-2 border-mineshaft-500 px-2.5 py-1.5 whitespace-nowrap text-mineshaft-200 hover:bg-mineshaft-600"
- leftIcon={<FontAwesomeIcon icon={faInfinity} />}
+ variant="info"
+ size="xs"
+ className="mt-px mr-2"
onClick={async () => {
if (!subscription || !rootOrg) return;
-
- // direct user to start pro trial
const url = await mutateAsync({
orgId: rootOrg.id,
success_url: window.location.href
});
-
window.location.href = url;
}}
>
+ <Infinity />
Free Pro Trial
</Button>
</Tooltip>
) : (
- <div className="mt-0.5 mr-3 hidden rounded-sm border border-mineshaft-400 px-1 text-xs text-mineshaft-100 no-underline! opacity-50 md:inline-block">
+ <Badge variant="info" className="mt-[3px] mr-3 hidden md:inline-flex">
{getPlan(subscription)}
- </div>
+ </Badge>
)}
- {/* eslint-disable-next-line no-nested-ternary */}
- {!location.pathname.startsWith("/admin") ? (
- user.superAdmin ? (
- <Link
- className="mr-2 flex h-[34px] items-center rounded-md border border-mineshaft-500 px-2.5 py-1.5 text-sm whitespace-nowrap text-mineshaft-200 hover:bg-mineshaft-600"
- to="/admin"
- onClick={handleNavigateToAdminConsole}
- >
- <InstanceIcon className="inline-block size-3.5" />
- <span className="ml-2 hidden md:inline-block">Server Console</span>
+ {!location.pathname.startsWith("/admin") && user.superAdmin && (
+ <Button variant="outline" size="xs" className="mt-px mr-2" asChild>
+ <Link to="/admin" onClick={handleNavigateToAdminConsole}>
+ <InstanceIcon />
+ <span className="hidden md:inline">Server Console</span>
</Link>
- ) : (
- <OrgPermissionCan I={OrgPermissionActions.Create} a={OrgPermissionSubjects.Member}>
- {(isAllowed) =>
- isAllowed ? (
+ </Button>
+ )}
+ {!location.pathname.startsWith("/admin") && !user.superAdmin && (
+ <OrgPermissionCan I={OrgPermissionActions.Create} a={OrgPermissionSubjects.Member}>
+ {(isAllowed) =>
+ isAllowed ? (
+ <Button variant="outline" size="sm" className="mr-2" asChild>
<Link
- className="mr-2 flex h-[34px] items-center rounded-md border border-mineshaft-500 px-2.5 py-1.5 text-sm whitespace-nowrap text-mineshaft-200 hover:bg-mineshaft-600"
to="/organizations/$orgId/access-management"
params={{ orgId: currentOrg.id }}
search={{
@@ -716,162 +591,152 @@ export const Navbar = () => {
action: "invite-members"
}}
>
- <UserPlusIcon className="inline-block size-3.5" />
- <span className="ml-2 hidden md:inline-block">Invite Users</span>
+ <UserPlus />
+ <span className="hidden md:inline">Invite Users</span>
</Link>
- ) : null
- }
- </OrgPermissionCan>
- )
- ) : null}
- <DropdownMenu modal={false}>
- <DropdownMenuTrigger>
- <div className="rounded-l-md border border-r-0 border-mineshaft-500 px-2.5 py-1 hover:bg-mineshaft-600">
- <FontAwesomeIcon icon={faCircleQuestion} className="text-mineshaft-200" />
- </div>
- </DropdownMenuTrigger>
- <DropdownMenuContent align="end" side="bottom" className="mt-3 p-1">
- {INFISICAL_SUPPORT_OPTIONS.map(([icon, text, getUrl]) => {
- const url =
- text === "Email Support"
- ? getUrl({
- org_id: currentOrg.id,
- domain: window.location.origin,
- ...(isSubOrganization && { root_org_id: rootOrg.id })
- })
- : getUrl();
-
- if (url === "server-admins" && isInfisicalCloud()) {
- return null;
- }
- if (url === "upgrade-path" && isInfisicalCloud()) {
- return null;
- }
- return (
- <DropdownMenuItem key={url as string}>
- {url === "server-admins" ? (
- <button
- type="button"
- onClick={() => setShowAdminsModal(true)}
- className="flex w-full items-center rounded-md font-normal text-mineshaft-300 duration-200"
- >
- <div className="relative flex w-full cursor-pointer items-center justify-start rounded-md select-none">
- {icon}
- <div className="text-sm">{text}</div>
- </div>
- </button>
- ) : (
- <a
- target="_blank"
- rel="noopener noreferrer"
- href={String(url)}
- className="flex w-full items-center rounded-md font-normal text-mineshaft-300 duration-200"
+ </Button>
+ ) : null
+ }
+ </OrgPermissionCan>
+ )}
+ <UnstableButtonGroup className="mr-2">
+ <UnstableDropdownMenu modal={false}>
+ <UnstableDropdownMenuTrigger asChild>
+ <UnstableIconButton variant="outline" size="sm" aria-label="Help">
+ <CircleHelp />
+ </UnstableIconButton>
+ </UnstableDropdownMenuTrigger>
+ <UnstableDropdownMenuContent align="end" side="bottom" sideOffset={8}>
+ {INFISICAL_SUPPORT_OPTIONS.map(([Icon, text, getUrl]) => {
+ const url =
+ text === "Email Support"
+ ? getUrl({
+ org_id: currentOrg.id,
+ domain: window.location.origin,
+ ...(isSubOrganization && { root_org_id: rootOrg.id })
+ })
+ : getUrl();
+
+ if (url === "server-admins" && isInfisicalCloud()) {
+ return null;
+ }
+ if (url === "upgrade-path" && isInfisicalCloud()) {
+ return null;
+ }
+
+ if (url === "server-admins") {
+ return (
+ <UnstableDropdownMenuItem
+ key="server-admins"
+ onSelect={() => setShowAdminsModal(true)}
>
- <div className="relative flex w-full cursor-pointer items-center justify-start rounded-md select-none">
- {icon}
- <div className="text-sm">{text}</div>
- </div>
+ <Icon className="size-4" />
+ {text}
+ </UnstableDropdownMenuItem>
+ );
+ }
+
+ return (
+ <UnstableDropdownMenuItem key={url as string} asChild>
+ <a target="_blank" rel="noopener noreferrer" href={String(url)}>
+ <Icon />
+ {text}
</a>
- )}
- </DropdownMenuItem>
- );
- })}
- {envConfig.PLATFORM_VERSION && (
- <div className="mt-2 mb-2 w-full cursor-default pl-5 text-sm duration-200 hover:text-mineshaft-200">
- <FontAwesomeIcon icon={faInfo} className="mr-4 px-[0.1rem]" />
- Version: {envConfig.PLATFORM_VERSION}
- </div>
- )}
- </DropdownMenuContent>
- </DropdownMenu>
- <NotificationDropdown />
- <DropdownMenu modal={false}>
- <DropdownMenuTrigger asChild>
- <div className="rounded-r-md border border-mineshaft-500 px-2.5 py-1 hover:bg-mineshaft-600">
- <FontAwesomeIcon icon={faUserCircle} className="text-mineshaft-200" />
- </div>
- </DropdownMenuTrigger>
- <DropdownMenuContent side="bottom" align="end" className="mt-3 p-1">
- <div className="cursor-default px-1 py-1">
- <div className="flex w-full items-center justify-center rounded-md border border-mineshaft-600 bg-linear-to-tr from-primary-500/10 to-mineshaft-800 p-1 px-2 transition-all duration-150">
- <div className="p-1 pr-3">
- <FontAwesomeIcon icon={faUser} className="text-xl text-mineshaft-400" />
- </div>
- <div className="flex grow flex-col text-white">
- <div className="max-w-36 truncate text-sm font-medium text-ellipsis capitalize">
- {user?.firstName} {user?.lastName}
+ </UnstableDropdownMenuItem>
+ );
+ })}
+ {envConfig.PLATFORM_VERSION && (
+ <>
+ <UnstableDropdownMenuSeparator />
+ <div className="flex items-center gap-2 px-3 py-1.5 text-xs text-muted">
+ <Info className="size-3.5" />
+ Version: {envConfig.PLATFORM_VERSION}
</div>
- <div className="text-xs text-mineshaft-300">{user.email}</div>
+ </>
+ )}
+ </UnstableDropdownMenuContent>
+ </UnstableDropdownMenu>
+ <NotificationDropdown />
+ <UnstableDropdownMenu modal={false}>
+ <UnstableDropdownMenuTrigger asChild>
+ <UnstableIconButton variant="outline" size="sm" aria-label="User menu">
+ <User />
+ </UnstableIconButton>
+ </UnstableDropdownMenuTrigger>
+ <UnstableDropdownMenuContent side="bottom" align="end" sideOffset={8}>
+ <div className="cursor-default px-3 py-2">
+ <div className="text-sm font-medium capitalize">
+ {user?.firstName} {user?.lastName}
</div>
+ <div className="text-muted-foreground text-xs">{user.email}</div>
</div>
- </div>
- <Link to="/personal-settings">
- <DropdownMenuItem icon={<FontAwesomeIcon icon={faUserCog} />}>
- Personal Settings
- </DropdownMenuItem>
- </Link>
- <OrgPermissionCan I={OrgPermissionActions.Create} a={OrgPermissionSubjects.Member}>
- {(isAllowed) =>
- isAllowed ? (
- <Link
- to="/organizations/$orgId/access-management"
- params={{ orgId: currentOrg.id }}
- search={{
- selectedTab: "members",
- action: "invite-members"
- }}
- >
- <DropdownMenuItem icon={<FontAwesomeIcon icon={faUserPlus} />}>
- Invite Users
- </DropdownMenuItem>
- </Link>
- ) : null
- }
- </OrgPermissionCan>
- <a
- href="https://infisical.com/docs/documentation/getting-started/introduction"
- target="_blank"
- rel="noopener noreferrer"
- className="mt-3 w-full text-sm leading-[1.2rem] font-normal text-mineshaft-300 hover:text-mineshaft-100"
- >
- <DropdownMenuItem>
- Documentation
- <FontAwesomeIcon
- icon={faArrowUpRightFromSquare}
- className="text-xxs mb-[0.06rem] pl-1.5"
- />
- </DropdownMenuItem>
- </a>
- <a
- href="https://infisical.com/slack"
- target="_blank"
- rel="noopener noreferrer"
- className="mt-3 w-full text-sm leading-[1.2rem] font-normal text-mineshaft-300 hover:text-mineshaft-100"
- >
- <DropdownMenuItem>
- Join Slack Community
- <FontAwesomeIcon
- icon={faArrowUpRightFromSquare}
- className="text-xxs mb-[0.06rem] pl-1.5"
- />
- </DropdownMenuItem>
- </a>
- <div className="mt-1 h-1 border-t border-mineshaft-600" />
- <DropdownMenuItem onClick={handleCopyToken}>
- Copy Token
- <Tooltip
- content="This token is linked to your current login session and can only access resources within the organization you're currently logged into."
- className="max-w-3xl"
- >
- <FontAwesomeIcon icon={faInfoCircle} className="pl-1.5 text-xs" />
- </Tooltip>
- </DropdownMenuItem>
- <div className="mt-1 h-1 border-t border-mineshaft-600" />
- <DropdownMenuItem onClick={logOutUser} icon={<FontAwesomeIcon icon={faSignOut} />}>
- Log Out
- </DropdownMenuItem>
- </DropdownMenuContent>
- </DropdownMenu>
+ <UnstableDropdownMenuSeparator />
+ <UnstableDropdownMenuItem asChild>
+ <Link to="/personal-settings">
+ <Settings className="size-4" />
+ Personal Settings
+ </Link>
+ </UnstableDropdownMenuItem>
+ <OrgPermissionCan I={OrgPermissionActions.Create} a={OrgPermissionSubjects.Member}>
+ {(isAllowed) =>
+ isAllowed ? (
+ <UnstableDropdownMenuItem asChild>
+ <Link
+ to="/organizations/$orgId/access-management"
+ params={{ orgId: currentOrg.id }}
+ search={{
+ selectedTab: "members",
+ action: "invite-members"
+ }}
+ >
+ <UserPlus />
+ Invite Users
+ </Link>
+ </UnstableDropdownMenuItem>
+ ) : null
+ }
+ </OrgPermissionCan>
+ <UnstableDropdownMenuSeparator />
+ <UnstableDropdownMenuItem asChild>
+ <a
+ href="https://infisical.com/docs/documentation/getting-started/introduction"
+ target="_blank"
+ rel="noopener noreferrer"
+ >
+ <Book />
+ Documentation
+ <ExternalLink className="ml-auto size-3.5 opacity-50" />
+ </a>
+ </UnstableDropdownMenuItem>
+ <UnstableDropdownMenuItem asChild>
+ <a href="https://infisical.com/slack" target="_blank" rel="noopener noreferrer">
+ <Slack />
+ Join Slack Community
+ <ExternalLink className="ml-auto size-3.5 opacity-50" />
+ </a>
+ </UnstableDropdownMenuItem>
+ <UnstableDropdownMenuSeparator />
+ <UnstableDropdownMenuItem onSelect={handleCopyToken}>
+ <Clipboard />
+ Copy Token
+ <V3Tooltip>
+ <V3TooltipTrigger>
+ <Info className="size-3.5 opacity-50" />
+ </V3TooltipTrigger>
+ <V3TooltipContent className="max-w-xs">
+ This token is linked to your current login session and can only access resources
+ within the organization you&apos;re currently logged into.
+ </V3TooltipContent>
+ </V3Tooltip>
+ </UnstableDropdownMenuItem>
+ <UnstableDropdownMenuSeparator />
+ <UnstableDropdownMenuItem onSelect={logOutUser}>
+ <LogOut />
+ Log Out
+ </UnstableDropdownMenuItem>
+ </UnstableDropdownMenuContent>
+ </UnstableDropdownMenu>
+ </UnstableButtonGroup>
<Modal
isOpen={showCardDeclinedModal}
@@ -897,21 +762,21 @@ export const Navbar = () => {
</div>
<div className="mt-4">
<div className="flex space-x-3">
- <Button
+ <V2Button
colorSchema="primary"
variant="solid"
onClick={handleNavigateToRootOrgBilling}
>
Update Payment Method
- </Button>
+ </V2Button>
{!isModalIntrusive && (
- <Button
+ <V2Button
colorSchema="secondary"
variant="outline"
onClick={() => setShowCardDeclinedModal(false)}
>
Dismiss
- </Button>
+ </V2Button>
)}
</div>
</div>
diff --git a/frontend/src/layouts/OrganizationLayout/components/NavBar/NotificationDropdown.tsx b/frontend/src/layouts/OrganizationLayout/components/NavBar/NotificationDropdown.tsx
index d72d9d59ef..a5d4aed05a 100644
--- a/frontend/src/layouts/OrganizationLayout/components/NavBar/NotificationDropdown.tsx
+++ b/frontend/src/layouts/OrganizationLayout/components/NavBar/NotificationDropdown.tsx
@@ -2,6 +2,7 @@ import { useMemo } from "react";
import { faBell } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { useRouter } from "@tanstack/react-router";
+import { Bell, BellDotIcon } from "lucide-react";
import {
ContentLoader,
@@ -9,6 +10,7 @@ import {
DropdownMenuContent,
DropdownMenuTrigger
} from "@app/components/v2";
+import { UnstableIconButton } from "@app/components/v3";
import {
useDeleteNotification,
useMarkAllNotificationsAsRead,
@@ -33,15 +35,15 @@ export const NotificationDropdown = () => {
return (
<DropdownMenu modal={false}>
- <DropdownMenuTrigger>
- <div className="relative border border-r-0 border-mineshaft-500 px-2.5 py-1 hover:bg-mineshaft-600">
- <FontAwesomeIcon icon={faBell} className="text-mineshaft-200" />
- {unreadCount > 0 && (
- <span className="absolute -top-1 -right-1 flex h-4 min-w-4 items-center justify-center rounded-full bg-yellow-400 px-1 text-[10px] text-black">
- {unreadCount > 99 ? "99+" : unreadCount}
- </span>
- )}
- </div>
+ <DropdownMenuTrigger asChild>
+ <UnstableIconButton
+ variant="outline"
+ size="sm"
+ aria-label="Notifications"
+ className="relative"
+ >
+ {unreadCount > 0 ? <BellDotIcon className="text-warning" /> : <Bell />}
+ </UnstableIconButton>
</DropdownMenuTrigger>
<DropdownMenuContent
align="end"
diff --git a/frontend/src/layouts/OrganizationLayout/components/OrgNavBar/OrgNavBar.tsx b/frontend/src/layouts/OrganizationLayout/components/OrgNavBar/OrgNavBar.tsx
deleted file mode 100644
index 09859b10f4..0000000000
--- a/frontend/src/layouts/OrganizationLayout/components/OrgNavBar/OrgNavBar.tsx
+++ /dev/null
@@ -1,127 +0,0 @@
-import { Link, useLocation } from "@tanstack/react-router";
-import { motion } from "framer-motion";
-import { twMerge } from "tailwind-merge";
-
-import { CreateOrgModal } from "@app/components/organization/CreateOrgModal";
-import { Tab, TabList, Tabs } from "@app/components/v2";
-import { useOrganization } from "@app/context";
-import { usePopUp } from "@app/hooks";
-
-type Props = {
- isHidden?: boolean;
-};
-
-export const OrgNavBar = ({ isHidden }: Props) => {
- const { isRootOrganization, currentOrg } = useOrganization();
- const { popUp, handlePopUpToggle } = usePopUp(["createOrg"] as const);
-
- const { pathname } = useLocation();
-
- const variant = isRootOrganization ? "org" : "namespace";
-
- return (
- <div className="bg-mineshaft-900">
- {!isHidden && (
- <div
- className={twMerge(
- "dark flex w-full flex-col overflow-x-hidden border-y bg-gradient-to-b px-4 pt-0.5",
- isRootOrganization
- ? "border-t-org/15 border-b-org/5 from-org/[0.075] to-org/[0.025]"
- : "border-t-sub-org/15 border-b-sub-org/5 from-sub-org/[0.075] to-sub-org/[0.025]"
- )}
- >
- <motion.div
- key="menu-org-items"
- initial={{ x: -150 }}
- animate={{ x: 0 }}
- exit={{ x: -150 }}
- transition={{ duration: 0.2 }}
- >
- <nav className="w-full">
- <Tabs value="selected">
- <TabList className="border-b-0">
- <Link to="/organizations/$orgId/projects" params={{ orgId: currentOrg.id }}>
- {({ isActive }) => (
- <Tab variant={variant} value={isActive ? "selected" : ""}>
- Overview
- </Tab>
- )}
- </Link>
- <Link
- to="/organizations/$orgId/app-connections"
- params={{ orgId: currentOrg.id }}
- >
- {({ isActive }) => (
- <Tab variant={variant} value={isActive ? "selected" : ""}>
- App Connections
- </Tab>
- )}
- </Link>
- <Link to="/organizations/$orgId/networking" params={{ orgId: currentOrg.id }}>
- {({ isActive }) => (
- <Tab variant={variant} value={isActive ? "selected" : ""}>
- Networking
- </Tab>
- )}
- </Link>
- <Link to="/organizations/$orgId/secret-sharing" params={{ orgId: currentOrg.id }}>
- {({ isActive }) => (
- <Tab value={isActive ? "selected" : ""} variant={variant}>
- Secret Sharing
- </Tab>
- )}
- </Link>
- <Link
- to="/organizations/$orgId/access-management"
- params={{ orgId: currentOrg.id }}
- >
- {({ isActive }) => (
- <Tab
- variant={variant}
- value={
- isActive ||
- pathname.match(/organizations\/[^/]+\/(members|identities|groups|roles)/)
- ? "selected"
- : ""
- }
- >
- Access Control
- </Tab>
- )}
- </Link>
- <Link to="/organizations/$orgId/audit-logs" params={{ orgId: currentOrg.id }}>
- {({ isActive }) => (
- <Tab variant={variant} value={isActive ? "selected" : ""}>
- Audit Logs
- </Tab>
- )}
- </Link>
- {isRootOrganization && (
- <Link to="/organizations/$orgId/billing" params={{ orgId: currentOrg.id }}>
- {({ isActive }) => (
- <Tab variant={variant} value={isActive ? "selected" : ""}>
- Usage & Billing
- </Tab>
- )}
- </Link>
- )}
- <Link to="/organizations/$orgId/settings" params={{ orgId: currentOrg.id }}>
- {({ isActive }) => (
- <Tab variant={variant} value={isActive ? "selected" : ""}>
- Settings
- </Tab>
- )}
- </Link>
- </TabList>
- </Tabs>
- </nav>
- </motion.div>
- </div>
- )}
- <CreateOrgModal
- isOpen={popUp?.createOrg?.isOpen}
- onClose={() => handlePopUpToggle("createOrg", false)}
- />
- </div>
- );
-};
diff --git a/frontend/src/layouts/OrganizationLayout/components/OrgNavBar/index.tsx b/frontend/src/layouts/OrganizationLayout/components/OrgNavBar/index.tsx
deleted file mode 100644
index 06509e9195..0000000000
--- a/frontend/src/layouts/OrganizationLayout/components/OrgNavBar/index.tsx
+++ /dev/null
@@ -1 +0,0 @@
-export { OrgNavBar } from "./OrgNavBar";
diff --git a/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/AINav.tsx b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/AINav.tsx
new file mode 100644
index 0000000000..b9bb9edf9d
--- /dev/null
+++ b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/AINav.tsx
@@ -0,0 +1,21 @@
+import { FileText, Settings, Shield, Terminal } from "lucide-react";
+
+import { ProjectNavList } from "./ProjectNavLink";
+import { MCP_SUBMENU, PROJECT_ACCESS_CONTROL_SUBMENU } from "./submenus";
+import type { NavItem, Submenu } from "./types";
+
+export const AINav = ({ onSubmenuOpen }: { onSubmenuOpen: (submenu: Submenu) => void }) => {
+ const items: NavItem[] = [
+ { label: "MCP", icon: Terminal, pathSuffix: "overview", submenu: MCP_SUBMENU },
+ {
+ label: "Access Control",
+ icon: Shield,
+ pathSuffix: "access-management",
+ activeMatch: /\/groups\/|\/identities\/|\/members\/|\/roles\//,
+ submenu: PROJECT_ACCESS_CONTROL_SUBMENU
+ },
+ { label: "Audit Logs", icon: FileText, pathSuffix: "audit-logs" },
+ { label: "Settings", icon: Settings, pathSuffix: "settings" }
+ ];
+ return <ProjectNavList items={items} onSubmenuOpen={onSubmenuOpen} />;
+};
diff --git a/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/CertManagerNav.tsx b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/CertManagerNav.tsx
new file mode 100644
index 0000000000..3828c99ad6
--- /dev/null
+++ b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/CertManagerNav.tsx
@@ -0,0 +1,110 @@
+import {
+ Bell,
+ BookCheck,
+ Cable,
+ FileKey,
+ FileText,
+ Monitor,
+ PenTool,
+ Plug,
+ Search,
+ Settings,
+ Shield,
+ ShieldCheck
+} from "lucide-react";
+
+import { useProject, useSubscription } from "@app/context";
+import {
+ useListWorkspaceCertificateTemplates,
+ useListWorkspacePkiSubscribers
+} from "@app/hooks/api";
+
+import { ProjectNavList } from "./ProjectNavLink";
+import {
+ CERT_APPROVALS_SUBMENU,
+ CERT_CERTIFICATES_SUBMENU,
+ CERT_CODE_SIGNING_SUBMENU,
+ CERT_DISCOVERY_SUBMENU,
+ CERT_SETTINGS_SUBMENU,
+ PROJECT_ACCESS_CONTROL_SUBMENU
+} from "./submenus";
+import type { NavItem, Submenu } from "./types";
+
+export const CertManagerNav = ({
+ onSubmenuOpen
+}: {
+ onSubmenuOpen: (submenu: Submenu) => void;
+}) => {
+ const { currentProject } = useProject();
+ const { subscription } = useSubscription();
+ const { data: subscribers = [] } = useListWorkspacePkiSubscribers(currentProject?.id || "");
+ const { data: templatesData } = useListWorkspaceCertificateTemplates({
+ projectId: currentProject?.id || ""
+ });
+ const templates = templatesData?.certificateTemplates || [];
+
+ const items: NavItem[] = [
+ {
+ label: "Certificates",
+ icon: FileKey,
+ pathSuffix: "policies",
+ submenu: CERT_CERTIFICATES_SUBMENU
+ },
+ {
+ label: "Discovery",
+ icon: Search,
+ pathSuffix: "discovery",
+ activeMatch: /\/discovery/,
+ submenu: CERT_DISCOVERY_SUBMENU
+ },
+ {
+ label: "Certificate Authorities",
+ icon: ShieldCheck,
+ pathSuffix: "certificate-authorities",
+ activeMatch: /\/ca\//
+ },
+ {
+ label: "Code Signing",
+ icon: PenTool,
+ pathSuffix: "code-signing",
+ activeMatch: /\/code-signing/,
+ submenu: CERT_CODE_SIGNING_SUBMENU
+ },
+ { label: "Alerting", icon: Bell, pathSuffix: "alerting" },
+ {
+ label: "Approvals",
+ icon: BookCheck,
+ pathSuffix: "approvals",
+ submenu: CERT_APPROVALS_SUBMENU
+ },
+ { label: "Integrations", icon: Plug, pathSuffix: "integrations" },
+ { label: "App Connections", icon: Cable, pathSuffix: "app-connections" },
+ {
+ label: "Subscribers (Legacy)",
+ icon: Monitor,
+ pathSuffix: "subscribers",
+ hidden: !(subscription.pkiLegacyTemplates || subscribers.length > 0)
+ },
+ {
+ label: "Certificate Templates (Legacy)",
+ icon: FileKey,
+ pathSuffix: "certificate-templates",
+ hidden: !(subscription.pkiLegacyTemplates || templates.length > 0)
+ },
+ {
+ label: "Access Control",
+ icon: Shield,
+ pathSuffix: "access-management",
+ activeMatch: /\/groups\/|\/identities\/|\/members\/|\/roles\//,
+ submenu: PROJECT_ACCESS_CONTROL_SUBMENU
+ },
+ { label: "Audit Logs", icon: FileText, pathSuffix: "audit-logs" },
+ {
+ label: "Settings",
+ icon: Settings,
+ pathSuffix: "settings",
+ submenu: CERT_SETTINGS_SUBMENU
+ }
+ ];
+ return <ProjectNavList items={items} onSubmenuOpen={onSubmenuOpen} />;
+};
diff --git a/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/KmsNav.tsx b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/KmsNav.tsx
new file mode 100644
index 0000000000..2f376aead7
--- /dev/null
+++ b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/KmsNav.tsx
@@ -0,0 +1,22 @@
+import { FileText, Key, LayoutDashboard, Settings, Shield } from "lucide-react";
+
+import { ProjectNavList } from "./ProjectNavLink";
+import { PROJECT_ACCESS_CONTROL_SUBMENU } from "./submenus";
+import type { NavItem, Submenu } from "./types";
+
+export const KmsNav = ({ onSubmenuOpen }: { onSubmenuOpen: (submenu: Submenu) => void }) => {
+ const items: NavItem[] = [
+ { label: "Overview", icon: LayoutDashboard, pathSuffix: "overview" },
+ { label: "KMIP", icon: Key, pathSuffix: "kmip" },
+ {
+ label: "Access Control",
+ icon: Shield,
+ pathSuffix: "access-management",
+ activeMatch: /\/groups\/|\/identities\/|\/members\/|\/roles\//,
+ submenu: PROJECT_ACCESS_CONTROL_SUBMENU
+ },
+ { label: "Audit Logs", icon: FileText, pathSuffix: "audit-logs" },
+ { label: "Settings", icon: Settings, pathSuffix: "settings" }
+ ];
+ return <ProjectNavList items={items} onSubmenuOpen={onSubmenuOpen} />;
+};
diff --git a/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/OrgNav.tsx b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/OrgNav.tsx
new file mode 100644
index 0000000000..4021bab77c
--- /dev/null
+++ b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/OrgNav.tsx
@@ -0,0 +1,214 @@
+import { useState } from "react";
+import { Link, useLocation, useNavigate } from "@tanstack/react-router";
+import { AnimatePresence, motion } from "framer-motion";
+import {
+ Cable,
+ ChevronRight,
+ CreditCard,
+ FileText,
+ Network,
+ Settings,
+ Share2,
+ Shield
+} from "lucide-react";
+import { twMerge } from "tailwind-merge";
+
+import {
+ OrgIcon,
+ SidebarGroup,
+ SidebarMenu,
+ SidebarMenuButton,
+ SidebarMenuItem,
+ SubOrgIcon
+} from "@app/components/v3";
+import { useOrganization, useSubscription } from "@app/context";
+
+import {
+ getOrgSettingsSubmenu,
+ getSecretSharingSubmenu,
+ NETWORKING_SUBMENU,
+ ORG_ACCESS_CONTROL_SUBMENU
+} from "./submenus";
+import { OrgSubmenuView } from "./SubmenuViews";
+import type { OrgNavItem, Submenu } from "./types";
+
+// --- Org nav ---
+
+const OrgNav = ({ onSubmenuOpen }: { onSubmenuOpen: (submenu: Submenu) => void }) => {
+ const { currentOrg, isRootOrganization, isSubOrganization } = useOrganization();
+ const { subscription } = useSubscription();
+ const { pathname } = useLocation();
+ const orgId = currentOrg.id;
+
+ const items: OrgNavItem[] = [
+ {
+ label: "Overview",
+ icon: isRootOrganization ? OrgIcon : SubOrgIcon,
+ to: "/organizations/$orgId/projects",
+ isActive: pathname === `/organizations/${orgId}/projects`
+ },
+ {
+ label: "App Connections",
+ icon: Cable,
+ to: "/organizations/$orgId/app-connections",
+ isActive: pathname.startsWith(`/organizations/${orgId}/app-connections`)
+ },
+ {
+ label: "Networking",
+ icon: Network,
+ to: "/organizations/$orgId/networking",
+ isActive: pathname.startsWith(`/organizations/${orgId}/networking`),
+ submenu: NETWORKING_SUBMENU
+ },
+ {
+ label: "Secret Sharing",
+ icon: Share2,
+ to: "/organizations/$orgId/secret-sharing",
+ isActive: pathname.startsWith(`/organizations/${orgId}/secret-sharing`),
+ submenu: getSecretSharingSubmenu({ isSubOrganization })
+ },
+ {
+ label: "Audit Logs",
+ icon: FileText,
+ to: "/organizations/$orgId/audit-logs",
+ isActive: pathname.startsWith(`/organizations/${orgId}/audit-logs`)
+ },
+ {
+ label: "Access Control",
+ icon: Shield,
+ to: "/organizations/$orgId/access-management",
+ isActive:
+ pathname.startsWith(`/organizations/${orgId}/access-management`) ||
+ Boolean(pathname.match(/organizations\/[^/]+\/(members|identities|groups|roles)/)),
+ submenu: ORG_ACCESS_CONTROL_SUBMENU
+ },
+ ...(isRootOrganization
+ ? [
+ {
+ label: "Usage & Billing",
+ icon: CreditCard,
+ to: "/organizations/$orgId/billing",
+ isActive: pathname.startsWith(`/organizations/${orgId}/billing`)
+ }
+ ]
+ : []),
+ {
+ label: "Settings",
+ icon: Settings,
+ to: "/organizations/$orgId/settings",
+ isActive: pathname.startsWith(`/organizations/${orgId}/settings`),
+ submenu: getOrgSettingsSubmenu({
+ isSubOrganization,
+ hasSubOrganization: Boolean(subscription?.subOrganization)
+ })
+ }
+ ];
+
+ return (
+ <SidebarMenu>
+ {items.map((item) =>
+ item.submenu ? (
+ <SidebarMenuItem key={item.label}>
+ <SidebarMenuButton
+ size="lg"
+ isActive={item.isActive}
+ tooltip={item.label}
+ onClick={() => onSubmenuOpen(item.submenu!)}
+ >
+ <item.icon className="size-4" />
+ <span>{item.label}</span>
+ <ChevronRight
+ className={twMerge(
+ "ml-auto size-4 !text-foreground",
+ !item.isActive && "opacity-50"
+ )}
+ />
+ </SidebarMenuButton>
+ </SidebarMenuItem>
+ ) : (
+ <SidebarMenuItem key={item.label}>
+ <SidebarMenuButton asChild isActive={item.isActive} size="lg" tooltip={item.label}>
+ {/* eslint-disable-next-line @typescript-eslint/no-explicit-any */}
+ {/* eslint-disable-next-line @typescript-eslint/no-explicit-any */}
+ <Link to={item.to as any} params={{ orgId } as any}>
+ <item.icon className="size-4" />
+ <span>{item.label}</span>
+ </Link>
+ </SidebarMenuButton>
+ </SidebarMenuItem>
+ )
+ )}
+ </SidebarMenu>
+ );
+};
+
+// --- Org nav wrapper ---
+
+export const OrgNavWrapper = () => {
+ const { currentOrg, isSubOrganization } = useOrganization();
+ const { subscription } = useSubscription();
+ const { pathname } = useLocation();
+ const navigate = useNavigate();
+ const orgId = currentOrg.id;
+
+ const isOnAccessControl =
+ pathname.startsWith(`/organizations/${orgId}/access-management`) ||
+ Boolean(pathname.match(/organizations\/[^/]+\/(members|identities|groups|roles)/));
+ const isOnSettings = pathname.startsWith(`/organizations/${orgId}/settings`);
+ const isOnSecretSharing = pathname.startsWith(`/organizations/${orgId}/secret-sharing`);
+ const isOnNetworking = pathname.startsWith(`/organizations/${orgId}/networking`);
+
+ const getInitialSubmenu = (): Submenu | null => {
+ if (isOnAccessControl) return ORG_ACCESS_CONTROL_SUBMENU;
+ if (isOnSettings)
+ return getOrgSettingsSubmenu({
+ isSubOrganization,
+ hasSubOrganization: Boolean(subscription?.subOrganization)
+ });
+ if (isOnSecretSharing) return getSecretSharingSubmenu({ isSubOrganization });
+ if (isOnNetworking) return NETWORKING_SUBMENU;
+ return null;
+ };
+
+ const [activeSubmenu, setActiveSubmenu] = useState<Submenu | null>(getInitialSubmenu);
+
+ const handleSubmenuOpen = (submenu: Submenu) => {
+ setActiveSubmenu(submenu);
+ navigate({
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ to: `/organizations/$orgId/${submenu.pathSuffix}` as any,
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ params: { orgId } as any,
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ search: { selectedTab: submenu.defaultTab } as any
+ });
+ };
+
+ return (
+ <AnimatePresence mode="wait" initial={false}>
+ {activeSubmenu ? (
+ <motion.div
+ key="submenu"
+ initial={{ x: 30, opacity: 0 }}
+ animate={{ x: 0, opacity: 1 }}
+ exit={{ x: 30, opacity: 0 }}
+ transition={{ duration: 0.15, ease: "easeOut" }}
+ >
+ <OrgSubmenuView submenu={activeSubmenu} onBack={() => setActiveSubmenu(null)} />
+ </motion.div>
+ ) : (
+ <motion.div
+ key="main"
+ initial={{ x: -30, opacity: 0 }}
+ animate={{ x: 0, opacity: 1 }}
+ exit={{ x: -30, opacity: 0 }}
+ transition={{ duration: 0.15, ease: "easeOut" }}
+ >
+ <SidebarGroup>
+ <OrgNav onSubmenuOpen={handleSubmenuOpen} />
+ </SidebarGroup>
+ </motion.div>
+ )}
+ </AnimatePresence>
+ );
+};
diff --git a/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/OrgSidebar.tsx b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/OrgSidebar.tsx
new file mode 100644
index 0000000000..291cfa2ade
--- /dev/null
+++ b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/OrgSidebar.tsx
@@ -0,0 +1,29 @@
+import { useParams } from "@tanstack/react-router";
+
+import { Sidebar, SidebarContent, SidebarFooter } from "@app/components/v3";
+import { useOrganization } from "@app/context";
+
+import { OrgNavWrapper } from "./OrgNav";
+import { ProjectNav } from "./ProjectNav";
+
+// --- Main sidebar ---
+
+export const OrgSidebar = () => {
+ const projectId = useParams({
+ strict: false,
+ select: (el) => el?.projectId
+ });
+ const isInsideProject = Boolean(projectId);
+ const { isSubOrganization } = useOrganization();
+
+ let scope: "project" | "sub-org" | "org" = "org";
+ if (isInsideProject) scope = "project";
+ else if (isSubOrganization) scope = "sub-org";
+
+ return (
+ <Sidebar scope={scope} collapsible="none" side="left">
+ <SidebarContent>{isInsideProject ? <ProjectNav /> : <OrgNavWrapper />}</SidebarContent>
+ <SidebarFooter />
+ </Sidebar>
+ );
+};
diff --git a/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/PamNav.tsx b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/PamNav.tsx
new file mode 100644
index 0000000000..e3d07304dc
--- /dev/null
+++ b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/PamNav.tsx
@@ -0,0 +1,30 @@
+import { BookCheck, Database, FileText, Search, Settings, Shield, Video } from "lucide-react";
+
+import { ProjectNavList } from "./ProjectNavLink";
+import { PAM_APPROVALS_SUBMENU, PROJECT_ACCESS_CONTROL_SUBMENU } from "./submenus";
+import type { NavItem, Submenu } from "./types";
+
+export const PamNav = ({ onSubmenuOpen }: { onSubmenuOpen: (submenu: Submenu) => void }) => {
+ const items: NavItem[] = [
+ { label: "Resources", icon: Database, pathSuffix: "resources" },
+ { label: "Sessions", icon: Video, pathSuffix: "sessions" },
+ { label: "Discovery", icon: Search, pathSuffix: "discovery", activeMatch: /\/discovery\// },
+ {
+ label: "Approvals",
+ icon: BookCheck,
+ pathSuffix: "approvals",
+ activeMatch: /\/approvals\//,
+ submenu: PAM_APPROVALS_SUBMENU
+ },
+ {
+ label: "Access Control",
+ icon: Shield,
+ pathSuffix: "access-management",
+ activeMatch: /\/groups\/|\/identities\/|\/members\/|\/roles\//,
+ submenu: PROJECT_ACCESS_CONTROL_SUBMENU
+ },
+ { label: "Audit Logs", icon: FileText, pathSuffix: "audit-logs" },
+ { label: "Settings", icon: Settings, pathSuffix: "settings" }
+ ];
+ return <ProjectNavList items={items} onSubmenuOpen={onSubmenuOpen} />;
+};
diff --git a/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/ProjectNav.tsx b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/ProjectNav.tsx
new file mode 100644
index 0000000000..a50e5fce68
--- /dev/null
+++ b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/ProjectNav.tsx
@@ -0,0 +1,142 @@
+import { useState } from "react";
+import { useLocation, useNavigate } from "@tanstack/react-router";
+import { AnimatePresence, motion } from "framer-motion";
+import { DoorOpen, FileKey, Shield } from "lucide-react";
+
+import { SidebarGroup, SidebarMenu } from "@app/components/v3";
+import { useOrganization, useProject } from "@app/context";
+import { ProjectType } from "@app/hooks/api/projects/types";
+
+import { AINav } from "./AINav";
+import { CertManagerNav } from "./CertManagerNav";
+import { KmsNav } from "./KmsNav";
+import { PamNav } from "./PamNav";
+import { SecretManagerNav } from "./SecretManagerNav";
+import { SecretScanningNav } from "./SecretScanningNav";
+import { SshNav } from "./SshNav";
+import {
+ CERT_APPROVALS_SUBMENU,
+ CERT_CERTIFICATES_SUBMENU,
+ CERT_CODE_SIGNING_SUBMENU,
+ CERT_DISCOVERY_SUBMENU,
+ CERT_SETTINGS_SUBMENU,
+ INTEGRATIONS_SUBMENU,
+ MCP_SUBMENU,
+ PAM_APPROVALS_SUBMENU,
+ PROJECT_ACCESS_CONTROL_SUBMENU,
+ SECRET_SCANNING_SETTINGS_SUBMENU,
+ SM_SETTINGS_SUBMENU
+} from "./submenus";
+import { ProjectSubmenuView } from "./SubmenuViews";
+import type { Submenu } from "./types";
+import { PROJECT_TYPE_PATH } from "./types";
+
+const PROJECT_NAV_COMPONENT: Record<
+ ProjectType,
+ React.ComponentType<{ onSubmenuOpen: (submenu: Submenu) => void }>
+> = {
+ [ProjectType.SecretManager]: SecretManagerNav,
+ [ProjectType.KMS]: KmsNav,
+ [ProjectType.CertificateManager]: CertManagerNav,
+ [ProjectType.SSH]: SshNav,
+ [ProjectType.PAM]: PamNav,
+ [ProjectType.AI]: AINav,
+ [ProjectType.SecretScanning]: SecretScanningNav
+};
+
+// --- Project nav wrapper ---
+
+export const ProjectNav = () => {
+ const { currentProject } = useProject();
+ const { currentOrg } = useOrganization();
+ const { pathname } = useLocation();
+ const navigate = useNavigate();
+ const NavComponent = PROJECT_NAV_COMPONENT[currentProject.type];
+
+ const isOnAccessControl =
+ pathname.includes("/access-management") ||
+ Boolean(pathname.match(/\/groups\/|\/identities\/|\/members\/|\/roles\//));
+ const isOnIntegrations = pathname.includes("/integrations");
+ const isOnProjectSettings = pathname.endsWith("/settings") || pathname.includes("/settings?");
+ const isOnApproval = pathname.includes("/approval");
+ const isOnMcpOverview = currentProject.type === ProjectType.AI && pathname.includes("/overview");
+ const isCertManager = currentProject.type === ProjectType.CertificateManager;
+ const isOnCertPolicies = isCertManager && pathname.includes("/policies");
+ const isOnCertDiscovery = isCertManager && pathname.includes("/discovery");
+ const isOnCertCodeSigning = isCertManager && pathname.includes("/code-signing");
+ const isOnCertApprovals = isCertManager && pathname.includes("/approvals");
+
+ const getInitialProjectSubmenu = (): Submenu | null => {
+ if (isOnAccessControl) return PROJECT_ACCESS_CONTROL_SUBMENU;
+ if (isOnIntegrations) return INTEGRATIONS_SUBMENU;
+ if (isOnProjectSettings && currentProject.type === ProjectType.SecretManager)
+ return SM_SETTINGS_SUBMENU;
+ if (isOnProjectSettings && isCertManager) return CERT_SETTINGS_SUBMENU;
+ if (isOnProjectSettings && currentProject.type === ProjectType.SecretScanning)
+ return SECRET_SCANNING_SETTINGS_SUBMENU;
+ if (isOnMcpOverview) return MCP_SUBMENU;
+ if (isOnCertPolicies) return CERT_CERTIFICATES_SUBMENU;
+ if (isOnCertDiscovery) return CERT_DISCOVERY_SUBMENU;
+ if (isOnCertCodeSigning) return CERT_CODE_SIGNING_SUBMENU;
+ if (isOnCertApprovals) return CERT_APPROVALS_SUBMENU;
+ if (currentProject.type === ProjectType.PAM && pathname.includes("/approvals"))
+ return PAM_APPROVALS_SUBMENU;
+ if (isOnApproval)
+ return {
+ title: "Approvals",
+ pathSuffix: "approval",
+ defaultTab: "approval-requests",
+ items: [
+ { label: "Change Requests", icon: FileKey, tab: "approval-requests" },
+ { label: "Access Requests", icon: DoorOpen, tab: "resource-requests" },
+ { label: "Policies", icon: Shield, tab: "policies" }
+ ]
+ };
+ return null;
+ };
+
+ const [activeSubmenu, setActiveSubmenu] = useState<Submenu | null>(getInitialProjectSubmenu);
+
+ const handleSubmenuOpen = (submenu: Submenu) => {
+ setActiveSubmenu(submenu);
+ const typePath = PROJECT_TYPE_PATH[currentProject.type];
+ navigate({
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ to: `/organizations/$orgId/projects/${typePath}/$projectId/${submenu.pathSuffix}` as any,
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ params: { orgId: currentOrg.id, projectId: currentProject.id } as any,
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ search: { selectedTab: submenu.defaultTab } as any
+ });
+ };
+
+ return (
+ <AnimatePresence mode="wait" initial={false}>
+ {activeSubmenu ? (
+ <motion.div
+ key="submenu"
+ initial={{ x: 30, opacity: 0 }}
+ animate={{ x: 0, opacity: 1 }}
+ exit={{ x: 30, opacity: 0 }}
+ transition={{ duration: 0.15, ease: "easeOut" }}
+ >
+ <ProjectSubmenuView submenu={activeSubmenu} onBack={() => setActiveSubmenu(null)} />
+ </motion.div>
+ ) : (
+ <motion.div
+ key="main"
+ initial={{ x: -30, opacity: 0 }}
+ animate={{ x: 0, opacity: 1 }}
+ exit={{ x: -30, opacity: 0 }}
+ transition={{ duration: 0.15, ease: "easeOut" }}
+ >
+ <SidebarGroup>
+ <SidebarMenu>
+ <NavComponent onSubmenuOpen={handleSubmenuOpen} />
+ </SidebarMenu>
+ </SidebarGroup>
+ </motion.div>
+ )}
+ </AnimatePresence>
+ );
+};
diff --git a/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/ProjectNavLink.tsx b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/ProjectNavLink.tsx
new file mode 100644
index 0000000000..7f3546ddb3
--- /dev/null
+++ b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/ProjectNavLink.tsx
@@ -0,0 +1,92 @@
+import { Link, useLocation } from "@tanstack/react-router";
+import { ChevronRight } from "lucide-react";
+import { twMerge } from "tailwind-merge";
+
+import { Badge, SidebarMenuButton, SidebarMenuItem } from "@app/components/v3";
+import { useOrganization, useProject } from "@app/context";
+
+import type { NavItem, Submenu } from "./types";
+import { PROJECT_TYPE_PATH } from "./types";
+
+// --- Project nav link (handles submenu chevron or normal link) ---
+
+export const ProjectNavLink = ({
+ item,
+ onSubmenuOpen
+}: {
+ item: NavItem;
+ onSubmenuOpen?: (submenu: Submenu) => void;
+}) => {
+ const { currentOrg } = useOrganization();
+ const { currentProject } = useProject();
+ const { pathname } = useLocation();
+
+ const typePath = PROJECT_TYPE_PATH[currentProject.type];
+ const basePath = `/organizations/${currentOrg.id}/projects/${typePath}/${currentProject.id}`;
+ const fullPath = `${basePath}/${item.pathSuffix}`;
+ const isActive = pathname.startsWith(fullPath) || Boolean(item.activeMatch?.test(pathname));
+
+ if (item.submenu && onSubmenuOpen) {
+ return (
+ <SidebarMenuItem>
+ <SidebarMenuButton
+ size="lg"
+ scope="project"
+ isActive={isActive}
+ tooltip={item.label}
+ onClick={() => onSubmenuOpen(item.submenu!)}
+ >
+ <item.icon className="size-4" />
+ <span>{item.label}</span>
+ {Boolean(item.badgeCount) && (
+ <Badge variant="warning" isSquare className="ml-auto">
+ {item.badgeCount}
+ </Badge>
+ )}
+ <ChevronRight className={twMerge("size-4 opacity-50", !item.badgeCount && "ml-auto")} />
+ </SidebarMenuButton>
+ </SidebarMenuItem>
+ );
+ }
+
+ return (
+ <SidebarMenuItem>
+ <SidebarMenuButton size="lg" scope="project" asChild isActive={isActive} tooltip={item.label}>
+ <Link
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ to={`/organizations/$orgId/projects/${typePath}/$projectId/${item.pathSuffix}` as any}
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ params={{ orgId: currentOrg.id, projectId: currentProject.id } as any}
+ >
+ <item.icon className="size-4" />
+ <span>{item.label}</span>
+ </Link>
+ </SidebarMenuButton>
+ {Boolean(item.badgeCount) && (
+ <Badge variant="warning" className="absolute top-[10.5px] right-4">
+ {item.badgeCount}
+ </Badge>
+ )}
+ </SidebarMenuItem>
+ );
+};
+
+export const ProjectNavList = ({
+ items,
+ onSubmenuOpen
+}: {
+ items: NavItem[];
+ onSubmenuOpen: (submenu: Submenu) => void;
+}) => (
+ <>
+ {items
+ .filter((i) => !i.hidden)
+ .map((item) => (
+ <ProjectNavLink
+ key={item.label}
+ item={item}
+ onSubmenuOpen={item.submenu ? onSubmenuOpen : undefined}
+ />
+ ))}
+ </>
+);
diff --git a/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/SecretManagerNav.tsx b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/SecretManagerNav.tsx
new file mode 100644
index 0000000000..c8b4bde57b
--- /dev/null
+++ b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/SecretManagerNav.tsx
@@ -0,0 +1,106 @@
+import {
+ BookCheck,
+ DoorOpen,
+ FileKey,
+ FileText,
+ Plug,
+ RefreshCw,
+ Settings,
+ Shield
+} from "lucide-react";
+
+import { ProjectIcon } from "@app/components/v3";
+import { useProject } from "@app/context";
+import {
+ useGetAccessRequestsCount,
+ useGetSecretApprovalRequestCount,
+ useGetSecretRotations
+} from "@app/hooks/api";
+
+import { ProjectNavList } from "./ProjectNavLink";
+import {
+ INTEGRATIONS_SUBMENU,
+ SECRET_MANAGER_ACCESS_CONTROL_SUBMENU,
+ SM_SETTINGS_SUBMENU
+} from "./submenus";
+import type { NavItem, Submenu } from "./types";
+
+export const SecretManagerNav = ({
+ onSubmenuOpen
+}: {
+ onSubmenuOpen: (submenu: Submenu) => void;
+}) => {
+ const { currentProject, projectId } = useProject();
+
+ const { data: secretApprovalReqCount } = useGetSecretApprovalRequestCount({ projectId });
+ const { data: accessApprovalRequestCount } = useGetAccessRequestsCount({
+ projectSlug: currentProject?.slug || ""
+ });
+ const { data: secretRotations } = useGetSecretRotations({
+ workspaceId: projectId,
+ options: { refetchOnMount: false }
+ });
+
+ const pendingRequestsCount =
+ (secretApprovalReqCount?.open || 0) + (accessApprovalRequestCount?.pendingCount || 0);
+
+ const approvalsSubmenu: Submenu = {
+ title: "Approvals",
+ pathSuffix: "approval",
+ defaultTab: "approval-requests",
+ items: [
+ {
+ label: "Change Requests",
+ icon: FileKey,
+ tab: "approval-requests",
+ badgeCount: secretApprovalReqCount?.open || undefined
+ },
+ {
+ label: "Access Requests",
+ icon: DoorOpen,
+ tab: "resource-requests",
+ badgeCount: accessApprovalRequestCount?.pendingCount || undefined
+ },
+ { label: "Policies", icon: Shield, tab: "policies" }
+ ]
+ };
+
+ const items: NavItem[] = [
+ {
+ label: "Overview",
+ icon: ProjectIcon,
+ pathSuffix: "overview",
+ activeMatch: /\/secrets\/|\/commits\//
+ },
+ {
+ label: "Approvals",
+ icon: BookCheck,
+ pathSuffix: "approval",
+ badgeCount: pendingRequestsCount || undefined,
+ submenu: approvalsSubmenu
+ },
+ {
+ label: "Integrations",
+ icon: Plug,
+ pathSuffix: "integrations",
+ submenu: INTEGRATIONS_SUBMENU
+ },
+ {
+ label: "Secret Rotations",
+ icon: RefreshCw,
+ pathSuffix: "secret-rotation",
+ hidden: !secretRotations?.length
+ },
+ {
+ label: "Access Control",
+ icon: Shield,
+ pathSuffix: "access-management",
+ activeMatch: /\/groups\/|\/identities\/|\/members\/|\/roles\//,
+ submenu: SECRET_MANAGER_ACCESS_CONTROL_SUBMENU
+ },
+ { label: "Audit Logs", icon: FileText, pathSuffix: "audit-logs" },
+ { label: "Settings", icon: Settings, pathSuffix: "settings", submenu: SM_SETTINGS_SUBMENU }
+ ];
+
+ return <ProjectNavList items={items} onSubmenuOpen={onSubmenuOpen} />;
+};
diff --git a/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/SecretScanningNav.tsx b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/SecretScanningNav.tsx
new file mode 100644
index 0000000000..e8e22e2424
--- /dev/null
+++ b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/SecretScanningNav.tsx
@@ -0,0 +1,63 @@
+import { Cable, Database, FileText, Search, Settings, Shield } from "lucide-react";
+
+import {
+ ProjectPermissionSub,
+ useProject,
+ useProjectPermission,
+ useSubscription
+} from "@app/context";
+import { ProjectPermissionSecretScanningFindingActions } from "@app/context/ProjectPermissionContext/types";
+import { useGetSecretScanningUnresolvedFindingCount } from "@app/hooks/api/secretScanningV2";
+
+import { ProjectNavList } from "./ProjectNavLink";
+import { PROJECT_ACCESS_CONTROL_SUBMENU, SECRET_SCANNING_SETTINGS_SUBMENU } from "./submenus";
+import type { NavItem, Submenu } from "./types";
+
+export const SecretScanningNav = ({
+ onSubmenuOpen
+}: {
+ onSubmenuOpen: (submenu: Submenu) => void;
+}) => {
+ const { currentProject } = useProject();
+ const { permission } = useProjectPermission();
+ const { subscription } = useSubscription();
+
+ const { data: unresolvedFindings } = useGetSecretScanningUnresolvedFindingCount(
+ currentProject.id,
+ {
+ enabled:
+ subscription.secretScanning &&
+ permission.can(
+ ProjectPermissionSecretScanningFindingActions.Read,
+ ProjectPermissionSub.SecretScanningFindings
+ ),
+ refetchInterval: 30000
+ }
+ );
+
+ const items: NavItem[] = [
+ { label: "Data Sources", icon: Database, pathSuffix: "data-sources" },
+ {
+ label: "Findings",
+ icon: Search,
+ pathSuffix: "findings",
+ badgeCount: unresolvedFindings || undefined
+ },
+ { label: "App Connections", icon: Cable, pathSuffix: "app-connections" },
+ {
+ label: "Access Control",
+ icon: Shield,
+ pathSuffix: "access-management",
+ activeMatch: /\/groups\/|\/identities\/|\/members\/|\/roles\//,
+ submenu: PROJECT_ACCESS_CONTROL_SUBMENU
+ },
+ { label: "Audit Logs", icon: FileText, pathSuffix: "audit-logs" },
+ {
+ label: "Settings",
+ icon: Settings,
+ pathSuffix: "settings",
+ submenu: SECRET_SCANNING_SETTINGS_SUBMENU
+ }
+ ];
+ return <ProjectNavList items={items} onSubmenuOpen={onSubmenuOpen} />;
+};
diff --git a/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/SshNav.tsx b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/SshNav.tsx
new file mode 100644
index 0000000000..c601d4a804
--- /dev/null
+++ b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/SshNav.tsx
@@ -0,0 +1,57 @@
+import { FileText, Server, Settings, Shield, ShieldCheck } from "lucide-react";
+
+import { ProjectPermissionCan } from "@app/components/permissions";
+import { ProjectPermissionActions, ProjectPermissionSub } from "@app/context";
+
+import { ProjectNavLink } from "./ProjectNavLink";
+import { PROJECT_ACCESS_CONTROL_SUBMENU } from "./submenus";
+import type { NavItem, Submenu } from "./types";
+
+export const SshNav = ({ onSubmenuOpen }: { onSubmenuOpen: (submenu: Submenu) => void }) => {
+ const items: NavItem[] = [
+ { label: "Hosts", icon: Server, pathSuffix: "overview", activeMatch: /\/ssh-host-groups\// },
+ {
+ label: "Certificate Authorities",
+ icon: ShieldCheck,
+ pathSuffix: "cas",
+ activeMatch: /\/ca\//,
+ permissionCheck: true
+ },
+ {
+ label: "Access Control",
+ icon: Shield,
+ pathSuffix: "access-management",
+ activeMatch: /\/groups\/|\/identities\/|\/members\/|\/roles\//,
+ submenu: PROJECT_ACCESS_CONTROL_SUBMENU
+ },
+ { label: "Audit Logs", icon: FileText, pathSuffix: "audit-logs" },
+ { label: "Settings", icon: Settings, pathSuffix: "settings" }
+ ];
+
+ return (
+ <>
+ {items
+ .filter((i) => !i.hidden)
+ .map((item) => {
+ if (item.permissionCheck) {
+ return (
+ <ProjectPermissionCan
+ key={item.label}
+ I={ProjectPermissionActions.Read}
+ a={ProjectPermissionSub.SshCertificateAuthorities}
+ >
+ {(isAllowed) => (isAllowed ? <ProjectNavLink item={item} /> : null)}
+ </ProjectPermissionCan>
+ );
+ }
+ return (
+ <ProjectNavLink
+ key={item.label}
+ item={item}
+ onSubmenuOpen={item.submenu ? onSubmenuOpen : undefined}
+ />
+ );
+ })}
+ </>
+ );
+};
diff --git a/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/SubmenuViews.tsx b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/SubmenuViews.tsx
new file mode 100644
index 0000000000..04951fea99
--- /dev/null
+++ b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/SubmenuViews.tsx
@@ -0,0 +1,149 @@
+import { Link, useLocation, useSearch } from "@tanstack/react-router";
+import { ChevronLeft } from "lucide-react";
+
+import {
+ Badge,
+ SidebarGroup,
+ SidebarGroupLabel,
+ SidebarMenu,
+ SidebarMenuButton,
+ SidebarMenuItem
+} from "@app/components/v3";
+import { useOrganization, useProject } from "@app/context";
+
+import type { Submenu } from "./types";
+import { PROJECT_TYPE_PATH } from "./types";
+
+// --- Generic submenu view for projects ---
+
+export const ProjectSubmenuView = ({
+ submenu,
+ onBack
+}: {
+ submenu: Submenu;
+ onBack: () => void;
+}) => {
+ const { currentOrg } = useOrganization();
+ const { currentProject } = useProject();
+ const { pathname } = useLocation();
+ const searchParams = useSearch({ strict: false }) as Record<string, string>;
+
+ const typePath = PROJECT_TYPE_PATH[currentProject.type];
+ const basePath = `/organizations/${currentOrg.id}/projects/${typePath}/${currentProject.id}`;
+ const isOnExactPage = pathname.startsWith(`${basePath}/${submenu.pathSuffix}`);
+ const currentTab = searchParams?.selectedTab;
+
+ return (
+ <SidebarGroup>
+ <SidebarGroupLabel asChild>
+ <button
+ className="cursor-pointer hover:bg-foreground/[0.025]"
+ type="button"
+ onClick={onBack}
+ >
+ <ChevronLeft />
+ <span>{submenu.title}</span>
+ </button>
+ </SidebarGroupLabel>
+ <SidebarMenu>
+ {submenu.items.map((sub) => {
+ const matchesDetail = Boolean(sub.activeMatch?.test(pathname));
+ const isActive =
+ matchesDetail ||
+ (isOnExactPage &&
+ (currentTab === sub.tab || (!currentTab && sub.tab === submenu.defaultTab)));
+
+ return (
+ <SidebarMenuItem key={sub.label}>
+ <SidebarMenuButton
+ size="lg"
+ scope="project"
+ asChild
+ isActive={isActive}
+ tooltip={sub.label}
+ >
+ <Link
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ to={
+ `/organizations/$orgId/projects/${typePath}/$projectId/${submenu.pathSuffix}` as any
+ }
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ params={{ orgId: currentOrg.id, projectId: currentProject.id } as any}
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ search={{ selectedTab: sub.tab } as any}
+ >
+ <sub.icon className="size-4" />
+ <span>{sub.label}</span>
+ </Link>
+ </SidebarMenuButton>
+ {Boolean(sub.badgeCount) && (
+ <Badge variant="warning" className="absolute top-[10.5px] right-4">
+ {sub.badgeCount}
+ </Badge>
+ )}
+ </SidebarMenuItem>
+ );
+ })}
+ </SidebarMenu>
+ </SidebarGroup>
+ );
+};
+
+// --- Generic submenu view for org ---
+
+export const OrgSubmenuView = ({ submenu, onBack }: { submenu: Submenu; onBack: () => void }) => {
+ const { currentOrg } = useOrganization();
+ const { pathname } = useLocation();
+ const searchParams = useSearch({ strict: false }) as Record<string, string>;
+ const orgId = currentOrg.id;
+
+ const isOnExactPage = pathname.startsWith(`/organizations/${orgId}/${submenu.pathSuffix}`);
+ const currentTab = searchParams?.selectedTab;
+
+ return (
+ <SidebarGroup>
+ <SidebarGroupLabel asChild>
+ <button
+ className="cursor-pointer hover:bg-foreground/[0.025]"
+ type="button"
+ onClick={onBack}
+ >
+ <ChevronLeft />
+ <span>{submenu.title}</span>
+ </button>
+ </SidebarGroupLabel>
+ <SidebarMenu>
+ {submenu.items.map((sub) => {
+ const matchesDetail = Boolean(sub.activeMatch?.test(pathname));
+ const isActive =
+ matchesDetail ||
+ (isOnExactPage &&
+ (currentTab === sub.tab || (!currentTab && sub.tab === submenu.defaultTab)));
+
+ return (
+ <SidebarMenuItem key={sub.label}>
+ <SidebarMenuButton size="lg" asChild isActive={isActive} tooltip={sub.label}>
+ <Link
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ to={`/organizations/$orgId/${submenu.pathSuffix}` as any}
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ params={{ orgId } as any}
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ search={{ selectedTab: sub.tab } as any}
+ >
+ <sub.icon className="size-4" />
+ <span>{sub.label}</span>
+ </Link>
+ </SidebarMenuButton>
+ {Boolean(sub.badgeCount) && (
+ <Badge variant="warning" className="absolute top-[10.5px] right-4">
+ {sub.badgeCount}
+ </Badge>
+ )}
+ </SidebarMenuItem>
+ );
+ })}
+ </SidebarMenu>
+ </SidebarGroup>
+ );
+};
diff --git a/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/index.tsx b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/index.tsx
new file mode 100644
index 0000000000..315d7ffab7
--- /dev/null
+++ b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/index.tsx
@@ -0,0 +1 @@
+export { OrgSidebar } from "./OrgSidebar";
diff --git a/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/submenus.ts b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/submenus.ts
new file mode 100644
index 0000000000..017e8008b0
--- /dev/null
+++ b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/submenus.ts
@@ -0,0 +1,261 @@
+import {
+ ArrowDownToLine,
+ ArrowLeftRight,
+ ArrowUpFromLine,
+ Blocks,
+ Cable,
+ ClipboardList,
+ Cog,
+ Container,
+ Database,
+ DoorOpen,
+ FileCheck,
+ FileKey,
+ FileText,
+ FolderCog,
+ HardDrive,
+ IdCardLanyard,
+ Key,
+ Lock,
+ MapPin,
+ PenTool,
+ Plug,
+ Route,
+ ScanSearch,
+ Search,
+ Server,
+ Settings,
+ Shield,
+ ShieldCheck,
+ ShieldUser,
+ Trash2,
+ User,
+ Users
+} from "lucide-react";
+
+import { SubOrgIcon } from "@app/components/v3";
+
+import type { Submenu } from "./types";
+
+// --- Shared submenu definitions ---
+
+export const ORG_ACCESS_CONTROL_SUBMENU: Submenu = {
+ title: "Access Control",
+ pathSuffix: "access-management",
+ defaultTab: "members",
+ activeMatch: /\/members\/|\/groups\/|\/identities\/|\/roles\//,
+ items: [
+ { label: "Members", icon: User, tab: "members", activeMatch: /\/members\// },
+ { label: "Groups", icon: Users, tab: "groups", activeMatch: /\/groups\// },
+ {
+ label: "Machine Identities",
+ icon: HardDrive,
+ tab: "identities",
+ activeMatch: /\/identities\//
+ },
+ { label: "Roles", icon: IdCardLanyard, tab: "roles", activeMatch: /\/roles\// }
+ ]
+};
+
+export const PROJECT_ACCESS_CONTROL_SUBMENU: Submenu = {
+ title: "Access Control",
+ pathSuffix: "access-management",
+ defaultTab: "members",
+ activeMatch: /\/members\/|\/groups\/|\/identities\/|\/roles\//,
+ items: [
+ { label: "Users", icon: User, tab: "members", activeMatch: /\/members\// },
+ { label: "Groups", icon: Users, tab: "groups", activeMatch: /\/groups\// },
+ {
+ label: "Machine Identities",
+ icon: HardDrive,
+ tab: "identities",
+ activeMatch: /\/identities\//
+ },
+ { label: "Roles", icon: IdCardLanyard, tab: "roles", activeMatch: /\/roles\// }
+ ]
+};
+
+export const SECRET_MANAGER_ACCESS_CONTROL_SUBMENU: Submenu = {
+ ...PROJECT_ACCESS_CONTROL_SUBMENU,
+ items: [
+ ...PROJECT_ACCESS_CONTROL_SUBMENU.items,
+ { label: "Service Tokens", icon: Key, tab: "service-tokens" }
+ ]
+};
+
+export const SM_SETTINGS_SUBMENU: Submenu = {
+ title: "Settings",
+ pathSuffix: "settings",
+ defaultTab: "tab-project-general",
+ items: [
+ { label: "General", icon: Cog, tab: "tab-project-general" },
+ { label: "Secrets Management", icon: FileKey, tab: "tab-secret-general" },
+ { label: "Secret Validation Rules", icon: ShieldCheck, tab: "tab-secret-validation-rules" },
+ { label: "Encryption", icon: Lock, tab: "tab-project-encryption" },
+ { label: "Workflow Integrations", icon: Plug, tab: "tab-workflow-integrations" },
+ { label: "Webhooks", icon: Cable, tab: "tab-project-webhooks" }
+ ]
+};
+
+export const INTEGRATIONS_SUBMENU: Submenu = {
+ title: "Integrations",
+ pathSuffix: "integrations",
+ defaultTab: "app-connections",
+ items: [
+ { label: "App Connections", icon: Cable, tab: "app-connections" },
+ { label: "Secret Syncs", icon: ArrowLeftRight, tab: "secret-syncs" },
+ { label: "Framework Integrations", icon: Blocks, tab: "framework-integrations" },
+ { label: "Infrastructure Integrations", icon: Container, tab: "infrastructure-integrations" },
+ { label: "Native Integrations", icon: Plug, tab: "native-integrations" }
+ ]
+};
+
+export const getOrgSettingsSubmenu = ({
+ isSubOrganization,
+ hasSubOrganization
+}: {
+ isSubOrganization: boolean;
+ hasSubOrganization: boolean;
+}): Submenu => ({
+ title: "Settings",
+ pathSuffix: "settings",
+ defaultTab: "tab-org-general",
+ items: [
+ { label: "General", icon: Cog, tab: "tab-org-general" },
+ ...(!isSubOrganization
+ ? [
+ { label: "SSO", icon: ShieldUser, tab: "sso-settings" },
+ { label: "Provisioning", icon: Route, tab: "provisioning-settings" },
+ { label: "Security", icon: ShieldCheck, tab: "tab-org-security" }
+ ]
+ : []),
+ { label: "Encryption", icon: Lock, tab: "tab-org-encryption" },
+ { label: "Workflow Integrations", icon: Plug, tab: "workflow-integrations" },
+ { label: "Audit Log Streams", icon: FileText, tab: "tag-audit-log-streams" },
+ { label: "External Migrations", icon: Database, tab: "tab-external-migrations" },
+ { label: "Project Templates", icon: FolderCog, tab: "project-templates" },
+ { label: "Product Enforcements", icon: ClipboardList, tab: "product-enforcements" },
+ ...(!isSubOrganization && hasSubOrganization
+ ? [{ label: "Sub Organizations", icon: SubOrgIcon, tab: "tab-sub-organizations" }]
+ : [])
+ ]
+});
+
+export const getSecretSharingSubmenu = ({
+ isSubOrganization
+}: {
+ isSubOrganization: boolean;
+}): Submenu => ({
+ title: "Secret Sharing",
+ pathSuffix: "secret-sharing",
+ defaultTab: "share-secret",
+ items: [
+ { label: "Share Secrets", icon: ArrowUpFromLine, tab: "share-secret" },
+ { label: "Request Secrets", icon: ArrowDownToLine, tab: "request-secret" },
+ ...(!isSubOrganization ? [{ label: "Settings", icon: Settings, tab: "settings" }] : [])
+ ]
+});
+
+export const NETWORKING_SUBMENU: Submenu = {
+ title: "Networking",
+ pathSuffix: "networking",
+ defaultTab: "gateways",
+ items: [
+ { label: "Gateways", icon: DoorOpen, tab: "gateways" },
+ { label: "Relays", icon: Route, tab: "relays" }
+ ]
+};
+
+// --- Cert manager submenus ---
+
+export const CERT_CERTIFICATES_SUBMENU: Submenu = {
+ title: "Certificates",
+ pathSuffix: "policies",
+ defaultTab: "certificates",
+ items: [
+ { label: "Certificates", icon: FileKey, tab: "certificates" },
+ { label: "Certificate Requests", icon: FileCheck, tab: "certificate-requests" },
+ { label: "Certificate Profiles", icon: ClipboardList, tab: "profiles" },
+ { label: "Certificate Policies", icon: Shield, tab: "policies" }
+ ]
+};
+
+export const CERT_DISCOVERY_SUBMENU: Submenu = {
+ title: "Discovery",
+ pathSuffix: "discovery",
+ defaultTab: "jobs",
+ items: [
+ { label: "Jobs", icon: Search, tab: "jobs" },
+ { label: "Installations", icon: MapPin, tab: "installations" }
+ ]
+};
+
+export const CERT_CODE_SIGNING_SUBMENU: Submenu = {
+ title: "Code Signing",
+ pathSuffix: "code-signing",
+ defaultTab: "signers",
+ items: [
+ { label: "Signers", icon: PenTool, tab: "signers" },
+ { label: "Signing Requests", icon: FileCheck, tab: "signing-requests" },
+ { label: "Signing Policies", icon: Shield, tab: "signing-policies" },
+ { label: "Grants", icon: Key, tab: "grants" }
+ ]
+};
+
+export const CERT_APPROVALS_SUBMENU: Submenu = {
+ title: "Approvals",
+ pathSuffix: "approvals",
+ defaultTab: "requests",
+ items: [
+ { label: "Requests", icon: FileCheck, tab: "requests" },
+ { label: "Policies", icon: Shield, tab: "policies" }
+ ]
+};
+
+export const CERT_SETTINGS_SUBMENU: Submenu = {
+ title: "Settings",
+ pathSuffix: "settings",
+ defaultTab: "general",
+ items: [
+ { label: "General", icon: Cog, tab: "general" },
+ { label: "Certificate Cleanup", icon: Trash2, tab: "certificate-cleanup" }
+ ]
+};
+
+// --- Secret scanning submenus ---
+
+export const SECRET_SCANNING_SETTINGS_SUBMENU: Submenu = {
+ title: "Settings",
+ pathSuffix: "settings",
+ defaultTab: "general",
+ items: [
+ { label: "General", icon: Cog, tab: "general" },
+ { label: "Scanning Settings", icon: ScanSearch, tab: "scanning-settings" }
+ ]
+};
+
+// --- PAM submenus ---
+
+export const PAM_APPROVALS_SUBMENU: Submenu = {
+ title: "Approvals",
+ pathSuffix: "approvals",
+ defaultTab: "requests",
+ items: [
+ { label: "Requests", icon: FileCheck, tab: "requests" },
+ { label: "Policies", icon: Shield, tab: "policies" },
+ { label: "Grants", icon: Key, tab: "grants" }
+ ]
+};
+
+// --- AI submenus ---
+
+export const MCP_SUBMENU: Submenu = {
+ title: "MCP",
+ pathSuffix: "overview",
+ defaultTab: "mcp-endpoints",
+ items: [
+ { label: "MCP Endpoints", icon: Server, tab: "mcp-endpoints" },
+ { label: "MCP Servers", icon: HardDrive, tab: "mcp-servers" },
+ { label: "Activity Logs", icon: FileText, tab: "activity-logs" }
+ ]
+};
diff --git a/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/types.ts b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/types.ts
new file mode 100644
index 0000000000..cdb218a7a0
--- /dev/null
+++ b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/types.ts
@@ -0,0 +1,49 @@
+import { ProjectType } from "@app/hooks/api/projects/types";
+
+export const PROJECT_TYPE_PATH: Record<ProjectType, string> = {
+ [ProjectType.SecretManager]: "secret-management",
+ [ProjectType.CertificateManager]: "cert-manager",
+ [ProjectType.SSH]: "ssh",
+ [ProjectType.KMS]: "kms",
+ [ProjectType.PAM]: "pam",
+ [ProjectType.SecretScanning]: "secret-scanning",
+ [ProjectType.AI]: "ai"
+};
+
+export type SubmenuItem = {
+ label: string;
+ icon: React.ComponentType<{ className?: string }>;
+ tab: string;
+ badgeCount?: number;
+ /** Extra regex to match detail pages (e.g. /members/$id) */
+ activeMatch?: RegExp;
+};
+
+export type Submenu = {
+ title: string;
+ items: SubmenuItem[];
+ pathSuffix: string;
+ defaultTab: string;
+ /** Extra regex to consider the submenu's page as active (for detail pages) */
+ activeMatch?: RegExp;
+};
+
+export type NavItem = {
+ label: string;
+ icon: React.ComponentType<{ className?: string }>;
+ pathSuffix: string;
+ activeMatch?: RegExp;
+ badgeCount?: number;
+ hidden?: boolean;
+ submenu?: Submenu;
+ /** For SSH CA permission gating */
+ permissionCheck?: boolean;
+};
+
+export type OrgNavItem = {
+ label: string;
+ icon: React.ComponentType<{ className?: string }>;
+ to: string;
+ isActive: boolean;
+ submenu?: Submenu;
+};
diff --git a/frontend/src/layouts/PamLayout/PamLayout.tsx b/frontend/src/layouts/PamLayout/PamLayout.tsx
index 7a62752fe5..c589911a32 100644
--- a/frontend/src/layouts/PamLayout/PamLayout.tsx
+++ b/frontend/src/layouts/PamLayout/PamLayout.tsx
@@ -1,126 +1,14 @@
-import { Link, Outlet, useLocation } from "@tanstack/react-router";
-import { motion } from "framer-motion";
+import { Outlet } from "@tanstack/react-router";
-import { Tab, TabList, Tabs } from "@app/components/v2";
-import { useOrganization, useProject, useProjectPermission } from "@app/context";
+import { useProjectPermission } from "@app/context";
import { AssumePrivilegeModeBanner } from "../ProjectLayout/components/AssumePrivilegeModeBanner";
export const PamLayout = () => {
- const { currentProject } = useProject();
- const { currentOrg } = useOrganization();
const { assumedPrivilegeDetails } = useProjectPermission();
- const location = useLocation();
return (
- <div className="dark flex h-full w-full flex-col overflow-x-hidden bg-mineshaft-900">
- <div className="border-y border-t-project/10 border-b-project/5 bg-gradient-to-b from-project/[0.075] to-project/[0.025] px-4 pt-0.5">
- <motion.div
- key="menu-project-items"
- initial={{ x: -150 }}
- animate={{ x: 0 }}
- exit={{ x: -150 }}
- transition={{ duration: 0.2 }}
- className="px-4"
- >
- <nav className="w-full">
- <Tabs value="selected">
- <TabList className="border-b-0">
- <Link
- to="/organizations/$orgId/projects/pam/$projectId/resources"
- params={{
- orgId: currentOrg.id,
- projectId: currentProject.id
- }}
- >
- {({ isActive }) => <Tab value={isActive ? "selected" : ""}>Resources</Tab>}
- </Link>
- <Link
- to="/organizations/$orgId/projects/pam/$projectId/sessions"
- params={{
- orgId: currentOrg.id,
- projectId: currentProject.id
- }}
- >
- {({ isActive }) => <Tab value={isActive ? "selected" : ""}>Sessions</Tab>}
- </Link>
- <Link
- to="/organizations/$orgId/projects/pam/$projectId/discovery"
- params={{
- orgId: currentOrg.id,
- projectId: currentProject.id
- }}
- >
- {({ isActive }) => (
- <Tab
- value={
- isActive || location.pathname.includes("/discovery/") ? "selected" : ""
- }
- >
- Discovery
- </Tab>
- )}
- </Link>
- <Link
- to="/organizations/$orgId/projects/pam/$projectId/approvals"
- params={{
- orgId: currentOrg.id,
- projectId: currentProject.id
- }}
- >
- {({ isActive }) => (
- <Tab
- value={
- isActive || location.pathname.match(/\/approvals\/|\/i/) ? "selected" : ""
- }
- >
- Approvals
- </Tab>
- )}
- </Link>
- <Link
- to="/organizations/$orgId/projects/pam/$projectId/access-management"
- params={{
- orgId: currentOrg.id,
- projectId: currentProject.id
- }}
- >
- {({ isActive }) => (
- <Tab
- value={
- isActive ||
- location.pathname.match(/\/groups\/|\/identities\/|\/members\/|\/roles\//)
- ? "selected"
- : ""
- }
- >
- Access Control
- </Tab>
- )}
- </Link>
- <Link
- to="/organizations/$orgId/projects/pam/$projectId/audit-logs"
- params={{
- orgId: currentOrg.id,
- projectId: currentProject.id
- }}
- >
- {({ isActive }) => <Tab value={isActive ? "selected" : ""}>Audit Logs</Tab>}
- </Link>
- <Link
- to="/organizations/$orgId/projects/pam/$projectId/settings"
- params={{
- orgId: currentOrg.id,
- projectId: currentProject.id
- }}
- >
- {({ isActive }) => <Tab value={isActive ? "selected" : ""}>Settings</Tab>}
- </Link>
- </TabList>
- </Tabs>
- </nav>
- </motion.div>
- </div>
+ <div className="flex h-full w-full flex-col overflow-x-hidden">
{assumedPrivilegeDetails && <AssumePrivilegeModeBanner />}
<div className="flex-1 overflow-x-hidden overflow-y-auto bg-bunker-800 px-12 pt-10 pb-4">
<Outlet />
diff --git a/frontend/src/layouts/PkiManagerLayout/PkiManagerLayout.tsx b/frontend/src/layouts/PkiManagerLayout/PkiManagerLayout.tsx
index 134a513f1e..50a89587f4 100644
--- a/frontend/src/layouts/PkiManagerLayout/PkiManagerLayout.tsx
+++ b/frontend/src/layouts/PkiManagerLayout/PkiManagerLayout.tsx
@@ -1,212 +1,14 @@
-import { Link, Outlet, useLocation } from "@tanstack/react-router";
-import { motion } from "framer-motion";
+import { Outlet } from "@tanstack/react-router";
-import { Tab, TabList, Tabs } from "@app/components/v2";
-import { useOrganization, useProject, useProjectPermission, useSubscription } from "@app/context";
-import {
- useListWorkspaceCertificateTemplates,
- useListWorkspacePkiSubscribers
-} from "@app/hooks/api";
+import { useProjectPermission } from "@app/context";
import { AssumePrivilegeModeBanner } from "../ProjectLayout/components/AssumePrivilegeModeBanner";
export const PkiManagerLayout = () => {
- const { currentOrg } = useOrganization();
- const { currentProject } = useProject();
const { assumedPrivilegeDetails } = useProjectPermission();
- const { subscription } = useSubscription();
- const { data: subscribers = [] } = useListWorkspacePkiSubscribers(currentProject?.id || "");
- const { data: templatesData } = useListWorkspaceCertificateTemplates({
- projectId: currentProject?.id || ""
- });
- const templates = templatesData?.certificateTemplates || [];
-
- const hasExistingSubscribers = subscribers.length > 0;
- const hasExistingTemplates = templates.length > 0;
- const showLegacySection =
- subscription.pkiLegacyTemplates || hasExistingSubscribers || hasExistingTemplates;
-
- const location = useLocation();
return (
- <div className="dark flex h-full w-full flex-col overflow-x-hidden bg-mineshaft-900">
- <div className="border-y border-t-project/10 border-b-project/5 bg-gradient-to-b from-project/[0.075] to-project/[0.025] px-4 pt-0.5">
- <motion.div
- key="menu-project-items"
- initial={{ x: -150 }}
- animate={{ x: 0 }}
- exit={{ x: -150 }}
- transition={{ duration: 0.2 }}
- className="px-4"
- >
- <nav className="w-full">
- <Tabs value="selected">
- <TabList className="border-b-0">
- <Link
- to="/organizations/$orgId/projects/cert-manager/$projectId/policies"
- params={{
- orgId: currentOrg.id,
- projectId: currentProject.id
- }}
- >
- {({ isActive }) => <Tab value={isActive ? "selected" : ""}>Certificates</Tab>}
- </Link>
- <Link
- to="/organizations/$orgId/projects/cert-manager/$projectId/discovery"
- params={{
- orgId: currentOrg.id,
- projectId: currentProject.id
- }}
- >
- {({ isActive }) => (
- <Tab
- value={isActive || location.pathname.match(/\/discovery/) ? "selected" : ""}
- >
- Discovery
- </Tab>
- )}
- </Link>
- <Link
- to="/organizations/$orgId/projects/cert-manager/$projectId/certificate-authorities"
- params={{
- orgId: currentOrg.id,
- projectId: currentProject.id
- }}
- >
- {({ isActive }) => (
- <Tab value={isActive || location.pathname.match(/\/ca\//) ? "selected" : ""}>
- Certificate Authorities
- </Tab>
- )}
- </Link>
- <Link
- to="/organizations/$orgId/projects/cert-manager/$projectId/code-signing"
- params={{
- orgId: currentOrg.id,
- projectId: currentProject.id
- }}
- >
- {({ isActive }) => (
- <Tab
- value={
- isActive || location.pathname.match(/\/code-signing/) ? "selected" : ""
- }
- >
- Code Signing
- </Tab>
- )}
- </Link>
- <Link
- to="/organizations/$orgId/projects/cert-manager/$projectId/alerting"
- params={{
- orgId: currentOrg.id,
- projectId: currentProject.id
- }}
- >
- {({ isActive }) => <Tab value={isActive ? "selected" : ""}>Alerting</Tab>}
- </Link>
- <Link
- to="/organizations/$orgId/projects/cert-manager/$projectId/approvals"
- params={{
- orgId: currentOrg.id,
- projectId: currentProject.id
- }}
- >
- {({ isActive }) => <Tab value={isActive ? "selected" : ""}>Approvals</Tab>}
- </Link>
- <Link
- to="/organizations/$orgId/projects/cert-manager/$projectId/integrations"
- params={{
- orgId: currentOrg.id,
- projectId: currentProject.id
- }}
- >
- {({ isActive }) => <Tab value={isActive ? "selected" : ""}>Integrations</Tab>}
- </Link>
- <Link
- to="/organizations/$orgId/projects/cert-manager/$projectId/app-connections"
- params={{
- orgId: currentOrg.id,
- projectId: currentProject.id
- }}
- >
- {({ isActive }) => <Tab value={isActive ? "selected" : ""}>App Connections</Tab>}
- </Link>
- {showLegacySection && (
- <>
- {(subscription.pkiLegacyTemplates || hasExistingSubscribers) && (
- <Link
- to="/organizations/$orgId/projects/cert-manager/$projectId/subscribers"
- params={{
- orgId: currentOrg.id,
- projectId: currentProject.id
- }}
- >
- {({ isActive }) => (
- <Tab value={isActive ? "selected" : ""}>Subscribers (Legacy)</Tab>
- )}
- </Link>
- )}
- {(subscription.pkiLegacyTemplates || hasExistingTemplates) && (
- <Link
- to="/organizations/$orgId/projects/cert-manager/$projectId/certificate-templates"
- params={{
- orgId: currentOrg.id,
- projectId: currentProject.id
- }}
- >
- {({ isActive }) => (
- <Tab value={isActive ? "selected" : ""}>
- Certificate Templates (Legacy)
- </Tab>
- )}
- </Link>
- )}
- </>
- )}
- <Link
- to="/organizations/$orgId/projects/cert-manager/$projectId/access-management"
- params={{
- orgId: currentOrg.id,
- projectId: currentProject.id
- }}
- >
- {({ isActive }) => (
- <Tab
- value={
- isActive ||
- location.pathname.match(/\/groups\/|\/identities\/|\/members\/|\/roles\//)
- ? "selected"
- : ""
- }
- >
- Access Control
- </Tab>
- )}
- </Link>
- <Link
- to="/organizations/$orgId/projects/cert-manager/$projectId/audit-logs"
- params={{
- orgId: currentOrg.id,
- projectId: currentProject.id
- }}
- >
- {({ isActive }) => <Tab value={isActive ? "selected" : ""}>Audit Logs</Tab>}
- </Link>
- <Link
- to="/organizations/$orgId/projects/cert-manager/$projectId/settings"
- params={{
- orgId: currentOrg.id,
- projectId: currentProject.id
- }}
- >
- {({ isActive }) => <Tab value={isActive ? "selected" : ""}>Settings</Tab>}
- </Link>
- </TabList>
- </Tabs>
- </nav>
- </motion.div>
- </div>
+ <div className="flex h-full w-full flex-col overflow-x-hidden">
{assumedPrivilegeDetails && <AssumePrivilegeModeBanner />}
<div className="flex-1 overflow-x-hidden overflow-y-auto bg-bunker-800 px-12 pt-10 pb-4">
<Outlet />
diff --git a/frontend/src/layouts/ProjectLayout/components/ProjectSelect/ProjectSelect.tsx b/frontend/src/layouts/ProjectLayout/components/ProjectSelect/ProjectSelect.tsx
index e006ce1dd2..0cc45b497f 100644
--- a/frontend/src/layouts/ProjectLayout/components/ProjectSelect/ProjectSelect.tsx
+++ b/frontend/src/layouts/ProjectLayout/components/ProjectSelect/ProjectSelect.tsx
@@ -1,28 +1,25 @@
import { useMemo, useState } from "react";
-import { faStar } from "@fortawesome/free-regular-svg-icons";
-import {
- faCaretDown,
- faCheck,
- faMagnifyingGlass,
- faPlus,
- faStar as faSolidStar
-} from "@fortawesome/free-solid-svg-icons";
-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { Link, linkOptions, useParams } from "@tanstack/react-router";
+import { Check, ChevronsUpDown, Plus, Star } from "lucide-react";
import { UpgradePlanModal } from "@app/components/license/UpgradePlanModal";
import { OrgPermissionCan } from "@app/components/permissions";
import { NewProjectModal } from "@app/components/projects";
import {
- DropdownMenu,
- DropdownMenuContent,
- DropdownMenuItem,
- DropdownMenuTrigger,
- IconButton,
- Input,
- Tooltip
-} from "@app/components/v2";
-import { Badge, ProjectIcon } from "@app/components/v3";
+ Badge,
+ Command,
+ CommandEmpty,
+ CommandGroup,
+ CommandInput,
+ CommandItem,
+ CommandList,
+ Popover,
+ PopoverAnchor,
+ PopoverContent,
+ PopoverTrigger,
+ ProjectIcon,
+ UnstableIconButton
+} from "@app/components/v3";
import {
OrgPermissionActions,
OrgPermissionSubjects,
@@ -33,7 +30,7 @@ import {
import { getProjectHomePage } from "@app/helpers/project";
import { usePopUp } from "@app/hooks";
import { useGetUserProjects } from "@app/hooks/api";
-import { Project, ProjectType } from "@app/hooks/api/projects/types";
+import { ProjectType } from "@app/hooks/api/projects/types";
import { useUpdateUserProjectFavorites } from "@app/hooks/api/users/mutation";
import { useGetUserProjectFavorites } from "@app/hooks/api/users/queries";
@@ -48,7 +45,7 @@ const PROJECT_TYPE_NAME: Record<ProjectType, string> = {
};
const ProjectSelectInner = () => {
- const [searchProject, setSearchProject] = useState("");
+ const [open, setOpen] = useState(false);
const { currentProject: currentWorkspace } = useProject();
const { currentOrg } = useOrganization();
const { data: projects = [] } = useGetUserProjects();
@@ -83,145 +80,141 @@ const ProjectSelectInner = () => {
const projectsSortedByFav = useMemo(() => {
const projectOptions = projects
- .map((w): Project & { isFavorite: boolean } => ({
+ .map((w) => ({
...w,
isFavorite: Boolean(projectFavorites?.includes(w.id))
}))
.sort((a, b) => Number(b.isFavorite) - Number(a.isFavorite));
return projectOptions;
- }, [projects, projectFavorites, currentWorkspace]);
+ }, [projects, projectFavorites]);
+
+ const handleSelectProject = (projectId: string) => {
+ const workspace = projects.find((p) => p.id === projectId);
+ if (!workspace || workspace.id === currentWorkspace.id) {
+ setOpen(false);
+ return;
+ }
+ const url = linkOptions({
+ to: getProjectHomePage(workspace.type, workspace.environments),
+ params: {
+ projectId: workspace.id,
+ orgId: workspace.orgId
+ }
+ });
+ const urlInstance = new URL(
+ `${window.location.origin}${url.to.replaceAll("$orgId", url.params.orgId).replaceAll("$projectId", url.params.projectId)}`
+ );
+ window.location.assign(urlInstance);
+ };
return (
- <div className="relative mr-2 flex min-w-16 items-center gap-1 self-end rounded-t-md border-x border-t border-project/10 bg-gradient-to-b from-project/10 to-project/[0.075] pt-1.5 pr-1 pb-2.5 pl-3">
- {/* scott: the below is used to hide the top border from the org nav bar */}
- <div className="absolute -bottom-px left-0 h-px w-full bg-mineshaft-900">
- <div className="h-full bg-project/[0.075]" />
- </div>
- <DropdownMenu modal={false}>
+ <div className="mr-2 flex min-w-16 items-center gap-1 pr-1 pl-1">
+ <Popover open={open} onOpenChange={setOpen}>
+ <PopoverAnchor className="absolute left-18" />
<Link
to={getProjectHomePage(currentWorkspace.type, currentWorkspace.environments)}
params={{
projectId: currentWorkspace.id,
orgId: currentWorkspace.orgId
}}
- className="group flex cursor-pointer items-center gap-x-2 overflow-hidden pt-0.5 text-sm text-white"
+ className="group flex cursor-pointer items-center gap-x-2 overflow-hidden text-sm text-white"
>
<ProjectIcon className="size-[14px] shrink-0 text-project" />
<span className="truncate">{currentWorkspace?.name}</span>
- <Badge variant="project" className="hidden lg:inline-flex">
+ <Badge variant="project" className="mb-hidden lg:inline-flex">
{currentWorkspace.type ? PROJECT_TYPE_NAME[currentWorkspace.type] : "Project"}
</Badge>
</Link>
- <DropdownMenuTrigger asChild>
- <div>
- <IconButton
- variant="plain"
- colorSchema="secondary"
- ariaLabel="switch-project"
- className="top-px px-2 py-1"
- >
- <FontAwesomeIcon icon={faCaretDown} className="text-xs text-bunker-300" />
- </IconButton>
- </div>
- </DropdownMenuTrigger>
- <DropdownMenuContent
- align="start"
- side="bottom"
- className="mt-6 cursor-default p-1 shadow-mineshaft-600 drop-shadow-md"
- style={{ minWidth: "220px" }}
- >
- <div className="px-2 py-1 text-xs text-mineshaft-400 capitalize">Projects</div>
- <div className="mb-1 border-b border-b-mineshaft-600 py-1 pb-1">
- <Input
- value={searchProject}
- onChange={(evt) => setSearchProject(evt.target.value || "")}
- leftIcon={<FontAwesomeIcon icon={faMagnifyingGlass} />}
- size="xs"
- variant="plain"
- placeholder="Search projects"
- />
- </div>
- <div className="max-h-80 thin-scrollbar overflow-auto">
- {projectsSortedByFav
- ?.filter((el) => el.name?.toLowerCase().includes(searchProject.toLowerCase()))
- ?.map((workspace) => {
- return (
- <DropdownMenuItem
+ <PopoverTrigger asChild>
+ <UnstableIconButton variant="ghost" size="xs" aria-label="switch-project">
+ <ChevronsUpDown />
+ </UnstableIconButton>
+ </PopoverTrigger>
+ <PopoverContent align="start" sideOffset={20} className="w-96 p-0">
+ <Command>
+ <CommandInput placeholder="Search projects..." />
+ <CommandList>
+ <CommandEmpty>No projects found.</CommandEmpty>
+ <CommandGroup heading="Projects">
+ {projectsSortedByFav.map((workspace) => (
+ <CommandItem
key={workspace.id}
- onClick={async () => {
- // todo(akhi): this is not using react query because react query in overview is throwing error when envs are not exact same count
- // to reproduce change this back to router.push and switch between two projects with different env count
- // look into this on dashboard revamp
- const url = linkOptions({
- to: getProjectHomePage(workspace.type, workspace.environments),
- params: {
- projectId: workspace.id,
- orgId: workspace.orgId
- }
- });
- const urlInstance = new URL(
- `${window.location.origin}${url.to.replaceAll("$orgId", url.params.orgId).replaceAll("$projectId", url.params.projectId)}`
- );
- window.location.assign(urlInstance);
- }}
- icon={
- currentWorkspace?.id === workspace.id && (
- <FontAwesomeIcon icon={faCheck} className="mr-3 text-primary" />
- )
- }
+ value={`${workspace.name} ${PROJECT_TYPE_NAME[workspace.type]}`}
+ onSelect={() => handleSelectProject(workspace.id)}
+ className="gap-2"
>
- <div className="flex items-center">
- <div className="flex flex-1 items-center justify-between overflow-hidden">
- <Tooltip side="right" className="break-words" content={workspace.name}>
- <div className="max-w-40 truncate overflow-hidden whitespace-nowrap">
- {workspace.name}
- </div>
- </Tooltip>
- </div>
- <div>
- <FontAwesomeIcon
- icon={workspace.isFavorite ? faSolidStar : faStar}
- className="text-sm text-yellow-600 hover:text-mineshaft-400"
- onClick={async (e) => {
- e.stopPropagation();
- await (
- workspace.isFavorite
- ? removeProjectFromFavorites
- : addProjectToFavorites
- )(workspace.id);
- }}
- />
- </div>
+ <Check
+ className={
+ currentWorkspace?.id === workspace.id ? "opacity-100" : "opacity-0"
+ }
+ />
+ <div className="flex min-w-0 flex-1 flex-col">
+ <span className="truncate text-sm">{workspace.name}</span>
+ <span className="text-[11px] text-muted">
+ {PROJECT_TYPE_NAME[workspace.type]}
+ </span>
</div>
- </DropdownMenuItem>
- );
- })}
- </div>
- <div className="mt-1 h-1 border-t border-mineshaft-600" />
- <OrgPermissionCan I={OrgPermissionActions.Create} a={OrgPermissionSubjects.Workspace}>
- {(isOldProjectPermissionAllowed) => (
- <OrgPermissionCan I={OrgPermissionActions.Create} a={OrgPermissionSubjects.Project}>
- {(isAllowed) => (
- <DropdownMenuItem
- isDisabled={!isAllowed && !isOldProjectPermissionAllowed}
- icon={<FontAwesomeIcon icon={faPlus} />}
- onClick={() =>
- handlePopUpOpen(isAddingProjectsAllowed ? "addNewWs" : "upgradePlan")
- }
+ <UnstableIconButton
+ variant="ghost"
+ size="xs"
+ aria-label="toggle favorite"
+ onPointerDown={(e) => e.stopPropagation()}
+ onClick={async (e) => {
+ e.stopPropagation();
+ e.preventDefault();
+ await (
+ workspace.isFavorite ? removeProjectFromFavorites : addProjectToFavorites
+ )(workspace.id);
+ }}
+ onKeyDown={(e) => {
+ if (e.key === "Enter") e.stopPropagation();
+ }}
+ >
+ <Star
+ className={
+ workspace.isFavorite
+ ? "fill-yellow-600 text-yellow-600"
+ : "text-yellow-600"
+ }
+ />
+ </UnstableIconButton>
+ </CommandItem>
+ ))}
+ </CommandGroup>
+ </CommandList>
+ <div className="border-t border-border p-1">
+ <OrgPermissionCan I={OrgPermissionActions.Create} a={OrgPermissionSubjects.Workspace}>
+ {(isOldProjectPermissionAllowed) => (
+ <OrgPermissionCan
+ I={OrgPermissionActions.Create}
+ a={OrgPermissionSubjects.Project}
>
- New Project
- </DropdownMenuItem>
+ {(isAllowed) => (
+ <button
+ type="button"
+ disabled={!isAllowed && !isOldProjectPermissionAllowed}
+ className="flex w-full cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm text-foreground hover:bg-foreground/5 disabled:pointer-events-none disabled:opacity-50"
+ onClick={() => {
+ setOpen(false);
+ handlePopUpOpen(isAddingProjectsAllowed ? "addNewWs" : "upgradePlan");
+ }}
+ >
+ <Plus className="size-4" />
+ <span>New Project</span>
+ </button>
+ )}
+ </OrgPermissionCan>
)}
</OrgPermissionCan>
- )}
- </OrgPermissionCan>
- </DropdownMenuContent>
- </DropdownMenu>
+ </div>
+ </Command>
+ </PopoverContent>
+ </Popover>
<UpgradePlanModal
isOpen={popUp.upgradePlan.isOpen}
onOpenChange={(isOpen) => handlePopUpToggle("upgradePlan", isOpen)}
- text="You’ve reached the maximum number of projects available on the Free plan. Upgrade to the Infisical Pro plan to create more projects."
+ text="You've reached the maximum number of projects available on the Free plan. Upgrade to the Infisical Pro plan to create more projects."
/>
<NewProjectModal
isOpen={popUp.addNewWs.isOpen}
diff --git a/frontend/src/layouts/SecretManagerLayout/SecretManagerLayout.tsx b/frontend/src/layouts/SecretManagerLayout/SecretManagerLayout.tsx
index 7c4abab9d5..411f518ab3 100644
--- a/frontend/src/layouts/SecretManagerLayout/SecretManagerLayout.tsx
+++ b/frontend/src/layouts/SecretManagerLayout/SecretManagerLayout.tsx
@@ -1,164 +1,14 @@
-import { Link, Outlet, useLocation } from "@tanstack/react-router";
-import { motion } from "framer-motion";
+import { Outlet } from "@tanstack/react-router";
-import { Tab, TabList, Tabs } from "@app/components/v2";
-import { Badge } from "@app/components/v3";
-import { useOrganization, useProject, useProjectPermission } from "@app/context";
-import {
- useGetAccessRequestsCount,
- useGetSecretApprovalRequestCount,
- useGetSecretRotations
-} from "@app/hooks/api";
+import { useProjectPermission } from "@app/context";
import { AssumePrivilegeModeBanner } from "../ProjectLayout/components/AssumePrivilegeModeBanner";
export const SecretManagerLayout = () => {
- const { currentProject, projectId } = useProject();
const { assumedPrivilegeDetails } = useProjectPermission();
- const { currentOrg } = useOrganization();
- const location = useLocation();
-
- const projectSlug = currentProject?.slug || "";
-
- const { data: secretApprovalReqCount } = useGetSecretApprovalRequestCount({
- projectId
- });
- const { data: accessApprovalRequestCount } = useGetAccessRequestsCount({
- projectSlug
- });
-
- // we only show the secret rotations v1 tab if they have existing rotations
- const { data: secretRotations } = useGetSecretRotations({
- workspaceId: projectId,
- options: {
- refetchOnMount: false
- }
- });
-
- const pendingRequestsCount =
- (secretApprovalReqCount?.open || 0) + (accessApprovalRequestCount?.pendingCount || 0);
return (
- <div className="dark flex h-full w-full flex-col overflow-x-hidden bg-mineshaft-900">
- <div className="border-y border-t-project/10 border-b-project/5 bg-gradient-to-b from-project/[0.075] to-project/[0.025] px-4 pt-0.5">
- <motion.div
- key="menu-project-items"
- initial={{ x: -150 }}
- animate={{ x: 0 }}
- exit={{ x: -150 }}
- transition={{ duration: 0.2 }}
- className="px-4"
- >
- <nav className="w-full">
- <Tabs value="selected">
- <TabList className="border-b-0">
- <Link
- to="/organizations/$orgId/projects/secret-management/$projectId/overview"
- params={{
- orgId: currentOrg.id,
- projectId: currentProject.id,
- ...(currentProject.environments.length
- ? { envSlug: currentProject.environments[0]?.slug }
- : {})
- }}
- >
- {({ isActive }) => (
- <Tab
- value={
- isActive || location.pathname.match(/\/secrets\/|\/commits\//)
- ? "selected"
- : ""
- }
- >
- Overview
- </Tab>
- )}
- </Link>
- <Link
- to="/organizations/$orgId/projects/secret-management/$projectId/approval"
- params={{
- orgId: currentOrg.id,
- projectId: currentProject.id
- }}
- >
- {({ isActive }) => (
- <Tab value={isActive ? "selected" : ""}>
- Approvals
- {Boolean(
- secretApprovalReqCount?.open || accessApprovalRequestCount?.pendingCount
- ) && (
- <Badge variant="warning" isSquare className="ml-1.5">
- {pendingRequestsCount}
- </Badge>
- )}
- </Tab>
- )}
- </Link>
- <Link
- to="/organizations/$orgId/projects/secret-management/$projectId/integrations"
- params={{
- orgId: currentOrg.id,
- projectId: currentProject.id
- }}
- >
- {({ isActive }) => <Tab value={isActive ? "selected" : ""}>Integrations</Tab>}
- </Link>
- {Boolean(secretRotations?.length) && (
- <Link
- to="/organizations/$orgId/projects/secret-management/$projectId/secret-rotation"
- params={{
- orgId: currentOrg.id,
- projectId: currentProject.id
- }}
- >
- {({ isActive }) => (
- <Tab value={isActive ? "selected" : ""}>Secret Rotations</Tab>
- )}
- </Link>
- )}
- <Link
- to="/organizations/$orgId/projects/secret-management/$projectId/access-management"
- params={{
- orgId: currentOrg.id,
- projectId: currentProject.id
- }}
- >
- {({ isActive }) => (
- <Tab
- value={
- isActive ||
- location.pathname.match(/\/groups\/|\/identities\/|\/members\/|\/roles\//)
- ? "selected"
- : ""
- }
- >
- Access Control
- </Tab>
- )}
- </Link>
- <Link
- to="/organizations/$orgId/projects/secret-management/$projectId/audit-logs"
- params={{
- orgId: currentOrg.id,
- projectId: currentProject.id
- }}
- >
- {({ isActive }) => <Tab value={isActive ? "selected" : ""}>Audit Logs</Tab>}
- </Link>
- <Link
- to="/organizations/$orgId/projects/secret-management/$projectId/settings"
- params={{
- orgId: currentOrg.id,
- projectId: currentProject.id
- }}
- >
- {({ isActive }) => <Tab value={isActive ? "selected" : ""}>Settings</Tab>}
- </Link>
- </TabList>
- </Tabs>
- </nav>
- </motion.div>
- </div>
+ <div className="flex h-full w-full flex-col overflow-x-hidden">
{assumedPrivilegeDetails && <AssumePrivilegeModeBanner />}
<div className="flex-1 overflow-x-hidden overflow-y-auto bg-bunker-800 px-12 pt-10 pb-4">
<Outlet />
diff --git a/frontend/src/layouts/SecretScanningLayout/SecretScanningLayout.tsx b/frontend/src/layouts/SecretScanningLayout/SecretScanningLayout.tsx
index 860365f250..befd5a0865 100644
--- a/frontend/src/layouts/SecretScanningLayout/SecretScanningLayout.tsx
+++ b/frontend/src/layouts/SecretScanningLayout/SecretScanningLayout.tsx
@@ -1,135 +1,14 @@
-import { Link, Outlet, useLocation } from "@tanstack/react-router";
-import { motion } from "framer-motion";
+import { Outlet } from "@tanstack/react-router";
-import { Tab, TabList, Tabs } from "@app/components/v2";
-import { Badge } from "@app/components/v3";
-import {
- ProjectPermissionSub,
- useOrganization,
- useProject,
- useProjectPermission,
- useSubscription
-} from "@app/context";
-import { ProjectPermissionSecretScanningFindingActions } from "@app/context/ProjectPermissionContext/types";
-import { useGetSecretScanningUnresolvedFindingCount } from "@app/hooks/api/secretScanningV2";
+import { useProjectPermission } from "@app/context";
import { AssumePrivilegeModeBanner } from "../ProjectLayout/components/AssumePrivilegeModeBanner";
export const SecretScanningLayout = () => {
- const { currentOrg } = useOrganization();
- const { currentProject } = useProject();
const { assumedPrivilegeDetails } = useProjectPermission();
- const { permission } = useProjectPermission();
- const { subscription } = useSubscription();
- const location = useLocation();
-
- const { data: unresolvedFindings } = useGetSecretScanningUnresolvedFindingCount(
- currentProject.id,
- {
- enabled:
- subscription.secretScanning &&
- permission.can(
- ProjectPermissionSecretScanningFindingActions.Read,
- ProjectPermissionSub.SecretScanningFindings
- ),
- refetchInterval: 30000
- }
- );
-
return (
- <div className="dark flex h-full w-full flex-col overflow-x-hidden bg-mineshaft-900">
- <div className="border-y border-t-project/10 border-b-project/5 bg-gradient-to-b from-project/[0.075] to-project/[0.025] px-4 pt-0.5">
- <motion.div
- key="menu-project-items"
- initial={{ x: -150 }}
- animate={{ x: 0 }}
- exit={{ x: -150 }}
- transition={{ duration: 0.2 }}
- className="px-4"
- >
- <nav className="w-full">
- <Tabs value="selected">
- <TabList className="border-b-0">
- <Link
- to="/organizations/$orgId/projects/secret-scanning/$projectId/data-sources"
- params={{
- orgId: currentOrg.id,
- projectId: currentProject.id
- }}
- >
- {({ isActive }) => <Tab value={isActive ? "selected" : ""}>Data Sources</Tab>}
- </Link>
- <Link
- to="/organizations/$orgId/projects/secret-scanning/$projectId/findings"
- params={{
- orgId: currentOrg.id,
- projectId: currentProject.id
- }}
- >
- {({ isActive }) => (
- <Tab value={isActive ? "selected" : ""}>
- Findings
- {Boolean(unresolvedFindings) && (
- <Badge isSquare variant="warning" className="ml-2">
- {unresolvedFindings}
- </Badge>
- )}
- </Tab>
- )}
- </Link>
- <Link
- to="/organizations/$orgId/projects/secret-scanning/$projectId/app-connections"
- params={{
- orgId: currentOrg.id,
- projectId: currentProject.id
- }}
- >
- {({ isActive }) => <Tab value={isActive ? "selected" : ""}>App Connections</Tab>}
- </Link>
- <Link
- to="/organizations/$orgId/projects/secret-scanning/$projectId/access-management"
- params={{
- orgId: currentOrg.id,
- projectId: currentProject.id
- }}
- >
- {({ isActive }) => (
- <Tab
- value={
- isActive ||
- location.pathname.match(/\/groups\/|\/identities\/|\/members\/|\/roles\//)
- ? "selected"
- : ""
- }
- >
- Access Control
- </Tab>
- )}
- </Link>
- <Link
- to="/organizations/$orgId/projects/secret-scanning/$projectId/audit-logs"
- params={{
- orgId: currentOrg.id,
- projectId: currentProject.id
- }}
- >
- {({ isActive }) => <Tab value={isActive ? "selected" : ""}>Audit Logs</Tab>}
- </Link>
- <Link
- to="/organizations/$orgId/projects/secret-scanning/$projectId/settings"
- params={{
- orgId: currentOrg.id,
- projectId: currentProject.id
- }}
- >
- {({ isActive }) => <Tab value={isActive ? "selected" : ""}>Settings</Tab>}
- </Link>
- </TabList>
- </Tabs>
- </nav>
- </motion.div>
- </div>
+ <div className="flex h-full w-full flex-col overflow-x-hidden">
{assumedPrivilegeDetails && <AssumePrivilegeModeBanner />}
<div className="flex-1 overflow-x-hidden overflow-y-auto bg-bunker-800 px-12 pt-10 pb-4">
<Outlet />
diff --git a/frontend/src/layouts/SshLayout/SshLayout.tsx b/frontend/src/layouts/SshLayout/SshLayout.tsx
index 1c4c387715..20abd7f598 100644
--- a/frontend/src/layouts/SshLayout/SshLayout.tsx
+++ b/frontend/src/layouts/SshLayout/SshLayout.tsx
@@ -1,122 +1,14 @@
-import { Link, Outlet, useLocation } from "@tanstack/react-router";
-import { motion } from "framer-motion";
+import { Outlet } from "@tanstack/react-router";
-import { ProjectPermissionCan } from "@app/components/permissions";
-import { Tab, TabList, Tabs } from "@app/components/v2";
-import {
- ProjectPermissionActions,
- ProjectPermissionSub,
- useOrganization,
- useProject,
- useProjectPermission
-} from "@app/context";
+import { useProjectPermission } from "@app/context";
import { AssumePrivilegeModeBanner } from "../ProjectLayout/components/AssumePrivilegeModeBanner";
export const SshLayout = () => {
- const { currentOrg } = useOrganization();
- const { currentProject } = useProject();
const { assumedPrivilegeDetails } = useProjectPermission();
- const location = useLocation();
return (
- <div className="dark flex h-full w-full flex-col overflow-x-hidden bg-mineshaft-900">
- <div className="border-y border-t-project/10 border-b-project/5 bg-gradient-to-b from-project/[0.075] to-project/[0.025] px-4 pt-0.5">
- <motion.div
- key="menu-project-items"
- initial={{ x: -150 }}
- animate={{ x: 0 }}
- exit={{ x: -150 }}
- transition={{ duration: 0.2 }}
- className="px-4"
- >
- <nav className="w-full">
- <Tabs value="selected">
- <TabList className="border-b-0">
- <Link
- to="/organizations/$orgId/projects/ssh/$projectId/overview"
- params={{
- orgId: currentOrg.id,
- projectId: currentProject.id
- }}
- >
- {({ isActive }) => (
- <Tab
- value={
- isActive || location.pathname.match(/\/ssh-host-groups\//) ? "selected" : ""
- }
- >
- Hosts
- </Tab>
- )}
- </Link>
- <ProjectPermissionCan
- I={ProjectPermissionActions.Read}
- a={ProjectPermissionSub.SshCertificateAuthorities}
- >
- {(isAllowed) =>
- isAllowed && (
- <Link
- to="/organizations/$orgId/projects/ssh/$projectId/cas"
- params={{
- orgId: currentOrg.id,
- projectId: currentProject.id
- }}
- >
- {({ isActive }) => (
- <Tab
- value={isActive || location.pathname.match(/\/ca\//) ? "selected" : ""}
- >
- Certificate Authorities
- </Tab>
- )}
- </Link>
- )
- }
- </ProjectPermissionCan>
- <Link
- to="/organizations/$orgId/projects/ssh/$projectId/access-management"
- params={{
- orgId: currentOrg.id,
- projectId: currentProject.id
- }}
- >
- {({ isActive }) => (
- <Tab
- value={
- isActive ||
- location.pathname.match(/\/groups\/|\/identities\/|\/members\/|\/roles\//)
- ? "selected"
- : ""
- }
- >
- Access Control
- </Tab>
- )}
- </Link>
- <Link
- to="/organizations/$orgId/projects/ssh/$projectId/audit-logs"
- params={{
- orgId: currentOrg.id,
- projectId: currentProject.id
- }}
- >
- {({ isActive }) => <Tab value={isActive ? "selected" : ""}>Audit Logs</Tab>}
- </Link>
- <Link
- to="/organizations/$orgId/projects/ssh/$projectId/settings"
- params={{
- orgId: currentOrg.id,
- projectId: currentProject.id
- }}
- >
- {({ isActive }) => <Tab value={isActive ? "selected" : ""}>Settings</Tab>}
- </Link>
- </TabList>
- </Tabs>
- </nav>
- </motion.div>
- </div>
+ <div className="flex h-full w-full flex-col overflow-x-hidden">
{assumedPrivilegeDetails && <AssumePrivilegeModeBanner />}
<div className="flex-1 overflow-x-hidden overflow-y-auto bg-bunker-800 px-12 pt-10 pb-4">
<Outlet />
diff --git a/frontend/src/pages/admin/ResourceOverviewPage/ResourceOverviewPage.tsx b/frontend/src/pages/admin/ResourceOverviewPage/ResourceOverviewPage.tsx
index 199fcb1bd0..567ca2a069 100644
--- a/frontend/src/pages/admin/ResourceOverviewPage/ResourceOverviewPage.tsx
+++ b/frontend/src/pages/admin/ResourceOverviewPage/ResourceOverviewPage.tsx
@@ -1,12 +1,18 @@
import { Helmet } from "react-helmet";
import { useTranslation } from "react-i18next";
+import { useSearch } from "@tanstack/react-router";
-import { PageHeader, Tab, TabList, TabPanel, Tabs } from "@app/components/v2";
+import { PageHeader } from "@app/components/v2";
import { MachineIdentitiesTable, OrganizationsTable, UserIdentitiesTable } from "./components";
export const ResourceOverviewPage = () => {
const { t } = useTranslation();
+ const { selectedTab } = useSearch({
+ from: "/_authenticate/_inject-org-details/admin/_admin-layout/resources/overview"
+ });
+
+ const activeTab = selectedTab || "organizations";
return (
<div className="h-full bg-bunker-800">
@@ -20,28 +26,11 @@ export const ResourceOverviewPage = () => {
title="Resource Overview"
description="Manage resources within your Infisical instance."
/>
- <Tabs orientation="vertical" defaultValue="tab-organizations">
- <TabList>
- <Tab variant="instance" value="tab-organizations">
- Organizations
- </Tab>
- <Tab variant="instance" value="tab-users">
- Users
- </Tab>
- <Tab variant="instance" value="tab-identities">
- Machine Identities
- </Tab>
- </TabList>
- <TabPanel value="tab-organizations">
- <OrganizationsTable />
- </TabPanel>
- <TabPanel value="tab-users">
- <UserIdentitiesTable />
- </TabPanel>
- <TabPanel value="tab-identities">
- <MachineIdentitiesTable />
- </TabPanel>
- </Tabs>
+ <div>
+ {activeTab === "organizations" && <OrganizationsTable />}
+ {activeTab === "users" && <UserIdentitiesTable />}
+ {activeTab === "identities" && <MachineIdentitiesTable />}
+ </div>
</div>
</div>
</div>
diff --git a/frontend/src/pages/admin/ResourceOverviewPage/route.tsx b/frontend/src/pages/admin/ResourceOverviewPage/route.tsx
index ea27c1a063..61d801b3e1 100644
--- a/frontend/src/pages/admin/ResourceOverviewPage/route.tsx
+++ b/frontend/src/pages/admin/ResourceOverviewPage/route.tsx
@@ -1,11 +1,18 @@
import { createFileRoute, linkOptions } from "@tanstack/react-router";
+import { zodValidator } from "@tanstack/zod-adapter";
+import { z } from "zod";
import { ResourceOverviewPage } from "./ResourceOverviewPage";
+const resourceOverviewSearchSchema = z.object({
+ selectedTab: z.string().optional().default("organizations")
+});
+
export const Route = createFileRoute(
"/_authenticate/_inject-org-details/admin/_admin-layout/resources/overview"
)({
component: ResourceOverviewPage,
+ validateSearch: zodValidator(resourceOverviewSearchSchema),
beforeLoad: async () => {
return {
breadcrumbs: [
diff --git a/frontend/src/pages/ai/MCPPage/MCPPage.tsx b/frontend/src/pages/ai/MCPPage/MCPPage.tsx
index e137aca84d..7bce3c14a5 100644
--- a/frontend/src/pages/ai/MCPPage/MCPPage.tsx
+++ b/frontend/src/pages/ai/MCPPage/MCPPage.tsx
@@ -1,8 +1,8 @@
-import { useState } from "react";
import { Helmet } from "react-helmet";
import { useTranslation } from "react-i18next";
+import { useSearch } from "@tanstack/react-router";
-import { ContentLoader, PageHeader, Tab, TabList, TabPanel, Tabs } from "@app/components/v2";
+import { ContentLoader, PageHeader } from "@app/components/v2";
import { useProject } from "@app/context";
import { ProjectType } from "@app/hooks/api/projects/types";
@@ -19,7 +19,11 @@ enum TabSections {
export const MCPPage = () => {
const { t } = useTranslation();
const { currentProject } = useProject();
- const [activeTab, setActiveTab] = useState(TabSections.MCPEndpoints);
+ const { selectedTab } = useSearch({
+ from: "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/overview"
+ });
+
+ const activeTab = (selectedTab as TabSections) || TabSections.MCPEndpoints;
if (!currentProject) {
return <ContentLoader />;
@@ -36,35 +40,11 @@ export const MCPPage = () => {
title="MCP Management"
description="Manage MCP endpoints, connect MCP servers, and configure tools with secure governance"
/>
- <Tabs
- orientation="vertical"
- value={activeTab}
- onValueChange={(value) => setActiveTab(value as TabSections)}
- >
- <TabList>
- <Tab variant="project" value={TabSections.MCPEndpoints}>
- MCP Endpoints
- </Tab>
- <Tab variant="project" value={TabSections.MCPServers}>
- MCP Servers
- </Tab>
- <Tab variant="project" value={TabSections.ActivityLogs}>
- Activity Logs
- </Tab>
- </TabList>
-
- <TabPanel value={TabSections.MCPEndpoints}>
- <MCPEndpointsTab />
- </TabPanel>
-
- <TabPanel value={TabSections.MCPServers}>
- <MCPServersTab />
- </TabPanel>
-
- <TabPanel value={TabSections.ActivityLogs}>
- <MCPActivityLogsTab />
- </TabPanel>
- </Tabs>
+ <div>
+ {activeTab === TabSections.MCPEndpoints && <MCPEndpointsTab />}
+ {activeTab === TabSections.MCPServers && <MCPServersTab />}
+ {activeTab === TabSections.ActivityLogs && <MCPActivityLogsTab />}
+ </div>
</div>
</div>
);
diff --git a/frontend/src/pages/ai/MCPPage/route.tsx b/frontend/src/pages/ai/MCPPage/route.tsx
index 78ad5b06f0..3039a11779 100644
--- a/frontend/src/pages/ai/MCPPage/route.tsx
+++ b/frontend/src/pages/ai/MCPPage/route.tsx
@@ -1,11 +1,18 @@
import { createFileRoute } from "@tanstack/react-router";
+import { zodValidator } from "@tanstack/zod-adapter";
+import { z } from "zod";
import { MCPPage } from "./MCPPage";
+const mcpPageSearchSchema = z.object({
+ selectedTab: z.string().optional().default("mcp-endpoints")
+});
+
export const Route = createFileRoute(
"/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/overview"
)({
component: MCPPage,
+ validateSearch: zodValidator(mcpPageSearchSchema),
beforeLoad: ({ context }) => {
return {
breadcrumbs: [
diff --git a/frontend/src/pages/ai/SettingsPage/SettingsPage.tsx b/frontend/src/pages/ai/SettingsPage/SettingsPage.tsx
index 7a1d83cf31..d320047093 100644
--- a/frontend/src/pages/ai/SettingsPage/SettingsPage.tsx
+++ b/frontend/src/pages/ai/SettingsPage/SettingsPage.tsx
@@ -3,7 +3,7 @@ import { useTranslation } from "react-i18next";
import { Link } from "@tanstack/react-router";
import { InfoIcon } from "lucide-react";
-import { PageHeader, Tab, TabList, TabPanel, Tabs } from "@app/components/v2";
+import { PageHeader, TabPanel, Tabs } from "@app/components/v2";
import { useOrganization } from "@app/context";
import { ProjectType } from "@app/hooks/api/projects/types";
import { ProjectGeneralTab } from "@app/pages/project/SettingsPage/components/ProjectGeneralTab";
@@ -38,13 +38,6 @@ export const SettingsPage = () => {
</Link>
</PageHeader>
<Tabs orientation="vertical" defaultValue={tabs[0].key}>
- <TabList>
- {tabs.map((tab) => (
- <Tab value={tab.key} variant="project" key={tab.key}>
- {tab.name}
- </Tab>
- ))}
- </TabList>
{tabs.map(({ key, Component }) => (
<TabPanel value={key} key={key}>
<Component />
diff --git a/frontend/src/pages/cert-manager/ApprovalsPage/ApprovalsPage.tsx b/frontend/src/pages/cert-manager/ApprovalsPage/ApprovalsPage.tsx
index c7a769f2e0..7b0a559139 100644
--- a/frontend/src/pages/cert-manager/ApprovalsPage/ApprovalsPage.tsx
+++ b/frontend/src/pages/cert-manager/ApprovalsPage/ApprovalsPage.tsx
@@ -1,35 +1,19 @@
-import { useState } from "react";
import { Helmet } from "react-helmet";
import { useSearch } from "@tanstack/react-router";
-import { PageHeader, Tab, TabList, TabPanel, Tabs } from "@app/components/v2";
+import { PageHeader } from "@app/components/v2";
import { useProject } from "@app/context";
-import { CodeSigningGrantsTab } from "./components/CodeSigningGrantsTab";
-import { CodeSigningPolicyTab } from "./components/CodeSigningPolicyTab";
-import { CodeSigningRequestsTab } from "./components/CodeSigningRequestsTab";
import { PolicyTab } from "./components/PolicyTab";
import { RequestsTab } from "./components/RequestsTab";
-enum CertApprovalTabs {
- Requests = "requests",
- Policies = "policies"
-}
-
-enum CodeSigningApprovalTabs {
- Requests = "code-signing-requests",
- Policies = "code-signing-policies",
- Grants = "code-signing-grants"
-}
-
export const ApprovalsPage = () => {
const { currentProject } = useProject();
- const { section } = useSearch({ strict: false }) as { section?: string };
-
- const isCodeSigning = section === "code-signing";
+ const { selectedTab } = useSearch({
+ from: "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/approvals"
+ });
- const [certTab, setCertTab] = useState(CertApprovalTabs.Requests);
- const [codeSigningTab, setCodeSigningTab] = useState(CodeSigningApprovalTabs.Requests);
+ const activeTab = selectedTab || "requests";
return (
<div className="mx-auto flex flex-col justify-between bg-bunker-800 text-white">
@@ -39,65 +23,13 @@ export const ApprovalsPage = () => {
<div className="mx-auto mb-6 w-full max-w-8xl">
<PageHeader
scope={currentProject.type}
- title={isCodeSigning ? "Code Signing" : "Certificate Approvals"}
- description={
- isCodeSigning
- ? "Manage signing policies, review signing requests, and monitor grants."
- : "Manage approval workflows, update policy settings, and monitor request statuses."
- }
+ title="Certificate Approvals"
+ description="Manage approval workflows, update policy settings, and monitor request statuses."
/>
-
- {!isCodeSigning && (
- <Tabs
- orientation="vertical"
- value={certTab}
- onValueChange={(value) => setCertTab(value as CertApprovalTabs)}
- >
- <TabList>
- <Tab variant="project" value={CertApprovalTabs.Requests}>
- Requests
- </Tab>
- <Tab variant="project" value={CertApprovalTabs.Policies}>
- Policies
- </Tab>
- </TabList>
- <TabPanel value={CertApprovalTabs.Requests}>
- <RequestsTab />
- </TabPanel>
- <TabPanel value={CertApprovalTabs.Policies}>
- <PolicyTab />
- </TabPanel>
- </Tabs>
- )}
-
- {isCodeSigning && (
- <Tabs
- orientation="vertical"
- value={codeSigningTab}
- onValueChange={(value) => setCodeSigningTab(value as CodeSigningApprovalTabs)}
- >
- <TabList>
- <Tab variant="project" value={CodeSigningApprovalTabs.Requests}>
- Signing Requests
- </Tab>
- <Tab variant="project" value={CodeSigningApprovalTabs.Policies}>
- Signing Policies
- </Tab>
- <Tab variant="project" value={CodeSigningApprovalTabs.Grants}>
- Grants
- </Tab>
- </TabList>
- <TabPanel value={CodeSigningApprovalTabs.Requests}>
- <CodeSigningRequestsTab />
- </TabPanel>
- <TabPanel value={CodeSigningApprovalTabs.Policies}>
- <CodeSigningPolicyTab />
- </TabPanel>
- <TabPanel value={CodeSigningApprovalTabs.Grants}>
- <CodeSigningGrantsTab />
- </TabPanel>
- </Tabs>
- )}
+ <div>
+ {activeTab === "requests" && <RequestsTab />}
+ {activeTab === "policies" && <PolicyTab />}
+ </div>
</div>
</div>
);
diff --git a/frontend/src/pages/cert-manager/ApprovalsPage/route.tsx b/frontend/src/pages/cert-manager/ApprovalsPage/route.tsx
index ba05d2d383..5f8cfeb64c 100644
--- a/frontend/src/pages/cert-manager/ApprovalsPage/route.tsx
+++ b/frontend/src/pages/cert-manager/ApprovalsPage/route.tsx
@@ -5,6 +5,7 @@ import { z } from "zod";
import { ApprovalsPage } from "./ApprovalsPage";
const ApprovalsSearchSchema = z.object({
+ selectedTab: z.string().optional().default("requests"),
section: z.enum(["certificates", "code-signing"]).optional().default("certificates")
});
diff --git a/frontend/src/pages/cert-manager/CodeSigningPage/CodeSigningPage.tsx b/frontend/src/pages/cert-manager/CodeSigningPage/CodeSigningPage.tsx
index 38fc38fb9d..c9b0159f92 100644
--- a/frontend/src/pages/cert-manager/CodeSigningPage/CodeSigningPage.tsx
+++ b/frontend/src/pages/cert-manager/CodeSigningPage/CodeSigningPage.tsx
@@ -3,7 +3,7 @@ import { Helmet } from "react-helmet";
import { useTranslation } from "react-i18next";
import { useSearch } from "@tanstack/react-router";
-import { PageHeader, Tab, TabList, TabPanel, Tabs } from "@app/components/v2";
+import { PageHeader } from "@app/components/v2";
import { useProject } from "@app/context";
import { ProjectType } from "@app/hooks/api/projects/types";
@@ -13,28 +13,15 @@ import { CodeSigningRequestsTab } from "../ApprovalsPage/components/CodeSigningR
import { CreateSignerModal } from "./components/CreateSignerModal";
import { SignersTable } from "./components/SignersTable";
-enum CodeSigningTabs {
- Signers = "signers",
- Approvals = "approvals"
-}
-
-enum ApprovalSubTabs {
- Requests = "requests",
- Policies = "policies",
- Grants = "grants"
-}
-
export const CodeSigningPage = () => {
const { t } = useTranslation();
const { currentProject } = useProject();
- const { tab, subtab } = useSearch({ strict: false }) as { tab?: string; subtab?: string };
+ const { selectedTab } = useSearch({
+ from: "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/code-signing/"
+ });
+
+ const activeTab = selectedTab || "signers";
const [isCreateOpen, setIsCreateOpen] = useState(false);
- const [activeTab, setActiveTab] = useState(
- tab === "approvals" ? CodeSigningTabs.Approvals : CodeSigningTabs.Signers
- );
- const [approvalSubTab, setApprovalSubTab] = useState(
- (subtab as ApprovalSubTabs) || ApprovalSubTabs.Requests
- );
return (
<div className="mx-auto flex h-full flex-col justify-between bg-bunker-800 text-white">
@@ -47,55 +34,17 @@ export const CodeSigningPage = () => {
title="Code Signing"
description="Manage signers and control who can sign artifacts."
/>
-
- <Tabs
- orientation="vertical"
- value={activeTab}
- onValueChange={(value) => setActiveTab(value as CodeSigningTabs)}
- >
- <TabList>
- <Tab variant="project" value={CodeSigningTabs.Signers}>
- Signers
- </Tab>
- <Tab variant="project" value={CodeSigningTabs.Approvals}>
- Approvals
- </Tab>
- </TabList>
-
- <TabPanel value={CodeSigningTabs.Signers}>
+ <div>
+ {activeTab === "signers" && (
<SignersTable
projectId={currentProject.id}
onCreateSigner={() => setIsCreateOpen(true)}
/>
- </TabPanel>
- <TabPanel value={CodeSigningTabs.Approvals}>
- <Tabs
- value={approvalSubTab}
- onValueChange={(value) => setApprovalSubTab(value as ApprovalSubTabs)}
- >
- <TabList>
- <Tab variant="project" value={ApprovalSubTabs.Requests}>
- Requests
- </Tab>
- <Tab variant="project" value={ApprovalSubTabs.Policies}>
- Policies
- </Tab>
- <Tab variant="project" value={ApprovalSubTabs.Grants}>
- Grants
- </Tab>
- </TabList>
- <TabPanel value={ApprovalSubTabs.Requests}>
- <CodeSigningRequestsTab />
- </TabPanel>
- <TabPanel value={ApprovalSubTabs.Policies}>
- <CodeSigningPolicyTab />
- </TabPanel>
- <TabPanel value={ApprovalSubTabs.Grants}>
- <CodeSigningGrantsTab />
- </TabPanel>
- </Tabs>
- </TabPanel>
- </Tabs>
+ )}
+ {activeTab === "signing-requests" && <CodeSigningRequestsTab />}
+ {activeTab === "signing-policies" && <CodeSigningPolicyTab />}
+ {activeTab === "grants" && <CodeSigningGrantsTab />}
+ </div>
</div>
<CreateSignerModal
isOpen={isCreateOpen}
diff --git a/frontend/src/pages/cert-manager/CodeSigningPage/route.tsx b/frontend/src/pages/cert-manager/CodeSigningPage/route.tsx
index bc2c6a3d14..3ea1eac215 100644
--- a/frontend/src/pages/cert-manager/CodeSigningPage/route.tsx
+++ b/frontend/src/pages/cert-manager/CodeSigningPage/route.tsx
@@ -5,6 +5,7 @@ import { z } from "zod";
import { CodeSigningPage } from "./CodeSigningPage";
const CodeSigningSearchSchema = z.object({
+ selectedTab: z.string().optional().default("signers"),
tab: z.enum(["signers", "approvals"]).optional(),
subtab: z.enum(["requests", "policies", "grants"]).optional()
});
diff --git a/frontend/src/pages/cert-manager/DiscoveryPage/DiscoveryPage.tsx b/frontend/src/pages/cert-manager/DiscoveryPage/DiscoveryPage.tsx
index 5165bcf8a7..196a01b163 100644
--- a/frontend/src/pages/cert-manager/DiscoveryPage/DiscoveryPage.tsx
+++ b/frontend/src/pages/cert-manager/DiscoveryPage/DiscoveryPage.tsx
@@ -1,9 +1,9 @@
-import { useState } from "react";
import { Helmet } from "react-helmet";
import { useTranslation } from "react-i18next";
+import { useSearch } from "@tanstack/react-router";
import { ProjectPermissionCan } from "@app/components/permissions";
-import { PageHeader, Tab, TabList, TabPanel, Tabs } from "@app/components/v2";
+import { PageHeader } from "@app/components/v2";
import { DocumentationLinkBadge } from "@app/components/v3";
import {
ProjectPermissionPkiCertificateInstallationActions,
@@ -18,7 +18,11 @@ import { DiscoveryJobsTab, InstallationsTab } from "./components";
export const DiscoveryPage = () => {
const { t } = useTranslation();
const { currentProject } = useProject();
- const [selectedTab, setSelectedTab] = useState("jobs");
+ const { selectedTab } = useSearch({
+ from: "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/discovery/"
+ });
+
+ const activeTab = selectedTab || "jobs";
return (
<div className="mx-auto flex h-full flex-col justify-between bg-bunker-800 text-white">
@@ -38,17 +42,8 @@ export const DiscoveryPage = () => {
}
description="Discover and track SSL/TLS certificates across your infrastructure."
/>
- <Tabs orientation="vertical" value={selectedTab} onValueChange={setSelectedTab}>
- <TabList>
- <Tab variant="project" value="jobs">
- Jobs
- </Tab>
- <Tab variant="project" value="installations">
- Installations
- </Tab>
- </TabList>
-
- <TabPanel value="jobs">
+ <div>
+ {activeTab === "jobs" && (
<ProjectPermissionCan
renderGuardBanner
I={ProjectPermissionPkiDiscoveryActions.Read}
@@ -56,9 +51,8 @@ export const DiscoveryPage = () => {
>
<DiscoveryJobsTab projectId={currentProject?.id || ""} />
</ProjectPermissionCan>
- </TabPanel>
-
- <TabPanel value="installations">
+ )}
+ {activeTab === "installations" && (
<ProjectPermissionCan
renderGuardBanner
I={ProjectPermissionPkiCertificateInstallationActions.Read}
@@ -66,8 +60,8 @@ export const DiscoveryPage = () => {
>
<InstallationsTab projectId={currentProject?.id || ""} />
</ProjectPermissionCan>
- </TabPanel>
- </Tabs>
+ )}
+ </div>
</div>
</div>
);
diff --git a/frontend/src/pages/cert-manager/DiscoveryPage/route.tsx b/frontend/src/pages/cert-manager/DiscoveryPage/route.tsx
index 7e60d41302..b13bebd512 100644
--- a/frontend/src/pages/cert-manager/DiscoveryPage/route.tsx
+++ b/frontend/src/pages/cert-manager/DiscoveryPage/route.tsx
@@ -1,11 +1,18 @@
import { createFileRoute } from "@tanstack/react-router";
+import { zodValidator } from "@tanstack/zod-adapter";
+import { z } from "zod";
import { DiscoveryPage } from "./DiscoveryPage";
+const discoveryPageSearchSchema = z.object({
+ selectedTab: z.string().optional().default("jobs")
+});
+
export const Route = createFileRoute(
"/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/discovery/"
)({
component: DiscoveryPage,
+ validateSearch: zodValidator(discoveryPageSearchSchema),
beforeLoad: ({ context }) => {
return {
breadcrumbs: [
diff --git a/frontend/src/pages/cert-manager/IntegrationsListPage/IntegrationsListPage.tsx b/frontend/src/pages/cert-manager/IntegrationsListPage/IntegrationsListPage.tsx
index 8cf23c7255..06f2fa9654 100644
--- a/frontend/src/pages/cert-manager/IntegrationsListPage/IntegrationsListPage.tsx
+++ b/frontend/src/pages/cert-manager/IntegrationsListPage/IntegrationsListPage.tsx
@@ -3,7 +3,7 @@ import { useTranslation } from "react-i18next";
import { useNavigate, useSearch } from "@tanstack/react-router";
import { ProjectPermissionCan } from "@app/components/permissions";
-import { PageHeader, Tab, TabList, TabPanel, Tabs } from "@app/components/v2";
+import { PageHeader, TabPanel, Tabs } from "@app/components/v2";
import { ROUTE_PATHS } from "@app/const/routes";
import { ProjectPermissionSub, useOrganization, useProject } from "@app/context";
import { ProjectPermissionPkiSyncActions } from "@app/context/ProjectPermissionContext/types";
@@ -53,11 +53,6 @@ export const IntegrationsListPage = () => {
description="Manage integrations with third-party certificate services."
/>
<Tabs orientation="vertical" value={currentTab} onValueChange={updateSelectedTab}>
- <TabList>
- <Tab variant="project" value={IntegrationsListPageTabs.PkiSyncs}>
- Certificate Syncs
- </Tab>
- </TabList>
<TabPanel value={IntegrationsListPageTabs.PkiSyncs}>
<ProjectPermissionCan
renderGuardBanner
diff --git a/frontend/src/pages/cert-manager/PoliciesPage/PoliciesPage.tsx b/frontend/src/pages/cert-manager/PoliciesPage/PoliciesPage.tsx
index 0b97d6b8c9..4ae2365448 100644
--- a/frontend/src/pages/cert-manager/PoliciesPage/PoliciesPage.tsx
+++ b/frontend/src/pages/cert-manager/PoliciesPage/PoliciesPage.tsx
@@ -1,9 +1,10 @@
import { useState } from "react";
import { Helmet } from "react-helmet";
import { useTranslation } from "react-i18next";
+import { useNavigate, useSearch } from "@tanstack/react-router";
import { PermissionDeniedBanner } from "@app/components/permissions";
-import { ContentLoader, PageHeader, Tab, TabList, TabPanel, Tabs } from "@app/components/v2";
+import { ContentLoader, PageHeader } from "@app/components/v2";
import { useProject, useProjectPermission } from "@app/context";
import {
ProjectPermissionCertificateActions,
@@ -22,20 +23,27 @@ enum TabSections {
CertificateProfiles = "profiles",
CertificatePolicies = "policies",
Certificates = "certificates",
- CertificateRequests = "certificate-requests",
- PkiCollections = "pki-collections"
+ CertificateRequests = "certificate-requests"
}
export const PoliciesPage = () => {
const { t } = useTranslation();
const { currentProject } = useProject();
const { permission } = useProjectPermission();
- const [activeTab, setActiveTab] = useState(TabSections.Certificates);
+ const navigate = useNavigate();
+ const { selectedTab } = useSearch({
+ from: "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/policies"
+ });
+
+ const activeTab = (selectedTab as TabSections) || TabSections.Certificates;
const [certificateFilter, setCertificateFilter] = useState<{ search?: string }>({});
const handleViewCertificateFromRequest = (certificateId: string) => {
- setActiveTab(TabSections.Certificates);
setCertificateFilter({ search: certificateId });
+ navigate({
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ search: { selectedTab: TabSections.Certificates } as any
+ });
};
const canReadCertificateProfiles = permission.can(
@@ -66,53 +74,26 @@ export const PoliciesPage = () => {
title="Certificate Manager"
description="Streamline certificate management by creating and maintaining templates, profiles, and certificates in one place"
/>
-
- <Tabs
- orientation="vertical"
- value={activeTab}
- onValueChange={(value) => setActiveTab(value as TabSections)}
- >
- <TabList>
- <Tab variant="project" value={TabSections.Certificates}>
- Certificates
- </Tab>
- <Tab variant="project" value={TabSections.CertificateRequests}>
- Certificate Requests
- </Tab>
- <Tab variant="project" value={TabSections.CertificateProfiles}>
- Certificate Profiles
- </Tab>
- <Tab variant="project" value={TabSections.CertificatePolicies}>
- Certificate Policies
- </Tab>
- </TabList>
-
- <TabPanel value={TabSections.Certificates}>
- {canReadCertificates ? (
+ <div>
+ {activeTab === TabSections.Certificates &&
+ (canReadCertificates ? (
<CertificatesTab externalFilter={certificateFilter} />
) : (
<PermissionDeniedBanner />
- )}
- </TabPanel>
-
- <TabPanel value={TabSections.CertificateRequests}>
- {canReadCertificates ? (
+ ))}
+ {activeTab === TabSections.CertificateRequests &&
+ (canReadCertificates ? (
<CertificateRequestsTab
onViewCertificateFromRequest={handleViewCertificateFromRequest}
/>
) : (
<PermissionDeniedBanner />
- )}
- </TabPanel>
-
- <TabPanel value={TabSections.CertificateProfiles}>
- {canReadCertificateProfiles ? <CertificateProfilesTab /> : <PermissionDeniedBanner />}
- </TabPanel>
-
- <TabPanel value={TabSections.CertificatePolicies}>
- {canReadCertificatePolicies ? <CertificatePoliciesTab /> : <PermissionDeniedBanner />}
- </TabPanel>
- </Tabs>
+ ))}
+ {activeTab === TabSections.CertificateProfiles &&
+ (canReadCertificateProfiles ? <CertificateProfilesTab /> : <PermissionDeniedBanner />)}
+ {activeTab === TabSections.CertificatePolicies &&
+ (canReadCertificatePolicies ? <CertificatePoliciesTab /> : <PermissionDeniedBanner />)}
+ </div>
</div>
</div>
);
diff --git a/frontend/src/pages/cert-manager/PoliciesPage/route.tsx b/frontend/src/pages/cert-manager/PoliciesPage/route.tsx
index 70794f2674..19524feabb 100644
--- a/frontend/src/pages/cert-manager/PoliciesPage/route.tsx
+++ b/frontend/src/pages/cert-manager/PoliciesPage/route.tsx
@@ -1,11 +1,18 @@
import { createFileRoute } from "@tanstack/react-router";
+import { zodValidator } from "@tanstack/zod-adapter";
+import { z } from "zod";
import { PoliciesPage } from "./PoliciesPage";
+const policiesPageSearchSchema = z.object({
+ selectedTab: z.string().optional().default("certificates")
+});
+
export const Route = createFileRoute(
"/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/policies"
)({
component: PoliciesPage,
+ validateSearch: zodValidator(policiesPageSearchSchema),
beforeLoad: ({ context }) => {
return {
breadcrumbs: [
diff --git a/frontend/src/pages/cert-manager/SettingsPage/SettingsPage.tsx b/frontend/src/pages/cert-manager/SettingsPage/SettingsPage.tsx
index 97ec7fe966..ab0fd0b376 100644
--- a/frontend/src/pages/cert-manager/SettingsPage/SettingsPage.tsx
+++ b/frontend/src/pages/cert-manager/SettingsPage/SettingsPage.tsx
@@ -1,31 +1,23 @@
import { Helmet } from "react-helmet";
import { useTranslation } from "react-i18next";
-import { Link } from "@tanstack/react-router";
+import { Link, useSearch } from "@tanstack/react-router";
import { InfoIcon } from "lucide-react";
-import { PageHeader, Tab, TabList, TabPanel, Tabs } from "@app/components/v2";
+import { PageHeader } from "@app/components/v2";
import { useOrganization } from "@app/context";
import { ProjectType } from "@app/hooks/api/projects/types";
import { ProjectGeneralTab } from "@app/pages/project/SettingsPage/components/ProjectGeneralTab";
import { CertificateCleanupTab } from "./components/CertificateCleanupTab";
-const tabs = [
- {
- name: "General",
- key: "tab-project-general",
- Component: ProjectGeneralTab
- },
- {
- name: "Certificate Cleanup",
- key: "tab-certificate-cleanup",
- Component: CertificateCleanupTab
- }
-];
-
export const SettingsPage = () => {
const { t } = useTranslation();
const { currentOrg, isSubOrganization } = useOrganization();
+ const { selectedTab } = useSearch({
+ from: "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/settings"
+ });
+
+ const activeTab = selectedTab || "general";
return (
<div className="flex h-full w-full justify-center bg-bunker-800 text-white">
@@ -45,20 +37,10 @@ export const SettingsPage = () => {
settings?
</Link>
</PageHeader>
- <Tabs orientation="vertical" defaultValue={tabs[0].key}>
- <TabList>
- {tabs.map((tab) => (
- <Tab value={tab.key} variant="project" key={tab.key}>
- {tab.name}
- </Tab>
- ))}
- </TabList>
- {tabs.map(({ key, Component }) => (
- <TabPanel value={key} key={key}>
- <Component />
- </TabPanel>
- ))}
- </Tabs>
+ <div>
+ {activeTab === "general" && <ProjectGeneralTab />}
+ {activeTab === "certificate-cleanup" && <CertificateCleanupTab />}
+ </div>
</div>
</div>
);
diff --git a/frontend/src/pages/cert-manager/SettingsPage/route.tsx b/frontend/src/pages/cert-manager/SettingsPage/route.tsx
index 4f205481a3..2a8ac1da10 100644
--- a/frontend/src/pages/cert-manager/SettingsPage/route.tsx
+++ b/frontend/src/pages/cert-manager/SettingsPage/route.tsx
@@ -1,11 +1,18 @@
import { createFileRoute } from "@tanstack/react-router";
+import { zodValidator } from "@tanstack/zod-adapter";
+import { z } from "zod";
import { SettingsPage } from "./SettingsPage";
+const settingsPageSearchSchema = z.object({
+ selectedTab: z.string().optional().default("general")
+});
+
export const Route = createFileRoute(
"/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/settings"
)({
component: SettingsPage,
+ validateSearch: zodValidator(settingsPageSearchSchema),
beforeLoad: ({ context }) => {
return {
breadcrumbs: [
diff --git a/frontend/src/pages/kms/SettingsPage/SettingsPage.tsx b/frontend/src/pages/kms/SettingsPage/SettingsPage.tsx
index 857f8d4461..56eda913fa 100644
--- a/frontend/src/pages/kms/SettingsPage/SettingsPage.tsx
+++ b/frontend/src/pages/kms/SettingsPage/SettingsPage.tsx
@@ -3,7 +3,7 @@ import { useTranslation } from "react-i18next";
import { Link } from "@tanstack/react-router";
import { InfoIcon } from "lucide-react";
-import { PageHeader, Tab, TabList, TabPanel, Tabs } from "@app/components/v2";
+import { PageHeader, TabPanel, Tabs } from "@app/components/v2";
import { useOrganization } from "@app/context";
import { ProjectType } from "@app/hooks/api/projects/types";
import { ProjectGeneralTab } from "@app/pages/project/SettingsPage/components/ProjectGeneralTab";
@@ -44,13 +44,6 @@ export const SettingsPage = () => {
</Link>
</PageHeader>
<Tabs orientation="vertical" defaultValue={tabs[0].key}>
- <TabList>
- {tabs.map((tab) => (
- <Tab variant="project" value={tab.key} key={tab.key}>
- {tab.name}
- </Tab>
- ))}
- </TabList>
{tabs.map(({ key, Component }) => (
<TabPanel value={key} key={key}>
<Component />
diff --git a/frontend/src/pages/organization/AccessManagementPage/AccessManagementPage.tsx b/frontend/src/pages/organization/AccessManagementPage/AccessManagementPage.tsx
index cde27cb3c9..ff92afe6a0 100644
--- a/frontend/src/pages/organization/AccessManagementPage/AccessManagementPage.tsx
+++ b/frontend/src/pages/organization/AccessManagementPage/AccessManagementPage.tsx
@@ -7,7 +7,7 @@ import { Link, useNavigate, useSearch } from "@tanstack/react-router";
import { InfoIcon } from "lucide-react";
import { OrgPermissionGuardBanner } from "@app/components/permissions/OrgPermissionCan";
-import { Button, PageHeader, Tab, TabList, TabPanel, Tabs } from "@app/components/v2";
+import { Button, PageHeader, TabPanel, Tabs } from "@app/components/v2";
import { ROUTE_PATHS } from "@app/const/routes";
import {
OrgPermissionActions,
@@ -125,19 +125,6 @@ export const AccessManagementPage = () => {
onOpenChange={setIsUpgradePrivilegeSystemModalOpen}
/>
<Tabs orientation="vertical" value={selectedTab} onValueChange={updateSelectedTab}>
- <TabList>
- {tabSections
- .filter((el) => !el.isHidden)
- .map((el) => (
- <Tab
- variant={isSubOrganization ? "namespace" : "org"}
- value={el.key}
- key={`org-access-tab-${el.key}`}
- >
- {el.label}
- </Tab>
- ))}
- </TabList>
{tabSections
.filter((el) => !el.isHidden)
.map(({ key, component: Component }) => (
diff --git a/frontend/src/pages/organization/NetworkingPage/components/NetworkingTabGroup/NetworkingTabGroup.tsx b/frontend/src/pages/organization/NetworkingPage/components/NetworkingTabGroup/NetworkingTabGroup.tsx
index b48b8b1130..bd4e0c21d4 100644
--- a/frontend/src/pages/organization/NetworkingPage/components/NetworkingTabGroup/NetworkingTabGroup.tsx
+++ b/frontend/src/pages/organization/NetworkingPage/components/NetworkingTabGroup/NetworkingTabGroup.tsx
@@ -1,16 +1,12 @@
-import { useNavigate, useSearch } from "@tanstack/react-router";
+import { useSearch } from "@tanstack/react-router";
-import { Tab, TabList, TabPanel, Tabs } from "@app/components/v2";
+import { TabPanel, Tabs } from "@app/components/v2";
import { ROUTE_PATHS } from "@app/const/routes";
-import { useOrganization } from "@app/context";
import { GatewayTab } from "../GatewayTab/GatewayTab";
import { RelayTab } from "../RelayTab/RelayTab";
export const NetworkingTabGroup = () => {
- const navigate = useNavigate({
- from: ROUTE_PATHS.Organization.NetworkingPage.path
- });
const selectedTab = useSearch({
from: ROUTE_PATHS.Organization.NetworkingPage.id,
select: (el) => el.selectedTab,
@@ -18,27 +14,12 @@ export const NetworkingTabGroup = () => {
});
const tabs = [
- { name: "Gateways", key: "gateways", component: GatewayTab },
- { name: "Relays", key: "relays", component: RelayTab }
+ { key: "gateways", component: GatewayTab },
+ { key: "relays", component: RelayTab }
];
- const handleTabChange = (tab: string) => {
- navigate({
- search: { selectedTab: tab }
- });
- };
-
- const { isSubOrganization } = useOrganization();
-
return (
- <Tabs orientation="vertical" value={selectedTab} onValueChange={handleTabChange}>
- <TabList>
- {tabs.map((tab) => (
- <Tab variant={isSubOrganization ? "namespace" : "org"} value={tab.key} key={tab.key}>
- {tab.name}
- </Tab>
- ))}
- </TabList>
+ <Tabs orientation="vertical" value={selectedTab}>
{tabs.map(({ key, component: Component }) => (
<TabPanel value={key} key={`tab-panel-${key}`}>
<Component />
diff --git a/frontend/src/pages/organization/SecretSharingPage/ShareSecretSection.tsx b/frontend/src/pages/organization/SecretSharingPage/ShareSecretSection.tsx
index 7b8b16860d..f63eeee6c4 100644
--- a/frontend/src/pages/organization/SecretSharingPage/ShareSecretSection.tsx
+++ b/frontend/src/pages/organization/SecretSharingPage/ShareSecretSection.tsx
@@ -1,9 +1,8 @@
import { Helmet } from "react-helmet";
-import { useNavigate, useSearch } from "@tanstack/react-router";
+import { useSearch } from "@tanstack/react-router";
-import { Tab, TabList, TabPanel, Tabs } from "@app/components/v2";
+import { TabPanel, Tabs } from "@app/components/v2";
import { ROUTE_PATHS } from "@app/const/routes";
-import { useOrganization } from "@app/context";
import { RequestSecretTab } from "./components/RequestSecret/RequestSecretTab";
import { SecretSharingSettingsTab } from "./components/SecretSharingSettings/SecretSharingSettingsTab";
@@ -16,23 +15,10 @@ enum SecretSharingPageTabs {
}
export const ShareSecretSection = () => {
- const navigate = useNavigate();
- const { isSubOrganization, currentOrg } = useOrganization();
-
const { selectedTab } = useSearch({
from: ROUTE_PATHS.Organization.SecretSharing.id
});
- const updateSelectedTab = (tab: string) => {
- navigate({
- to: ROUTE_PATHS.Organization.SecretSharing.path,
- params: { orgId: currentOrg.id },
- search: (prev) => ({ ...prev, selectedTab: tab as SecretSharingPageTabs })
- });
- };
-
- const tabVariant = isSubOrganization ? "namespace" : "org";
-
return (
<div>
<Helmet>
@@ -41,20 +27,7 @@ export const ShareSecretSection = () => {
<meta property="og:image" content="/images/message.png" />
</Helmet>
- <Tabs orientation="vertical" value={selectedTab} onValueChange={updateSelectedTab}>
- <TabList>
- <Tab variant={tabVariant} value={SecretSharingPageTabs.ShareSecret}>
- Share Secrets
- </Tab>
- <Tab variant={tabVariant} value={SecretSharingPageTabs.RequestSecret}>
- Request Secrets
- </Tab>
- {!isSubOrganization && (
- <Tab variant={tabVariant} value={SecretSharingPageTabs.Settings}>
- Settings
- </Tab>
- )}
- </TabList>
+ <Tabs orientation="vertical" value={selectedTab}>
<TabPanel value={SecretSharingPageTabs.ShareSecret}>
<ShareSecretTab />
</TabPanel>
diff --git a/frontend/src/pages/organization/SettingsPage/components/OrgTabGroup/OrgTabGroup.tsx b/frontend/src/pages/organization/SettingsPage/components/OrgTabGroup/OrgTabGroup.tsx
index 93fb24c883..6d0f489556 100644
--- a/frontend/src/pages/organization/SettingsPage/components/OrgTabGroup/OrgTabGroup.tsx
+++ b/frontend/src/pages/organization/SettingsPage/components/OrgTabGroup/OrgTabGroup.tsx
@@ -1,8 +1,7 @@
-import { useState } from "react";
-import { useSearch } from "@tanstack/react-router";
+import { useNavigate, useSearch } from "@tanstack/react-router";
import { UpgradePlanModal } from "@app/components/license/UpgradePlanModal";
-import { Tab, TabList, TabPanel, Tabs } from "@app/components/v2";
+import { TabPanel, Tabs } from "@app/components/v2";
import { ROUTE_PATHS } from "@app/const/routes";
import { useOrganization, useSubscription } from "@app/context";
import { usePopUp } from "@app/hooks/usePopUp";
@@ -23,7 +22,8 @@ export const OrgTabGroup = () => {
const search = useSearch({
from: ROUTE_PATHS.Organization.SettingsPage.id
});
- const { isSubOrganization } = useOrganization();
+ const navigate = useNavigate();
+ const { currentOrg, isSubOrganization } = useOrganization();
const { subscription } = useSubscription();
const { popUp, handlePopUpOpen, handlePopUpToggle } = usePopUp(["upgradePlan"] as const);
@@ -84,11 +84,10 @@ export const OrgTabGroup = () => {
const visibleTabs = tabs.filter((el) => !el.isHidden);
const defaultTab = visibleTabs.find((t) => !t.requiresFeature)?.key ?? visibleTabs[0].key;
- const initialTab = search.selectedTab
+ const selectedTab = search.selectedTab
? (visibleTabs.find((t) => t.key === search.selectedTab && !t.requiresFeature)?.key ??
defaultTab)
: defaultTab;
- const [selectedTab, setSelectedTab] = useState(initialTab);
const handleTabChange = (key: string) => {
const tab = visibleTabs.find((t) => t.key === key);
@@ -96,19 +95,16 @@ export const OrgTabGroup = () => {
handlePopUpOpen("upgradePlan");
return;
}
- setSelectedTab(key);
+ navigate({
+ to: "/organizations/$orgId/settings",
+ params: { orgId: currentOrg.id },
+ search: { selectedTab: key }
+ });
};
return (
<>
<Tabs orientation="vertical" value={selectedTab} onValueChange={handleTabChange}>
- <TabList>
- {visibleTabs.map((tab) => (
- <Tab variant={isSubOrganization ? "namespace" : "org"} value={tab.key} key={tab.key}>
- {tab.name}
- </Tab>
- ))}
- </TabList>
{visibleTabs
.filter((tab) => !tab.requiresFeature)
.map(({ key, component: Component }) => (
diff --git a/frontend/src/pages/pam/ApprovalsPage/ApprovalsPage.tsx b/frontend/src/pages/pam/ApprovalsPage/ApprovalsPage.tsx
index d9bdbfda53..5b3e197076 100644
--- a/frontend/src/pages/pam/ApprovalsPage/ApprovalsPage.tsx
+++ b/frontend/src/pages/pam/ApprovalsPage/ApprovalsPage.tsx
@@ -1,8 +1,8 @@
import { Helmet } from "react-helmet";
-import { useNavigate, useSearch } from "@tanstack/react-router";
+import { useSearch } from "@tanstack/react-router";
-import { PageHeader, Tab, TabList, TabPanel, Tabs } from "@app/components/v2";
-import { useOrganization, useProject } from "@app/context";
+import { PageHeader } from "@app/components/v2";
+import { useProject } from "@app/context";
import { ApprovalControlTabs } from "@app/types/project";
import { ApprovalRequestTab } from "./components/ApprovalRequestTab";
@@ -10,24 +10,13 @@ import { PolicyTab } from "./components/PolicyTab";
import { RequestGrantTab } from "./components/RequestGrantTab";
const Page = () => {
- const navigate = useNavigate();
- const { currentOrg } = useOrganization();
const { currentProject } = useProject();
const selectedTab = useSearch({
strict: false,
select: (el) => el.selectedTab
});
- const updateSelectedTab = (tab: string) => {
- navigate({
- to: "/organizations/$orgId/projects/pam/$projectId/approvals",
- search: (prev) => ({ ...prev, selectedTab: tab }),
- params: {
- orgId: currentOrg.id,
- projectId: currentProject.id
- }
- });
- };
+ const activeTab = (selectedTab as ApprovalControlTabs) || ApprovalControlTabs.Requests;
return (
<div className="mx-auto flex flex-col justify-between bg-bunker-800 text-white">
@@ -37,28 +26,11 @@ const Page = () => {
title="PAM Approvals"
description="Manage approval workflows, update policy settings, and monitor request statuses."
/>
- <Tabs orientation="vertical" value={selectedTab} onValueChange={updateSelectedTab}>
- <TabList>
- <Tab variant="project" value={ApprovalControlTabs.Requests}>
- Requests
- </Tab>
- <Tab variant="project" value={ApprovalControlTabs.Policies}>
- Policies
- </Tab>
- <Tab variant="project" value={ApprovalControlTabs.Grants}>
- Grants
- </Tab>
- </TabList>
- <TabPanel value={ApprovalControlTabs.Requests}>
- <ApprovalRequestTab />
- </TabPanel>
- <TabPanel value={ApprovalControlTabs.Policies}>
- <PolicyTab />
- </TabPanel>
- <TabPanel value={ApprovalControlTabs.Grants}>
- <RequestGrantTab />
- </TabPanel>
- </Tabs>
+ <div>
+ {activeTab === ApprovalControlTabs.Requests && <ApprovalRequestTab />}
+ {activeTab === ApprovalControlTabs.Policies && <PolicyTab />}
+ {activeTab === ApprovalControlTabs.Grants && <RequestGrantTab />}
+ </div>
</div>
</div>
);
diff --git a/frontend/src/pages/pam/SettingsPage/SettingsPage.tsx b/frontend/src/pages/pam/SettingsPage/SettingsPage.tsx
index 4e7836b574..efcd362139 100644
--- a/frontend/src/pages/pam/SettingsPage/SettingsPage.tsx
+++ b/frontend/src/pages/pam/SettingsPage/SettingsPage.tsx
@@ -3,7 +3,7 @@ import { useTranslation } from "react-i18next";
import { Link } from "@tanstack/react-router";
import { InfoIcon } from "lucide-react";
-import { PageHeader, Tab, TabList, TabPanel, Tabs } from "@app/components/v2";
+import { PageHeader, TabPanel, Tabs } from "@app/components/v2";
import { useOrganization } from "@app/context";
import { ProjectType } from "@app/hooks/api/projects/types";
import { ProjectGeneralTab } from "@app/pages/project/SettingsPage/components/ProjectGeneralTab";
@@ -36,11 +36,6 @@ export const SettingsPage = () => {
</Link>
</PageHeader>
<Tabs orientation="vertical" defaultValue="tab-project-general">
- <TabList>
- <Tab variant="project" value="tab-project-general">
- General
- </Tab>
- </TabList>
<TabPanel value="tab-project-general">
<ProjectGeneralTab />
</TabPanel>
diff --git a/frontend/src/pages/project/AccessControlPage/AccessControlPage.tsx b/frontend/src/pages/project/AccessControlPage/AccessControlPage.tsx
index 2fa567d5e1..7ba8536bca 100644
--- a/frontend/src/pages/project/AccessControlPage/AccessControlPage.tsx
+++ b/frontend/src/pages/project/AccessControlPage/AccessControlPage.tsx
@@ -3,7 +3,7 @@ import { useTranslation } from "react-i18next";
import { Link, useNavigate, useSearch } from "@tanstack/react-router";
import { InfoIcon } from "lucide-react";
-import { PageHeader, Tab, TabList, TabPanel, Tabs } from "@app/components/v2";
+import { PageHeader, TabPanel, Tabs } from "@app/components/v2";
import { useOrganization, useProject } from "@app/context";
import { getProjectBaseURL } from "@app/helpers/project";
import { ProjectType } from "@app/hooks/api/projects/types";
@@ -59,7 +59,7 @@ const Page = () => {
</Link>
</PageHeader>
<Tabs orientation="vertical" value={selectedTab} onValueChange={updateSelectedTab}>
- <TabList>
+ {/* <TabList>
<Tab variant="project" value={ProjectAccessControlTabs.Member}>
Users
</Tab>
@@ -77,7 +77,7 @@ const Page = () => {
<Tab variant="project" value={ProjectAccessControlTabs.Roles}>
Roles
</Tab>
- </TabList>
+ </TabList> */}
<TabPanel value={ProjectAccessControlTabs.Member}>
<MembersTab />
</TabPanel>
diff --git a/frontend/src/pages/secret-manager/IntegrationsListPage/IntegrationsListPage.tsx b/frontend/src/pages/secret-manager/IntegrationsListPage/IntegrationsListPage.tsx
index 4c180fd6d0..876256954b 100644
--- a/frontend/src/pages/secret-manager/IntegrationsListPage/IntegrationsListPage.tsx
+++ b/frontend/src/pages/secret-manager/IntegrationsListPage/IntegrationsListPage.tsx
@@ -1,16 +1,11 @@
import { Helmet } from "react-helmet";
import { useTranslation } from "react-i18next";
-import { useNavigate, useSearch } from "@tanstack/react-router";
+import { useSearch } from "@tanstack/react-router";
import { ProjectPermissionCan } from "@app/components/permissions";
-import { PageHeader, Tab, TabList, TabPanel, Tabs } from "@app/components/v2";
+import { PageHeader, TabPanel, Tabs } from "@app/components/v2";
import { ROUTE_PATHS } from "@app/const/routes";
-import {
- ProjectPermissionActions,
- ProjectPermissionSub,
- useOrganization,
- useProject
-} from "@app/context";
+import { ProjectPermissionActions, ProjectPermissionSub } from "@app/context";
import { ProjectPermissionSecretSyncActions } from "@app/context/ProjectPermissionContext/types";
import { ProjectType } from "@app/hooks/api/projects/types";
import { IntegrationsListPageTabs } from "@app/types/integrations";
@@ -24,28 +19,12 @@ import {
} from "./components";
export const IntegrationsListPage = () => {
- const navigate = useNavigate();
- const { currentOrg } = useOrganization();
- const { currentProject } = useProject();
const { t } = useTranslation();
const { selectedTab } = useSearch({
from: ROUTE_PATHS.SecretManager.IntegrationsListPage.id
});
- const updateSelectedTab = (tab: string) => {
- navigate({
- to: ROUTE_PATHS.SecretManager.IntegrationsListPage.path,
- search: {
- selectedTab: tab as IntegrationsListPageTabs
- },
- params: {
- projectId: currentProject.id,
- orgId: currentOrg.id
- }
- });
- };
-
return (
<>
<Helmet>
@@ -61,24 +40,7 @@ export const IntegrationsListPage = () => {
title="Project Integrations"
description="Manage integrations with third-party services."
/>
- <Tabs orientation="vertical" value={selectedTab} onValueChange={updateSelectedTab}>
- <TabList>
- <Tab variant="project" value={IntegrationsListPageTabs.AppConnections}>
- App Connections
- </Tab>
- <Tab variant="project" value={IntegrationsListPageTabs.FrameworkIntegrations}>
- Framework Integrations
- </Tab>
- <Tab variant="project" value={IntegrationsListPageTabs.InfrastructureIntegrations}>
- Infrastructure Integrations
- </Tab>
- <Tab variant="project" value={IntegrationsListPageTabs.NativeIntegrations}>
- Native Integrations
- </Tab>
- <Tab variant="project" value={IntegrationsListPageTabs.SecretSyncs}>
- Secret Syncs
- </Tab>
- </TabList>
+ <Tabs orientation="vertical" value={selectedTab}>
<TabPanel value={IntegrationsListPageTabs.AppConnections}>
<AppConnectionsTab />
</TabPanel>
diff --git a/frontend/src/pages/secret-manager/SecretApprovalsPage/SecretApprovalsPage.tsx b/frontend/src/pages/secret-manager/SecretApprovalsPage/SecretApprovalsPage.tsx
index 6ce8b0435b..ccf44e0754 100644
--- a/frontend/src/pages/secret-manager/SecretApprovalsPage/SecretApprovalsPage.tsx
+++ b/frontend/src/pages/secret-manager/SecretApprovalsPage/SecretApprovalsPage.tsx
@@ -1,8 +1,9 @@
import { Helmet } from "react-helmet";
import { useTranslation } from "react-i18next";
+import { useSearch } from "@tanstack/react-router";
-import { PageHeader, Tab, TabList, TabPanel, Tabs } from "@app/components/v2";
-import { Badge } from "@app/components/v3";
+import { PageHeader, TabPanel, Tabs } from "@app/components/v2";
+import { ROUTE_PATHS } from "@app/const/routes";
import { useProject } from "@app/context";
import { useGetAccessRequestsCount, useGetSecretApprovalRequestCount } from "@app/hooks/api";
import { ProjectType } from "@app/hooks/api/projects/types";
@@ -13,8 +14,6 @@ import { SecretApprovalRequest } from "./components/SecretApprovalRequest";
enum TabSection {
SecretApprovalRequests = "approval-requests",
- SecretPolicies = "approval-rules",
- ResourcePolicies = "resource-rules",
ResourceApprovalRequests = "resource-requests",
Policies = "policies"
}
@@ -27,11 +26,18 @@ export const SecretApprovalsPage = () => {
projectId
});
const { data: accessApprovalRequestCount } = useGetAccessRequestsCount({ projectSlug });
+
+ const { selectedTab: searchTab } = useSearch({
+ from: ROUTE_PATHS.SecretManager.ApprovalPage.id
+ });
+
const defaultTab =
(accessApprovalRequestCount?.pendingCount || 0) > (secretApprovalReqCount?.open || 0)
? TabSection.ResourceApprovalRequests
: TabSection.SecretApprovalRequests;
+ const selectedTab = searchTab || defaultTab;
+
return (
<div>
<Helmet>
@@ -45,28 +51,7 @@ export const SecretApprovalsPage = () => {
title="Approval Workflows"
description="Create approval policies for any modifications to secrets in sensitive environments and folders."
/>
- <Tabs orientation="vertical" defaultValue={defaultTab}>
- <TabList>
- <Tab variant="project" value={TabSection.SecretApprovalRequests}>
- Change Requests
- {Boolean(secretApprovalReqCount?.open) && (
- <Badge variant="warning" isSquare className="ml-2">
- {secretApprovalReqCount?.open}
- </Badge>
- )}
- </Tab>
- <Tab variant="project" value={TabSection.ResourceApprovalRequests}>
- Access Requests
- {Boolean(accessApprovalRequestCount?.pendingCount) && (
- <Badge variant="warning" isSquare className="ml-2">
- {accessApprovalRequestCount?.pendingCount}
- </Badge>
- )}
- </Tab>
- <Tab variant="project" value={TabSection.Policies}>
- Policies
- </Tab>
- </TabList>
+ <Tabs orientation="vertical" value={selectedTab}>
<TabPanel value={TabSection.SecretApprovalRequests}>
<SecretApprovalRequest />
</TabPanel>
diff --git a/frontend/src/pages/secret-manager/SecretApprovalsPage/route.tsx b/frontend/src/pages/secret-manager/SecretApprovalsPage/route.tsx
index 60f183e2e3..098e13dcc2 100644
--- a/frontend/src/pages/secret-manager/SecretApprovalsPage/route.tsx
+++ b/frontend/src/pages/secret-manager/SecretApprovalsPage/route.tsx
@@ -5,7 +5,8 @@ import { z } from "zod";
import { SecretApprovalsPage } from "./SecretApprovalsPage";
const SecretApprovalPageQueryParams = z.object({
- requestId: z.string().catch("")
+ requestId: z.string().catch(""),
+ selectedTab: z.string().catch("")
});
export const Route = createFileRoute(
diff --git a/frontend/src/pages/secret-manager/SettingsPage/SettingsPage.tsx b/frontend/src/pages/secret-manager/SettingsPage/SettingsPage.tsx
index e17219226e..8610d1044a 100644
--- a/frontend/src/pages/secret-manager/SettingsPage/SettingsPage.tsx
+++ b/frontend/src/pages/secret-manager/SettingsPage/SettingsPage.tsx
@@ -1,9 +1,10 @@
import { Helmet } from "react-helmet";
import { useTranslation } from "react-i18next";
-import { Link } from "@tanstack/react-router";
+import { Link, useSearch } from "@tanstack/react-router";
import { InfoIcon } from "lucide-react";
-import { PageHeader, Tab, TabList, TabPanel, Tabs } from "@app/components/v2";
+import { PageHeader, TabPanel, Tabs } from "@app/components/v2";
+import { ROUTE_PATHS } from "@app/const/routes";
import { useOrganization, useProject } from "@app/context";
import { ProjectType, ProjectVersion } from "@app/hooks/api/projects/types";
import { ProjectGeneralTab } from "@app/pages/project/SettingsPage/components/ProjectGeneralTab";
@@ -17,32 +18,26 @@ import { WorkflowIntegrationTab } from "./components/WorkflowIntegrationSection"
export const SettingsPage = () => {
const { t } = useTranslation();
const { isSubOrganization } = useOrganization();
-
const { currentProject } = useProject();
+
+ const { selectedTab } = useSearch({
+ from: ROUTE_PATHS.SecretManager.SettingsPage.id
+ });
+
const tabs = [
- { name: "General", key: "tab-project-general", Component: ProjectGeneralTab },
- { name: "Secrets Management", key: "tab-secret-general", Component: SecretSettingsTab },
+ { key: "tab-project-general", Component: ProjectGeneralTab },
+ { key: "tab-secret-general", Component: SecretSettingsTab },
{
- name: "Secret Validation Rules",
key: "tab-secret-validation-rules",
Component: SecretValidationRulesTab
},
{
- name: "Encryption",
key: "tab-project-encryption",
isHidden: currentProject?.version !== ProjectVersion.V3,
Component: EncryptionTab
},
- {
- name: "Workflow Integrations",
- key: "tab-workflow-integrations",
- Component: WorkflowIntegrationTab
- },
- {
- name: "Webhooks",
- key: "tab-project-webhooks",
- Component: WebhooksTab
- }
+ { key: "tab-workflow-integrations", Component: WorkflowIntegrationTab },
+ { key: "tab-project-webhooks", Component: WebhooksTab }
];
return (
@@ -67,16 +62,7 @@ export const SettingsPage = () => {
settings?
</Link>
</PageHeader>
- <Tabs orientation="vertical" defaultValue={tabs[0].key}>
- <TabList>
- {tabs
- .filter((el) => !el.isHidden)
- .map((tab) => (
- <Tab variant="project" value={tab.key} key={tab.key}>
- {tab.name}
- </Tab>
- ))}
- </TabList>
+ <Tabs orientation="vertical" value={selectedTab}>
{tabs
.filter((el) => !el.isHidden)
.map(({ key, Component }) => (
diff --git a/frontend/src/pages/secret-manager/SettingsPage/route.tsx b/frontend/src/pages/secret-manager/SettingsPage/route.tsx
index 090671368e..3d841749d2 100644
--- a/frontend/src/pages/secret-manager/SettingsPage/route.tsx
+++ b/frontend/src/pages/secret-manager/SettingsPage/route.tsx
@@ -1,11 +1,21 @@
-import { createFileRoute } from "@tanstack/react-router";
+import { createFileRoute, stripSearchParams } from "@tanstack/react-router";
+import { zodValidator } from "@tanstack/zod-adapter";
+import { z } from "zod";
import { SettingsPage } from "./SettingsPage";
+const SettingsPageQueryParams = z.object({
+ selectedTab: z.string().catch("tab-project-general")
+});
+
export const Route = createFileRoute(
"/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-management/$projectId/_secret-manager-layout/settings"
)({
component: SettingsPage,
+ validateSearch: zodValidator(SettingsPageQueryParams),
+ search: {
+ middlewares: [stripSearchParams({ selectedTab: "" })]
+ },
beforeLoad: ({ context }) => {
return {
breadcrumbs: [
diff --git a/frontend/src/pages/secret-scanning/SettingsPage/SettingsPage.tsx b/frontend/src/pages/secret-scanning/SettingsPage/SettingsPage.tsx
index 398b5c3406..2b1d9ad9b3 100644
--- a/frontend/src/pages/secret-scanning/SettingsPage/SettingsPage.tsx
+++ b/frontend/src/pages/secret-scanning/SettingsPage/SettingsPage.tsx
@@ -1,10 +1,10 @@
import { Helmet } from "react-helmet";
import { useTranslation } from "react-i18next";
-import { Link } from "@tanstack/react-router";
+import { Link, useSearch } from "@tanstack/react-router";
import { InfoIcon } from "lucide-react";
import { ProjectPermissionCan } from "@app/components/permissions";
-import { PageHeader, Tab, TabList, TabPanel, Tabs } from "@app/components/v2";
+import { PageHeader } from "@app/components/v2";
import { ProjectPermissionSub, useOrganization } from "@app/context";
import { ProjectPermissionSecretScanningConfigActions } from "@app/context/ProjectPermissionContext/types";
import { ProjectType } from "@app/hooks/api/projects/types";
@@ -15,6 +15,11 @@ import { ProjectScanningConfigTab } from "./components/ProjectScanningConfigTab"
export const SettingsPage = () => {
const { t } = useTranslation();
const { currentOrg, isSubOrganization } = useOrganization();
+ const { selectedTab } = useSearch({
+ from: "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-scanning/$projectId/_secret-scanning-layout/settings"
+ });
+
+ const activeTab = selectedTab || "general";
return (
<div className="flex h-full w-full justify-center bg-bunker-800 text-white">
@@ -38,19 +43,9 @@ export const SettingsPage = () => {
settings?
</Link>
</PageHeader>
- <Tabs orientation="vertical" defaultValue="tab-project-general">
- <TabList>
- <Tab variant="project" value="tab-project-general">
- General
- </Tab>
- <Tab variant="project" value="tab-project-secret-scanning">
- Scanning Settings
- </Tab>
- </TabList>
- <TabPanel value="tab-project-general">
- <ProjectGeneralTab />
- </TabPanel>
- <TabPanel value="tab-project-secret-scanning">
+ <div>
+ {activeTab === "general" && <ProjectGeneralTab />}
+ {activeTab === "scanning-settings" && (
<ProjectPermissionCan
I={ProjectPermissionSecretScanningConfigActions.Read}
a={ProjectPermissionSub.SecretScanningConfigs}
@@ -58,8 +53,8 @@ export const SettingsPage = () => {
>
<ProjectScanningConfigTab />
</ProjectPermissionCan>
- </TabPanel>
- </Tabs>
+ )}
+ </div>
</div>
</div>
);
diff --git a/frontend/src/pages/secret-scanning/SettingsPage/route.tsx b/frontend/src/pages/secret-scanning/SettingsPage/route.tsx
index b4d4296a39..14faa12517 100644
--- a/frontend/src/pages/secret-scanning/SettingsPage/route.tsx
+++ b/frontend/src/pages/secret-scanning/SettingsPage/route.tsx
@@ -1,11 +1,18 @@
import { createFileRoute } from "@tanstack/react-router";
+import { zodValidator } from "@tanstack/zod-adapter";
+import { z } from "zod";
import { SettingsPage } from "./SettingsPage";
+const settingsPageSearchSchema = z.object({
+ selectedTab: z.string().optional().default("general")
+});
+
export const Route = createFileRoute(
"/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-scanning/$projectId/_secret-scanning-layout/settings"
)({
component: SettingsPage,
+ validateSearch: zodValidator(settingsPageSearchSchema),
beforeLoad: ({ context }) => {
return {
breadcrumbs: [