Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set default log file by job outcome #2025

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

markgrahamdawson
Copy link
Contributor

@markgrahamdawson markgrahamdawson commented Dec 10, 2024

This pr now implements setting default log file by job outcome in two ways:

  1. If the user navigates to the log view through the node menu the job state is passed to the view as in this pr...
    master...MetRonnie:cylc-ui:menu-log-file

  2. If the user manually types in the path of the job via the input in the log view a new query is made as in this pr...
    offline data: enable querying failed jobs cylc-uiserver#657

Closes #1241

Check List

  • I have read CONTRIBUTING.md and added my name as a Code Contributor.
  • Contains logically grouped changes (else tidy your branch by rebase).
  • Does not contain off-topic changes (use other PRs for other changes).
  • Applied any dependency changes to both setup.cfg (and conda-environment.yml if present).
  • Tests are included (or explain why tests are not needed).
  • Changelog entry included if this is a change that can affect users
  • Cylc-Doc pull request opened if required at cylc/cylc-doc/pull/XXXX.
  • If this is a bug fix, PR should be raised against the relevant ?.?.x branch.

@markgrahamdawson markgrahamdawson marked this pull request as ready for review February 4, 2025 13:17
@markgrahamdawson markgrahamdawson force-pushed the 1241-log-view-set-default-log-file-by-job-outcome branch from f31427b to 44e4d78 Compare February 5, 2025 09:20
@oliver-sanders
Copy link
Member

LGTM. Works well.

Looking at the "network" tab in the web inspector, it looks like we get two jobState queries, even when we are opening a log from the Tree view where we already know what the job state is?

We should be able to disable this check if the file is specified in the initial inputs (the query is only needed if the file is not specified).

Copy link
Member

@oliver-sanders oliver-sanders left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@oliver-sanders
Copy link
Member

oliver-sanders commented Mar 13, 2025

Note, we may need to wait until cylc/cylc-uiserver#657 is merged?

@markgrahamdawson markgrahamdawson force-pushed the 1241-log-view-set-default-log-file-by-job-outcome branch from 9706db5 to 6e3f8d1 Compare March 13, 2025 13:28
fix

re-implemented based on review

fix broken E2E test

fix tests

review ammends

added change log

fix linting issue

fixed unit tests

review amends

review amends 2

fixed issue with query call

fix linting

fix linting

fixed issue with network requests

review amends

fix unit tests

split getDefaultFile into workflow and job functions
@markgrahamdawson markgrahamdawson force-pushed the 1241-log-view-set-default-log-file-by-job-outcome branch from 4b2d273 to 0f4541b Compare March 26, 2025 11:10
@@ -14,3 +14,4 @@ window.ResizeObserver ??= ResizeObserverStub
// Mock element scroll API as not currently included in jsdom:
// https://github.com/jsdom/jsdom/issues/1422
Element.prototype.scrollBy ??= function () { }
Element.prototype.scrollIntoView ??= function () { }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, might as well put the whole lot in to avoid potential future pain for devs:

Suggested change
Element.prototype.scrollIntoView ??= function () { }
Element.prototype.scrollIntoView ??= function () { }
Element.prototype.scroll ??= function () { }
Element.prototype.scrollTo ??= function () { }

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although I'm curious as to why this is needed on this branch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

log view: set default log file by job outcome
3 participants