Skip to content

Commit cb3142a

Browse files
536 change tree icon default expanded (#636)
* Use title for root PB and standard icon * by default open de root PB in a card * make subscriptionInstanceId smaller font see #456 * Open subscriptions in new tab - see #456 * replace the size s statement * Create shaggy-squids-kick.md * replace the size s statement
1 parent 33dd38d commit cb3142a

File tree

9 files changed

+23
-16
lines changed

9 files changed

+23
-16
lines changed

.changeset/shaggy-squids-kick.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'wfo-ui-surf': patch
3+
'wfo-ui': patch
4+
'@orchestrator-ui/orchestrator-ui-components': patch
5+
---
6+
7+
- expand the root product block card by default
8+
- change tree icon of root product block
9+
- open other subscription detail page opens in new tab
10+
- use title of root product block in tree like the other product blocks

apps/wfo-ui-surf/components/WfoServiceTicketDetailPage/WfoImpactedCustomersTable.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export const WfoImpactedCustomersTable = ({
6868
name: t('customers'),
6969
field: 'customer',
7070
render: (customer) => (
71-
<EuiText size={'s'}>
71+
<EuiText size="s">
7272
<b>{customer.customer_abbrev}</b>
7373
</EuiText>
7474
),

apps/wfo-ui-surf/components/WfoServiceTicketsList/WfoServiceTicketsList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ export const WfoServiceTicketsList = ({
137137
<b>{formatDate(date)}</b>
138138
</EuiText>
139139
) : (
140-
<EuiText size={'s'}>{formatDate(date)}</EuiText>
140+
<EuiText size="s">{formatDate(date)}</EuiText>
141141
);
142142
},
143143
},

packages/orchestrator-ui-components/src/components/WfoSettings/WfoModifySettings.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const WfoModifySettings: FC<WfoModifySettingsProps> = ({
2525
paddingSize="l"
2626
css={{ width: '50%' }}
2727
>
28-
<EuiText size={'s'}>
28+
<EuiText size="s">
2929
<h4>{t('modifyEngine')}</h4>
3030
</EuiText>
3131
<EuiSpacer size="m"></EuiSpacer>

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,10 @@ export const WfoRelatedSubscriptions = ({
8686
field: 'description',
8787
name: t('description'),
8888
render: (value, record) => (
89-
<Link href={`/subscriptions/${record.subscriptionId}`}>
89+
<Link
90+
target="_blank"
91+
href={`/subscriptions/${record.subscriptionId}`}
92+
>
9093
{value}
9194
</Link>
9295
),

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@ import { getTokenName } from '../../utils/getTokenName';
1212
import { WfoTree } from '../WfoTree';
1313
import { getWfoTreeNodeDepth } from '../WfoTree';
1414
import { WfoSubscriptionProductBlock } from './WfoSubscriptionProductBlock';
15-
import {
16-
getFieldFromProductBlockInstanceValues,
17-
getProductBlockTitle,
18-
} from './utils';
15+
import { getProductBlockTitle } from './utils';
1916

2017
interface WfoSubscriptionDetailTreeProps {
2118
productBlockInstances: ProductBlockInstance[];
@@ -47,9 +44,8 @@ export const WfoSubscriptionDetailTree = ({
4744
// Does this node have a parent?
4845
if (shallowCopy.parent === null) {
4946
// Doesn't look like it, so this node is the root of the tree
50-
shallowCopy.label = getFieldFromProductBlockInstanceValues(
47+
shallowCopy.label = getProductBlockTitle(
5148
shallowCopy.productBlockInstanceValues,
52-
'name',
5349
);
5450
shallowCopy.callback = () => setSelectedTreeNode(shallowCopy.id);
5551
depthList.push(0); // First id is on root

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export const WfoSubscriptionProductBlock = ({
8484
)}
8585
</h3>
8686
</EuiText>
87-
<EuiText>{`${t(
87+
<EuiText size="s">{`${t(
8888
'subscriptionInstanceId',
8989
)}: ${subscriptionInstanceId}`}</EuiText>
9090
</EuiFlexItem>
@@ -131,6 +131,7 @@ export const WfoSubscriptionProductBlock = ({
131131
) : (
132132
<a
133133
href={`${PATH_SUBSCRIPTIONS}/${ownerSubscriptionId}`}
134+
target="_blank"
134135
>
135136
{ownerSubscriptionId}
136137
</a>

packages/orchestrator-ui-components/src/components/WfoTree/WfoTreeNode.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,7 @@ export const WfoTreeNode: FC<WfoTreeNodeProps> = ({
4444
const expanded = expandedIds.includes(item.id);
4545
const selected = selectedIds.includes(item.id);
4646

47-
let expandIcon = expanded ? 'arrowDown' : 'arrowRight';
48-
if (item.id === 0) {
49-
expandIcon = expanded ? 'folderOpen' : 'folderClosed';
50-
}
47+
const expandIcon = expanded ? 'arrowDown' : 'arrowRight';
5148

5249
return (
5350
<div style={{ paddingLeft: `${level * parseInt(theme.size.m)}px` }}>

packages/orchestrator-ui-components/src/contexts/TreeContext.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export type TreeProviderProps = {
2323

2424
export const TreeProvider: React.FC<TreeProviderProps> = ({ children }) => {
2525
const [depths, setDepths] = React.useState<number[]>([]);
26-
const [selectedIds, setSelectedIds] = React.useState<number[]>([]);
26+
const [selectedIds, setSelectedIds] = React.useState<number[]>([0]);
2727
const [expandedIds, setExpandedIds] = React.useState<number[]>([0]);
2828

2929
const toggleSelectedId = (id: number) => {

0 commit comments

Comments
 (0)