Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(pf5): upgrade Recording view to Patternfly 5 #1318

Merged
merged 29 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
1fde123
chore(pf5): remove unused ellipsis icon
tthvo Aug 7, 2024
88fa5f4
fix: menu should close when clicking outside
tthvo Aug 7, 2024
1c46423
feat: add delete button to row action
tthvo Aug 7, 2024
6d593db
fix: fix automated analysis view in recording table
tthvo Aug 8, 2024
be3ffbf
fix: nicer empty text
tthvo Aug 8, 2024
2ec927a
chore: apply eslint fixes
tthvo Aug 8, 2024
6982a52
fix: AA label should not overflow
tthvo Aug 8, 2024
d838293
chore: nicer no result display
tthvo Aug 8, 2024
ca83c36
fix: use checkboxes for state filters
tthvo Aug 8, 2024
29cdd14
fix: add extra space to empty state title
tthvo Aug 8, 2024
9643c7c
fix: fix datetime picker
tthvo Aug 8, 2024
c537b73
chore: better text display for filters
tthvo Aug 8, 2024
32a399f
fix: fix duration checkbox
tthvo Aug 8, 2024
34e60a2
fix: fix overflow menu
tthvo Aug 8, 2024
d47d05f
fix: overflow stop btn must be disabled if so
tthvo Aug 8, 2024
a35b55b
fix: restore AA label group styles
tthvo Aug 9, 2024
130b44d
fix: remove y translation for checkbox
tthvo Aug 9, 2024
85db604
chore: ensure form select toggle is visible
tthvo Aug 9, 2024
acb1bd5
feat: should show empty text when no templates are found
tthvo Aug 9, 2024
fb1d95c
chore: increase font-size for form explanation text
tthvo Aug 9, 2024
106da09
feat-WIP: new designs for label-related UI
tthvo Aug 9, 2024
4c4e221
feat: new label editor for recordings
tthvo Aug 10, 2024
12403e6
chore: apply eslint fixes
tthvo Aug 10, 2024
b97aa4f
feat: use icon button for label upload
tthvo Aug 10, 2024
0d493d4
revert: remove delete action in row action
tthvo Aug 10, 2024
234de2d
feat: error helper text for invalid labels
tthvo Aug 10, 2024
08b9959
feat: remove invalid labels if any in the editor
tthvo Aug 10, 2024
5e257c8
chore: apply eslint
tthvo Aug 10, 2024
41a0b9b
fix: should let datetime display to fill
tthvo Aug 10, 2024
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
1 change: 1 addition & 0 deletions locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"OK": "OK",
"PRESERVED_ARCHIVES": "Preserved Archives",
"PRODUCTION": "PRODUCTION",
"REFRESH": "Refresh",
"REMOVE": "Remove",
"RENAME": "Rename",
"RESET": "Reset",
Expand Down
3 changes: 2 additions & 1 deletion locales/en/public.json
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,8 @@
"DISPLAY_SELECTED_DATETIME": "Displayed selected datetime",
"TABS": "Select a date or time tab"
},
"SELECTED_DATETIME": "Selected DateTime"
"SELECTED_DATETIME": "Selected Date and Time",
"SELECTED_TIMEZONE": "Selected Timezone"
},
"ERROR_BOUNDARY": {
"ERROR_MESSAGE": "Reason: {{message}}",
Expand Down
6 changes: 3 additions & 3 deletions src/app/CreateRecording/CreateRecording.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

import { TargetView } from '@app/TargetView/TargetView';
import { Card, CardBody, Tab, Tabs } from '@patternfly/react-core';
import { Card, CardBody, Tab, Tabs, TabTitleText } from '@patternfly/react-core';
import * as React from 'react';
import { CustomRecordingForm } from './CustomRecordingForm';
import { SnapshotRecordingForm } from './SnapshotRecordingForm';
Expand All @@ -33,10 +33,10 @@ export const CreateRecording: React.FC = () => {
<Card>
<CardBody>
<Tabs activeKey={activeTab} onSelect={onTabSelect}>
<Tab eventKey={0} title="Custom Flight Recording">
<Tab eventKey={0} title={<TabTitleText>Custom Flight Recording</TabTitleText>}>
<CustomRecordingForm />
</Tab>
<Tab eventKey={1} title="Snapshot Recording">
<Tab eventKey={1} title={<TabTitleText>Snapshot Recording</TabTitleText>}>
<SnapshotRecordingForm />
</Tab>
</Tabs>
Expand Down
26 changes: 15 additions & 11 deletions src/app/CreateRecording/CustomRecordingForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ import {
Split,
SplitItem,
Text,
TextContent,
TextInput,
TextVariants,
Tooltip,
Expand Down Expand Up @@ -403,11 +404,13 @@ export const CustomRecordingForm: React.FC = () => {

return (
<>
<Text component={TextVariants.small}>
JDK Flight Recordings are compact records of events which have occurred within the Target JVM. Many event types
are built in to the JVM itself, while others are user defined.
</Text>
<Form isHorizontal>
<TextContent>
<Text component={TextVariants.p}>
JDK Flight Recordings are compact records of events which have occurred within the Target JVM. Many event
types are built in to the JVM itself, while others are user defined.
</Text>
</TextContent>
<FormGroup label="Name" isRequired fieldId="recording-name">
<TextInput
value={formData.name}
Expand Down Expand Up @@ -498,7 +501,7 @@ export const CustomRecordingForm: React.FC = () => {
<HelperTextItem variant={!formData.template?.name ? ValidatedOptions.default : ValidatedOptions.success}>
{formData.template?.name
? 'The Event Template to be applied in this Recording'
: 'A Template must be selected'}
: 'A Template must be selected.'}
</HelperTextItem>
</HelperText>
</FormHelperText>
Expand All @@ -522,6 +525,12 @@ export const CustomRecordingForm: React.FC = () => {
</Tooltip>
}
>
<RecordingLabelFields
labels={formData.labels}
setLabels={handleLabelsChange}
setValid={handleLabelValidationChange}
isDisabled={loading}
/>
<FormHelperText>
<HelperText>
<HelperTextItem
Expand All @@ -534,12 +543,6 @@ export const CustomRecordingForm: React.FC = () => {
</HelperTextItem>
</HelperText>
</FormHelperText>
<RecordingLabelFields
labels={formData.labels}
setLabels={handleLabelsChange}
setValid={handleLabelValidationChange}
isDisabled={loading}
/>
</FormGroup>
</ExpandableSection>
<ExpandableSection
Expand Down Expand Up @@ -614,6 +617,7 @@ export const CustomRecordingForm: React.FC = () => {
</SplitItem>
<SplitItem>
<FormSelect
className="recording-create__form_select"
value={formData.maxAgeUnit}
onChange={handleMaxAgeUnitChange}
aria-label="Max Age units Input"
Expand Down
16 changes: 9 additions & 7 deletions src/app/CreateRecording/SnapshotRecordingForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { authFailMessage, isAuthFail, missingSSLMessage } from '@app/ErrorView/t
import { LoadingProps } from '@app/Shared/Components/types';
import { ServiceContext } from '@app/Shared/Services/Services';
import { useSubscriptions } from '@app/utils/hooks/useSubscriptions';
import { ActionGroup, Button, Form, Text, TextVariants } from '@patternfly/react-core';
import { ActionGroup, Button, Form, Text, TextContent, TextVariants } from '@patternfly/react-core';
import * as React from 'react';
import { useNavigate } from 'react-router-dom';
import { first } from 'rxjs';
Expand Down Expand Up @@ -109,12 +109,14 @@ export const SnapshotRecordingForm: React.FC<SnapshotRecordingFormProps> = (_) =
return (
<>
<Form isHorizontal>
<Text component={TextVariants.p}>
A Snapshot Recording is one which contains all information about all events that have been captured in the
current session by <i>other,&nbsp; non-Snapshot</i> Recordings. Snapshots do not themselves define which
events are enabled, their thresholds, or any other options. A Snapshot is only ever in the STOPPED state from
the moment it is created.
</Text>
<TextContent>
<Text component={TextVariants.p}>
A Snapshot Recording is one which contains all information about all events that have been captured in the
current session by <i>other, non-Snapshot</i> Recordings. Snapshots do not themselves define which events
are enabled, their thresholds, or any other options. A Snapshot is only ever in the STOPPED state from the
moment it is created.
</Text>
</TextContent>
<ActionGroup>
<Button variant="primary" onClick={handleCreateSnapshot} isDisabled={loading} {...createButtonLoadingProps}>
{loading ? 'Creating' : 'Create'}
Expand Down
26 changes: 10 additions & 16 deletions src/app/DateTimePicker/DateTimePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ import {
Bullseye,
Button,
CalendarMonth,
Flex,
FlexItem,
Form,
FormGroup,
Tab,
Expand Down Expand Up @@ -158,20 +156,16 @@ export const DateTimePicker: React.FC<DateTimePickerProps> = ({ onSelect, onDism
</Tab>
</Tabs>
<FormGroup label={t('DateTimePicker.SELECTED_DATETIME')}>
<Flex>
<FlexItem>
<TextInput
id="selected-datetime"
aria-label={t('DateTimePicker.ARIA_LABELS.DISPLAY_SELECTED_DATETIME') || ''}
className="datetime-picker__datetime-selected-display"
readOnly
value={selectedDatetimeDisplay}
/>
</FlexItem>
<FlexItem>
<TimezonePicker menuAppendTo={document.body} onTimezoneChange={setTimezone} selected={timezone} isCompact />
</FlexItem>
</Flex>
<TextInput
id="selected-datetime"
aria-label={t('DateTimePicker.ARIA_LABELS.DISPLAY_SELECTED_DATETIME') || ''}
className="datetime-picker__datetime-selected-display"
readOnlyVariant="default"
value={selectedDatetimeDisplay}
/>
</FormGroup>
<FormGroup label={t('DateTimePicker.SELECTED_TIMEZONE')}>
<TimezonePicker onTimezoneChange={setTimezone} selected={timezone} />
</FormGroup>
<ActionGroup style={{ marginTop: 0 }}>
<Button variant="primary" onClick={handleSubmit}>
Expand Down
12 changes: 4 additions & 8 deletions src/app/DateTimePicker/TimePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,7 @@ export const TimePicker: React.FC<TimePickerProps> = ({
onChange={onSecondSelect}
/>
</LevelItem>
{is24h ? (
<></>
) : (
{is24h ? null : (
<LevelItem key={'meridiem'}>
<MeridiemPicker isAM={meridiemAM} onSelect={onMeridiemSelect} />
</LevelItem>
Expand Down Expand Up @@ -200,16 +198,14 @@ const TimeSpinner: React.FC<TimeSpinnerProps> = ({ variant, onChange, selected,
{label}
</Title>
</StackItem>
) : (
<></>
)}
) : null}
<StackItem key={`${variant}-increment`}>
<Button
className={css('datetime-picker__time-spin-box', 'up')}
onClick={handleIncrement}
aria-label={t(`TimeSpinner.INCREMENT_${variant.toUpperCase()}_VALUE`) || ''}
>
<Icon size="md">
<Icon size="lg">
<AngleUpIcon />
</Icon>
</Button>
Expand All @@ -232,7 +228,7 @@ const TimeSpinner: React.FC<TimeSpinnerProps> = ({ variant, onChange, selected,
onClick={handleDecrement}
aria-label={t(`TimeSpinner.DECREMENT_${variant.toUpperCase()}_VALUE`) || ''}
>
<Icon size="md">
<Icon size="lg">
<AngleDownIcon />
</Icon>
</Button>
Expand Down
Loading
Loading