Skip to content

Commit

Permalink
Merge branch 'master' into DOCS-1050
Browse files Browse the repository at this point in the history
  • Loading branch information
J2-D2-3PO authored Dec 9, 2024
2 parents 1ccf3cf + 7320ca9 commit f5a61d9
Show file tree
Hide file tree
Showing 5 changed files with 126 additions and 86 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,10 @@ export const CallsTable: FC<{
}}
filterListItems={
<TailwindContents>
<RefreshButton onClick={() => calls.refetch()} />
<RefreshButton
onClick={() => calls.refetch()}
disabled={callsLoading}
/>
{!hideOpSelector && (
<OpSelector
frozenFilter={frozenFilter}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,8 @@ export const BulkDeleteButton: FC<{

export const RefreshButton: FC<{
onClick: () => void;
}> = ({onClick}) => {
disabled?: boolean;
}> = ({onClick, disabled}) => {
return (
<Box
sx={{
Expand All @@ -483,6 +484,7 @@ export const RefreshButton: FC<{
variant="outline"
size="medium"
onClick={onClick}
disabled={disabled}
tooltip="Refresh"
icon="reload-refresh"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,47 +211,50 @@ const ObjectVersionPageInner: React.FC<{
</Tailwind>
}
headerContent={
<SimpleKeyValueTable
data={{
[refExtra ? 'Parent Object' : 'Name']: (
<>
{objectName}{' '}
{objectVersions.loading ? (
<LoadingDots />
) : (
<>
[
<ObjectVersionsLink
entity={entityName}
project={projectName}
filter={{
objectName,
}}
versionCount={objectVersionCount}
neverPeek
variant="secondary"
<Tailwind>
<div className="grid w-full auto-cols-max grid-flow-col gap-[16px] text-[14px]">
<div className="block">
<p className="text-moon-500">Name</p>
<div className="flex items-center">
<ObjectVersionsLink
entity={entityName}
project={projectName}
filter={{objectName}}
versionCount={objectVersionCount}
neverPeek
variant="secondary">
<div className="group flex items-center font-semibold">
<span>{objectName}</span>
{objectVersions.loading ? (
<LoadingDots />
) : (
<span className="ml-[4px]">
({objectVersionCount} version
{objectVersionCount !== 1 ? 's' : ''})
</span>
)}
<Icon
name="forward-next"
width={16}
height={16}
className="ml-[2px] opacity-0 group-hover:opacity-100"
/>
]
</>
)}
</>
),
Version: <>{objectVersionIndex}</>,
...(refExtra
? {
Subpath: refExtra,
}
: {}),
// 'Type Version': (
// <TypeVersionLink
// entityName={entityName}
// projectName={projectName}
// typeName={typeName}
// version={typeVersionHash}
// />
// ),
}}
/>
</div>
</ObjectVersionsLink>
</div>
</div>
<div className="block">
<p className="text-moon-500">Version</p>
<p>{objectVersionIndex}</p>
</div>
{refExtra && (
<div className="block">
<p className="text-moon-500">Subpath</p>
<p>{refExtra}</p>
</div>
)}
</div>
</Tailwind>
}
// menuItems={[
// {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, {useMemo} from 'react';

import {Icon} from '../../../../Icon';
import {LoadingDots} from '../../../../LoadingDots';
import {Tailwind} from '../../../../Tailwind';
import {NotFoundPanel} from '../NotFoundPanel';
Expand All @@ -13,7 +14,6 @@ import {
import {CenteredAnimatedLoader} from './common/Loader';
import {
ScrollableTabContent,
SimpleKeyValueTable,
SimplePageLayoutWithHeader,
} from './common/SimplePageLayout';
import {TabUseOp} from './TabUseOp';
Expand Down Expand Up @@ -75,49 +75,71 @@ const OpVersionPageInner: React.FC<{
<SimplePageLayoutWithHeader
title={opVersionText(opId, versionIndex)}
headerContent={
<SimpleKeyValueTable
data={{
Name: (
<>
{opId}{' '}
{opVersions.loading ? (
<LoadingDots />
) : (
<>
[
<OpVersionsLink
entity={entity}
project={project}
filter={{
opName: opId,
}}
versionCount={opVersionCount}
neverPeek
variant="secondary"
/>
]
</>
)}
</>
),
Version: <>{versionIndex}</>,
Calls:
!callsStats.loading || opVersionCallCount > 0 ? (
<CallsLink
<Tailwind>
<div className="grid w-full auto-cols-max grid-flow-col gap-[16px] text-[14px]">
<div className="block">
<p className="text-moon-500">Name</p>
<div className="flex items-center">
<OpVersionsLink
entity={entity}
project={project}
callCount={opVersionCallCount}
filter={{
opVersionRefs: [uri],
opName: opId,
}}
versionCount={opVersionCount}
neverPeek
variant="secondary"
/>
variant="secondary">
<div className="group flex items-center font-semibold">
<span>{opId}</span>
{opVersions.loading ? (
<LoadingDots />
) : (
<span className="ml-[4px]">
({opVersionCount} version
{opVersionCount !== 1 ? 's' : ''})
</span>
)}
<Icon
name="forward-next"
width={16}
height={16}
className="ml-[2px] opacity-0 group-hover:opacity-100"
/>
</div>
</OpVersionsLink>
</div>
</div>
<div className="block">
<p className="text-moon-500">Version</p>
<p>{versionIndex}</p>
</div>
<div className="block">
<p className="text-moon-500">Calls:</p>
{!callsStats.loading || opVersionCallCount > 0 ? (
<div className="group flex w-max items-center">
<CallsLink
entity={entity}
project={project}
callCount={opVersionCallCount}
filter={{
opVersionRefs: [uri],
}}
neverPeek
variant="secondary"
/>
<Icon
name="forward-next"
width={16}
height={16}
className="ml-[2px] text-teal-500 opacity-0 hover:hidden group-hover:opacity-100"
/>
</div>
) : (
<></>
),
}}
/>
<p>-</p>
)}
</div>
</div>
</Tailwind>
}
tabs={[
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@ export const ObjectVersionsLink: React.FC<{
filter?: WFHighLevelObjectVersionFilter;
neverPeek?: boolean;
variant?: LinkVariant;
children?: React.ReactNode;
}> = props => {
const {peekingRouter, baseRouter} = useWeaveflowRouteContext();
const router = props.neverPeek ? baseRouter : peekingRouter;
Expand All @@ -440,9 +441,13 @@ export const ObjectVersionsLink: React.FC<{
props.project,
props.filter
)}>
{props.versionCount}
{props.countIsLimited ? '+' : ''} version
{props.versionCount !== 1 ? 's' : ''}
{props.children ?? (
<>
{props.versionCount}
{props.countIsLimited ? '+' : ''} version
{props.versionCount !== 1 ? 's' : ''}
</>
)}
</Link>
);
};
Expand All @@ -455,16 +460,21 @@ export const OpVersionsLink: React.FC<{
filter?: WFHighLevelOpVersionFilter;
neverPeek?: boolean;
variant?: LinkVariant;
children?: React.ReactNode;
}> = props => {
const {peekingRouter, baseRouter} = useWeaveflowRouteContext();
const router = props.neverPeek ? baseRouter : peekingRouter;
return (
<Link
$variant={props.variant}
to={router.opVersionsUIUrl(props.entity, props.project, props.filter)}>
{props.versionCount}
{props.countIsLimited ? '+' : ''} version
{props.versionCount !== 1 ? 's' : ''}
{props.children ?? (
<>
{props.versionCount}
{props.countIsLimited ? '+' : ''} version
{props.versionCount !== 1 ? 's' : ''}
</>
)}
</Link>
);
};

0 comments on commit f5a61d9

Please sign in to comment.