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
Add link reference to a raw git diff #8
Conversation
What do you think of the "design"? I have no idea how this applies to the previous design, and I pretty much just put in a button where I thought it would be useful. Should I adjust something? |
b6f562e
to
bca9a9b
Compare
fromVersion, | ||
toVersion | ||
}) => { | ||
if (fromVersion === '') { |
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.
I dont know if this is "enough" in terms of checking whether the button should be shown. AFAIK the fromVersion
and toVersion
will be always present, so this is protecting only the few cases when the website is being loaded.
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.
good point. I think it's enough for now. There is an open issue for displaying "something" when the diff is empty but it shouldn't be addressed here :)
import { Button as AntdButton } from 'antd' | ||
import { getDiffURL } from '../../utils' | ||
|
||
const Container = styled.div` |
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.
Both styles are copied from the UpgradeButton
, should we somehow adjust them? I think it looks good as is.
@vinzscam Wanna take a look at this? |
@vinzscam ping |
@vinzscam pong |
Hi @VladMasarik! This is great!
The place where the "diff" button is makes sense. The only issue I see is that it steals some space. I can see this 👇 as an alternative What do you think? |
Signed-off-by: Vladimir Masarik <vladimir.masarik@ef.com>
@vinzscam I moved the button! Do you have any thoughts? |
This is great @VladMasarik! |
Summary
What issues does the pull request solve?
As per this issue Backstage Upgrade Helper should provide a Git patch backstage#11642 it would be nice to have access to a git diff that people can then simply apply with
git apply patch.diff
.What is the feature? (if applicable)
This PR adds a link onto the main page that links to a raw diff generated by https://github.com/backstage/upgrade-helper-diff .
How did you implement the solution?
I implemented it as "copy" of
UpgradeButton
component, and just adjusted it / passed in version variables, plus I used thegetDiffURL
function to get the relevant raw diff URL.What areas of the website does it impact?
It Impacts the home page.
Test Plan
I am not sure how to easily create a gif of the change. Here is a picture before you click on the "Show me how to upgrade"
Image after you click on the "Show me how to upgrade"
The "See raw text diff" link redirects you to a relevant diff
What are the steps to reproduce?
Clone my fork
Then select some diffs, and click on the "Show me how to upgrade"
Checklist
README.md
(if needed) ... I still have to add some documentation to the backstage repo docs so that people know why it is there, and how they can use it.