Add some TODO's

This commit is contained in:
Laurent Nguyen 2024-03-28 11:45:26 +01:00
parent 98c4d31717
commit 37940fb297

View File

@ -112,7 +112,6 @@ const DocumentsTabComponent: React.FunctionComponent<{
]); ]);
const [documentIds, setDocumentIds] = useState<DocumentId[]>([]); const [documentIds, setDocumentIds] = useState<DocumentId[]>([]);
const [isExecuting, setIsExecuting] = useState<boolean>(false); // TODO isExecuting is a member of TabsBase. We may need to update this field. const [isExecuting, setIsExecuting] = useState<boolean>(false); // TODO isExecuting is a member of TabsBase. We may need to update this field.
const [dataContentsGridScrollHeight, setDataContentsGridScrollHeight] = useState<string>(undefined);
// Query // Query
const [documentsIterator, setDocumentsIterator] = useState<{ const [documentsIterator, setDocumentsIterator] = useState<{
@ -120,11 +119,11 @@ const DocumentsTabComponent: React.FunctionComponent<{
applyFilterButtonPressed: boolean; applyFilterButtonPressed: boolean;
}>(undefined); }>(undefined);
const [queryAbortController, setQueryAbortController] = useState<AbortController>(undefined); const [queryAbortController, setQueryAbortController] = useState<AbortController>(undefined);
const [resourceTokenPartitionKey, setResourceTokenPartitionKey] = useState<string>(undefined); const [resourceTokenPartitionKey, setResourceTokenPartitionKey] = useState<string>(undefined); // TODO: Make this a constant is setter getting called
const [isQueryCopilotSampleContainer, setIsQueryCopilotSampleContainer] = useState<boolean>(false); const [isQueryCopilotSampleContainer, setIsQueryCopilotSampleContainer] = useState<boolean>(false); // TODO: Make this a constant is setter getting called
const [cancelQueryTimeoutID, setCancelQueryTimeoutID] = useState<NodeJS.Timeout>(undefined); const [cancelQueryTimeoutID, setCancelQueryTimeoutID] = useState<NodeJS.Timeout>(undefined);
const [isExecutionError, setIsExecutionError] = useState<boolean>(false); const [isExecutionError, setIsExecutionError] = useState<boolean>(false); // TODO: Where is this used?
const [onLoadStartKey, setOnLoadStartKey] = useState<number>(props.onLoadStartKey); const [onLoadStartKey, setOnLoadStartKey] = useState<number>(props.onLoadStartKey);
const [initialDocumentContent, setInitialDocumentContent] = useState<string>(undefined); const [initialDocumentContent, setInitialDocumentContent] = useState<string>(undefined);
@ -271,6 +270,7 @@ const DocumentsTabComponent: React.FunctionComponent<{
visible: true, visible: true,
}; };
// TODO: Where is this used?
const documentContentsContainerId = `documentContentsContainer${props.tabId}`; const documentContentsContainerId = `documentContentsContainer${props.tabId}`;
const documentContentsGridId = `documentContentsGrid${props.tabId}`; const documentContentsGridId = `documentContentsGrid${props.tabId}`;
@ -520,8 +520,8 @@ const DocumentsTabComponent: React.FunctionComponent<{
? `the selected ${selectedRows.size} items` ? `the selected ${selectedRows.size} items`
: "the selected item" : "the selected item"
: isPlural : isPlural
? `the selected ${selectedRows.size} documents` ? `the selected ${selectedRows.size} documents`
: "the selected document"; : "the selected document";
const msg = `Are you sure you want to delete ${documentName}?`; const msg = `Are you sure you want to delete ${documentName}?`;
useDialog.getState().showOkCancelModalDialog( useDialog.getState().showOkCancelModalDialog(
@ -828,6 +828,7 @@ const DocumentsTabComponent: React.FunctionComponent<{
return documentsIterator.iterator.fetchNext().then((response) => response.resources); return documentsIterator.iterator.fetchNext().then((response) => response.resources);
}; };
// TODO: use this when generating column headers
const showPartitionKey = (() => { const showPartitionKey = (() => {
if (!props.collection) { if (!props.collection) {
return false; return false;
@ -1146,7 +1147,7 @@ const DocumentsTabComponent: React.FunctionComponent<{
<button <button
className="filterbtnstyle queryButton" className="filterbtnstyle queryButton"
onClick={onShowFilterClick} onClick={onShowFilterClick}
/*data-bind="click: onShowFilterClick"*/ /*data-bind="click: onShowFilterClick"*/
> >
Edit Filter Edit Filter
</button> </button>
@ -1196,7 +1197,7 @@ const DocumentsTabComponent: React.FunctionComponent<{
} }
value={filterContent} value={filterContent}
onChange={(e) => setFilterContent(e.target.value)} onChange={(e) => setFilterContent(e.target.value)}
/* /*
data-bind=" data-bind="
W attr:{ W attr:{
placeholder:isPreferredApiMongoDB?'Type a query predicate (e.g., {´a´:´foo´}), or choose one from the drop down list, or leave empty to query all documents.':'Type a query predicate (e.g., WHERE c.id=´1´), or choose one from the drop down list, or leave empty to query all documents.' placeholder:isPreferredApiMongoDB?'Type a query predicate (e.g., {´a´:´foo´}), or choose one from the drop down list, or leave empty to query all documents.':'Type a query predicate (e.g., WHERE c.id=´1´), or choose one from the drop down list, or leave empty to query all documents.'
@ -1249,7 +1250,7 @@ textInput: filterContent"
tabIndex={0} tabIndex={0}
onClick={onHideFilterClick} onClick={onHideFilterClick}
onKeyDown={onCloseButtonKeyDown} onKeyDown={onCloseButtonKeyDown}
/*data-bind="click: onHideFilterClick, event: { keydown: onCloseButtonKeyDown }"*/ /*data-bind="click: onHideFilterClick, event: { keydown: onCloseButtonKeyDown }"*/
> >
<img src={CloseIcon} style={{ height: 14, width: 14 }} alt="Hide filter" /> <img src={CloseIcon} style={{ height: 14, width: 14 }} alt="Hide filter" />
</span> </span>