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

fix(ui): correctly display AnalysisRun YAML #1861

Merged
merged 1 commit into from
Apr 18, 2024

Conversation

hiddeco
Copy link
Contributor

@hiddeco hiddeco commented Apr 17, 2024

Follow up to #1827.

Ensures the modal actually displays the YAML, even if it does not make use of the raw response API option yet.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
Copy link

netlify bot commented Apr 17, 2024

Deploy Preview for docs-kargo-akuity-io ready!

Name Link
🔨 Latest commit 7f562ce
🔍 Latest deploy log https://app.netlify.com/sites/docs-kargo-akuity-io/deploys/66202d1ec48f78000845908f
😎 Deploy Preview https://deploy-preview-1861.kargo.akuity.io
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@hiddeco hiddeco added this to the v0.6.0 milestone Apr 17, 2024
Copy link
Contributor

@devholic devholic left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -32,7 +32,7 @@ export const AnalysisRunModal = ({ visible, hide, name }: Props) => {
{isLoading ? (
<LoadingState />
) : (
<YamlEditor value={yaml.stringify(data?.analysisRun?.toJson())} height='500px' disabled />
<YamlEditor value={yaml.stringify(data?.result?.value?.toJson())} height='500px' disabled />
Copy link
Contributor

@devholic devholic Apr 17, 2024

Choose a reason for hiding this comment

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

Can we use new query parameter for using raw yaml manifest in this PR? (Not sure if frontend maintainers like this code or not 👀)

  const { data, isLoading } = useQuery(getAnalysisRun, {
    namespace: projectName,
    name,
    format: RawFormat.YAML,
  });

  let manifest: string = '';
  if (data?.result) {
    manifest = new TextDecoder().decode(data.result.value as Uint8Array);
  }
...
        <YamlEditor value={manifest} height='500px' disabled />

Copy link
Member

Choose a reason for hiding this comment

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

@devholic I think that would be more straightforward as well, but since this is broken right now, can we possibly create a follow-up for that?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sure, no problem :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Following up was my thinking as well. Will do this later today. Thanks both 🙇🏼‍♂️

Copy link

codecov bot commented Apr 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 46.15%. Comparing base (fcf8948) to head (7f562ce).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1861   +/-   ##
=======================================
  Coverage   46.15%   46.15%           
=======================================
  Files         213      213           
  Lines       13865    13865           
=======================================
  Hits         6400     6400           
  Misses       7181     7181           
  Partials      284      284           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -32,7 +32,7 @@ export const AnalysisRunModal = ({ visible, hide, name }: Props) => {
{isLoading ? (
<LoadingState />
) : (
<YamlEditor value={yaml.stringify(data?.analysisRun?.toJson())} height='500px' disabled />
<YamlEditor value={yaml.stringify(data?.result?.value?.toJson())} height='500px' disabled />
Copy link
Member

Choose a reason for hiding this comment

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

@devholic I think that would be more straightforward as well, but since this is broken right now, can we possibly create a follow-up for that?

@hiddeco hiddeco added this pull request to the merge queue Apr 18, 2024
Merged via the queue into akuity:main with commit 8f04cc5 Apr 18, 2024
19 checks passed
@hiddeco hiddeco deleted the fix-get-analysisrun-ui branch April 18, 2024 06:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants