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

Move helpText to LicenseDropdown component #4739

Open
wants to merge 2 commits into
base: unstable
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
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,9 @@
box
:required="isEditable"
:disabled="!isEditable"
:helpText="helpText"
/>
</div>
<p v-if="helpText" class="help" style="margin-bottom: 8px">
{{ helpText }}
</p>
</div>
<div class="form-item">
<div class="input-container">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@
/>
</template>
</DropdownWrapper>
<p>
<p v-if="helpText" class="help">
{{ helpText }}
</p>
<p style="position: relative; top: -15px">
<KButton
class="info-link"
appearance="basic-link"
Expand All @@ -36,7 +39,7 @@
/>
</p>
<div
v-for="(licenseItem, index) in licences"
v-for="(licenseItem, index) in licencesList"
v-show="showAboutLicense"
:key="index"
class="mb-4 mt-3"
Expand Down Expand Up @@ -135,6 +138,10 @@
type: Boolean,
default: false,
},
helpText: {
type: String,
default: '',
},
},
data() {
return {
Expand Down Expand Up @@ -206,7 +213,7 @@
? getLicenseDescriptionValidators().map(translateValidator)
: [];
},
licences() {
licencesList() {
return LicensesList.filter(license => license.id).map(license => ({
...license,
name: this.translateConstant(license.license_name),
Expand Down Expand Up @@ -277,4 +284,14 @@
}
}

// Positions help text beneath the license dropdown
.help {
position: relative;
top: -25px;
Copy link
Member

Choose a reason for hiding this comment

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

Could you put a comment explaining why this is hardcoded like this? It LGTM but since it is a particular case it can be helpful to leave a note about what this is doing on the page.

Copy link
Member Author

Choose a reason for hiding this comment

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

That's a good point, I'll add that in.

left: 10px;
margin-bottom: 0;
font-size: 12px;
color: var(--v-text-lighten4);
}

</style>