Skip to content

Commit

Permalink
maybe now
Browse files Browse the repository at this point in the history
  • Loading branch information
emilia-friedberg committed Dec 9, 2024
1 parent 56a6416 commit 53c6999
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ exports[`RulesAnalysis Component matches snapshot when ai_type is AUTO_ML_AI_TYP
24
</td>
<td
class="rdtDay rdtToday"
class="rdtDay rdtActive"
data-month="11"
data-value="25"
data-year="2023"
Expand Down Expand Up @@ -731,7 +731,7 @@ exports[`RulesAnalysis Component matches snapshot when ai_type is AUTO_ML_AI_TYP
<input
class="form-control"
type="text"
value="2023-12-25 00:00"
value="2023-12-26 00:00"
/>
<div
class="rdtPicker"
Expand Down Expand Up @@ -1045,15 +1045,15 @@ exports[`RulesAnalysis Component matches snapshot when ai_type is AUTO_ML_AI_TYP
24
</td>
<td
class="rdtDay rdtToday"
class="rdtDay"
data-month="11"
data-value="25"
data-year="2023"
>
25
</td>
<td
class="rdtDay"
class="rdtDay rdtActive"
data-month="11"
data-value="26"
data-year="2023"
Expand Down Expand Up @@ -2133,7 +2133,7 @@ exports[`RulesAnalysis Component matches snapshot when ai_type is not AUTO_ML_AI
24
</td>
<td
class="rdtDay rdtToday"
class="rdtDay rdtActive"
data-month="11"
data-value="25"
data-year="2023"
Expand Down Expand Up @@ -2269,7 +2269,7 @@ exports[`RulesAnalysis Component matches snapshot when ai_type is not AUTO_ML_AI
<input
class="form-control"
type="text"
value="2023-12-25 00:00"
value="2023-12-26 00:00"
/>
<div
class="rdtPicker"
Expand Down Expand Up @@ -2583,15 +2583,15 @@ exports[`RulesAnalysis Component matches snapshot when ai_type is not AUTO_ML_AI
24
</td>
<td
class="rdtDay rdtToday"
class="rdtDay"
data-month="11"
data-value="25"
data-year="2023"
>
25
</td>
<td
class="rdtDay"
class="rdtDay rdtActive"
data-month="11"
data-value="26"
data-year="2023"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe('RulesAnalysis Component', () => {
queryClient.setQueryData(
[`change-logs-for-activity-versions-${mockActivityId}`, mockActivityId, { ignoreCount: true }],
{
changeLogs: [{ id: 1, state: 'active' }],
changeLogs: [{ id: 1, state: 'active', start_date: '12-25-23', end_date: '12-26-23' }],
}
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ const RulesAnalysis: React.FC<RouteComponentProps<ActivityRouteProps>> = ({ hist
const [sorted, setSorted] = React.useState([])
const [versionOption, setVersionOption] = React.useState<DropdownObjectInterface>(initialVersionOption);
const [versionOptions, setVersionOptions] = React.useState<DropdownObjectInterface[]>([]);
const [startDateForQuery, setStartDate] = React.useState<string>(initialStartDateString);
const [endDate, onEndDateChange] = React.useState<Date>(initialEndDate);
const [endDateForQuery, setEndDate] = React.useState<string>(initialEndDateString);
const [startDateForQuery, setStartDateForQuery] = React.useState<string>(initialStartDateString);
const [endDate, setEndDate] = React.useState<Date>(initialEndDate);
const [endDateForQuery, setEndDateForQuery] = React.useState<string>(initialEndDateString);
const [totalResponsesByConjunction, setTotalResponsesByConjunction] = React.useState<number>(null);
const [formattedRows, setFormattedRows] = React.useState<any[]>(null);
const [startDate, onStartDateChange] = React.useState<Date>(initialStartDate);
const [startDate, setStartDate] = React.useState<Date>(initialStartDate);

const selectedConjunction = selectedPrompt ? selectedPrompt.conjunction : promptConjunction

Expand Down Expand Up @@ -126,8 +126,8 @@ const RulesAnalysis: React.FC<RouteComponentProps<ActivityRouteProps>> = ({ hist
if (versionOption && versionOption.value) {
const { value } = versionOption;
const { start_date, end_date } = value;
onStartDateChange(new Date(start_date))
onEndDateChange(new Date(end_date))
setStartDate(new Date(start_date))
setEndDate(new Date(end_date))
}
}, [versionOption]);

Expand Down Expand Up @@ -205,7 +205,7 @@ const RulesAnalysis: React.FC<RouteComponentProps<ActivityRouteProps>> = ({ hist
}

function handleFilterClick() {
handlePageFilterClick({ startDate, endDate, versionOption, setStartDate, setEndDate, setPageNumber: null, storageKey: RULES_ANALYSIS });
handlePageFilterClick({ startDate, endDate, versionOption, setStartDate: setStartDateForQuery, setEndDate: setEndDateForQuery, setPageNumber: null, storageKey: RULES_ANALYSIS });
}

function setPromptBasedOnActivity() {
Expand Down Expand Up @@ -494,8 +494,8 @@ const RulesAnalysis: React.FC<RouteComponentProps<ActivityRouteProps>> = ({ hist
endDate={endDate}
handleFilterClick={handleFilterClick}
handleVersionSelection={handleVersionSelection}
onEndDateChange={onEndDateChange}
onStartDateChange={onStartDateChange}
onEndDateChange={setEndDate}
onStartDateChange={setStartDate}
selectedVersion={versionOption}
startDate={startDate}
versionOptions={versionOptions}
Expand Down

0 comments on commit 53c6999

Please sign in to comment.