Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Edit Server deletion date not working
  • Loading branch information
MVarshini authored Aug 25, 2023
1 parent ba208a4 commit cc58130
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
IS_ITEM_SEEN,
NAME_KEY,
ROWS_PER_PAGE,
SERVER_DELETION_KEY,
START_PAGE_NUMBER,
USER_FAVORITE,
} from "assets/constants/overviewConstants";
Expand All @@ -29,6 +30,7 @@ import React, { useCallback, useState } from "react";
import {
deleteDataset,
editMetadata,
getEditedMetadata,
getMetaDataActions,
setRows,
setRowtoEdit,
Expand Down Expand Up @@ -97,8 +99,7 @@ const NewRunsComponent = () => {
dispatch(getMetaDataActions(dataset, "favorite", isFavoriting));
};
const saveRowData = (dataset) => {
const item = newRuns.find((run) => run.resource_id === dataset.resource_id);
dispatch(getMetaDataActions(dataset, "datasetName", item.name));
dispatch(getEditedMetadata(dataset, "newRuns"));
};
const moreActionItems = (dataset) => [
{
Expand Down Expand Up @@ -200,6 +201,13 @@ const NewRunsComponent = () => {
saveRowData={saveRowData}
rowActions={rowActions}
item={item}
onDateSelect={(_event, str) =>
updateTblValue(
str,
SERVER_DELETION_KEY,
item.resource_id
)
}
textInputEdit={(val) =>
updateTblValue(val, NAME_KEY, item.resource_id)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ const SavedRunsComponent = () => {
updateTblValue(val, NAME_KEY, item.resource_id)
}
toggleEdit={toggleEdit}
onDateSelect={(str) =>
onDateSelect={(_event, str) =>
updateTblValue(
str,
SERVER_DELETION_KEY,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,14 @@ export const NewRunsRow = (props) => {
)}
</Td>
<Td dataLabel={columnNames.endtime}>
{formatDateTime(item.metadata[SERVER_DELETION])}
{item[CONSTANTS.IS_EDIT] ? (
<SelectDateComponent
value={item.metadata[SERVER_DELETION]}
onDateSelect={props.onDateSelect}
/>
) : (
formatDateTime(item.metadata[SERVER_DELETION])
)}
</Td>
<Td
favorites={{
Expand Down

0 comments on commit cc58130

Please sign in to comment.