datajunction-ui 0.0.143 → 0.0.144

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datajunction-ui",
3
- "version": "0.0.143",
3
+ "version": "0.0.144",
4
4
  "description": "DataJunction UI",
5
5
  "module": "src/index.tsx",
6
6
  "repository": {
@@ -639,14 +639,14 @@ describe('NamespacePage', () => {
639
639
  git_branch: 'main',
640
640
  num_nodes: 10,
641
641
  invalid_node_count: 1,
642
- last_deployed_at: '2024-10-18T12:00:00+00:00',
642
+ last_updated_at: '2024-10-18T12:00:00+00:00',
643
643
  },
644
644
  {
645
645
  namespace: 'default.feature-xyz',
646
646
  git_branch: 'feature-xyz',
647
647
  num_nodes: 5,
648
648
  invalid_node_count: 0,
649
- last_deployed_at: null,
649
+ last_updated_at: null,
650
650
  },
651
651
  ];
652
652
 
@@ -797,7 +797,7 @@ describe('NamespacePage', () => {
797
797
  });
798
798
 
799
799
  describe('formatRelativeTime', () => {
800
- it('shows last_deployed_at timestamp on branch cards', async () => {
800
+ it('shows last_updated_at timestamp on branch cards', async () => {
801
801
  mockDjClient.getNamespaceGitConfig.mockResolvedValue({
802
802
  github_repo_path: 'org/repo',
803
803
  git_branch: 'main',
@@ -811,7 +811,7 @@ describe('NamespacePage', () => {
811
811
  git_branch: 'main',
812
812
  num_nodes: 3,
813
813
  invalid_node_count: 0,
814
- last_deployed_at: new Date(
814
+ last_updated_at: new Date(
815
815
  Date.now() - 2 * 24 * 60 * 60 * 1000,
816
816
  ).toISOString(),
817
817
  },
@@ -56,7 +56,7 @@ function DefaultBranchPreview({ groups, defaultBranchNs }) {
56
56
  margin: '20px',
57
57
  }}
58
58
  >
59
- {filtered.map(({ type, nodes: typeNodes, hasMore }, idx) => {
59
+ {filtered.map(({ type, nodes: typeNodes, hasMore, totalCount }, idx) => {
60
60
  const shown = typeNodes;
61
61
  const isLeftCol = idx % 2 === 0;
62
62
  return (
@@ -100,7 +100,8 @@ function DefaultBranchPreview({ groups, defaultBranchNs }) {
100
100
  borderRadius: '8px',
101
101
  }}
102
102
  >
103
- {typeNodes.length}
103
+ {totalCount ??
104
+ (hasMore ? `${MAX_PER_TYPE}+` : typeNodes.length)}
104
105
  </span>
105
106
  </span>
106
107
  {hasMore && (
@@ -440,6 +441,8 @@ export function NamespacePage() {
440
441
  )
441
442
  .then(result => {
442
443
  const edges = result?.data?.findNodesPaginated?.edges ?? [];
444
+ const totalCount =
445
+ result?.data?.findNodesPaginated?.totalCount ?? null;
443
446
  const nodes = edges.map(e => ({
444
447
  ...e.node,
445
448
  status: e.node.current?.status,
@@ -449,9 +452,10 @@ export function NamespacePage() {
449
452
  type,
450
453
  nodes: nodes.slice(0, MAX_PER_TYPE),
451
454
  hasMore: nodes.length > MAX_PER_TYPE,
455
+ totalCount,
452
456
  };
453
457
  })
454
- .catch(() => ({ type, nodes: [], hasMore: false })),
458
+ .catch(() => ({ type, nodes: [], hasMore: false, totalCount: null })),
455
459
  ),
456
460
  )
457
461
  .then(groups => setDefaultBranchGroups(groups))
@@ -1430,7 +1434,7 @@ export function NamespacePage() {
1430
1434
  {b.invalid_node_count} invalid
1431
1435
  </span>
1432
1436
  )}
1433
- {b.last_deployed_at && (
1437
+ {b.last_updated_at && (
1434
1438
  <span
1435
1439
  style={{
1436
1440
  display: 'flex',
@@ -1438,9 +1442,9 @@ export function NamespacePage() {
1438
1442
  gap: '3px',
1439
1443
  color: '#94a3b8',
1440
1444
  }}
1441
- title={new Date(
1442
- b.last_deployed_at,
1443
- ).toLocaleString()}
1445
+ title={`Last node update: ${new Date(
1446
+ b.last_updated_at,
1447
+ ).toLocaleString()}`}
1444
1448
  >
1445
1449
  <svg
1446
1450
  xmlns="http://www.w3.org/2000/svg"
@@ -1456,7 +1460,7 @@ export function NamespacePage() {
1456
1460
  <circle cx="12" cy="12" r="10" />
1457
1461
  <polyline points="12 6 12 12 16 14" />
1458
1462
  </svg>
1459
- {formatRelativeTime(b.last_deployed_at)}
1463
+ {formatRelativeTime(b.last_updated_at)}
1460
1464
  </span>
1461
1465
  )}
1462
1466
  </div>
@@ -60,6 +60,7 @@ export const DataJunctionAPI = {
60
60
  hasPrevPage
61
61
  startCursor
62
62
  }
63
+ totalCount
63
64
  edges {
64
65
  node {
65
66
  name