datajunction-ui 0.0.75 → 0.0.76

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.
Files changed (29) hide show
  1. package/package.json +1 -1
  2. package/src/app/components/DashboardCard.jsx +93 -0
  3. package/src/app/components/NodeComponents.jsx +173 -0
  4. package/src/app/components/NodeListActions.jsx +8 -3
  5. package/src/app/components/__tests__/NodeComponents.test.jsx +262 -0
  6. package/src/app/hooks/__tests__/useWorkspaceData.test.js +533 -0
  7. package/src/app/hooks/useWorkspaceData.js +357 -0
  8. package/src/app/index.tsx +6 -0
  9. package/src/app/pages/MyWorkspacePage/ActiveBranchesSection.jsx +344 -0
  10. package/src/app/pages/MyWorkspacePage/CollectionsSection.jsx +188 -0
  11. package/src/app/pages/MyWorkspacePage/Loadable.jsx +6 -0
  12. package/src/app/pages/MyWorkspacePage/MaterializationsSection.jsx +190 -0
  13. package/src/app/pages/MyWorkspacePage/MyNodesSection.jsx +342 -0
  14. package/src/app/pages/MyWorkspacePage/MyWorkspacePage.css +632 -0
  15. package/src/app/pages/MyWorkspacePage/NeedsAttentionSection.jsx +185 -0
  16. package/src/app/pages/MyWorkspacePage/NodeList.jsx +46 -0
  17. package/src/app/pages/MyWorkspacePage/NotificationsSection.jsx +133 -0
  18. package/src/app/pages/MyWorkspacePage/TypeGroupGrid.jsx +209 -0
  19. package/src/app/pages/MyWorkspacePage/__tests__/ActiveBranchesSection.test.jsx +295 -0
  20. package/src/app/pages/MyWorkspacePage/__tests__/CollectionsSection.test.jsx +278 -0
  21. package/src/app/pages/MyWorkspacePage/__tests__/MaterializationsSection.test.jsx +238 -0
  22. package/src/app/pages/MyWorkspacePage/__tests__/MyNodesSection.test.jsx +389 -0
  23. package/src/app/pages/MyWorkspacePage/__tests__/MyWorkspacePage.test.jsx +347 -0
  24. package/src/app/pages/MyWorkspacePage/__tests__/NeedsAttentionSection.test.jsx +272 -0
  25. package/src/app/pages/MyWorkspacePage/__tests__/NodeList.test.jsx +162 -0
  26. package/src/app/pages/MyWorkspacePage/__tests__/NotificationsSection.test.jsx +204 -0
  27. package/src/app/pages/MyWorkspacePage/__tests__/TypeGroupGrid.test.jsx +556 -0
  28. package/src/app/pages/MyWorkspacePage/index.jsx +150 -0
  29. package/src/app/services/DJService.js +323 -2
@@ -73,8 +73,10 @@ export const DataJunctionAPI = {
73
73
  mode
74
74
  updatedAt
75
75
  }
76
- createdBy {
77
- username
76
+ gitInfo {
77
+ repo
78
+ branch
79
+ defaultBranch
78
80
  }
79
81
  }
80
82
  }
@@ -1910,6 +1912,325 @@ export const DataJunctionAPI = {
1910
1912
  return await response.json();
1911
1913
  },
1912
1914
 
