Skip to content

Commit 1522d2a

Browse files
Ruben van LeeuwenDutchBen
authored andcommitted
1713: Fixes some layout issues
1 parent f21e125 commit 1522d2a

File tree

4 files changed

+24
-10
lines changed

4 files changed

+24
-10
lines changed

packages/orchestrator-ui-components/src/components/WfoSubscription/WfoCustomerDescriptionsField.tsx

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React, { FC } from 'react';
22

3+
import { useOrchestratorTheme } from '@/hooks';
34
import { useGetCustomerQuery } from '@/rtk';
45
import {
56
useSetCustomerDescriptionMutation,
@@ -22,6 +23,7 @@ export type WfoCustomerDescriptionsFieldProps = {
2223
export const WfoCustomerDescriptionsField: FC<
2324
WfoCustomerDescriptionsFieldProps
2425
> = ({ customerDescriptions, subscriptionCustomerId, subscriptionId }) => {
26+
const { theme } = useOrchestratorTheme();
2527
const [updateCustomerDescription, {}] =
2628
useUpdateCustomerDescriptionMutation();
2729
const [setCustomerDescription, {}] = useSetCustomerDescriptionMutation();
@@ -61,8 +63,15 @@ export const WfoCustomerDescriptionsField: FC<
6163
subscriptionId,
6264
}: CustomerDescriptionWithName) => (
6365
<div key={customerId} css={{ display: 'flex' }}>
64-
{fullname ?? customerId}
65-
{`${shortcode ?? customerId}`}:
66+
<div
67+
css={{
68+
whiteSpace: 'nowrap',
69+
alignSelf: 'center',
70+
marginRight: theme.base / 2,
71+
}}
72+
>
73+
{fullname ?? customerId} {`${shortcode ?? customerId}`}:
74+
</div>
6675
<WfoInlineEdit
6776
value={description}
6877
triggerModify={(value) =>
@@ -80,7 +89,7 @@ export const WfoCustomerDescriptionsField: FC<
8089
const customerDescriptionCreateForm = () => {
8190
if (!subscriptionCustomerId) return;
8291
return (
83-
<div key={subscriptionCustomerId} css={{ display: 'flex' }}>
92+
<div key={subscriptionCustomerId}>
8493
<WfoInlineEdit
8594
value={INVISIBLE_CHARACTER}
8695
onlyShowOnHover={true}
@@ -102,7 +111,13 @@ export const WfoCustomerDescriptionsField: FC<
102111
);
103112

104113
return (
105-
<>
114+
<div
115+
css={{
116+
display: 'flex',
117+
flexDirection: 'column',
118+
alignItems: 'flex-start',
119+
}}
120+
>
106121
{(currentCustomerSubscriptionDescription &&
107122
customerDescriptionEditForm(
108123
currentCustomerSubscriptionDescription,
@@ -115,6 +130,6 @@ export const WfoCustomerDescriptionsField: FC<
115130
.map((customerDescriptionWithName) =>
116131
customerDescriptionEditForm(customerDescriptionWithName),
117132
)}
118-
</>
133+
</div>
119134
);
120135
};

packages/orchestrator-ui-components/src/components/WfoSubscription/WfoSubscriptionActions/WfoSubscriptionActionExpandableMenuItem.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { useTranslations } from 'next-intl';
44
import Link from 'next/link';
55

66
import { EuiButtonIcon, EuiText } from '@elastic/eui';
7-
import { ReactJSXElement } from '@emotion/react/types/jsx-namespace';
87

98
import { PATH_SUBSCRIPTIONS } from '@/components';
109
import { useWithOrchestratorTheme } from '@/hooks';
@@ -15,7 +14,7 @@ import { getSubscriptionActionStyles } from './styles';
1514
export type WfoSubscriptionActionExpandableMenuItemProps = {
1615
subscriptionAction: SubscriptionAction;
1716
onClickLockedRelation: (relation: string) => void;
18-
children: ReactJSXElement;
17+
children: React.ReactNode;
1918
};
2019

2120
export const WfoSubscriptionActionExpandableMenuItem: FC<

packages/orchestrator-ui-components/src/components/WfoSubscription/WfoSubscriptionActions/WfoSubscriptionActions.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import {
1313
EuiTitle,
1414
EuiToolTip,
1515
} from '@elastic/eui';
16-
import { ReactJSXElement } from '@emotion/react/types/jsx-namespace';
1716

1817
import { PATH_START_NEW_TASK, PATH_START_NEW_WORKFLOW } from '@/components';
1918
import { PolicyResource } from '@/configuration/policy-resources';
@@ -94,7 +93,7 @@ export const WfoSubscriptionActions: FC<WfoSubscriptionActionsProps> = ({
9493
}) => {
9594
// Change icon to include x if there's a reason
9695
// Add tooltip with reason
97-
const linkIt = (actionItem: ReactJSXElement) => {
96+
const linkIt = (actionItem: React.ReactNode) => {
9897
const path = isTask ? PATH_START_NEW_TASK : PATH_START_NEW_WORKFLOW;
9998
const url = {
10099
pathname: `${path}/${action.name}`,
@@ -116,7 +115,7 @@ export const WfoSubscriptionActions: FC<WfoSubscriptionActionsProps> = ({
116115
);
117116
};
118117

119-
const tooltipIt = (actionItem: ReactJSXElement) => {
118+
const tooltipIt = (actionItem: React.ReactNode) => {
120119
/**
121120
Whether an action is disabled is indicated by it having a reason property.
122121
The value of the reason property is as a translation key that should

packages/orchestrator-ui-components/src/components/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,4 @@ export * from './WfoTitleWithWebsocketBadge';
3434
export * from './WfoRadioDropdown';
3535
export * from './WfoInlineNoteEdit';
3636
export * from './WfoTableCodeBlock';
37+
export * from './WfoInlineEdit';

0 commit comments

Comments
 (0)