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

Option to restrict simple list item creation #1548

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

Jess2896
Copy link

@Jess2896 Jess2896 commented Nov 3, 2022

Feature Info

Jira Ticket Url

Description

  • Added some simple logic to have the option to restrict the creation of simple list items, if the new argument is not received, the simple list works in the same way it did before

@coveralls
Copy link

coveralls commented Nov 3, 2022

Coverage Status

Coverage decreased (-0.06%) to 34.871% when pulling 3071ce5 on sites-admin-tags into edf59e3 on master.

// Only saves values from the autocomplete list if tag creation restriction is enabled
if (this.restrictItemCreation) {
if (!this.autocompleteValue) {
this.autocompleteValue = false;
Copy link
Member

Choose a reason for hiding this comment

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

If autocompleteValue is false and meets the criteria, why do you assign false again to it? 👀

@@ -404,5 +418,12 @@
.list-items-leave-active {
transition: opacity $standard-time $standard-curve;
}

.restriction-error-message {
color: rgba(255, 0, 0, 0.54);
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 use the corresponding hex value of this color?

@@ -359,6 +365,14 @@
});
this.update(this.items);
}
},
onTriggerRestrictionError() {
if (this.args.restrictedErrrorMessage) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if (this.args.restrictedErrrorMessage) {
if (this.args.restrictedErrorMessage) {

<div class="ui-textbox__feedback" v-if="hasFeedback || maxLength">
<div class="ui-textbox__feedback-text" v-if="showError">{{ error }}</div>
<div class="ui-textbox__feedback-text" v-else-if="showHelp">{{ args.help }}</div>
<div class="ui-textbox__counter" v-if="maxLength">
{{ valueLength + '/' + maxLength }}
</div>
</div>
<div class="restriction-error-message" v-if="showRestrictionError">{{ args.restrictedErrrorMessage }}</div>
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<div class="restriction-error-message" v-if="showRestrictionError">{{ args.restrictedErrrorMessage }}</div>
<div class="restriction-error-message" v-if="showRestrictionError">{{ args.restrictedErrorMessage }}</div>

Also, should you add this property to the docs too?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants