Skip to content

Commit

Permalink
fix: Show scheduled change request (#3118)
Browse files Browse the repository at this point in the history
  • Loading branch information
kyle-ssg authored Dec 8, 2023
1 parent 0604ec1 commit efddf13
Showing 1 changed file with 106 additions and 113 deletions.
219 changes: 106 additions & 113 deletions frontend/web/components/pages/ChangeRequestPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -351,22 +351,24 @@ const ChangeRequestsPage = class extends Component {
</nav>
<PageTitle
cta={
<Row>
<Button
theme='secondary'
onClick={this.deleteChangeRequest}
>
Delete
</Button>
<Button
onClick={() =>
this.editChangeRequest(projectFlag, environmentFlag)
}
className='ml-2'
>
Edit
</Button>
</Row>
!changeRequest?.committed_at && (
<Row>
<Button
theme='secondary'
onClick={this.deleteChangeRequest}
>
Delete
</Button>
<Button
onClick={() =>
this.editChangeRequest(projectFlag, environmentFlag)
}
className='ml-2'
>
Edit
</Button>
</Row>
)
}
title={changeRequest.title}
>
Expand Down Expand Up @@ -512,11 +514,7 @@ const ChangeRequestsPage = class extends Component {
}
/>

<div
style={{
maxWidth: changeRequest.committed_at ? '530px' : '',
}}
>
<div>
<Panel
title={
isScheduled ? 'Scheduled Change' : 'Change Request'
Expand Down Expand Up @@ -644,102 +642,97 @@ const ChangeRequestsPage = class extends Component {
</div>
</Panel>
</Flex>

{!changeRequest.committed_at && (
<Flex>
<Panel className='no-pad panel-change-request'>
<div className='search-list'>
<Row className='table-header px-4'>
{isScheduled
? 'Scheduled Change'
: 'Change Request'}
</Row>
<Row className='list-item change-request-item px-4'>
<div
className='font-weight-medium mr-3'
style={{ width: labelWidth }}
>
Enabled:
</div>
<Switch
checked={newEnabled}
disabled
style={{
opacity:
newEnabled === oldEnabled ? 0.25 : 1,
}}
<Flex>
<Panel className='no-pad panel-change-request'>
<div className='search-list'>
<Row className='table-header px-4'>
{isScheduled
? 'Scheduled Change'
: 'Change Request'}
</Row>
<Row className='list-item change-request-item px-4'>
<div
className='font-weight-medium mr-3'
style={{ width: labelWidth }}
>
Enabled:
</div>
<Switch
checked={newEnabled}
disabled
style={{
opacity:
newEnabled === oldEnabled ? 0.25 : 1,
}}
/>
</Row>
<Row className='list-item change-request-item px-4 align-items-start'>
<div
className='font-weight-medium mr-3'
style={{ width: labelWidth }}
>
Value:
</div>
<Flex
style={{
opacity: oldValue === newValue ? 0.25 : 1,
}}
>
<label>Value</label>
<ValueEditor
value={newValue}
className={classnames('code-medium', {
'change-request-updated-value':
oldValue !== newValue,
})}
/>
</Row>
<Row className='list-item change-request-item px-4 align-items-start'>
<div
className='font-weight-medium mr-3'
style={{ width: labelWidth }}
>
Value:
</div>
<Flex
style={{
opacity: oldValue === newValue ? 0.25 : 1,
}}
>
<label>Value</label>
<ValueEditor
value={newValue}
className={classnames('code-medium', {
'change-request-updated-value':
oldValue !== newValue,
})}
/>
</Flex>
</Row>
</Flex>
</Row>

{isMv &&
mvData.map((v, i) => (
<Row
key={i}
className='list-item px-4 align-start change-request-item'
{isMv &&
mvData.map((v, i) => (
<Row
key={i}
className='list-item px-4 align-start change-request-item'
>
<div
style={{ width: labelWidth }}
className='font-weight-medium flex flex-row align-items-center mr-3'
>
<div
style={{ width: labelWidth }}
className='font-weight-medium flex flex-row align-items-center mr-3'
>
<div className='flex flex-row align-items-center align-self-start'>
<span className='mr-1'>
Variation {i + 1}
</span>
<Tooltip
place='bottom'
title={
<Icon name='info-outlined' />
}
className='ml-1'
noIcon
>
{Utils.getTypedValue(v.value)}
</Tooltip>
</div>
<div className='flex flex-row align-items-center align-self-start'>
<span className='mr-1'>
Variation {i + 1}
</span>
<Tooltip
place='bottom'
title={<Icon name='info-outlined' />}
className='ml-1'
noIcon
>
{Utils.getTypedValue(v.value)}
</Tooltip>
</div>
<Flex
style={{
opacity: !v.changed ? 0.25 : 1,
}}
>
<label>Environment Weight %</label>
<Input
value={v.newValue}
className={classnames('code-medium', {
'change-request-updated-value':
v.changed,
})}
style={{ pointerEvents: 'none' }}
/>
</Flex>
</Row>
))}
</div>
</Panel>
</Flex>
)}
</div>
<Flex
style={{
opacity: !v.changed ? 0.25 : 1,
}}
>
<label>Environment Weight %</label>
<Input
value={v.newValue}
className={classnames('code-medium', {
'change-request-updated-value':
v.changed,
})}
style={{ pointerEvents: 'none' }}
/>
</Flex>
</Row>
))}
</div>
</Panel>
</Flex>
</Flex>
</div>
</div>
Expand Down

3 comments on commit efddf13

@vercel
Copy link

@vercel vercel bot commented on efddf13 Dec 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on efddf13 Dec 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on efddf13 Dec 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

docs – ./docs

docs-git-main-flagsmith.vercel.app
docs.flagsmith.com
docs-flagsmith.vercel.app
docs.bullet-train.io

Please sign in to comment.