Repository navigation
Disable skip button if step is mandatory - #1211
Conversation
| exceptedSampleIDs, | ||
| serializeFilterParamsWithDescriptions(filters), | ||
| ), | ||
| <Tooltip destroyOnHidden mouseEnterDelay={0} title={step.mandatory && actionName == "skip" ? `${step.step_name} cannot be skipped` : ""}> |
There was a problem hiding this comment.
mouseEnterDelay default is much better than 0. 0 leads to useless popups coming up each time you move your mouse around.
| exceptedSampleIDs, | ||
| serializeFilterParamsWithDescriptions(filters), | ||
| ), | ||
| <Tooltip destroyOnHidden mouseEnterDelay={0} title={step.mandatory && actionName == "skip" ? `${step.step_name} cannot be skipped` : ""}> |
There was a problem hiding this comment.
Your title have the option to actually give some information about the skip action might has well use it when the step is not mandatory. You could even pre-calculate a tooltip for each button shown.
|
You disable the last step of the whole process ... It would be much better to disable the first button on the workflow management page. I am aware that there is the issue of the step being skipable only for specific workflows. Let's explore how using the selected samples queued steps we can validate if each selected sample has at least one skipable queued step. if not we disable the main skip button. |
can_samples_skip returns True if at least one selected sample is queued to a non-mandatory step. Skip stays disabled when no selected sample is queued, when all queued samples are at mandatory steps, or when more than 960 samples are selected. The workflow assignment page uses it to disable Skip with a tooltip. smartQuerySetLookup now always sends id__in or id__not__in. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
| @action(detail=False, methods=["get"]) | ||
| def can_samples_skip(self, request: Request): | ||
| """ | ||
| Returns True if at least one selected sample is queued to a step order that is not mandatory. |
There was a problem hiding this comment.
This is not what we want ... We should have true if each sample is queued to at least one step order that is skippable ...
| # SampleNextStepByStudyFilter lacks the custom ones (is_pooled, metadata, qPCR_status__in, | ||
| # qc_flag__in, project name, batch name/barcode). | ||
| samples = SampleFilter(request.GET, queryset=Sample.objects.all().distinct()).qs | ||
| if samples.count() > MAX_SELECTION: |
There was a problem hiding this comment.
total > MAX_SELECTION or total == 0 ?
There was a problem hiding this comment.
Eheh, I just had the same idea and outsmarted Claude in the process ;)
The previous any-sample rule allowed skipping mandatory steps. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
5eeeff6 to
e3bcab7
Compare
| # Use SampleFilter, not SampleNextStepByStudyFilter: the table filters are sample filters, and | ||
| # SampleNextStepByStudyFilter lacks the custom ones (is_pooled, metadata, qPCR_status__in, | ||
| # qc_flag__in, project name, batch name/barcode). | ||
| samples = SampleFilter(request.GET, queryset=Sample.objects.all().distinct()).qs |
There was a problem hiding this comment.
Maybe it would make more sense to have this endpoint on sample instead.
Samples are selected with the sample table filters, so the endpoint belongs on the sample viewset: /samples/can_skip/. Update the skip button tooltip to match the all-samples-must-be-skippable rule. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
No description provided.