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

Merged
Merged
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 @@ -270,6 +270,9 @@
<HelpTooltip :text="$tr('authorToolTip')" top :small="false" />
</template>
</VCombobox>
<p v-if="disableSourceEdits" class="help">
{{ helpTextString.$tr('cannotEditPublic') }}
</p>

<!-- Provider -->
<VCombobox
Expand Down Expand Up @@ -321,6 +324,7 @@
:disabled="disableSourceEdits"
:placeholder="getPlaceholder('license')"
:descriptionPlaceholder="getPlaceholder('license_description')"
:helpText="disableSourceEdits ? helpTextString.$tr('cannotEditPublic') : ''"
@focus="trackClick('License')"
@descriptionFocus="trackClick('License description')"
/>
Expand All @@ -344,6 +348,9 @@
@input="copyright_holder = $event"
@focus="trackClick('Copyright holder')"
/>
<p v-if="disableSourceEdits" class="help">
{{ helpTextString.$tr('cannotEditPublic') }}
</p>
</VFlex>
</template>
</VLayout>
Expand Down Expand Up @@ -384,6 +391,7 @@
import FileUpload from '../../views/files/FileUpload';
import SubtitlesList from '../../views/files/supplementaryLists/SubtitlesList';
import { isImportedContent, isDisableSourceEdits, importedChannelLink } from '../../utils';
import EditSourceModal from '../QuickEditModal/EditSourceModal.vue';
import AccessibilityOptions from './AccessibilityOptions.vue';
import LevelsOptions from 'shared/views/contentNodeFields/LevelsOptions';
import CategoryOptions from 'shared/views/contentNodeFields/CategoryOptions';
Expand All @@ -409,6 +417,7 @@
nonUniqueValue,
} from 'shared/constants';
import { constantsTranslationMixin, metadataTranslationMixin } from 'shared/mixins';
import { crossComponentTranslator } from 'shared/i18n';

function getValueFromResults(results) {
if (results.length === 0) {
Expand Down Expand Up @@ -547,6 +556,7 @@
valid: true,
diffTracker: {},
changed: false,
helpTextString: crossComponentTranslator(EditSourceModal),
};
},
computed: {
Expand Down Expand Up @@ -991,4 +1001,14 @@
}
}

// Positions help text underneath
p.help {
position: relative;
top: -20px;
left: 10px;
margin-bottom: 14px;
font-size: 12px;
color: var(--v-text-lighten4);
}

</style>
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;
LianaHarris360 marked this conversation as resolved.
Show resolved Hide resolved
left: 10px;
margin-bottom: 0;
font-size: 12px;
color: var(--v-text-lighten4);
}

</style>