Skip to content
14 changes: 9 additions & 5 deletions frontend/web/components/feature-summary/FeatureRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ const FeatureRow: FC<FeatureRowProps> = (props) => {
: []

openModal(
<Row className='align-items-center'>
<Row noWrap className='align-items-center'>
Comment thread
talissoncosta marked this conversation as resolved.
Resolved
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
{!!cameFrom && (
<IconButton
size='medium'
Expand All @@ -247,8 +247,12 @@ const FeatureRow: FC<FeatureRowProps> = (props) => {
<Icon name='arrow-left' width={20} />
</IconButton>
)}
<span>
{permission ? 'Edit Feature' : 'Feature'}: {projectFlag.name}
<span className='text-truncate'>
{/* Phones show just the name so the copy button stays beside it */}
<span className='d-none d-md-inline'>
{permission ? 'Edit Feature' : 'Feature'}:{' '}
</span>
{projectFlag.name}
</span>
<IconButton
variant='ghost'
Expand All @@ -257,12 +261,12 @@ const FeatureRow: FC<FeatureRowProps> = (props) => {
onClick={() => {
Utils.copyToClipboard(projectFlag.name)
}}
className='ms-2'
className='ms-2 flex-shrink-0'
>
<Icon width={16} name='copy' />
</IconButton>
{ownerChips.length > 0 && (
<div className='d-flex align-items-center gap-1 ms-3'>
<div className='d-none d-md-flex align-items-center gap-1 ms-3'>
<Icon name='people' width={16} fill='#9DA4AE' />
{ownerChips.slice(0, 3).map((chip) => (
<span key={chip.id} className='chip chip--xs'>
Expand Down
10 changes: 1 addition & 9 deletions frontend/web/components/metrics/EnvironmentMetricsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ const EnvironmentMetricsList: FC<EnvironmentMetricsListProps> = ({
},
)

const MAX_COLUMNS = 6
const columns = Math.min(data?.metrics?.length || 0, MAX_COLUMNS) || 1

const extraMetricsData = getExtraMetricsData(projectId, environmentId)

useEffect(() => {
Expand All @@ -48,12 +45,7 @@ const EnvironmentMetricsList: FC<EnvironmentMetricsListProps> = ({
}
>
<div className='flex gap-2'>
<div
className='metrics-grid'
style={{
gridTemplateColumns: `repeat(${columns}, 1fr)`,
}}
>
<div className='metrics-grid'>
{data?.metrics.map((metric) => (
<EnvironmentMetric
key={metric.name}
Expand Down
33 changes: 16 additions & 17 deletions frontend/web/components/modals/CreateSegment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -522,34 +522,33 @@ const CreateSegment: FC<CreateSegmentType> = ({
: 'Add at least one AND/NOT rule to create a segment.'}
</InfoMessage>
)}
<Row className='justify-content-end'>
{!isReadOnly && (
<div
{!isReadOnly && (
<div className='d-flex flex-column flex-sm-row justify-content-sm-end gap-2'>
<Button
theme='outline'
data-test='add-rule'
type='button'
onClick={() =>
addRule(topLevelRuleType === 'ANY' ? 'ALL' : 'ANY')
}
className='text-center'
>
<Button theme='outline' data-test='add-rule' type='button'>
{topLevelRuleType === 'ANY'
? 'Add OR Condition'
: 'Add AND Condition'}
</Button>
</div>
)}
{!isReadOnly && topLevelRuleType !== 'ANY' && (
<div onClick={() => addRule('NONE')} className='text-center'>
{topLevelRuleType === 'ANY'
? 'Add OR Condition'
: 'Add AND Condition'}
</Button>
{topLevelRuleType !== 'ANY' && (
<Button
theme='outline'
className='ml-2 btn--outline-danger'
className='btn--outline-danger'
data-test='add-rule'
type='button'
onClick={() => addRule('NONE')}
>
Add AND NOT Condition
</Button>
</div>
)}
</Row>
)}
</div>
)}
</div>
</div>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ const RuleConditionRow: React.FC<RuleConditionRowProps> = ({
<Flex className='or-divider__line' />
</Row>
)}
<div className='d-flex flex-row align-items-center gap-1 flex-nowrap'>
<div className='d-flex flex-1 flex-row rule align-items-center justify-content-between gap-1 col-8 col-md-10'>
<div className='col-10 col-sm-4 col-md-4'>
<div className='d-flex flex-row align-items-center gap-1 flex-wrap flex-sm-nowrap'>
<div className='d-flex flex-grow-1 flex-column flex-sm-row rule align-items-stretch align-items-sm-center justify-content-between gap-1 col-12 col-sm-8 col-md-10 mx-0'>
<div className='col-12 col-sm-4 col-md-4'>
<RuleConditionPropertySelect
dataTest={`${dataTest}-property-${ruleIndex}`}
ruleIndex={ruleIndex}
Expand All @@ -107,7 +107,7 @@ const RuleConditionRow: React.FC<RuleConditionRowProps> = ({
setRuleProperty(ruleIndex, 'operator', value)
}}
options={operators}
className='col-10 col-sm-3 col-md-3'
className='col-12 col-sm-3 col-md-3'
/>
)}
<RuleConditionValueInput
Expand All @@ -128,12 +128,12 @@ const RuleConditionRow: React.FC<RuleConditionRowProps> = ({
})
}}
isValid={Utils.validateRule(rule) && !ruleErrors?.value}
className='col-10 col-sm-4 col-md-4'
className='col-12 col-sm-4 col-md-4'
/>
</div>
<div
className={classNames(
'd-flex flex-sm-column flex-md-row',
'd-flex flex-sm-column flex-md-row ms-auto ms-sm-0',
Comment thread
talissoncosta marked this conversation as resolved.
Resolved
isLastRule && !readOnly ? 'gap-2' : '',
)}
>
Expand Down
10 changes: 9 additions & 1 deletion frontend/web/styles/components/_metrics.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,12 @@
display: grid;
justify-content: center;
row-gap: 12px;
}
grid-template-columns: repeat(2, 1fr);

// Wider screens: every metric on one row
@include media-breakpoint-up(md) {
grid-auto-columns: 1fr;
grid-auto-flow: column;
grid-template-columns: none;
}
}
28 changes: 23 additions & 5 deletions frontend/web/styles/project/_modals.scss
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ $side-width: 800px;

.tabs {
.tab-item {
padding-top: 24px;
padding-bottom: 24px;
overflow-y: auto;
height: calc(100vh - 110px);
Expand Down Expand Up @@ -344,12 +343,31 @@ $side-width: 800px;
}
}

// Lets a long drawer title truncate instead of pushing its buttons out
.side-modal .modal-title {
min-width: 0;
}

.side-modal.create-feature-modal {
.modal-body {
padding-top: 0;
}
.tabs .tab-item {
padding-top: 24px;
}
}

@include media-breakpoint-down(md) {
.modal-dialog {
margin:0;
// Drawers fill the screen; dialogs stay cards
.side-modal .modal-dialog {
margin: 0;
// Bootstrap caps .modal-dialog width from 544px; drawers stay full width
max-width: none;
.modal-content {
border-radius:0;
height: 100vh;
border-radius: 0;
min-height: 100vh;
// Fits the visible screen when the mobile browser toolbar shows
min-height: 100dvh;
}
}
}
Expand Down
Loading