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 linebreak follow common mark convention #3626

Merged
merged 2 commits into from
May 13, 2022
Merged

Conversation

khanhtc1202
Copy link
Member

What this PR does / why we need it:

In this PR, I added

  • logic to show No description. text in case the application configuration does not contain any description value.
  • logic to convert hard line break with \ (follow commonMark convention) to markdown best practice hard line break (with two or more spaces at the end of line)

Which issue(s) this PR fixes:

Fixes #

Does this PR introduce a user-facing change?:

NONE

Copy link
Member

@knanao knanao left a comment

Choose a reason for hiding this comment

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

Nice catch!

@@ -184,6 +184,7 @@ export const ApplicationDetail: FC<ApplicationDetailProps> = memo(

const piped = useAppSelector(selectPipedById(app?.pipedId));
const isSyncing = useIsSyncingApplication(app?.id);
const description = app?.description.replace(/\\\n/g, " \n");
Copy link
Member

Choose a reason for hiding this comment

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

Nice solution.

@@ -319,7 +320,7 @@ export const ApplicationDetail: FC<ApplicationDetailProps> = memo(
display="flex"
>
<ReactMarkdown linkTarget="_blank" className={classes.markdown}>
{app.description}
{description || "No description."}
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need this?
I feel that the current empty string is better since it can hide the unneeded description block.

Copy link
Member Author

@khanhtc1202 khanhtc1202 May 13, 2022

Choose a reason for hiding this comment

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

I get your point 👍 But to me, showing that there will be something there in case of the configuration file contains a description field would be better for the UI, and users who have not yet used that feature will be aware of that

Copy link
Member

Choose a reason for hiding this comment

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

The design is still not good enough for that empty case and we're having Play environment to show up that feature.
So I think that it should be hidden until we have a better design. 🤔

Copy link
Member Author

@khanhtc1202 khanhtc1202 May 13, 2022

Choose a reason for hiding this comment

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

Having a better UI is a long time issue of pipecd development 😄 so well, if you guys really think that the current description is ugly, then it's okay to me to remove that if it's empty

Copy link
Member Author

Choose a reason for hiding this comment

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

done, updated by b36e46c

Copy link
Member

@nghialv nghialv left a comment

Choose a reason for hiding this comment

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

Thank you.

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.

4 participants