[TAN-7981] Add MCP update tools for project and phase#14075
Conversation
| } | ||
| }, | ||
|
|
||
| manual_voters_amount: { type: 'integer', description: 'Count of offline/manually-recorded voters. Only for voting phases.' } |
There was a problem hiding this comment.
This was missing from the create phase tool.
There was a problem hiding this comment.
I didn't include it on purpose in the first iteration, but I suppose it won't hurt to add it.
| # `*_multiloc` fields merge per-locale (locales the caller didn't pass are kept); others replace. | ||
| # Callers should reject unknown/non-updatable keys before calling this. | ||
| def apply_attributes(record, attributes) | ||
| attributes.each do |key, value| |
There was a problem hiding this comment.
Moved this to shared file, as the new update tools for Phase/Project also need it.
There was a problem hiding this comment.
It doesn't feel like the right place for this method, and the rework in #14166 actually removed it from the generic update tool altogether. Maybe what we really need is just a utility function to merge multilocs.
| include_all_areas: { type: 'boolean', description: 'Whether the project is associated with all areas.' }, | ||
| listed: { type: 'boolean', description: 'Whether the project is listed/discoverable (vs accessible by link only).' }, | ||
| track_participation_location: { type: 'boolean', description: "Whether to track participants' location (requires the participation-location feature)." } | ||
| }, |
There was a problem hiding this comment.
Again, some missing attributes added to the create project tool. Could be argued we don't need Listed here, but I don't think it hurts either :)
| <<~DESC.squish | ||
| Updates an existing phase. Partial update — only the fields you pass change, and `*_multiloc` | ||
| fields merge per locale. Accepts the same fields as create_phase, except project_id — a phase | ||
| can't be moved to another project. Changing participation_method is rejected if the phase |
There was a problem hiding this comment.
A phase can't be moved to another project
Figured this was best ^
|
@amanda-anderson okay to rebase this onto #14164? |
| # `*_multiloc` fields merge per-locale (locales the caller didn't pass are kept); others replace. | ||
| # Callers should reject unknown/non-updatable keys before calling this. | ||
| def apply_attributes(record, attributes) | ||
| attributes.each do |key, value| |
There was a problem hiding this comment.
It doesn't feel like the right place for this method, and the rework in #14166 actually removed it from the generic update tool altogether. Maybe what we really need is just a utility function to merge multilocs.
| } | ||
| }, | ||
|
|
||
| manual_voters_amount: { type: 'integer', description: 'Count of offline/manually-recorded voters. Only for voting phases.' } |
There was a problem hiding this comment.
I didn't include it on purpose in the first iteration, but I suppose it won't hurt to add it.
|
@adessy Since #14164 was merged to master, I just merged master in and resolved the conflicts - hoping that's acceptable? :) |
Changelog
Added