Skip to content

Commit 9a612fb

Browse files
committed
fix(emails): update profiling run template
1 parent b6a92f5 commit 9a612fb

5 files changed

Lines changed: 41 additions & 50 deletions

File tree

testgen/common/notifications/notifications.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ def get_body_template(self) -> str:
208208
}
209209
210210
.text-yellow {
211-
color: #FDD835;
211+
color: #FBC02D;
212212
}
213213
214214
.text-orange {

testgen/common/notifications/profiling_run.py

Lines changed: 37 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def get_subject_template(self) -> str:
2525
return (
2626
"[TestGen] Profiling Run {{format_status profiling_run.status}}: {{table_groups_name}}"
2727
"{{#if new_issue_count}}"
28-
'| {{new_issue_count}} new hygiene {{pluralize new_issue_count "issue" "issues"}}'
28+
' | {{format_number new_issue_count}} new hygiene {{pluralize new_issue_count "issue" "issues"}}'
2929
"{{/if}}"
3030
)
3131

@@ -51,7 +51,7 @@ def get_main_content_template(self):
5151
<td class="summary__label">Schema</td>
5252
<td class="summary__value">{{table_group_schema}}</td>
5353
<td align="right">
54-
<a class="link" href="{{profiling_run.results_url}}" target="_blank">View Results on TestGen &gt;</a>
54+
<a class="link" href="{{profiling_run.results_url}}" target="_blank">View results on TestGen &gt;</a>
5555
</td>
5656
5757
</tr>
@@ -83,18 +83,20 @@ def get_main_content_template(self):
8383
<td class="summary__title">Issues Summary</td>
8484
{{#if (eq profiling_run.status 'Complete')}}
8585
<td align="right">
86-
<a class="link" href="{{profiling_run.issues_url}}" target="_blank">View Issues on TestGen &gt;</a>
86+
<a class="link" href="{{profiling_run.issues_url}}" target="_blank">View {{format_number issue_count}} issues &gt;</a>
8787
</td>
8888
{{/if}}
8989
</tr>
9090
<tr>
9191
<td class="summary__subtitle">
9292
{{#if (eq profiling_run.status 'Complete')}}
9393
{{#if (eq notification_trigger 'on_changes')}}
94-
Profiling run has new hygiene issues.
94+
Profiling run detected new hygiene issues.
9595
{{/if}}
9696
{{#if (eq notification_trigger 'always')}}
97-
Profiling run has finished.
97+
{{#if issue_count}}
98+
Profiling run detected hygiene issues.
99+
{{/if}}
98100
{{/if}}
99101
{{/if}}
100102
{{#if (eq profiling_run.status 'Error')}}
@@ -156,7 +158,7 @@ def get_result_table_template(self):
156158
border="0">
157159
<tr>
158160
<td></td>
159-
<td colspan="2" class="summary-title
161+
<td colspan="2" class="summary__title
160162
{{#if (eq priority 'Definite')}} text-red {{/if}}
161163
{{#if (eq priority 'Likely')}} text-orange {{/if}}
162164
{{#if (eq priority 'Possible')}} text-yellow {{/if}}
@@ -165,12 +167,12 @@ def get_result_table_template(self):
165167
">{{label}}</td>
166168
<td colspan="2" align="right">
167169
<a class="link" href="{{url}}" target="_blank">
168-
View {{count.total}} {{label}} &gt;
170+
View {{format_number count.total}} {{label}} &gt;
169171
</a>
170172
</td>
171173
</tr>
172174
{{#if (len issues)}}
173-
<tr class="summary__header">
175+
<tr class="text-caption">
174176
<td></td>
175177
<td>Table</td>
176178
<td>Columns</td>
@@ -195,7 +197,7 @@ def get_result_table_template(self):
195197
</td>
196198
<td colspan="2" align="right" class="summary__caption">
197199
<span class="text-purple" style="margin-right: 4px; font-style: normal;">&#9679;</span>
198-
indicates new {{label}}
200+
indicates new issues
199201
</td>
200202
</tr>
201203
{{/if}}
@@ -206,38 +208,26 @@ def get_result_table_template(self):
206208

207209
def get_extra_css_template(self) -> str:
208210
return """
209-
.tg-summary-header td {
210-
padding: 10px 0 10px 0;
211-
font-size: 14px;
212-
text-color: rgba(0, 0, 0, 0.54);
213-
}
214-
.tg-summary-counts td {
215-
height: 32px;
216-
border-left-width: 4px;
217-
border-left-style: solid;
218-
padding-left: 8px;
219-
padding-right: 24px;
220-
line-height: 1.2;
221-
}
222-
.tg-summary-counts-label {
223-
font-size: 12px;
224-
text-color: rgba(0, 0, 0, 0.54);
225-
}
226-
.tg-summary-counts-count {
227-
font-size: 16px;
228-
}
229-
.border-yellow {
230-
border-color: #FDD835;
231-
}
232-
233-
.border-orange {
234-
border-color: #FF9800;
235-
}
236-
237-
.border-red {
238-
border-color: #EF5350;
239-
}
240-
211+
.tg-summary-header td {
212+
padding: 10px 0 10px 0;
213+
font-size: 14px;
214+
text-color: rgba(0, 0, 0, 0.54);
215+
}
216+
.tg-summary-counts td {
217+
height: 32px;
218+
border-left-width: 4px;
219+
border-left-style: solid;
220+
padding-left: 8px;
221+
padding-right: 24px;
222+
line-height: 1.2;
223+
}
224+
.tg-summary-counts-label {
225+
font-size: 12px;
226+
text-color: rgba(0, 0, 0, 0.54);
227+
}
228+
.tg-summary-counts-count {
229+
font-size: 16px;
230+
}
241231
"""
242232

243233

@@ -274,11 +264,11 @@ def send_profiling_run_notifications(profiling_run: ProfilingRun, result_list_ct
274264
hygiene_issues_summary = []
275265
counts = HygieneIssue.select_count_by_priority(profiling_run.id)
276266
for priority, likelihood, label in (
277-
("Definite", "Definite", "Definite Hygiene Issues"),
278-
("Likely", "Likely", "Likely Hygiene Issues"),
279-
("Possible", "Possible", "Possible Hygiene Issues"),
280-
("High", "Potential PII", "Potential PII - High risk"),
281-
("Moderate", "Potential PII", "Potential PII - Moderate risk"),
267+
("Definite", "Definite", "definite issues"),
268+
("Likely", "Likely", "likely issues"),
269+
("Possible", "Possible", "possible issues"),
270+
("High", "Potential PII", "potential PII - high risk"),
271+
("Moderate", "Potential PII", "potential PII - moderate risk"),
282272
):
283273
context_issues = [
284274
{
@@ -323,6 +313,7 @@ def send_profiling_run_notifications(profiling_run: ProfilingRun, result_list_ct
323313
"table_ct": profiling_run.table_ct,
324314
"column_ct": profiling_run.column_ct,
325315
},
316+
"issue_count": len(issues),
326317
"new_issue_count": sum(1 for _, is_new in issues if is_new),
327318
"hygiene_issues_summary": hygiene_issues_summary,
328319
**dict(get_current_session().execute(labels_query).one()),

testgen/ui/components/frontend/js/pages/profiling_runs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ const Toolbar = (
245245
Button({
246246
icon: 'today',
247247
type: 'stroked',
248-
label: 'Profiling Schedules',
248+
label: 'Schedules',
249249
tooltip: 'Manage when profiling should run for table groups',
250250
tooltipPosition: 'bottom',
251251
width: 'fit-content',

testgen/ui/components/frontend/js/pages/table_group_list.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ const Toolbar = (permissions, connections, selectedConnection, tableGroupNameFil
270270
Button({
271271
icon: 'today',
272272
type: 'stroked',
273-
label: 'Profiling Schedules',
273+
label: 'Schedules',
274274
tooltip: 'Manage when profiling should run for table groups',
275275
tooltipPosition: 'bottom',
276276
width: 'fit-content',

testgen/ui/views/profiling_runs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ def _get_component_props(self) -> dict[str, typing.Any]:
147147
table_group_options.insert(0, (None, "All Table Groups"))
148148
trigger_labels = {
149149
ProfilingRunNotificationTrigger.always.value: "Always",
150-
ProfilingRunNotificationTrigger.on_changes.value: "On new hygiene issues found",
150+
ProfilingRunNotificationTrigger.on_changes.value: "On new hygiene issues",
151151
}
152152
trigger_options = [(t.value, trigger_labels[t.value]) for t in ProfilingRunNotificationTrigger]
153153
return {

0 commit comments

Comments
 (0)