Skip to content

Conversation

c960657
Copy link
Contributor

@c960657 c960657 commented Oct 31, 2024

Add API support for updating attribution domains.

This moves the existing validation and normalization from the dynamic attribute (..._as_text) to the “real” database attribute, so it is shared with the API. The text↔array conversion is not used by the API, so this is moved to the controller for the settings page.

This feature may be useful e.g. for online newspapers that want to update the setting for all staff writers.

Documentation PR: mastodon/documentation#1558

Copy link
Contributor

@mjankowski mjankowski left a comment

Choose a reason for hiding this comment

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

If for whatever reason we don't want the API change here, we should pull out the normalization/validation changes and do those.

Copy link
Contributor

github-actions bot commented Nov 4, 2024

This pull request has merge conflicts that must be resolved before it can be merged.

# Conflicts:
#	config/locales/simple_form.nl.yml
Copy link
Contributor

github-actions bot commented Nov 4, 2024

This pull request has resolved merge conflicts and is ready for review.

Copy link
Contributor

This pull request has merge conflicts that must be resolved before it can be merged.

# Conflicts:
#	config/locales/simple_form.nl.yml
Copy link
Contributor

This pull request has resolved merge conflicts and is ready for review.

Copy link
Contributor

This pull request has merge conflicts that must be resolved before it can be merged.

@renchap renchap requested a review from a team November 15, 2024 11:23
@ClearlyClaire
Copy link
Contributor

Is too_many_lines still used at all? I can't see any sign of it being used, and indeed, trying to add more domains than the maximum, I get the following:

Validation failed: Attribution domains is too long (maximum is 100 characters) (ActiveRecord::RecordInvalid)

# Conflicts:
#	app/views/settings/verifications/show.html.haml
#	config/locales/simple_form.cy.yml
@c960657
Copy link
Contributor Author

c960657 commented Nov 17, 2024

Is too_many_lines still used at all?

No, good catch. I have removed it now.

Copy link
Contributor

This pull request has resolved merge conflicts and is ready for review.

Copy link
Contributor

github-actions bot commented Jan 4, 2025

This pull request has merge conflicts that must be resolved before it can be merged.

# Conflicts:
#	spec/models/account_spec.rb
Copy link
Contributor

github-actions bot commented Jan 4, 2025

This pull request has resolved merge conflicts and is ready for review.

Copy link
Contributor

@ClearlyClaire ClearlyClaire left a comment

Choose a reason for hiding this comment

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

This looks ok to me, but I'd like to have another pair of eyes on it.

The added request specs should most probably be system specs instead.

There is already a documentation PR (mastodon/documentation#1558) but it may also warrant an API version bump (see Mastodon::Version.api_version)

Copy link
Contributor

github-actions bot commented Jan 8, 2025

This pull request has resolved merge conflicts and is ready for review.

ClearlyClaire
ClearlyClaire previously approved these changes Jan 9, 2025
Copy link
Contributor

@oneiros oneiros left a comment

Choose a reason for hiding this comment

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

Overall I think this good, thanks a lot.

I did find two more minor problems though. Please have a look at my comments when you have time.

Copy link
Contributor

This pull request has merge conflicts that must be resolved before it can be merged.

Copy link
Contributor

This pull request has resolved merge conflicts and is ready for review.

@oneiros
Copy link
Contributor

oneiros commented Jan 15, 2025

Thank you for taking the time to consider my remarks. This looks good to me now.

The accompanying docs PR (mastodon/documentation#1558) is no longer accurate after the latest changes. Would you be so kind and update that as well? Thanks!

(Oh, and when you do: The first version this will most probably be introduced in will be 4.4.)

@oneiros oneiros added this pull request to the merge queue Jan 17, 2025
Merged via the queue into mastodon:main with commit a3baae0 Jan 17, 2025
32 checks passed
vmstan pushed a commit to vmstan/mastodon that referenced this pull request Mar 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ruby Pull requests that update Ruby code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants