Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 10 additions & 0 deletions .changeset/shaggy-squids-kick.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'wfo-ui-surf': patch
'wfo-ui': patch
'@orchestrator-ui/orchestrator-ui-components': patch
---

- expand the root product block card by default
- change tree icon of root product block
- open other subscription detail page opens in new tab
- use title of root product block in tree like the other product blocks
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export const WfoImpactedCustomersTable = ({
name: t('customers'),
field: 'customer',
render: (customer) => (
<EuiText size={'s'}>
<EuiText size="s">
<b>{customer.customer_abbrev}</b>
</EuiText>
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export const WfoServiceTicketsList = ({
<b>{formatDate(date)}</b>
</EuiText>
) : (
<EuiText size={'s'}>{formatDate(date)}</EuiText>
<EuiText size="s">{formatDate(date)}</EuiText>
);
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const WfoModifySettings: FC<WfoModifySettingsProps> = ({
paddingSize="l"
css={{ width: '50%' }}
>
<EuiText size={'s'}>
<EuiText size="s">
<h4>{t('modifyEngine')}</h4>
</EuiText>
<EuiSpacer size="m"></EuiSpacer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ export const WfoRelatedSubscriptions = ({
field: 'description',
name: t('description'),
render: (value, record) => (
<Link href={`/subscriptions/${record.subscriptionId}`}>
<Link
target="_blank"
href={`/subscriptions/${record.subscriptionId}`}
>
{value}
</Link>
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@ import { getTokenName } from '../../utils/getTokenName';
import { WfoTree } from '../WfoTree';
import { getWfoTreeNodeDepth } from '../WfoTree';
import { WfoSubscriptionProductBlock } from './WfoSubscriptionProductBlock';
import {
getFieldFromProductBlockInstanceValues,
getProductBlockTitle,
} from './utils';
import { getProductBlockTitle } from './utils';

interface WfoSubscriptionDetailTreeProps {
productBlockInstances: ProductBlockInstance[];
Expand Down Expand Up @@ -47,9 +44,8 @@ export const WfoSubscriptionDetailTree = ({
// Does this node have a parent?
if (shallowCopy.parent === null) {
// Doesn't look like it, so this node is the root of the tree
shallowCopy.label = getFieldFromProductBlockInstanceValues(
shallowCopy.label = getProductBlockTitle(
shallowCopy.productBlockInstanceValues,
'name',
);
shallowCopy.callback = () => setSelectedTreeNode(shallowCopy.id);
depthList.push(0); // First id is on root
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export const WfoSubscriptionProductBlock = ({
)}
</h3>
</EuiText>
<EuiText>{`${t(
<EuiText size="s">{`${t(
'subscriptionInstanceId',
)}: ${subscriptionInstanceId}`}</EuiText>
</EuiFlexItem>
Expand Down Expand Up @@ -131,6 +131,7 @@ export const WfoSubscriptionProductBlock = ({
) : (
<a
href={`${PATH_SUBSCRIPTIONS}/${ownerSubscriptionId}`}
target="_blank"
>
{ownerSubscriptionId}
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,7 @@ export const WfoTreeNode: FC<WfoTreeNodeProps> = ({
const expanded = expandedIds.includes(item.id);
const selected = selectedIds.includes(item.id);

let expandIcon = expanded ? 'arrowDown' : 'arrowRight';
if (item.id === 0) {
expandIcon = expanded ? 'folderOpen' : 'folderClosed';
}
const expandIcon = expanded ? 'arrowDown' : 'arrowRight';

return (
<div style={{ paddingLeft: `${level * parseInt(theme.size.m)}px` }}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export type TreeProviderProps = {

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

const toggleSelectedId = (id: number) => {
Expand Down