Skip to content

Conversation

@Dospalko
Copy link
Contributor

  • add client-side validation for the plugin manifest URL so only http/https URLs can be saved
  • surface inline feedback by passing validation state from PluginForm → BasicInfoTab → FormInput and wiring el-form-item props
  • disable both save actions and manifest refresh while the URL is invalid, ensuring we trim input and revalidate on submit/refresh

@netlify
Copy link

netlify bot commented Sep 30, 2025

Deploy Preview for qelos-docs ready!

Name Link
🔨 Latest commit 55a47f9
🔍 Latest deploy log https://app.netlify.com/projects/qelos-docs/deploys/68e8b71d165c6100080ed43b
😎 Deploy Preview https://deploy-preview-37--qelos-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Comment on lines 158 to 165
try {
const url = new URL(rawValue);
if (!['http:', 'https:'].includes(url.protocol)) {
return t('Manifest URL must start with http:// or https://');
}
} catch (error) {
return t('Manifest URL must be a valid URL');
}
Copy link
Contributor

Choose a reason for hiding this comment

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

this validation can be replaced by adding type="url" on the form input.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Made a new commit! :)

@davidmeirlevy
Copy link
Contributor

@Dospalko thanks for the PR!
I'll review it and run it locally to check the behavior.

@Dospalko
Copy link
Contributor Author

Dospalko commented Oct 2, 2025

Hey, @davidmeirlevy can you give me feedback please? :) i would like to have a Merge for uni purposes:))

@davidmeirlevy
Copy link
Contributor

@Dospalko i already gave you a comment: this validation can be replaced by adding type="url" on the form input.

@davidmeirlevy davidmeirlevy linked an issue Oct 3, 2025 that may be closed by this pull request
@Dospalko
Copy link
Contributor Author

Dospalko commented Oct 3, 2025

Validation now relies on the native type="url" field and HTML5 checks instead of the old new URL try/catch block.
In apps/admin/src/modules/plugins/components/plugin-form/BasicInfoTab.vue: the manifest field is explicitly type="url", and apps/admin/src/modules/plugins/components/PluginForm.vue: rewrites manifestValidationError to reuse HTML5 validity (with an explicit http/https protocol guard and SSR-safe fallback). Save-disable logic and inline errors hook into this updated check.

@davidmeirlevy
Copy link
Contributor

@Dospalko looks good. I'll run it locally at the weekend and check this out.

Thanks.

@davidmeirlevy
Copy link
Contributor

@Dospalko can you please fix the conflicts with main branch?

manifestSubmitAttempted.value = true;
if (typeof edit.manifestUrl === 'string') {
edit.manifestUrl = edit.manifestUrl.trim();
Copy link
Contributor

@davidmeirlevy davidmeirlevy Oct 10, 2025

Choose a reason for hiding this comment

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

there's a vue modifier for v-model:
https://vuejs.org/guide/essentials/forms#trim

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.

Add form validation to plugin manifest URL

2 participants