1915
+ // ===== My Workspace GraphQL Queries =====
1916
+
1917
+ getWorkspaceRecentlyEdited: async function (username, limit = 10) {
1918
+ // Nodes the user has edited, ordered by last updated (excluding source nodes)
1919
+ const query = `
1920
+ query RecentlyEdited($editedBy: String!, $limit: Int!, $nodeTypes: [NodeType!]) {
1921
+ findNodesPaginated(editedBy: $editedBy, limit: $limit, nodeTypes: $nodeTypes, orderBy: UPDATED_AT, ascending: false) {
1922
+ edges {
1923
+ node {
1924
+ name
1925
+ type
1926
+ currentVersion
1927
+ current {
1928
+ displayName
1929
+ status
1930
+ mode
1931
+ updatedAt
1932
+ }
1933
+ gitInfo {
1934
+ repo
1935
+ branch
1936
+ defaultBranch
1937
+ isDefaultBranch
1938
+ parentNamespace
1939
+ gitOnly
1940
+ }
1941
+ }
1942
+ }
1943
+ }
1944
+ }
1945
+ `;
1946
+ return await (
1947
+ await fetch(DJ_GQL, {
1948
+ method: 'POST',
1949
+ headers: { 'Content-Type': 'application/json' },
1950
+ credentials: 'include',
1951
+ body: JSON.stringify({
1952
+ query,
1953
+ variables: {
1954
+ editedBy: username,
1955
+ limit,
1956
+ nodeTypes: ['TRANSFORM', 'METRIC', 'DIMENSION', 'CUBE'],
1957
+ },
1958
+ }),
1959
+ })
1960
+ ).json();
1961
+ },
1962
+
1963
+ getWorkspaceOwnedNodes: async function (username, limit = 10) {
1964
+ // Owned nodes ordered by UPDATED_AT (excluding source nodes)
1965
+ const query = `
1966
+ query OwnedNodes($ownedBy: String!, $limit: Int!, $nodeTypes: [NodeType!]) {
1967
+ findNodesPaginated(ownedBy: $ownedBy, limit: $limit, nodeTypes: $nodeTypes, orderBy: UPDATED_AT, ascending: false) {
1968
+ edges {
1969
+ node {
1970
+ name
1971
+ type
1972
+ currentVersion
1973
+ current {
1974
+ displayName
1975
+ status
1976
+ mode
1977
+ updatedAt
1978
+ }
1979
+ gitInfo {
1980
+ repo
1981
+ branch
1982
+ defaultBranch
1983
+ isDefaultBranch
1984
+ parentNamespace
1985
+ gitOnly
1986
+ }
1987
+ }
1988
+ }
1989
+ }
1990
+ }
1991
+ `;
1992
+ return await (
1993
+ await fetch(DJ_GQL, {
1994
+ method: 'POST',
1995
+ headers: { 'Content-Type': 'application/json' },
1996
+ credentials: 'include',
1997
+ body: JSON.stringify({
1998
+ query,
1999
+ variables: {
2000
+ ownedBy: username,
2001
+ limit,
2002
+ nodeTypes: ['TRANSFORM', 'METRIC', 'DIMENSION', 'CUBE'],
2003
+ },
2004
+ }),
2005
+ })
2006
+ ).json();
2007
+ },
2008
+
2009
+ getWorkspaceCollections: async function (username) {
2010
+ const query = `
2011
+ query UserCollections($createdBy: String!) {
2012
+ listCollections(createdBy: $createdBy) {
2013
+ name
2014
+ description
2015
+ nodeCount
2016
+ }
2017
+ }
2018
+ `;
2019
+ return await (
2020
+ await fetch(DJ_GQL, {
2021
+ method: 'POST',
2022
+ headers: { 'Content-Type': 'application/json' },
2023
+ credentials: 'include',
2024
+ body: JSON.stringify({
2025
+ query,
2026
+ variables: { createdBy: username },
2027
+ }),
2028
+ })
2029
+ ).json();
2030
+ },
2031
+
2032
+ listAllCollections: async function () {
2033
+ const query = `
2034
+ query AllCollections {
2035
+ listCollections {
2036
+ name
2037
+ description
2038
+ nodeCount
2039
+ createdBy {
2040
+ username
2041
+ }
2042
+ }
2043
+ }
2044
+ `;
2045
+ return await (
2046
+ await fetch(DJ_GQL, {
2047
+ method: 'POST',
2048
+ headers: { 'Content-Type': 'application/json' },
2049
+ credentials: 'include',
2050
+ body: JSON.stringify({ query }),
2051
+ })
2052
+ ).json();
2053
+ },
2054
+
2055
+ getWorkspaceNodesMissingDescription: async function (username, limit = 5) {
2056
+ const query = `
2057
+ query NodesMissingDescription($ownedBy: String!, $limit: Int!) {
2058
+ findNodesPaginated(ownedBy: $ownedBy, missingDescription: true, limit: $limit) {
2059
+ edges {
2060
+ node {
2061
+ name
2062
+ type
2063
+ current {
2064
+ displayName
2065
+ status
2066
+ }
2067
+ }
2068
+ }
2069
+ }
2070
+ }
2071
+ `;
2072
+ return await (
2073
+ await fetch(DJ_GQL, {
2074
+ method: 'POST',
2075
+ headers: { 'Content-Type': 'application/json' },
2076
+ credentials: 'include',
2077
+ body: JSON.stringify({
2078
+ query,
2079
+ variables: { ownedBy: username, limit },
2080
+ }),
2081
+ })
2082
+ ).json();
2083
+ },
2084
+
2085
+ getWorkspaceInvalidNodes: async function (username, limit = 10) {
2086
+ // Nodes the user owns that have INVALID status
2087
+ const query = `
2088
+ query InvalidNodes($ownedBy: String!, $limit: Int!, $statuses: [NodeStatus!]) {
2089
+ findNodesPaginated(ownedBy: $ownedBy, statuses: $statuses, limit: $limit) {
2090
+ edges {
2091
+ node {
2092
+ name
2093
+ type
2094
+ current {
2095
+ displayName
2096
+ status
2097
+ }
2098
+ }
2099
+ }
2100
+ }
2101
+ }
2102
+ `;
2103
+ return await (
2104
+ await fetch(DJ_GQL, {
2105
+ method: 'POST',
2106
+ headers: { 'Content-Type': 'application/json' },
2107
+ credentials: 'include',
2108
+ body: JSON.stringify({
2109
+ query,
2110
+ variables: {
2111
+ ownedBy: username,
2112
+ limit,
2113
+ statuses: ['INVALID'],
2114
+ },
2115
+ }),
2116
+ })
2117
+ ).json();
2118
+ },
2119
+
2120
+ getWorkspaceOrphanedDimensions: async function (username, limit = 10) {
2121
+ // Dimension nodes the user owns that are not linked to by any other node
2122
+ const query = `
2123
+ query OrphanedDimensions($ownedBy: String!, $limit: Int!, $orphanedDimension: Boolean!) {
2124
+ findNodesPaginated(ownedBy: $ownedBy, orphanedDimension: $orphanedDimension, limit: $limit) {
2125
+ edges {
2126
+ node {
2127
+ name
2128
+ type
2129
+ current {
2130
+ displayName
2131
+ status
2132
+ }
2133
+ }
2134
+ }
2135
+ }
2136
+ }
2137
+ `;
2138
+ return await (
2139
+ await fetch(DJ_GQL, {
2140
+ method: 'POST',
2141
+ headers: { 'Content-Type': 'application/json' },
2142
+ credentials: 'include',
2143
+ body: JSON.stringify({
2144
+ query,
2145
+ variables: {
2146
+ ownedBy: username,
2147
+ limit,
2148
+ orphanedDimension: true,
2149
+ },
2150
+ }),
2151
+ })
2152
+ ).json();
2153
+ },
2154
+
2155
+ getWorkspaceDraftNodes: async function (username, limit = 50) {
2156
+ // Draft nodes the user owns (we'll filter for stale ones on frontend)
2157
+ const query = `
2158
+ query DraftNodes($ownedBy: String!, $limit: Int!, $mode: NodeMode!) {
2159
+ findNodesPaginated(ownedBy: $ownedBy, mode: $mode, limit: $limit, orderBy: UPDATED_AT, ascending: true) {
2160
+ edges {
2161
+ node {
2162
+ name
2163
+ type
2164
+ current {
2165
+ displayName
2166
+ status
2167
+ mode
2168
+ updatedAt
2169
+ }
2170
+ }
2171
+ }
2172
+ }
2173
+ }
2174
+ `;
2175
+ return await (
2176
+ await fetch(DJ_GQL, {
2177
+ method: 'POST',
2178
+ headers: { 'Content-Type': 'application/json' },
2179
+ credentials: 'include',
2180
+ body: JSON.stringify({
2181
+ query,
2182
+ variables: {
2183
+ ownedBy: username,
2184
+ limit,
2185
+ mode: 'DRAFT',
2186
+ },
2187
+ }),
2188
+ })
2189
+ ).json();
2190
+ },
2191
+
2192
+ getWorkspaceMaterializations: async function (username, limit = 20) {
2193
+ // Nodes the user owns that have materializations configured
2194
+ const query = `
2195
+ query MaterializedNodes($ownedBy: String!, $limit: Int!, $hasMaterialization: Boolean!) {
2196
+ findNodesPaginated(ownedBy: $ownedBy, limit: $limit, hasMaterialization: $hasMaterialization) {
2197
+ edges {
2198
+ node {
2199
+ name
2200
+ type
2201
+ current {
2202
+ displayName
2203
+ status
2204
+ materializations {
2205
+ name
2206
+ schedule
2207
+ job
2208
+ }
2209
+ availability {
2210
+ catalog
2211
+ table
2212
+ validThroughTs
2213
+ maxTemporalPartition
2214
+ }
2215
+ }
2216
+ }
2217
+ }
2218
+ }
2219
+ }
2220
+ `;
2221
+ return await (
2222
+ await fetch(DJ_GQL, {
2223
+ method: 'POST',
2224
+ headers: { 'Content-Type': 'application/json' },
2225
+ credentials: 'include',
2226
+ body: JSON.stringify({
2227
+ query,
2228
+ variables: { ownedBy: username, limit, hasMaterialization: true },
2229
+ }),
2230
+ })
2231
+ ).json();
2232
+ },
2233
+
1913
2234
  // =================================
1914
2235
  // Pre-aggregation API
1915
2236
  // =================================