Skip to content

Commit

Permalink
Hide "control tags" except when creating/editing claims.
Browse files Browse the repository at this point in the history
## 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).
  • Loading branch information
infinite-persistence committed May 10, 2021
1 parent b11d163 commit 96d4120
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions ui/component/channelEdit/view.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ function ChannelForm(props: Props) {
<TagsSearch
suggestMature={!SIMPLE_SITE}
disableAutoFocus
disableControlTags
limitSelect={MAX_TAG_SELECT}
tagsPassedIn={params.tags || []}
label={__('Selected Tags')}
Expand Down
3 changes: 3 additions & 0 deletions ui/component/tagsSearch/view.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ type Props = {
limitSelect?: number,
limitShow?: number,
user: User,
disableControlTags?: boolean,
};

const UNALLOWED_TAGS = ['lbry-first'];
Expand Down Expand Up @@ -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) => {
Expand Down Expand Up @@ -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>
Expand Down
1 change: 1 addition & 0 deletions ui/page/settingsCreator/view.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ export default function SettingsCreatorPage(props: Props) {
tagsPassedIn={mutedWordTags}
placeholder={__('Add words to block')}
hideSuggestions
disableControlTags
/>
</div>
}
Expand Down

0 comments on commit 96d4120

Please sign in to comment.