Skip to content

[Domain] DNS Management Improvements#1050

Merged
saeedvaziry merged 2 commits intovitodeploy:3.xfrom
RichardAnderson:feat/dnsimprovements
Mar 16, 2026
Merged

[Domain] DNS Management Improvements#1050
saeedvaziry merged 2 commits intovitodeploy:3.xfrom
RichardAnderson:feat/dnsimprovements

Conversation

@RichardAnderson
Copy link
Member

@RichardAnderson RichardAnderson commented Mar 16, 2026

This pull request introduces support for DNS record priority, refactors validation logic, and improves clipboard functionality in the frontend. The most significant changes are grouped below:

DNS Record Priority Support

  • Added a new nullable priority field to the dns_records table via a migration and updated the DNSRecord model to include this property in fillable and cast arrays. [1] [2] [3] [4]
  • Updated DNS record creation, updating, syncing, and Cloudflare provider logic to handle the new priority field. This includes reading, saving, and passing priority where applicable. [1] [2] [3] [4] [5]
  • Modified the DNSRecordResource to expose the priority field in API responses.

Validation Refactoring

  • Extracted DNS record validation rules into a new DNSRecordRules class, centralizing and updating rules to include the priority field.
  • Updated CreateDNSRecord and UpdateDNSRecord actions to use the new validation rules class. [1] [2]

Cloudflare Provider Enhancements

  • Refactored Cloudflare provider to use a buildPayload method for creating/updating records, ensuring consistent handling of the new priority field. [1] [2] [3]

Frontend Clipboard Improvements

  • Replaced custom clipboard logic in copyable-badge.tsx with a reusable useClipboard hook, and updated UI feedback. [1] [2]
  • Updated DNS record columns to use a new CopyableText component for improved clipboard handling and visual feedback. [1] [2]
CleanShot 2026-03-16 at 21 24 00
  • TXT entries now utilise a TextArea instead of a Input
CleanShot 2026-03-16 at 21 25 02
  • MX entries now support Priority
CleanShot 2026-03-16 at 21 25 40
  • Proxy only appears when the provider supports it, and only on the types of records that it is supported on.
  • Where proxy is enabled, a "lock" icon appears next to the content, instead of a whole column.

DNS Provider Registration Extensions

  • Extended DNS provider registration to support proxyTypes and supportsCreatedAt configuration, updating relevant service provider and plugin logic. [1] [2] [3] [4]
  • Configured Cloudflare to support A, AAAA and CNAME records for proxying.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR enhances the domain DNS management feature by adding MX priority support end-to-end (DB/model/API/provider/UI), centralizing DNS record validation, and improving frontend UX around copying values and provider-specific capabilities.

Changes:

  • Added nullable priority to DNS records (migration/model/resource/actions/provider parsing/payload).
  • Refactored DNS record validation into DNSRecordRules and updated create/update actions to use it.
  • Frontend updates: provider-aware columns/proxy UI, TXT uses textarea, new clipboard hook + new copy UI patterns.

Reviewed changes

Copilot reviewed 16 out of 18 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
tests/Unit/DNSProviders/CloudflareTest.php Expands unit coverage for Cloudflare record parsing including priority handling.
resources/js/types/index.d.ts Extends provider config types with proxy_types and supports_created_at.
resources/js/types/dns-record.d.ts Adds priority to the DNSRecord TS type.
resources/js/pages/domains/show.tsx Builds record table columns dynamically based on provider config.
resources/js/pages/domains/components/record-form.tsx Adds MX priority input, TXT textarea, manual TTL option, and provider-aware proxy toggle.
resources/js/pages/domains/components/record-columns.tsx Refactors columns into getColumns, adds priority column, lock icon, and new copy UI.
resources/js/hooks/use-clipboard.ts Introduces reusable clipboard hook with toast + copied state.
resources/js/components/copyable-badge.tsx Migrates to useClipboard for shared clipboard behavior.
database/migrations/2026_03_16_201111_add_priority_to_dns_records_table.php Adds nullable priority column to dns_records.
app/Providers/DNSProviderServiceProvider.php Registers Cloudflare provider proxy/created-at capabilities.
app/Plugins/RegisterDNSProvider.php Adds proxyTypes and supportsCreatedAt to provider registration/config output.
app/Models/Domain.php Persists priority when syncing provider records into local DB.
app/Models/DNSRecord.php Adds priority to fillable/casts and adjusts TTL formatting output.
app/Http/Resources/DNSRecordResource.php Exposes priority in API/web JSON responses.
app/DNSProviders/Cloudflare.php Parses/sends priority and refactors request payload building.
app/Actions/Domain/UpdateDNSRecord.php Saves priority and uses centralized validation rules.
app/Actions/Domain/DNSRecordRules.php Centralizes validation and adds priority constraints.
app/Actions/Domain/CreateDNSRecord.php Saves priority and uses centralized validation rules.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@saeedvaziry saeedvaziry merged commit 9ec070b into vitodeploy:3.x Mar 16, 2026
3 checks passed
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.

3 participants