Skip to content

Commit aa1cc74

Browse files
rm logs, reformat
1 parent 66b0913 commit aa1cc74

2 files changed

Lines changed: 17 additions & 17 deletions

File tree

packages/app-builder/src/components/CaseManager/SnoozePanel/SnoozePanel.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ export const SnoozePanel = ({
7272
</TabsList>
7373
{Dict.entries(rulesByPivot).map(([pivotValue, rules]) => {
7474
const client = findDataFromPivotValue(pivotObjects ?? [], pivotValue);
75-
console.log('client', client);
7675
const table = dataModelWithTableOptions.find(
7776
(t) => t.name === client?.pivotObjectName,
7877
);
@@ -120,7 +119,6 @@ export const SnoozePanel = ({
120119
<span className="p-2">{t('cases:decisions.rule.snooze_until')}</span>
121120
</div>
122121
{rules.map((r) => {
123-
console.log(r);
124122
const formattedHitAt = (
125123
<span
126124
className={cn('text-grey-50 text-xs', { 'opacity-30': r.isSnoozed })}
@@ -190,7 +188,7 @@ export const SnoozePanel = ({
190188
) : null}
191189
</div>
192190
<div className="flex min-h-full items-center p-2">
193-
{r.isSnoozed ? (
191+
{r.isSnoozed && r.end ? (
194192
<span className="opacity-30">
195193
{formatRelative(r.end, new Date(), {
196194
locale: getDateFnsLocale(language),

packages/app-builder/src/routes/_builder+/cases+/$caseId+/_index.tsx

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -171,20 +171,22 @@ export const loader = async ({ request, params }: LoaderFunctionArgs) => {
171171
map(details, (d) =>
172172
pipe(
173173
d.rules,
174-
map((r) => ({
175-
...omit(r, ['evaluation']),
176-
isSnoozed: snoozes.find(
177-
(s) => s.pivotValue === pivotValue && r.ruleId === s.ruleId,
178-
)
179-
? true
180-
: false,
181-
hitAt: d.createdAt,
182-
decisionId: d.id,
183-
ruleGroup: scenarioRules.find((sr) => sr.id === r.ruleId)?.ruleGroup,
184-
start: snoozes.find((s) => s.ruleId === r.ruleId)?.startsAt as string,
185-
end: snoozes.find((s) => s.ruleId === r.ruleId)?.endsAt as string,
186-
scoreModifier: isRuleExecutionHit(r) ? r.scoreModifier : 0,
187-
})),
174+
map((r) => {
175+
const snooze = snoozes.find(
176+
(s) => s.pivotValue === pivotValue && s.ruleId === r.ruleId,
177+
);
178+
179+
return {
180+
...omit(r, ['evaluation']),
181+
isSnoozed: !!snooze,
182+
hitAt: d.createdAt,
183+
decisionId: d.id,
184+
ruleGroup: scenarioRules.find((sr) => sr.id === r.ruleId)?.ruleGroup,
185+
start: snooze?.startsAt,
186+
end: snooze?.endsAt,
187+
scoreModifier: isRuleExecutionHit(r) ? r.scoreModifier : 0,
188+
};
189+
}),
188190
),
189191
),
190192
flat(),

0 commit comments

Comments
 (0)