Skip to content

Commit dc916c0

Browse files
committed
Merge branch 'main' into kiahna-tucker/enable-manual-backfill
2 parents 1a320ac + d4a441a commit dc916c0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+921
-577
lines changed

.github/workflows/main.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- name: Stop previous
15-
uses: styfle/cancel-workflow-action@0.11.0
15+
uses: styfle/cancel-workflow-action@0.12.1
1616

1717
- name: Checkout
1818
uses: actions/checkout@v4
@@ -37,7 +37,7 @@ jobs:
3737
runs-on: ubuntu-latest
3838
steps:
3939
- name: Stop previous
40-
uses: styfle/cancel-workflow-action@0.11.0
40+
uses: styfle/cancel-workflow-action@0.12.1
4141

4242
- name: Checkout
4343
uses: actions/checkout@v4
@@ -84,7 +84,7 @@ jobs:
8484

8585
steps:
8686
- name: Stop previous
87-
uses: styfle/cancel-workflow-action@0.11.0
87+
uses: styfle/cancel-workflow-action@0.12.1
8888

8989
- name: Checkout
9090
uses: actions/checkout@v4

src/api/storageMappings.ts

+3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ const getStorageMappings = (
2121
catalog_prefix,
2222
updated_at
2323
`
24+
// TODO (storage mappins) including count will make pagination work but
25+
// it makes this table take around 3.3 SECONDS in production.
26+
// { count: 'exact' }
2427
);
2528

2629
queryBuilder = defaultTableFilter(

src/components/collection/DataPreview/index.tsx

+9-2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { LiveSpecsQuery_spec, useLiveSpecs_spec } from 'hooks/useLiveSpecs';
1212
import { Refresh } from 'iconoir-react';
1313
import { useMemo } from 'react';
1414
import { FormattedMessage } from 'react-intl';
15+
import { BASE_ERROR } from 'services/supabase';
1516
import { hasLength } from 'utils/misc-utils';
1617
import ListViewSkeleton from './ListViewSkeleton';
1718

@@ -56,6 +57,12 @@ export function DataPreview({ collectionName }: Props) {
5657
const journalData = useJournalData(journal?.name, collectionName, {
5758
desiredCount: 20,
5859
});
60+
const readError = journalData.error
61+
? {
62+
...BASE_ERROR,
63+
message: journalData.error.message,
64+
}
65+
: journalsError;
5966

6067
// There is a brief delay between when the data preview card is rendered and the two journal-related
6168
// hooks are called, which resulted in `isLoading` being a false negative. If the journal client is
@@ -118,8 +125,8 @@ export function DataPreview({ collectionName }: Props) {
118125
notFoundTitleMessage="collectionsPreview.notFound.message"
119126
/>
120127

121-
{journalsError ? (
122-
<Error error={journalsError} condensed />
128+
{readError ? (
129+
<Error error={readError} condensed />
123130
) : isLoading ? (
124131
<ListViewSkeleton />
125132
) : (journalData.data?.documents.length ?? 0) > 0 && spec ? (

src/components/shared/Entity/Details/Ops/index.tsx

+64-78
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
1-
import { Box, Button, Stack } from '@mui/material';
2-
import KeyValueList from 'components/shared/KeyValueList';
3-
import UnderDev from 'components/shared/UnderDev';
4-
import LogsTable from 'components/tables/Logs';
1+
import { Box, Stack } from '@mui/material';
52
import { useJournalData } from 'hooks/journals/useJournalData';
63
import useJournalNameForLogs from 'hooks/journals/useJournalNameForLogs';
74
import useGlobalSearchParams, {
85
GlobalSearchParams,
96
} from 'hooks/searchParams/useGlobalSearchParams';
107
import { useEffect, useMemo, useState } from 'react';
118
import { OpsLogFlowDocument } from 'types';
12-
import { MEGABYTE } from 'utils/dataPlane-utils';
13-
14-
const maxBytes = Math.round(MEGABYTE / 25);
9+
import Error from 'components/shared/Error';
10+
import { BASE_ERROR } from 'services/supabase';
11+
import LogsTable from 'components/tables/Logs';
12+
import { maxBytes, START_OF_LOGS_UUID } from 'components/tables/Logs/shared';
13+
import { useIntl } from 'react-intl';
1514

1615
function Ops() {
16+
const intl = useIntl();
17+
1718
const [fetchingMore, setFetchingMore] = useState(false);
1819
const [olderFinished, setOlderFinished] = useState(false);
1920
const [lastParsed, setLastParsed] = useState<number>(0);
@@ -24,9 +25,13 @@ function Ops() {
2425

2526
// TODO (typing)
2627
// need to handle typing
27-
const { data, loading, refresh } = useJournalData(name, collectionName, {
28-
maxBytes,
29-
});
28+
const { data, error, loading, refresh } = useJournalData(
29+
name,
30+
collectionName,
31+
{
32+
maxBytes,
33+
}
34+
);
3035

3136
const documents = useMemo(
3237
() => (data?.documents ?? []) as OpsLogFlowDocument[],
@@ -47,11 +52,25 @@ function Ops() {
4752
if (parsedEnd !== lastParsed) {
4853
if (documents.length > 0) {
4954
const newDocs = [...documents, ...docs];
55+
56+
if (parsedEnd === 0) {
57+
newDocs.unshift({
58+
_meta: {
59+
uuid: START_OF_LOGS_UUID,
60+
},
61+
level: 'info',
62+
message: intl.formatMessage({
63+
id: 'ops.logsTable.allOldLogsLoaded',
64+
}),
65+
ts: '',
66+
});
67+
}
68+
5069
setDocs(newDocs);
5170
setFetchingMore(false);
5271
}
5372
}
54-
}, [data?.meta, docs, documents, lastParsed]);
73+
}, [data?.meta, docs, documents, intl, lastParsed]);
5574

5675
useEffect(() => {
5776
// Get the mete data out of the response
@@ -65,82 +84,49 @@ function Ops() {
6584
// Keep track of where we last read data from so we can keep stepping backwards through the file
6685
setLastParsed(parsedEnd ?? 0);
6786

68-
// If we have hit 0 then we now we hit the start of the data are nothing older is available
87+
// If we have hit 0 then we now we hit the start of the data any nothing older is available
6988
if (parsedEnd === 0) {
7089
setOlderFinished(true);
7190
}
7291
}, [data?.meta]);
7392

7493
return (
7594
<Box>
76-
<UnderDev />
7795
<Box>
78-
<KeyValueList
79-
sectionTitle="Debugging Values"
80-
data={[
81-
{ title: 'Documents', val: docs.length },
82-
{ title: 'Last Byte Parsed', val: lastParsed },
83-
]}
84-
/>
85-
86-
<Stack spacing={2} direction="row">
87-
<Button
88-
disabled={loading || fetchingMore || olderFinished}
89-
onClick={() => {
90-
setFetchingMore(true);
91-
refresh({
92-
offset: 0,
93-
endOffset: lastParsed,
94-
});
95-
}}
96-
>
97-
Load Older
98-
</Button>
99-
100-
<Button
101-
disabled={loading || fetchingMore}
102-
onClick={() => {
103-
setFetchingMore(true);
104-
refresh();
105-
}}
106-
>
107-
Load Newer
108-
</Button>
109-
</Stack>
110-
11196
<Stack spacing={2}>
112-
{/* <JournalAlerts
113-
journalData={journalData}
114-
notFoundTitleMessage={
115-
<FormattedMessage
116-
id="ops.journals.notFound.message"
117-
values={{
118-
entityType,
119-
}}
120-
/>
121-
}
122-
/>*/}
123-
124-
<LogsTable
125-
documents={docs}
126-
loading={fetchingMore || loading}
127-
fetchNewer={() => {
128-
console.log('fetcher latest logs');
129-
130-
// setLoading(true);
131-
// setTimeout(() => setLoading(false), 2500);
132-
}}
133-
fetchOlder={
134-
olderFinished
135-
? undefined
136-
: () => {
137-
console.log('fetch older logs');
138-
139-
// setLoading(true);
140-
// setTimeout(() => setLoading(false), 2500);
141-
}
142-
}
143-
/>
97+
{error ? (
98+
<Error
99+
error={{
100+
...BASE_ERROR,
101+
message: error.message,
102+
}}
103+
condensed
104+
/>
105+
) : null}
106+
107+
<Box>
108+
<LogsTable
109+
documents={docs}
110+
loading={fetchingMore || loading}
111+
fetchNewer={() => {
112+
setFetchingMore(true);
113+
refresh();
114+
}}
115+
fetchOlder={
116+
olderFinished
117+
? undefined
118+
: () => {
119+
console.log('fetch older logs');
120+
121+
setFetchingMore(true);
122+
refresh({
123+
offset: 0,
124+
endOffset: lastParsed,
125+
});
126+
}
127+
}
128+
/>
129+
</Box>
144130
</Stack>
145131
</Box>
146132
</Box>

src/components/shared/Entity/EndpointConfig/index.tsx

+14-6
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { useEffect, useMemo } from 'react';
1313
import { useIntl } from 'react-intl';
1414
import { useMount, useUnmount } from 'react-use';
1515
import { createJSONFormDefaults } from 'services/ajv';
16+
import { useDetailsForm_unsupportedConnectorVersion } from 'stores/DetailsForm/hooks';
1617
import {
1718
useEndpointConfigStore_endpointConfig_data,
1819
useEndpointConfigStore_endpointSchema,
@@ -69,6 +70,9 @@ function EndpointConfig({
6970
useEndpointConfigStore_setEncryptedEndpointConfig();
7071
const endpointConfigErrorsExist = useEndpointConfigStore_errorsExist();
7172

73+
const unsupportedConnectorVersion =
74+
useDetailsForm_unsupportedConnectorVersion();
75+
7276
// Workflow related props
7377
const workflow = useEntityWorkflow();
7478
const editWorkflow =
@@ -103,7 +107,11 @@ function EndpointConfig({
103107
);
104108

105109
useEffect(() => {
106-
if (connectorTag?.endpoint_spec_schema && endpointSchemaChanged) {
110+
if (
111+
unsupportedConnectorVersion &&
112+
connectorTag?.endpoint_spec_schema &&
113+
endpointSchemaChanged
114+
) {
107115
// force some new data in
108116
setServerUpdateRequired(true);
109117
setEncryptedEndpointConfig({
@@ -121,14 +129,14 @@ function EndpointConfig({
121129
setPreviousEndpointConfig(defaultConfig);
122130
}
123131
}, [
124-
setServerUpdateRequired,
125-
setEndpointConfig,
126-
setEndpointSchema,
127-
setPreviousEndpointConfig,
128-
connectorTag,
129132
connectorTag?.endpoint_spec_schema,
130133
endpointSchemaChanged,
131134
setEncryptedEndpointConfig,
135+
setEndpointConfig,
136+
setEndpointSchema,
137+
setPreviousEndpointConfig,
138+
setServerUpdateRequired,
139+
unsupportedConnectorVersion,
132140
]);
133141

134142
// Controlling if we need to show the generate button again

src/components/shared/Entity/Shard/TableFooter.tsx

+7-13
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
1-
import {
2-
SxProps,
3-
TableFooter,
4-
TablePagination,
5-
TableRow,
6-
Theme,
7-
useTheme,
8-
} from '@mui/material';
1+
import { TableFooter, TablePagination, TableRow } from '@mui/material';
92
import { semiTransparentBackground } from 'context/Theme';
103
import { useShardDetail_readDictionary } from 'stores/ShardDetail/hooks';
114
import { ShardEntityTypes } from 'stores/ShardDetail/types';
@@ -25,16 +18,17 @@ function InformationTableFooter({
2518
taskTypes,
2619
taskName,
2720
}: Props) {
28-
const theme = useTheme();
29-
const tableHeaderFooterSx: SxProps<Theme> = {
30-
bgcolor: semiTransparentBackground[theme.palette.mode],
31-
};
3221
const dictionaryVals = useShardDetail_readDictionary(taskName, taskTypes);
3322
const count = dictionaryVals.allShards.length;
3423

3524
return (
3625
<TableFooter>
37-
<TableRow sx={{ ...tableHeaderFooterSx }}>
26+
<TableRow
27+
sx={{
28+
bgcolor: (theme) =>
29+
semiTransparentBackground[theme.palette.mode],
30+
}}
31+
>
3832
{count > 0 ? (
3933
<TablePagination
4034
count={count}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import { Button, Stack, Typography } from '@mui/material';
2+
import { FormattedMessage } from 'react-intl';
3+
import ErrorDialog from './index';
4+
5+
const ARIA_NAME = 'OauthWindowOpenerMissing';
6+
7+
function OauthWindowOpenerMissing() {
8+
return (
9+
<ErrorDialog
10+
body={
11+
<Stack spacing={2}>
12+
<Typography>
13+
<FormattedMessage id="oauth.windowOpener.error.message1" />
14+
</Typography>
15+
<Typography>
16+
<FormattedMessage id="oauth.windowOpener.error.message2" />
17+
</Typography>
18+
</Stack>
19+
}
20+
bodyTitle={<FormattedMessage id="oauth.windowOpener.error.title" />}
21+
cta={
22+
<Button
23+
onClick={() => {
24+
window.close();
25+
}}
26+
>
27+
<FormattedMessage id="cta.close" />
28+
</Button>
29+
}
30+
dialogTitle={
31+
<FormattedMessage id="oauth.windowOpener.error.dialog.title" />
32+
}
33+
name={ARIA_NAME}
34+
/>
35+
);
36+
}
37+
38+
export default OauthWindowOpenerMissing;

0 commit comments

Comments
 (0)