Skip to content

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

fix: UI polishin

Piyush Guptab409537c4546
diff --git a/backend/src/ee/services/license/license-fns.ts b/backend/src/ee/services/license/license-fns.ts
index d808c01815..09ff9e1081 100644
--- a/backend/src/ee/services/license/license-fns.ts
+++ b/backend/src/ee/services/license/license-fns.ts
@@ -15,7 +15,7 @@ export const isOfflineLicenseKey = (licenseKey: string): boolean => {
return "signature" in contents && "license" in contents;
} catch (error) {
- return true;
+ return false;
}
};
@@ -25,7 +25,7 @@ export const getLicenseKeyConfig = (
const cfg = config || getConfig();
if (!cfg) {
- return { isValid: true };
+ return { isValid: false };
}
const licenseKey = cfg.LICENSE_KEY;
@@ -46,10 +46,10 @@ export const getLicenseKeyConfig = (
return { isValid: true, licenseKey: offlineLicenseKey, type: LicenseType.Offline };
}
- return { isValid: true };
+ return { isValid: false };
}
- return { isValid: true };
+ return { isValid: false };
};
export const getDefaultOnPremFeatures = (): TFeatureSet => ({
@@ -64,56 +64,56 @@ export const getDefaultOnPremFeatures = (): TFeatureSet => ({
environmentsUsed: 0,
identityLimit: null,
identitiesUsed: 0,
- dynamicSecret: true,
+ dynamicSecret: false,
secretVersioning: true,
- pitRecovery: true,
- ipAllowlisting: true,
- rbac: true,
- githubOrgSync: true,
- customRateLimits: true,
- subOrganization: true,
- customAlerts: true,
- secretAccessInsights: true,
- auditLogs: true,
+ pitRecovery: false,
+ ipAllowlisting: false,
+ rbac: false,
+ githubOrgSync: false,
+ customRateLimits: false,
+ subOrganization: false,
+ customAlerts: false,
+ secretAccessInsights: false,
+ auditLogs: false,
auditLogsRetentionDays: 0,
- auditLogStreams: true,
+ auditLogStreams: false,
auditLogStreamLimit: 3,
- samlSSO: true,
- enforceGoogleSSO: true,
- hsm: true,
- oidcSSO: true,
- scim: true,
- ldap: true,
- groups: true,
+ samlSSO: false,
+ enforceGoogleSSO: false,
+ hsm: false,
+ oidcSSO: false,
+ scim: false,
+ ldap: false,
+ groups: false,
status: null,
trial_end: null,
has_used_trial: true,
- secretApproval: true,
- secretRotation: true,
- caCrl: true,
- instanceUserManagement: true,
- externalKms: true,
+ secretApproval: false,
+ secretRotation: false,
+ caCrl: false,
+ instanceUserManagement: false,
+ externalKms: false,
rateLimits: {
readLimit: 60,
writeLimit: 200,
secretsLimit: 40
},
- pkiEst: true,
- pkiAcme: true,
- enforceMfa: true,
- projectTemplates: true,
- kmip: true,
- gateway: true,
- sshHostGroups: true,
- secretScanning: true,
- enterpriseSecretSyncs: true,
- enterpriseCertificateSyncs: true,
- enterpriseAppConnections: true,
- fips: true,
- eventSubscriptions: true,
- machineIdentityAuthTemplates: true,
- pkiLegacyTemplates: true,
- pam: true
+ pkiEst: false,
+ pkiAcme: false,
+ enforceMfa: false,
+ projectTemplates: false,
+ kmip: false,
+ gateway: false,
+ sshHostGroups: false,
+ secretScanning: false,
+ enterpriseSecretSyncs: false,
+ enterpriseCertificateSyncs: false,
+ enterpriseAppConnections: false,
+ fips: false,
+ eventSubscriptions: false,
+ machineIdentityAuthTemplates: false,
+ pkiLegacyTemplates: false,
+ pam: false
});
export const setupLicenseRequestWithStore = (
diff --git a/frontend/src/components/secret-syncs/forms/SecretSyncDestinationFields/OctopusDeploySyncFields.tsx b/frontend/src/components/secret-syncs/forms/SecretSyncDestinationFields/OctopusDeploySyncFields.tsx
index 9a9e5a4c32..c241ff08b0 100644
--- a/frontend/src/components/secret-syncs/forms/SecretSyncDestinationFields/OctopusDeploySyncFields.tsx
+++ b/frontend/src/components/secret-syncs/forms/SecretSyncDestinationFields/OctopusDeploySyncFields.tsx
@@ -5,14 +5,14 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { SecretSyncConnectionField } from "@app/components/secret-syncs/forms/SecretSyncConnectionField";
import {
- Accordion,
- AccordionContent,
- AccordionItem,
- AccordionTrigger,
FilterableSelect,
FormControl,
Select,
SelectItem,
+ Tab,
+ TabList,
+ TabPanel,
+ Tabs,
Tooltip
} from "@app/components/v2";
import {
@@ -67,374 +67,383 @@ export const OctopusDeploySyncFields = () => {
}}
/>
- <Controller
- name="destinationConfig.spaceId"
- control={control}
- render={({ field: { value, onChange }, fieldState: { error } }) => (
- <FormControl
- isError={Boolean(error)}
- errorText={error?.message}
- label="Space"
- helperText={
- <Tooltip
- className="max-w-md"
- content="Select the Octopus Deploy space where your project is located."
- >
- <div>
- <span>Don&#39;t see the space you&#39;re looking for?</span>{" "}
- <FontAwesomeIcon icon={faCircleInfo} className="text-mineshaft-400" />
- </div>
- </Tooltip>
- }
- >
- <FilterableSelect
- menuPlacement="top"
- isLoading={isSpacesLoading && Boolean(connectionId)}
- isDisabled={!connectionId}
- value={spaces?.find((space) => space.id === value) ?? null}
- onChange={(option) => {
- const selectedSpace = option as SingleValue<TOctopusDeploySpace>;
- onChange(selectedSpace?.id ?? null);
- setValue("destinationConfig.spaceName", selectedSpace?.name ?? "");
- setValue("destinationConfig.projectId", "");
- setValue("destinationConfig.projectName", "");
- setValue("destinationConfig.scopeValues", undefined);
- }}
- options={spaces}
- placeholder={spaces?.length ? "Select a space..." : "No spaces found..."}
- getOptionLabel={(option) => option.name}
- getOptionValue={(option) => option.id}
- />
- </FormControl>
- )}
- />
+ <Tabs defaultValue="general" className="mt-4">
+ <TabList className="border-b border-mineshaft-600 bg-mineshaft-800 p-0">
+ <Tab value="general">General</Tab>
+ <Tab value="advanced">Advanced</Tab>
+ </TabList>
- <Controller
- name="destinationConfig.scope"
- control={control}
- defaultValue={OctopusDeploySyncScope.Project}
- render={({ field: { value, onChange }, fieldState: { error } }) => (
- <FormControl
- isError={Boolean(error)}
- errorText={error?.message}
- label="Scope"
- helperText="Select the scope for this sync configuration."
- >
- <Select
- value={value || OctopusDeploySyncScope.Project}
- onValueChange={(val) => {
- onChange(val);
- setValue("destinationConfig.projectId", "");
- setValue("destinationConfig.projectName", "");
- setValue("destinationConfig.scopeValues", undefined);
- }}
- className="w-full border border-mineshaft-500 capitalize"
- position="popper"
- placeholder="Select a scope..."
- dropdownContainerClassName="max-w-none"
- >
- {Object.values(OctopusDeploySyncScope).map((scopeValue) => (
- <SelectItem className="capitalize" value={scopeValue} key={scopeValue}>
- {scopeValue}
- </SelectItem>
- ))}
- </Select>
- </FormControl>
- )}
- />
+ <TabPanel value="general">
+ <div className="space-y-4">
+ <Controller
+ name="destinationConfig.spaceId"
+ control={control}
+ render={({ field: { value, onChange }, fieldState: { error } }) => (
+ <FormControl
+ isError={Boolean(error)}
+ errorText={error?.message}
+ label="Space"
+ helperText={
+ <Tooltip
+ className="max-w-md"
+ content="Select the Octopus Deploy space where your project is located."
+ >
+ <div>
+ <span>Don&#39;t see the space you&#39;re looking for?</span>{" "}
+ <FontAwesomeIcon icon={faCircleInfo} className="text-mineshaft-400" />
+ </div>
+ </Tooltip>
+ }
+ >
+ <FilterableSelect
+ menuPlacement="top"
+ isLoading={isSpacesLoading && Boolean(connectionId)}
+ isDisabled={!connectionId}
+ value={spaces?.find((space) => space.id === value) ?? null}
+ onChange={(option) => {
+ const selectedSpace = option as SingleValue<TOctopusDeploySpace>;
+ onChange(selectedSpace?.id ?? null);
+ setValue("destinationConfig.spaceName", selectedSpace?.name ?? "");
+ setValue("destinationConfig.projectId", "");
+ setValue("destinationConfig.projectName", "");
+ setValue("destinationConfig.scopeValues", undefined);
+ }}
+ options={spaces}
+ placeholder={spaces?.length ? "Select a space..." : "No spaces found..."}
+ getOptionLabel={(option) => option.name}
+ getOptionValue={(option) => option.id}
+ />
+ </FormControl>
+ )}
+ />
- {scope === OctopusDeploySyncScope.Project && (
- <Controller
- name="destinationConfig.projectId"
- control={control}
- render={({ field: { value, onChange }, fieldState: { error } }) => (
- <FormControl
- isError={Boolean(error)}
- errorText={error?.message}
- label="Project"
- helperText={
- <Tooltip
- className="max-w-md"
- content="Ensure the project exists in the selected space."
+ <Controller
+ name="destinationConfig.scope"
+ control={control}
+ defaultValue={OctopusDeploySyncScope.Project}
+ render={({ field: { value, onChange }, fieldState: { error } }) => (
+ <FormControl
+ isError={Boolean(error)}
+ errorText={error?.message}
+ label="Scope"
+ helperText="Select the scope for this sync configuration."
>
- <div>
- <span>Don&#39;t see the project you&#39;re looking for?</span>{" "}
- <FontAwesomeIcon icon={faCircleInfo} className="text-mineshaft-400" />
- </div>
- </Tooltip>
- }
- >
- <FilterableSelect
- menuPlacement="top"
- isLoading={isProjectsLoading && Boolean(connectionId && spaceId)}
- isDisabled={Boolean(!connectionId || !spaceId)}
- value={projects?.find((project) => project.id === value) ?? null}
- onChange={(option) => {
- const selectedProject = option as SingleValue<TOctopusDeployProject>;
- onChange(selectedProject?.id ?? null);
- setValue("destinationConfig.projectName", selectedProject?.name ?? "");
- setValue("destinationConfig.scopeValues", undefined);
- }}
- options={projects}
- placeholder={
- spaceId && projects?.length ? "Select a project..." : "No projects found..."
- }
- getOptionLabel={(option) => option.name}
- getOptionValue={(option) => option.id}
+ <Select
+ value={value || OctopusDeploySyncScope.Project}
+ onValueChange={(val) => {
+ onChange(val);
+ setValue("destinationConfig.projectId", "");
+ setValue("destinationConfig.projectName", "");
+ setValue("destinationConfig.scopeValues", undefined);
+ }}
+ className="w-full border border-mineshaft-500 capitalize"
+ position="popper"
+ placeholder="Select a scope..."
+ dropdownContainerClassName="max-w-none"
+ >
+ {Object.values(OctopusDeploySyncScope).map((scopeValue) => (
+ <SelectItem className="capitalize" value={scopeValue} key={scopeValue}>
+ {scopeValue}
+ </SelectItem>
+ ))}
+ </Select>
+ </FormControl>
+ )}
+ />
+
+ {scope === OctopusDeploySyncScope.Project && (
+ <Controller
+ name="destinationConfig.projectId"
+ control={control}
+ render={({ field: { value, onChange }, fieldState: { error } }) => (
+ <FormControl
+ isError={Boolean(error)}
+ errorText={error?.message}
+ label="Project"
+ helperText={
+ <Tooltip
+ className="max-w-md"
+ content="Ensure the project exists in the selected space."
+ >
+ <div>
+ <span>Don&#39;t see the project you&#39;re looking for?</span>{" "}
+ <FontAwesomeIcon icon={faCircleInfo} className="text-mineshaft-400" />
+ </div>
+ </Tooltip>
+ }
+ >
+ <FilterableSelect
+ menuPlacement="top"
+ isLoading={isProjectsLoading && Boolean(connectionId && spaceId)}
+ isDisabled={Boolean(!connectionId || !spaceId)}
+ value={projects?.find((project) => project.id === value) ?? null}
+ onChange={(option) => {
+ const selectedProject = option as SingleValue<TOctopusDeployProject>;
+ onChange(selectedProject?.id ?? null);
+ setValue("destinationConfig.projectName", selectedProject?.name ?? "");
+ setValue("destinationConfig.scopeValues", undefined);
+ }}
+ options={projects}
+ placeholder={
+ spaceId && projects?.length ? "Select a project..." : "No projects found..."
+ }
+ getOptionLabel={(option) => option.name}
+ getOptionValue={(option) => option.id}
+ />
+ </FormControl>
+ )}
/>
- </FormControl>
- )}
- />
- )}
+ )}
+ </div>
+ </TabPanel>
- {scope === OctopusDeploySyncScope.Project && projectId && (
- <Accordion type="single" collapsible className="w-full bg-mineshaft-700">
- <AccordionItem value="scope-values" className="overflow-visible">
- <AccordionTrigger>Scope Values (Optional)</AccordionTrigger>
- <AccordionContent className="max-h-96 overflow-y-auto">
- <div className="grid grid-cols-2 gap-x-4">
- {/* Environments */}
- <Controller
- name="destinationConfig.scopeValues.environments"
- control={control}
- render={({ field: { value, onChange }, fieldState: { error } }) => (
- <FormControl
- isError={Boolean(error)}
- errorText={error?.message}
- label="Environments"
- isOptional
- >
- <FilterableSelect
- isMulti
- menuPlacement="bottom"
- menuPosition="absolute"
- isLoading={isScopeValuesLoading}
- value={
- scopeValuesData?.environments?.filter((opt) =>
- (value || []).includes(opt.id)
- ) || []
- }
- onChange={(options) => {
- const selectedIds = (options as MultiValue<TScopeValueOption>).map(
- (opt) => opt.id
- );
- onChange(selectedIds.length > 0 ? selectedIds : undefined);
- }}
- options={scopeValuesData?.environments || []}
- placeholder={
- scopeValuesData?.environments?.length
- ? "Select environments..."
- : "No environments found..."
- }
- getOptionLabel={(option) => option.name}
- getOptionValue={(option) => option.id}
- />
- </FormControl>
- )}
- />
+ <TabPanel value="advanced" className="grow">
+ {scope === OctopusDeploySyncScope.Project && projectId ? (
+ <div className="max-h-96 overflow-y-auto">
+ {/* Environments */}
+ <Controller
+ name="destinationConfig.scopeValues.environments"
+ control={control}
+ render={({ field: { value, onChange }, fieldState: { error } }) => (
+ <FormControl
+ isError={Boolean(error)}
+ errorText={error?.message}
+ label="Environments"
+ isOptional
+ >
+ <FilterableSelect
+ isMulti
+ menuPlacement="bottom"
+ menuPosition="absolute"
+ isLoading={isScopeValuesLoading}
+ value={
+ scopeValuesData?.environments?.filter((opt) =>
+ (value || []).includes(opt.id)
+ ) || []
+ }
+ onChange={(options) => {
+ const selectedIds = (options as MultiValue<TScopeValueOption>).map(
+ (opt) => opt.id
+ );
+ onChange(selectedIds.length > 0 ? selectedIds : undefined);
+ }}
+ options={scopeValuesData?.environments || []}
+ placeholder={
+ scopeValuesData?.environments?.length
+ ? "Select environments..."
+ : "No environments found..."
+ }
+ getOptionLabel={(option) => option.name}
+ getOptionValue={(option) => option.id}
+ />
+ </FormControl>
+ )}
+ />
- {/* Target Tags */}
- <Controller
- name="destinationConfig.scopeValues.roles"
- control={control}
- render={({ field: { value, onChange }, fieldState: { error } }) => (
- <FormControl
- isError={Boolean(error)}
- errorText={error?.message}
- label="Target Tags"
- isOptional
- >
- <FilterableSelect
- isMulti
- menuPlacement="bottom"
- menuPosition="absolute"
- isLoading={isScopeValuesLoading}
- value={
- scopeValuesData?.roles?.filter((opt) => (value || []).includes(opt.id)) ||
- []
- }
- onChange={(options) => {
- const selectedIds = (options as MultiValue<TScopeValueOption>).map(
- (opt) => opt.id
- );
- onChange(selectedIds.length > 0 ? selectedIds : undefined);
- }}
- options={scopeValuesData?.roles || []}
- placeholder={
- scopeValuesData?.roles?.length
- ? "Select target tags..."
- : "No target tags found..."
- }
- getOptionLabel={(option) => option.name}
- getOptionValue={(option) => option.id}
- />
- </FormControl>
- )}
- />
+ {/* Target Tags */}
+ <Controller
+ name="destinationConfig.scopeValues.roles"
+ control={control}
+ render={({ field: { value, onChange }, fieldState: { error } }) => (
+ <FormControl
+ isError={Boolean(error)}
+ errorText={error?.message}
+ label="Target Tags"
+ isOptional
+ >
+ <FilterableSelect
+ isMulti
+ menuPlacement="bottom"
+ menuPosition="absolute"
+ isLoading={isScopeValuesLoading}
+ value={
+ scopeValuesData?.roles?.filter((opt) => (value || []).includes(opt.id)) ||
+ []
+ }
+ onChange={(options) => {
+ const selectedIds = (options as MultiValue<TScopeValueOption>).map(
+ (opt) => opt.id
+ );
+ onChange(selectedIds.length > 0 ? selectedIds : undefined);
+ }}
+ options={scopeValuesData?.roles || []}
+ placeholder={
+ scopeValuesData?.roles?.length
+ ? "Select target tags..."
+ : "No target tags found..."
+ }
+ getOptionLabel={(option) => option.name}
+ getOptionValue={(option) => option.id}
+ />
+ </FormControl>
+ )}
+ />
- {/* Targets */}
- <Controller
- name="destinationConfig.scopeValues.machines"
- control={control}
- render={({ field: { value, onChange }, fieldState: { error } }) => (
- <FormControl
- isError={Boolean(error)}
- errorText={error?.message}
- label="Targets"
- isOptional
- >
- <FilterableSelect
- isMulti
- menuPlacement="top"
- menuPosition="absolute"
- isLoading={isScopeValuesLoading}
- value={
- scopeValuesData?.machines?.filter((opt) =>
- (value || []).includes(opt.id)
- ) || []
- }
- onChange={(options) => {
- const selectedIds = (options as MultiValue<TScopeValueOption>).map(
- (opt) => opt.id
- );
- onChange(selectedIds.length > 0 ? selectedIds : undefined);
- }}
- options={scopeValuesData?.machines || []}
- placeholder={
- scopeValuesData?.machines?.length
- ? "Select targets..."
- : "No targets found..."
- }
- getOptionLabel={(option) => option.name}
- getOptionValue={(option) => option.id}
- />
- </FormControl>
- )}
- />
- {/* Processes */}
- <Controller
- name="destinationConfig.scopeValues.processes"
- control={control}
- render={({ field: { value, onChange }, fieldState: { error } }) => (
- <FormControl
- isError={Boolean(error)}
- errorText={error?.message}
- label="Processes"
- isOptional
- >
- <FilterableSelect
- isMulti
- menuPlacement="top"
- menuPosition="absolute"
- isLoading={isScopeValuesLoading}
- value={
- scopeValuesData?.processes?.filter((opt) =>
- (value || []).includes(opt.id)
- ) || []
- }
- onChange={(options) => {
- const selectedIds = (options as MultiValue<TScopeValueOption>).map(
- (opt) => opt.id
- );
- onChange(selectedIds.length > 0 ? selectedIds : undefined);
- }}
- options={scopeValuesData?.processes || []}
- placeholder={
- scopeValuesData?.processes?.length
- ? "Select processes..."
- : "No processes found..."
- }
- getOptionLabel={(option) => option.name}
- getOptionValue={(option) => option.id}
- />
- </FormControl>
- )}
- />
+ {/* Targets */}
+ <Controller
+ name="destinationConfig.scopeValues.machines"
+ control={control}
+ render={({ field: { value, onChange }, fieldState: { error } }) => (
+ <FormControl
+ isError={Boolean(error)}
+ errorText={error?.message}
+ label="Targets"
+ isOptional
+ >
+ <FilterableSelect
+ isMulti
+ menuPlacement="top"
+ menuPosition="absolute"
+ isLoading={isScopeValuesLoading}
+ value={
+ scopeValuesData?.machines?.filter((opt) =>
+ (value || []).includes(opt.id)
+ ) || []
+ }
+ onChange={(options) => {
+ const selectedIds = (options as MultiValue<TScopeValueOption>).map(
+ (opt) => opt.id
+ );
+ onChange(selectedIds.length > 0 ? selectedIds : undefined);
+ }}
+ options={scopeValuesData?.machines || []}
+ placeholder={
+ scopeValuesData?.machines?.length
+ ? "Select targets..."
+ : "No targets found..."
+ }
+ getOptionLabel={(option) => option.name}
+ getOptionValue={(option) => option.id}
+ />
+ </FormControl>
+ )}
+ />
+ {/* Processes */}
+ <Controller
+ name="destinationConfig.scopeValues.processes"
+ control={control}
+ render={({ field: { value, onChange }, fieldState: { error } }) => (
+ <FormControl
+ isError={Boolean(error)}
+ errorText={error?.message}
+ label="Processes"
+ isOptional
+ >
+ <FilterableSelect
+ isMulti
+ menuPlacement="top"
+ menuPosition="absolute"
+ isLoading={isScopeValuesLoading}
+ value={
+ scopeValuesData?.processes?.filter((opt) =>
+ (value || []).includes(opt.id)
+ ) || []
+ }
+ onChange={(options) => {
+ const selectedIds = (options as MultiValue<TScopeValueOption>).map(
+ (opt) => opt.id
+ );
+ onChange(selectedIds.length > 0 ? selectedIds : undefined);
+ }}
+ options={scopeValuesData?.processes || []}
+ placeholder={
+ scopeValuesData?.processes?.length
+ ? "Select processes..."
+ : "No processes found..."
+ }
+ getOptionLabel={(option) => option.name}
+ getOptionValue={(option) => option.id}
+ />
+ </FormControl>
+ )}
+ />
- {/* Deployment Steps */}
- <Controller
- name="destinationConfig.scopeValues.actions"
- control={control}
- render={({ field: { value, onChange }, fieldState: { error } }) => (
- <FormControl
- isError={Boolean(error)}
- errorText={error?.message}
- label="Deployment Steps"
- isOptional
- >
- <FilterableSelect
- isMulti
- menuPlacement="top"
- menuPosition="absolute"
- isLoading={isScopeValuesLoading}
- value={
- scopeValuesData?.actions?.filter((opt) =>
- (value || []).includes(opt.id)
- ) || []
- }
- onChange={(options) => {
- const selectedIds = (options as MultiValue<TScopeValueOption>).map(
- (opt) => opt.id
- );
- onChange(selectedIds.length > 0 ? selectedIds : undefined);
- }}
- options={scopeValuesData?.actions || []}
- placeholder={
- scopeValuesData?.actions?.length
- ? "Select deployment steps..."
- : "No deployment steps found..."
- }
- getOptionLabel={(option) => option.name}
- getOptionValue={(option) => option.id}
- />
- </FormControl>
- )}
- />
+ {/* Deployment Steps */}
+ <Controller
+ name="destinationConfig.scopeValues.actions"
+ control={control}
+ render={({ field: { value, onChange }, fieldState: { error } }) => (
+ <FormControl
+ isError={Boolean(error)}
+ errorText={error?.message}
+ label="Deployment Steps"
+ isOptional
+ >
+ <FilterableSelect
+ isMulti
+ menuPlacement="top"
+ menuPosition="absolute"
+ isLoading={isScopeValuesLoading}
+ value={
+ scopeValuesData?.actions?.filter((opt) => (value || []).includes(opt.id)) ||
+ []
+ }
+ onChange={(options) => {
+ const selectedIds = (options as MultiValue<TScopeValueOption>).map(
+ (opt) => opt.id
+ );
+ onChange(selectedIds.length > 0 ? selectedIds : undefined);
+ }}
+ options={scopeValuesData?.actions || []}
+ placeholder={
+ scopeValuesData?.actions?.length
+ ? "Select deployment steps..."
+ : "No deployment steps found..."
+ }
+ getOptionLabel={(option) => option.name}
+ getOptionValue={(option) => option.id}
+ />
+ </FormControl>
+ )}
+ />
- {/* Channels */}
- <Controller
- name="destinationConfig.scopeValues.channels"
- control={control}
- render={({ field: { value, onChange }, fieldState: { error } }) => (
- <FormControl
- isError={Boolean(error)}
- errorText={error?.message}
- label="Channels"
- isOptional
- >
- <FilterableSelect
- isMulti
- menuPlacement="top"
- menuPosition="absolute"
- isLoading={isScopeValuesLoading}
- value={
- scopeValuesData?.channels?.filter((opt) =>
- (value || []).includes(opt.id)
- ) || []
- }
- onChange={(options) => {
- const selectedIds = (options as MultiValue<TScopeValueOption>).map(
- (opt) => opt.id
- );
- onChange(selectedIds.length > 0 ? selectedIds : undefined);
- }}
- options={scopeValuesData?.channels || []}
- placeholder={
- scopeValuesData?.channels?.length
- ? "Select channels..."
- : "No channels found..."
- }
- getOptionLabel={(option) => option.name}
- getOptionValue={(option) => option.id}
- />
- </FormControl>
- )}
- />
- </div>
- </AccordionContent>
- </AccordionItem>
- </Accordion>
- )}
+ {/* Channels */}
+ <Controller
+ name="destinationConfig.scopeValues.channels"
+ control={control}
+ render={({ field: { value, onChange }, fieldState: { error } }) => (
+ <FormControl
+ isError={Boolean(error)}
+ errorText={error?.message}
+ label="Channels"
+ isOptional
+ >
+ <FilterableSelect
+ isMulti
+ menuPlacement="top"
+ menuPosition="absolute"
+ isLoading={isScopeValuesLoading}
+ value={
+ scopeValuesData?.channels?.filter((opt) =>
+ (value || []).includes(opt.id)
+ ) || []
+ }
+ onChange={(options) => {
+ const selectedIds = (options as MultiValue<TScopeValueOption>).map(
+ (opt) => opt.id
+ );
+ onChange(selectedIds.length > 0 ? selectedIds : undefined);
+ }}
+ options={scopeValuesData?.channels || []}
+ placeholder={
+ scopeValuesData?.channels?.length
+ ? "Select channels..."
+ : "No channels found..."
+ }
+ getOptionLabel={(option) => option.name}
+ getOptionValue={(option) => option.id}
+ />
+ </FormControl>
+ )}
+ />
+ </div>
+ ) : (
+ <div className="py-8 text-center text-mineshaft-400">
+ Please select a project in the Config tab to configure scope values.
+ </div>
+ )}
+ </TabPanel>
+ </Tabs>
</>
);
};