Skip to content

Commit 5134c88

Browse files
authored
add scheduling goal invocation ID to the allowed columns on Activity Directives table (#1895)
* add scheduling goal invocation ID to the allowed columns on Activity Directives table, also added to Activity Directives Form, moved to the Metadata section. added tooltips * fix tests, format * update ag grid header tooltip style to use --ag-background-color var * update text color for tooltip on ag grid table headers
1 parent f4155b8 commit 5134c88

File tree

12 files changed

+103
-21
lines changed

12 files changed

+103
-21
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/activity/ActivityAnchorForm.svelte.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ describe('Activity Anchor Form component', () => {
1919
name: 'parent 1',
2020
plan_id: 12,
2121
source_scheduling_goal_id: null,
22+
source_scheduling_goal_invocation_id: null,
2223
start_offset: '00:00:00.00',
2324
start_time_ms: 1715731443696,
2425
tags: [],
@@ -38,6 +39,7 @@ describe('Activity Anchor Form component', () => {
3839
name: 'child 1',
3940
plan_id: 12,
4041
source_scheduling_goal_id: null,
42+
source_scheduling_goal_invocation_id: null,
4143
start_offset: '00:10:00.00',
4244
start_time_ms: 1715731443696,
4345
tags: [],
@@ -57,6 +59,7 @@ describe('Activity Anchor Form component', () => {
5759
name: 'child 2',
5860
plan_id: 12,
5961
source_scheduling_goal_id: null,
62+
source_scheduling_goal_invocation_id: null,
6063
start_offset: '11:00:00.00',
6164
start_time_ms: 1715731443696,
6265
tags: [],
@@ -76,6 +79,7 @@ describe('Activity Anchor Form component', () => {
7679
name: 'child 3',
7780
plan_id: 12,
7881
source_scheduling_goal_id: null,
82+
source_scheduling_goal_invocation_id: null,
7983
start_offset: '09:00:00.00',
8084
start_time_ms: 1715731443696,
8185
tags: [],

src/components/activity/ActivityDirectiveForm.svelte

Lines changed: 44 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -620,24 +620,6 @@
620620
on:updateStartOffset={updateStartOffset}
621621
/>
622622

623-
<Highlight highlight={highlightKeysMap.source_scheduling_goal_id}>
624-
<Input layout="inline">
625-
<label
626-
use:tooltip={{ content: 'Source Scheduling Goal ID', placement: 'top' }}
627-
for="sourceSchedulingGoalId"
628-
>
629-
Source Scheduling Goal ID
630-
</label>
631-
<input
632-
class="st-input w-full"
633-
disabled
634-
name="sourceSchedulingGoalId"
635-
id="sourceSchedulingGoalId"
636-
value={activityDirective.source_scheduling_goal_id ?? 'None'}
637-
/>
638-
</Input>
639-
</Highlight>
640-
641623
<Highlight highlight={highlightKeysMap.tags}>
642624
<Input layout="inline">
643625
<label use:tooltip={{ content: 'Tags', placement: 'top' }} for="activityDirectiveTags"> Tags </label>
@@ -727,6 +709,50 @@
727709
/>
728710
</Input>
729711
</Highlight>
712+
713+
<Highlight highlight={highlightKeysMap.source_scheduling_goal_id}>
714+
<Input layout="inline">
715+
<label
716+
use:tooltip={{
717+
content:
718+
'Source Scheduling Goal ID - The ID of the scheduling goal that created this activity directive',
719+
placement: 'top',
720+
}}
721+
for="sourceSchedulingGoalId"
722+
>
723+
Source Scheduling Goal ID
724+
</label>
725+
<input
726+
class="st-input w-full"
727+
disabled
728+
name="sourceSchedulingGoalId"
729+
id="sourceSchedulingGoalId"
730+
value={activityDirective.source_scheduling_goal_id ?? 'None'}
731+
/>
732+
</Input>
733+
</Highlight>
734+
735+
<Highlight highlight={highlightKeysMap.source_scheduling_goal_invocation_id}>
736+
<Input layout="inline">
737+
<label
738+
use:tooltip={{
739+
content:
740+
'Source Scheduling Goal Invocation ID - The ID of the scheduling goal invocation (run) that created this activity directive',
741+
placement: 'top',
742+
}}
743+
for="sourceSchedulingGoalInvocationId"
744+
>
745+
Source Scheduling Goal Invocation ID
746+
</label>
747+
<input
748+
class="st-input w-full"
749+
disabled
750+
name="sourceSchedulingGoalInvocationId"
751+
id="sourceSchedulingGoalInvocationId"
752+
value={activityDirective.source_scheduling_goal_invocation_id ?? 'None'}
753+
/>
754+
</Input>
755+
</Highlight>
730756
</Collapse>
731757
</fieldset>
732758

src/components/activity/ActivityDirectivesTablePanel.svelte

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
field: 'anchor_name',
6868
filter: 'text',
6969
headerName: 'Anchor Name',
70+
headerTooltip: 'Name of the activity that this activity is anchored to, if any.',
7071
hide: true,
7172
resizable: true,
7273
sortable: true,
@@ -81,8 +82,10 @@
8182
field: 'anchored_to_start',
8283
filter: 'text',
8384
headerName: 'Anchored to Start',
85+
headerTooltip:
86+
'True if the activity is anchored to the start of the plan or the start of another activity, false if anchored to the end.',
8487
hide: true,
85-
resizable: false,
88+
resizable: true,
8689
sortable: true,
8790
},
8891
applied_preset: {
@@ -183,6 +186,17 @@
183186
field: 'source_scheduling_goal_id',
184187
filter: 'number',
185188
headerName: 'Scheduling Goal ID',
189+
headerTooltip: 'The ID of the scheduling goal that created this activity directive',
190+
hide: true,
191+
resizable: true,
192+
sortable: true,
193+
tooltipInteraction: true,
194+
},
195+
source_scheduling_goal_invocation_id: {
196+
field: 'source_scheduling_goal_invocation_id',
197+
filter: 'number',
198+
headerName: 'Scheduling Goal Invocation ID',
199+
headerTooltip: 'The ID of the scheduling goal invocation (run) that created this activity directive',
186200
hide: true,
187201
resizable: true,
188202
sortable: true,

src/components/plan/PlanMergeReview.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ describe('PlanMergeReview component', () => {
187187
plan_id: 1,
188188
snapshot_id: 1,
189189
source_scheduling_goal_id: -1,
190+
source_scheduling_goal_invocation_id: -1,
190191
start_offset: '23:06:17.622',
191192
tags: [],
192193
type: 'A_Activity',
@@ -209,6 +210,7 @@ describe('PlanMergeReview component', () => {
209210
plan_id: 1,
210211
snapshot_id: 1,
211212
source_scheduling_goal_id: -1,
213+
source_scheduling_goal_invocation_id: -1,
212214
start_offset: '36:25:10.489',
213215
tags: [],
214216
type: 'A_Activity',
@@ -249,6 +251,7 @@ describe('PlanMergeReview component', () => {
249251
plan_id: 1,
250252
snapshot_id: 1,
251253
source_scheduling_goal_id: -1,
254+
source_scheduling_goal_invocation_id: -1,
252255
start_offset: '23:06:17.622',
253256
tags: [],
254257
type: 'A_Activity',
@@ -268,6 +271,7 @@ describe('PlanMergeReview component', () => {
268271
name: 'A_Activity',
269272
snapshot_id: 2,
270273
source_scheduling_goal_id: -1,
274+
source_scheduling_goal_invocation_id: -1,
271275
start_offset: '36:25:10.489',
272276
tags: [],
273277
type: 'A_Activity',
@@ -309,6 +313,7 @@ describe('PlanMergeReview component', () => {
309313
name: 'B_Activity',
310314
snapshot_id: 6,
311315
source_scheduling_goal_id: -1,
316+
source_scheduling_goal_invocation_id: -1,
312317
start_offset: '46:33:39.909',
313318
tags: [],
314319
type: 'B_Activity',
@@ -337,6 +342,7 @@ describe('PlanMergeReview component', () => {
337342
plan_id: 1,
338343
snapshot_id: 6,
339344
source_scheduling_goal_id: -1,
345+
source_scheduling_goal_invocation_id: -1,
340346
start_offset: '53:35:33.936',
341347
tags: [],
342348
type: 'C_Activity',
@@ -360,6 +366,7 @@ describe('PlanMergeReview component', () => {
360366
name: 'A_Activity',
361367
snapshot_id: 6,
362368
source_scheduling_goal_id: -1,
369+
source_scheduling_goal_invocation_id: -1,
363370
start_offset: '23:22:32.036',
364371
tags: [],
365372
type: 'A_Activity',
@@ -380,6 +387,7 @@ describe('PlanMergeReview component', () => {
380387
plan_id: 1,
381388
snapshot_id: 6,
382389
source_scheduling_goal_id: -1,
390+
source_scheduling_goal_invocation_id: -1,
383391
start_offset: '23:22:32.036',
384392
tags: [],
385393
type: 'A_Activity',

src/css/ag-grid-stellar.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -607,3 +607,8 @@
607607
.ag-theme-stellar .ag-tertiary-highlight {
608608
background-color: var(--ag-selected-row-background-color);
609609
}
610+
611+
.ag-theme-stellar .ag-tooltip {
612+
background-color: var(--ag-background-color);
613+
color: var(--ag-data-color);
614+
}

src/types/activity.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ export type ActivityDirectiveDB = {
4545
name: string;
4646
plan_id: number;
4747
source_scheduling_goal_id: number | null;
48+
source_scheduling_goal_invocation_id: number | null;
4849
start_offset: string;
4950
tags: { tag: Tag }[];
5051
type: string;

src/utilities/activities.test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ describe('sortActivityDirectivesOrSpans', () => {
139139
name: 'foo 1',
140140
plan_id: 1,
141141
source_scheduling_goal_id: null,
142+
source_scheduling_goal_invocation_id: null,
142143
start_offset: '10:00:00',
143144
start_time_ms: 1715731443696,
144145
tags: [],
@@ -159,6 +160,7 @@ describe('sortActivityDirectivesOrSpans', () => {
159160
name: 'foo 2',
160161
plan_id: 1,
161162
source_scheduling_goal_id: null,
163+
source_scheduling_goal_invocation_id: null,
162164
start_offset: '09:00:00',
163165
start_time_ms: 1715731443696,
164166
tags: [],
@@ -179,6 +181,7 @@ describe('sortActivityDirectivesOrSpans', () => {
179181
name: 'foo 3',
180182
plan_id: 1,
181183
source_scheduling_goal_id: null,
184+
source_scheduling_goal_invocation_id: null,
182185
start_offset: '08:00:00',
183186
start_time_ms: 1715731443696,
184187
tags: [],
@@ -365,6 +368,7 @@ function getTestActivityDirectivesDB(): ActivityDirectiveDB[] {
365368
name: 'Activity 1',
366369
plan_id: 1,
367370
source_scheduling_goal_id: null,
371+
source_scheduling_goal_invocation_id: null,
368372
start_offset: '10:00:00',
369373
tags: [],
370374
type: 'foo',
@@ -384,6 +388,7 @@ function getTestActivityDirectivesDB(): ActivityDirectiveDB[] {
384388
name: 'Activity 2',
385389
plan_id: 1,
386390
source_scheduling_goal_id: null,
391+
source_scheduling_goal_invocation_id: null,
387392
start_offset: '09:00:00',
388393
tags: [],
389394
type: 'foo',
@@ -403,6 +408,7 @@ function getTestActivityDirectivesDB(): ActivityDirectiveDB[] {
403408
name: 'Activity 3',
404409
plan_id: 1,
405410
source_scheduling_goal_id: null,
411+
source_scheduling_goal_invocation_id: null,
406412
start_offset: '08:00:00',
407413
tags: [],
408414
type: 'foo',
@@ -426,6 +432,7 @@ describe('addAbsoluteTimeToRevision', () => {
426432
name: 'foo 1',
427433
plan_id: 1,
428434
source_scheduling_goal_id: null,
435+
source_scheduling_goal_invocation_id: null,
429436
start_offset: '05:00:00',
430437
tags: [],
431438
type: 'foo',

src/utilities/gql.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ const gql = {
141141
name
142142
plan_id
143143
source_scheduling_goal_id
144+
source_scheduling_goal_invocation_id
144145
start_offset
145146
tags {
146147
tag {
@@ -1656,6 +1657,7 @@ const gql = {
16561657
metadata
16571658
name
16581659
source_scheduling_goal_id
1660+
source_scheduling_goal_invocation_id
16591661
start_offset
16601662
tags {
16611663
tag {
@@ -2156,6 +2158,7 @@ const gql = {
21562158
name
21572159
plan_id
21582160
source_scheduling_goal_id
2161+
source_scheduling_goal_invocation_id
21592162
start_offset
21602163
tags {
21612164
tag {
@@ -3678,6 +3681,7 @@ const gql = {
36783681
name
36793682
plan_id
36803683
source_scheduling_goal_id
3684+
source_scheduling_goal_invocation_id
36813685
start_offset
36823686
tags {
36833687
tag {

src/utilities/plan.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ describe('Plan utility', () => {
110110
name: 'Test Activity',
111111
plan_id: 1,
112112
source_scheduling_goal_id: null,
113+
source_scheduling_goal_invocation_id: null,
113114
start_offset: '0:00:00',
114115
start_time_ms: 0,
115116
tags: [
@@ -190,6 +191,7 @@ describe('Plan utility', () => {
190191
name: 'Test Activity',
191192
plan_id: 1,
192193
source_scheduling_goal_id: null,
194+
source_scheduling_goal_invocation_id: null,
193195
start_offset: '0:00:00',
194196
start_time_ms: 0,
195197
tags: [
@@ -409,6 +411,7 @@ describe('Plan utility', () => {
409411
name: 'Test Activity',
410412
plan_id: 1,
411413
source_scheduling_goal_id: null,
414+
source_scheduling_goal_invocation_id: null,
412415
start_offset: '0:00:00',
413416
start_time_ms: 0,
414417
tags: [

0 commit comments

Comments
 (0)