Hide "control tags" except when creating/editing claims.

## Changes:
1) TagSearch: hide the "control tags" in the Creator Settings page (irrelevant).
2) TagSearch: show the "control tags" when creating/editing Channel (let's use `setting.CommentsEnabled` instead).
3) TagSearch: show the "control tags" when creating/editing Content (`disable-comments` can be used to block comments at the per-claim level, e.g. allow comments in general but block only for specific claims).

## Missing pieces:
For (2) and (3), some work is needed to hide the comment GUI when `setting.CommentsEnabled` is disabled for a particular channel. That flag is not ready in Commentron yet, so I'm not sure how this will be done at the moment. In other words, the checkbox does nothing at the moment.

## Potential flaw:
This change will hide all control tags. If we have more tags in the future and would like to selectively disable some, we'll have to change this parameter to an array instead. Since the usage is not widespread at the moment, a single `disableControlFlag` seems cleaner (don't over-think it yet).
This commit is contained in:
infinite-persistence 2021-05-10 14:31:16 +08:00 committed by Thomas Zarebczan
parent 8050fa24b2
commit 82aaf361f1
3 changed files with 5 additions and 0 deletions

View file

@ -361,6 +361,7 @@ function ChannelForm(props: Props) {
<TagsSearch
suggestMature={!SIMPLE_SITE}
disableAutoFocus
disableControlTags
limitSelect={MAX_TAG_SELECT}
tagsPassedIn={params.tags || []}
label={__('Selected Tags')}

View file

@ -26,6 +26,7 @@ type Props = {
limitSelect?: number,
limitShow?: number,
user: User,
disableControlTags?: boolean,
};
const UNALLOWED_TAGS = ['lbry-first'];
@ -58,6 +59,7 @@ export default function TagsSearch(props: Props) {
limitSelect = TAG_FOLLOW_MAX,
limitShow = 5,
user,
disableControlTags,
} = props;
const [newTag, setNewTag] = useState('');
const doesTagMatch = (name) => {
@ -224,6 +226,7 @@ export default function TagsSearch(props: Props) {
)}
</fieldset-section>
{experimentalFeature &&
!disableControlTags &&
onSelect && ( // onSelect ensures this does not appear on TagFollow
<fieldset-section>
<label>{__('Control Tags')}</label>

View file

@ -176,6 +176,7 @@ export default function SettingsCreatorPage(props: Props) {
tagsPassedIn={mutedWordTags}
placeholder={__('Add words to block')}
hideSuggestions
disableControlTags
/>
</div>
}