(false);
+ const { exportData, exportOptions } = useExport();
const selectedItemsText = checkableRows ? `Selected: ${numberOfCheckedItems}/${numberOfItems}` : `Items: ${numberOfItems}`;
@@ -42,6 +57,23 @@ const Panel = (props: PanelProps) => {
setIsRefreshing(false);
};
+ const exportAsCsv = useCallback(() => {
+ const exportColumns = table
+ .getVisibleLeafColumns()
+ .map((c) => c.id)
+ .join(exportOptions.separator);
+ const csvString = table
+ .getRowModel()
+ .rows.map((row) =>
+ row
+ .getVisibleCells()
+ .map((cell) => cell.getValue())
+ .join(exportOptions.separator)
+ )
+ .join(exportOptions.newLineCharacter);
+ exportData(downloadToCsvFileName, exportColumns, csvString);
+ }, [columns, table]);
+
return (
@@ -59,6 +91,11 @@ const Panel = (props: PanelProps) => {
Refresh
)}
+ {downloadToCsvFileName != null && (
+
+ )}
{panelElements}
);
diff --git a/Src/WitsmlExplorer.Frontend/components/ContentViews/table/contentTableUtils.ts b/Src/WitsmlExplorer.Frontend/components/ContentViews/table/contentTableUtils.ts
index f630cfb0b..ded396f14 100644
--- a/Src/WitsmlExplorer.Frontend/components/ContentViews/table/contentTableUtils.ts
+++ b/Src/WitsmlExplorer.Frontend/components/ContentViews/table/contentTableUtils.ts
@@ -7,6 +7,7 @@ export const selectId = "select";
export const expanderId = "expander";
export const activeId = "active"; //implemented specifically for LogCurveInfoListView, needs rework if other views will also use filtering
export const measureSortingFn = "measure";
+export const componentSortingFn = "component";
export const constantTableOptions = {
enableColumnResizing: true,
diff --git a/Src/WitsmlExplorer.Frontend/components/ContentViews/table/tableParts.ts b/Src/WitsmlExplorer.Frontend/components/ContentViews/table/tableParts.ts
index 6f2155203..fe39a900c 100644
--- a/Src/WitsmlExplorer.Frontend/components/ContentViews/table/tableParts.ts
+++ b/Src/WitsmlExplorer.Frontend/components/ContentViews/table/tableParts.ts
@@ -27,6 +27,7 @@ export interface ContentTableProps {
showRefresh?: boolean;
stickyLeftColumns?: number; // how many columns should be sticky
viewId?: string; //id that will be used to save view settings to local storage, or null if should not save
+ downloadToCsvFileName?: string;
}
export enum Order {
@@ -38,5 +39,6 @@ export enum ContentType {
String,
Number,
DateTime,
- Measure
+ Measure,
+ Component
}
diff --git a/Src/WitsmlExplorer.Frontend/components/ContextMenus/LogObjectContextMenu.tsx b/Src/WitsmlExplorer.Frontend/components/ContextMenus/LogObjectContextMenu.tsx
index 257a510c6..66672e62b 100644
--- a/Src/WitsmlExplorer.Frontend/components/ContextMenus/LogObjectContextMenu.tsx
+++ b/Src/WitsmlExplorer.Frontend/components/ContextMenus/LogObjectContextMenu.tsx
@@ -6,9 +6,11 @@ import NavigationContext from "../../contexts/navigationContext";
import OperationContext from "../../contexts/operationContext";
import OperationType from "../../contexts/operationType";
import { ComponentType } from "../../models/componentType";
+import CheckLogHeaderJob from "../../models/jobs/checkLogHeaderJob";
import { CopyRangeClipboard } from "../../models/jobs/componentReferences";
import { CopyComponentsJob } from "../../models/jobs/copyJobs";
import ObjectReference from "../../models/jobs/objectReference";
+import LogObject from "../../models/logObject";
import ObjectOnWellbore, { toObjectReference } from "../../models/objectOnWellbore";
import { ObjectType } from "../../models/objectType";
import { Server } from "../../models/server";
@@ -20,9 +22,10 @@ import LogDataImportModal, { LogDataImportModalProps } from "../Modals/LogDataIm
import LogPropertiesModal from "../Modals/LogPropertiesModal";
import { PropertiesModalMode } from "../Modals/ModalParts";
import ObjectPickerModal, { ObjectPickerProps } from "../Modals/ObjectPickerModal";
+import { ReportModal } from "../Modals/ReportModal";
import TrimLogObjectModal, { TrimLogObjectModalProps } from "../Modals/TrimLogObject/TrimLogObjectModal";
import ContextMenu from "./ContextMenu";
-import { menuItemText, StyledIcon } from "./ContextMenuUtils";
+import { StyledIcon, menuItemText } from "./ContextMenuUtils";
import { onClickPaste } from "./CopyUtils";
import { ObjectContextMenuProps, ObjectMenuItems } from "./ObjectMenuItems";
import { useClipboardComponentReferencesOfType } from "./UseClipboardComponentReferences";
@@ -89,6 +92,15 @@ const LogObjectContextMenu = (props: ObjectContextMenuProps): React.ReactElement
});
};
+ const onClickCheckHeader = async () => {
+ dispatchOperation({ type: OperationType.HideContextMenu });
+ const logReference: LogObject = checkedObjects[0];
+ const checkLogHeaderJob: CheckLogHeaderJob = { logReference };
+ const jobId = await JobService.orderJob(JobType.CheckLogHeader, checkLogHeaderJob);
+ const reportModalProps = { jobId };
+ dispatchOperation({ type: OperationType.DisplayModal, payload: });
+ };
+
return (
Import log data from .csv
,
+ ,
,