Skip to content

Commit

Permalink
chore(dashboard): restyle elements
Browse files Browse the repository at this point in the history
  • Loading branch information
Thuan Vo committed Apr 6, 2023
1 parent a449a9d commit 2fa3f94
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 18 deletions.
6 changes: 4 additions & 2 deletions src/app/Dashboard/AddCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ export const AddCard: React.FC<AddCardProps> = ({ variant, ..._props }) => {
case 'icon-button':
return (
<Tooltip content={'Add card'}>
<Button variant="plain" onClick={handleStart} style={{ padding: 0 }}>
<Button data-quickstart-id={'dashboard-add-btn'} variant="plain" onClick={handleStart} style={{ padding: 0 }}>
<QuickSearchIcon />
</Button>
</Tooltip>
Expand All @@ -221,8 +221,10 @@ export const AddCard: React.FC<AddCardProps> = ({ variant, ..._props }) => {
aria-label="Dashboard Card Catalog Modal"
isOpen={showWizard}
width={'90%'}
className="card-catalog__wizard-modal"
hasNoBodyWrapper
showClose={false}
appendTo={portalRoot}
>
<Wizard
id={'card-catalog-wizard'}
Expand Down Expand Up @@ -395,7 +397,7 @@ export const CardGallery: React.FC<CardGalleryProps> = ({ selection, onSelect })
</LabelGroup>
) : null}
</StackItem>
<StackItem>{getFullDescription(t(toViewCard.title), t)}</StackItem>
<StackItem>{getFullDescription(t(title), t)}</StackItem>
<StackItem isFilled>
{preview ? (
<div className="dashboard-card-preview">
Expand Down
4 changes: 2 additions & 2 deletions src/app/Dashboard/Charts/jfr/JFRMetricsChartController.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,12 @@ export class JFRMetricsChartController {
}
return this._api.targetHasRecording(target, {
state: RecordingState.RUNNING,
labels: [
labels: this._api.stringifyRecordingLabels([
{
key: 'origin',
value: RECORDING_NAME,
},
],
]),
});
}
}
2 changes: 1 addition & 1 deletion src/app/Dashboard/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ export function hasConfigByTitle(title: string, t: TFunction): boolean {

export function getConfigByTitle(title: string, t: TFunction): DashboardCardDescriptor {
for (const choice of getDashboardCards()) {
if (t(choice.title) === t(title)) {
if (t(choice.title) === title) {
return choice;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/Dashboard/DashboardLayoutConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ export const DashboardLayoutConfig: React.FunctionComponent<DashboardLayoutConfi
variant="primary"
aria-label={t('DashboardLayoutConfig.NEW.LABEL')}
onClick={handleCreateModalOpen}
data-quickstart-id="dashboard-new-btn"
data-quickstart-id="create-layout-btn"
>
Create Layout
</Button>
Expand Down
8 changes: 7 additions & 1 deletion src/app/QuickStarts/QuickStartDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,13 @@ export const GlobalQuickStartDrawer: React.FC<GlobalQuickStartDrawerProps> = ({
return (
<React.Suspense fallback={<LoadingView />}>
<QuickStartContext.Provider value={valuesForQuickStartContext}>
<QuickStartDrawer>{children}</QuickStartDrawer>
<QuickStartDrawer
onClick={(e) => {
e.stopPropagation();
}}
>
{children}
</QuickStartDrawer>
</QuickStartContext.Provider>
</React.Suspense>
);
Expand Down
18 changes: 10 additions & 8 deletions src/app/QuickStarts/quickstarts/dashboard-quickstart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ Each card displays a different set of information about the currently selected t
description: `
**Dashboard Layouts** are used to organize the Dashboard Cards that are displayed in the Dashboard. We will start by creating a new Dashboard Layout.
1. Click [New]{{highlight dashboard-new-btn}} on the **Layout Selector** toolbar.
1. Click the [Layout Selector]{{highlight dashboard-layout-selector}} on the toolbar.
This will open a modal dialog.
This will open a dropdown menu. Click the [Create Layout]{{highlight create-layout-btn}}.
2. Enter a name for the new layout.
3. Click Create when you are finished.
Expand All @@ -118,13 +118,15 @@ Each card displays a different set of information about the currently selected t
description: `
To create a card, we will go through a **creation wizard** that will guide us through the process of selecting the card type, and configuring the card, if needed.
1. Click the [Add]{{highlight dashboard-add-btn}} button on the Dashboard.
2. From the [Card Type selector]{{highlight card-type-selector}}, select the **Target JVM Details** card.
3. Click Finish.
4. Repeat steps 1-2 to add the **MBeans Metrics Chart** card to the Dashboard Layout.
5. This time, click Next to go to the next configuration step of the creation wizard.
1. Click the [Catalog Icon]{{highlight dashboard-add-btn}} on the toolbar.
This will open a modal. From the card catalog, select the **Target JVM Details** card. Full details and available preview will be shown on the drawer panel.
2. Click Finish.
3. Repeat steps 1-2 to add the **MBeans Metrics Chart** card to the Dashboard Layout.
4. This time, click Next to go to the next configuration step of the creation wizard.
[The default metric selected for the card is the \`Process CPU Load\` metric. You can change this by clicking the **Performance Metric** dropdown menu within the **MBeans Chart Card** configuration step and selecting a different metric. Try other metrics and settings!]{{admonition tip}}
6. Click Finish again to finish creating the second card.
5. Click Finish again to finish creating the second card.
`,
review: {
instructions: '#### Verify that you see the two new cards in the Dashboard.',
Expand Down
6 changes: 4 additions & 2 deletions src/app/Shared/Services/Api.service.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1173,7 +1173,9 @@ export class ApiService {
{
connectUrl: target.connectUrl,
recordingFilter: filter,
}
},
true,
true
).pipe(
map((resp) => {
const nodes = resp.data.targetNodes;
Expand Down Expand Up @@ -1824,7 +1826,7 @@ export interface ActiveRecordingFilterInput {
durationMsLessThanEqual?: number;
startTimeMsBeforeEqual?: number;
startTimeMsAfterEqual?: number;
labels?: RecordingLabel[];
labels?: string;
}

export const automatedAnalysisRecordingName = 'automated-analysis';
Expand Down
18 changes: 18 additions & 0 deletions src/app/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -622,3 +622,21 @@ svg.topology__node-decorator-icon.progress {
.dashboard-card-preview .pf-c-card {
box-shadow: none;
}

.card-catalog__wizard-modal {
height: 90%;
}

.card-catalog__detail-panel-body {
margin-top: -2.5em;
}

.pfext-spotlight__element-highlight-animate {
animation: 0.4s pfext-spotlight-fade-in 0s ease-in-out, 1.2s pfext-spotlight-fade-out 1s ease-in-out;
animation-fill-mode: forwards;
}

.pfext-spotlight__element-highlight-animate::after {
animation: 1.2s pfext-spotlight-expand 0.6s ease-out;
animation-fill-mode: forwards;
}
3 changes: 2 additions & 1 deletion src/app/utils/fakeData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import { Notifications, NotificationsInstance } from '@app/Notifications/Notific
import { Rule } from '@app/Rules/Rules';
import {
ActiveRecording,
ActiveRecordingFilterInput,
ApiService,
ArchivedRecording,
EventProbe,
Expand Down Expand Up @@ -158,7 +159,7 @@ class FakeApiService extends ApiService {
}

// JFR Metrics card
targetHasRecording(_target: Target, _recordingName: string): Observable<boolean> {
targetHasRecording(_target: Target, _filter?: ActiveRecordingFilterInput): Observable<boolean> {
return of(true);
}

Expand Down

0 comments on commit 2fa3f94

Please sign in to comment.