Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: label template settings that require an enterprise license appropriately#12952

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Parkreiner merged 1 commit intomainfromenterprise-template-settings
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -61,6 +61,7 @@ export interface TemplateSettingsForm {
// Helpful to show field errors on Storybook
initialTouched?: FormikTouched<UpdateTemplateMeta>;
accessControlEnabled: boolean;
advancedSchedulingEnabled: boolean;
portSharingExperimentEnabled: boolean;
portSharingControlsEnabled: boolean;
}
Expand All@@ -73,6 +74,7 @@ export const TemplateSettingsForm: FC<TemplateSettingsForm> = ({
isSubmitting,
initialTouched,
accessControlEnabled,
advancedSchedulingEnabled,
portSharingExperimentEnabled,
portSharingControlsEnabled,
}) => {
Expand DownExpand Up@@ -195,39 +197,54 @@ export const TemplateSettingsForm: FC<TemplateSettingsForm> = ({
</Stack>
</Stack>
</label>
<label htmlFor="require_active_version">
<Stack direction="row" spacing={1}>
<Checkbox
id="require_active_version"
name="require_active_version"
checked={form.values.require_active_version}
onChange={form.handleChange}
/>
<Stack spacing={2}>
<label htmlFor="require_active_version">
<Stack direction="row" spacing={1}>
<Checkbox
id="require_active_version"
name="require_active_version"
checked={form.values.require_active_version}
onChange={form.handleChange}
disabled={
!template.require_active_version &&
!advancedSchedulingEnabled
}
/>

<Stack direction="column" spacing={0.5}>
<Stack
direction="row"
alignItems="center"
spacing={0.5}
css={styles.optionText}
>
Require workspaces automatically update when started.
<HelpTooltip>
<HelpTooltipTrigger />
<HelpTooltipContent>
<HelpTooltipText>
This setting is not enforced for template admins.
</HelpTooltipText>
</HelpTooltipContent>
</HelpTooltip>
<Stack direction="column" spacing={0.5}>
<Stack
direction="row"
alignItems="center"
spacing={0.5}
css={styles.optionText}
>
Require workspaces automatically update when started.
<HelpTooltip>
<HelpTooltipTrigger />
<HelpTooltipContent>
<HelpTooltipText>
This setting is not enforced for template admins.
</HelpTooltipText>
</HelpTooltipContent>
</HelpTooltip>
</Stack>
<span css={styles.optionHelperText}>
Workspaces that are manually started or auto-started will
use the active template version.
</span>
</Stack>
</Stack>
</label>

{!advancedSchedulingEnabled && (
<Stack direction="row">
<EnterpriseBadge />
<span css={styles.optionHelperText}>
Workspaces that are manually started or auto-started will use
the active template version.
Enterprise license required to enabled.
</span>
</Stack>
</Stack>
</label>
)}
</Stack>
</Stack>
</FormSection>

Expand All@@ -241,7 +258,9 @@ export const TemplateSettingsForm: FC<TemplateSettingsForm> = ({
helperText:
"Leave the message empty to keep the template active. Any message provided will mark the template as deprecated. Use this message to inform users of the deprecation and how to migrate to a new template.",
})}
disabled={isSubmitting || !accessControlEnabled}
disabled={
isSubmitting || (!template.deprecated && !accessControlEnabled)
}
fullWidth
label="Deprecation Message"
/>
Expand All@@ -250,6 +269,8 @@ export const TemplateSettingsForm: FC<TemplateSettingsForm> = ({
<EnterpriseBadge />
<span css={styles.optionHelperText}>
Enterprise license required to deprecate templates.
{template.deprecated &&
" You cannot change the message, but you may remove it to mark this template as no longer deprecated."}
</span>
</Stack>
)}
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,6 +20,8 @@ export const TemplateSettingsPage: FC = () => {
const queryClient = useQueryClient();
const { entitlements, experiments } = useDashboard();
const accessControlEnabled = entitlements.features.access_control.enabled;
const advancedSchedulingEnabled =
entitlements.features.advanced_template_scheduling.enabled;
const sharedPortsExperimentEnabled = experiments.includes("shared-ports");
const sharedPortControlsEnabled =
entitlements.features.control_shared_ports.enabled;
Expand DownExpand Up@@ -70,6 +72,7 @@ export const TemplateSettingsPage: FC = () => {
});
}}
accessControlEnabled={accessControlEnabled}
advancedSchedulingEnabled={advancedSchedulingEnabled}
sharedPortsExperimentEnabled={sharedPortsExperimentEnabled}
sharedPortControlsEnabled={sharedPortControlsEnabled}
/>
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,7 @@ const meta: Meta<typeof TemplateSettingsPageView> = {
args: {
template: MockTemplate,
accessControlEnabled: true,
advancedSchedulingEnabled: true,
},
};

Expand DownExpand Up@@ -36,5 +37,19 @@ export const SaveTemplateSettingsError: Story = {
export const NoEntitlements: Story = {
args: {
accessControlEnabled: false,
advancedSchedulingEnabled: false,
},
};

export const NoEntitlementsExpiredSettings: Story = {
args: {
template: {
...MockTemplate,
deprecated: true,
deprecation_message: "This template tastes bad",
require_active_version: true,
},
accessControlEnabled: false,
advancedSchedulingEnabled: false,
},
};
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,6 +13,7 @@ export interface TemplateSettingsPageViewProps {
typeof TemplateSettingsForm
>["initialTouched"];
accessControlEnabled: boolean;
advancedSchedulingEnabled: boolean;
sharedPortsExperimentEnabled: boolean;
sharedPortControlsEnabled: boolean;
}
Expand All@@ -25,6 +26,7 @@ export const TemplateSettingsPageView: FC<TemplateSettingsPageViewProps> = ({
submitError,
initialTouched,
accessControlEnabled,
advancedSchedulingEnabled,
sharedPortsExperimentEnabled,
sharedPortControlsEnabled,
}) => {
Expand All@@ -42,6 +44,7 @@ export const TemplateSettingsPageView: FC<TemplateSettingsPageViewProps> = ({
onCancel={onCancel}
error={submitError}
accessControlEnabled={accessControlEnabled}
advancedSchedulingEnabled={advancedSchedulingEnabled}
portSharingExperimentEnabled={sharedPortsExperimentEnabled}
portSharingControlsEnabled={sharedPortControlsEnabled}
/>
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp