Fixing segment create error, adding environment to feature dialog

This commit is contained in:
2026-04-16 08:59:54 -07:00
parent b75f5f602e
commit 7b624b3238
8 changed files with 24 additions and 8 deletions

15
.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,15 @@
{
"sqltools.connections": [
{
"ssh": "Disabled",
"previewLimit": 50,
"server": "mic-check-db-1",
"port": 5432,
"askForPassword": true,
"driver": "PostgreSQL",
"name": "MicCheck - local",
"database": "micheck",
"username": "micheck"
}
]
}

View File

@@ -54,7 +54,8 @@
<div>
<p class="text-body-1 font-weight-medium mb-1">Enabled</p>
<p class="text-body-2 text-medium-emphasis">
{{ featureState.enabled ? 'On in this environment' : 'Off in this environment' }}
{{ featureState.enabled ? 'On' : 'Off' }} in
<strong>{{ contextStore.currentEnvironment?.name }}</strong>
</p>
</div>
<v-switch

View File

@@ -12,8 +12,8 @@
data-testid="rule-type-toggle"
@update:model-value="onTypeChange"
>
<v-btn value="AND" size="small" data-testid="rule-type-and">ALL (AND)</v-btn>
<v-btn value="OR" size="small" data-testid="rule-type-or">ANY (OR)</v-btn>
<v-btn value="All" size="small" data-testid="rule-type-and">ALL (AND)</v-btn>
<v-btn value="Any" size="small" data-testid="rule-type-or">ANY (OR)</v-btn>
</v-btn-toggle>
<v-spacer />
<v-btn
@@ -113,7 +113,7 @@ function onAddCondition(): void {
}
function onAddChildGroup(): void {
const newGroup: SegmentRule = { type: 'AND', conditions: [] };
const newGroup: SegmentRule = { type: 'All', conditions: [] };
const childRules = [...(props.rule.childRules ?? []), newGroup];
emit('update:rule', { ...props.rule, childRules });
}

View File

@@ -140,7 +140,7 @@ watch(() => props.modelValue, (open) => {
watch(() => props.segment, resetForm, { immediate: true });
function onAddRuleGroup(): void {
form.value.rules = [...form.value.rules, { type: 'AND', conditions: [] }];
form.value.rules = [...form.value.rules, { type: 'All', conditions: [] }];
}
function onUpdateRule(index: number, rule: SegmentRule): void {

View File

@@ -234,7 +234,7 @@ export type SegmentConditionOperator =
| 'PercentageSplit'
| 'ModuloValueDivisorRemainder';
export type SegmentRuleType = 'AND' | 'OR';
export type SegmentRuleType = 'All' | 'Any';
export interface SegmentCondition {
id?: number;

View File

@@ -24,7 +24,7 @@ const mockSegment: SegmentResponse = {
name: 'beta_users',
projectId: 10,
createdAt: '2026-01-01T00:00:00Z',
rules: [{ type: 'AND', conditions: [{ property: 'plan', operator: 'Equal', value: 'beta' }] }],
rules: [{ type: 'All', conditions: [{ property: 'plan', operator: 'Equal', value: 'beta' }] }],
};
const dialogStub = { template: '<div><slot /></div>' };

View File

@@ -24,7 +24,7 @@ const dialogStub = { template: '<div><slot /></div>' };
const mockSegments: SegmentResponse[] = [
{
id: 1, name: 'beta_users', projectId: 10, createdAt: '2026-01-01T00:00:00Z',
rules: [{ type: 'AND', conditions: [{ property: 'plan', operator: 'Equal', value: 'beta' }] }],
rules: [{ type: 'All', conditions: [{ property: 'plan', operator: 'Equal', value: 'beta' }] }],
},
{
id: 2, name: 'power_users', projectId: 10, createdAt: '2026-01-01T00:00:00Z',