Skip to content
New issue

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

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

Already on GitHub? # to your account

Bug/fix operation content responsiveness #9963

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions src/core/components/layouts/base.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,13 @@ export default class BaseLayout extends React.Component {

{hasServers || hasSchemes || hasSecurityDefinitions ? (
<div className="scheme-container">
<Col className="schemes wrapper" mobile={12}>
{hasServers || hasSchemes ? (
<div className="schemes-server-container">
{hasServers ? <ServersContainer /> : null}
{hasSchemes ? <SchemesContainer /> : null}
</div>
) : null}
<div className="schemes wrapper">
<div className="schemes-server-container">
{hasServers ? <ServersContainer /> : null}
{hasSchemes ? <SchemesContainer /> : null}
</div>
{hasSecurityDefinitions ? <AuthorizeBtnContainer /> : null}
</Col>
</div>
</div>
) : null}

Expand Down
36 changes: 19 additions & 17 deletions src/core/components/operation-tag.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,28 +77,30 @@ export default class OperationTag extends React.Component {
data-tag={tag}
data-is-open={showTag}
>
<DeepLink
enabled={deepLinking}
isShown={showTag}
path={createDeepLinkPath(tag)}
text={tag} />
{!tagDescription ? <small></small> :
<small>
<Markdown source={tagDescription} />
</small>
}

{!tagExternalDocsUrl ? null :
<div className="info__externaldocs">
<div className="opblock-tag-content">
<DeepLink
enabled={deepLinking}
isShown={showTag}
path={createDeepLinkPath(tag)}
text={tag} />
{!tagDescription ? <small></small> :
<small>
<Link
<Markdown source={tagDescription} />
</small>
}

{!tagExternalDocsUrl ? null :
<div className="info__externaldocs">
<small>
<Link
href={sanitizeUrl(tagExternalDocsUrl)}
onClick={(e) => e.stopPropagation()}
target="_blank"
>{tagExternalDocsDescription || tagExternalDocsUrl}</Link>
</small>
</div>
}
</small>
</div>
}
</div>


<button
Expand Down
71 changes: 30 additions & 41 deletions src/style/_layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,15 @@
margin-left: 1.25rem;
}

%flex-center
{
display: flex;
align-items: center;
}

.opblock-tag
{
display: flex;
align-items: center;
@extend %flex-center;

padding: 10px 20px 10px 10px;

Expand All @@ -39,6 +44,17 @@
{
background: rgba($opblock-tag-background-color-hover,.02);
}

&-content {
@extend %flex-center;
flex-wrap: wrap;
gap: 0.5rem 1rem;
flex: 1;

.markdown {
min-width: 130px;
}
}
}

@mixin method($color)
Expand Down Expand Up @@ -93,17 +109,11 @@

flex: 2;

padding: 0 10px;

@include text_body();
}

>div
{
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
flex: 1 1 150px;
font-weight: 400;
}

Expand All @@ -121,7 +131,9 @@

.info__externaldocs
{
text-align: right;
.link {
display: block;
}
}
}

Expand Down Expand Up @@ -781,32 +793,24 @@

.scheme-container
{
margin: 0 0 20px 0;
padding: 30px 0;

background: $scheme-container-background-color;
box-shadow: 0 1px 2px 0 rgba($scheme-container-box-shadow-color,.15);

/*
* We let the parent control space and alignements of children
*/
.schemes
{
display: flex;
align-items: flex-end;
justify-content: space-between;
margin-bottom: 1rem;
padding: 1.5rem;
gap: .5rem;
flex-wrap: wrap;

gap: 10px;

/*
This wraps the servers or schemes selector.
This was added to make sure the Authorize button is always on the right
and the servers or schemes selector is always on the left.
*/
> .schemes-server-container
{
display: flex;
flex-wrap: wrap;

gap: 10px;

> label
{
Expand All @@ -815,8 +819,8 @@

display: flex;
flex-direction: column;

margin: -20px 15px 0 0;
row-gap: .2rem;
margin-bottom: 0;

@include text_headline();

Expand All @@ -828,16 +832,6 @@
}
}
}

/*
This checks if the schemes-server-container is not present and
aligns the authorize button to the right
*/
&:not(:has(.schemes-server-container))
{
justify-content: flex-end;
}

/*
Target Authorize Button in schemes wrapper
This was added here to fix responsiveness issues with the authorize button
Expand All @@ -846,16 +840,11 @@
.auth-wrapper
{
flex: none;
justify-content: start;

.authorize
{
padding-right: 20px;
padding: .25rem 1rem;
margin: 0;

display: flex;

flex-wrap: nowrap;
}
}
}
Expand Down