-
Notifications
You must be signed in to change notification settings - Fork 899
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
RCLOUD-1270: Hide version from footer for rba #9129
Conversation
4ed19f0
to
e7f825a
Compare
:icon="version.icon" | ||
:color="version.color" | ||
/> | ||
<div v-if="!hideVersion"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just out of curiosity. Why increase the depth of the DOM, when you could change it with a
<div v-if="!hideVersion"> | |
<template v-if="!hideVersion"> |
/> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { RootStore } from "../../../stores/RootStore"; | ||
import { defineComponent, inject } from "vue"; | ||
import InfoDisplay from "./RundeckInfo.vue"; | ||
import {getFeatureEnabled} from "@/library/services/featureConfig"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try to use relative imports
|
||
export async function getFeatureEnabled(featureName: string) { | ||
const resp = await api.get(`/feature/${featureName}`); | ||
return !!resp.data.enabled; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if resp
is null
?
if (val !== null) { | ||
this.hideVersion = val; | ||
} else { | ||
this.hideVersion = false; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be done in one line
if (val !== null) { | |
this.hideVersion = val; | |
} else { | |
this.hideVersion = false; | |
} | |
this.hideVersion = (val !== null) ? val : false; |
Just a heads-up, there are unit tests for the RundeckInfo component (RundeckInfo.spec.ts), could you please add a test for the new case? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideal approach is to use data-test-id
for fetching, but is up to you
const rundeckVersionComponent = wrapper.findComponent({ | ||
name: "RundeckVersion", | ||
}); | ||
const versionDisplayComponent = wrapper.findComponent({ | ||
name: "VersionDisplay", | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea of testing is to check that what is shown to the user is tested, so we need to change this to the right behavior, that some divs inside those components are displayed, so you should change that find elements and then check its existance
const rundeckVersionComponent = wrapper.findComponent({ | |
name: "RundeckVersion", | |
}); | |
const versionDisplayComponent = wrapper.findComponent({ | |
name: "VersionDisplay", | |
}); | |
const rundeckVersionComponent = wrapper.find('div.rundeck-version-display'); | |
const versionDisplayComponent = wrapper.find('span.rundeck-version-icon'); |
Please check if that works if you want to change it, I'm a bit rusty with those kind fo tests 😅
326b620
to
06b81ba
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but could you add a test for the display of div.rundeck-info-widget__group
element?
Is this a bugfix, or an enhancement? Please describe.
Change of behavior for rba
Describe the solution you've implemented
Adding the option to hide the version number from the footer
Describe alternatives you've considered
Additional context
https://pagerduty.atlassian.net/browse/RCLOUD-1270