Skip to content

Fix proposal import with other proposals states in budgets#15630

Merged
alecslupu merged 21 commits intodevelopfrom
fix/proposal-import
Dec 24, 2025
Merged

Fix proposal import with other proposals states in budgets#15630
alecslupu merged 21 commits intodevelopfrom
fix/proposal-import

Conversation

@greenwoodt
Copy link
Copy Markdown
Member

@greenwoodt greenwoodt commented Nov 25, 2025

🎩 What? Why?

Allows the importing of published proposals within budgets based on a acceptance state of values: accepted, rejected, not_answered, evaluating and any created state within proposals attribute internal_states.

Custom states are saved to the internal_states attribute as a string, which allows us to iterate over the state options as a collection. In order to make this import work, I've needed to adapt the proposal method in the proposal to budgets command to check for these custom states and order them accordingly by their published_at value.

Adding a cost to the form is also attributed to the desired imported published proposals.

If none are ticked, ALL proposals answered will be imported and multiple option states are also a option as per request.

This PR also incorporates the option to import proposals as projects from the component which are "not_answered", allowing admins more flexibility managing the budgets module.

📌 Related Issues

Testing

  1. Login
  2. Find a space with some proposals with a no. of states answered.
  3. Head to Budgets within the same space.
  4. Click a Budget
  5. Click import, then the only option import proposals to projects
  6. Choose proposals from the dropdown
  7. Add a cost value
  8. Try an import via a option like "Accepted"
  9. See your published proposals imported.
  10. Head back to proposals
  11. Filter via "Answered" & "Accepted"
  12. Compare the import no. with the current filtered no. in proposals

Testing via new internal_states

  1. Login
  2. Find a space with "users can create proposals"
  3. Head to the proposals component
  4. Click on statuses
  5. Create a new status, assign a colour, then click save.
  6. Head to the front end of that space, create a proposal then click publish.
  7. Head back to the admin, find that proposal and answer it via that new custom state you created.
  8. Head to Budgets within the same space
  9. Click on a Budget
  10. Click import, then click the only option import proposals to projects
  11. In the Origin component drop down click the proposals component
  12. Add a cost value to form
  13. Click your custom state option from the list, then click "import proposals"
  14. See your new project imported from proposals
  15. Click on it to see the cost you added also.

📷 Screenshots

NEW STATE OPTION:
image

FILTERED & ANSWERED WITH NEW STATE:
image

CURRENTLY IMPORTED PUBLISHED PROPOSALS WITH ACCEPTED STATE:
image

IMPORT PROPOSALS FROM IN BUDGETS WITH NEW STATE:
image

SUCCESSFUL IMPORT OF CUSTOM STATE:
image

IMPORTED ASSIGNED COST:
image

♥️ Thank you!

github-actions[bot]
github-actions bot previously approved these changes Nov 25, 2025
github-actions[bot]
github-actions bot previously approved these changes Nov 25, 2025
github-actions[bot]
github-actions bot previously approved these changes Dec 5, 2025
@greenwoodt greenwoodt added release: v0.30 Issues or PRs that need to be tackled for v0.30 release: v0.31 Issues or PRs that need to be tackled for v0.31 labels Dec 9, 2025
github-actions[bot]
github-actions bot previously approved these changes Dec 9, 2025
github-actions[bot]
github-actions bot previously approved these changes Dec 9, 2025
github-actions[bot]
github-actions bot previously approved these changes Dec 9, 2025
@greenwoodt greenwoodt moved this from 🏗 In progress to 👀 In review in Maintainers' backlog Dec 9, 2025
github-actions[bot]
github-actions bot previously approved these changes Dec 9, 2025
@larsUE
Copy link
Copy Markdown

larsUE commented Dec 11, 2025

Looking at it plainly from a functional perspective: love it @greenwoodt , thanks!

@andreslucena andreslucena changed the title Proposal import in Budgets Fix proposal import with other proposals states in budgets Dec 17, 2025
Co-authored-by: Alexandru Emil Lupu <contact@alecslupu.ro>
@greenwoodt greenwoodt requested a review from alecslupu December 24, 2025 15:25
Copy link
Copy Markdown
Contributor

@alecslupu alecslupu left a comment

Choose a reason for hiding this comment

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

👍

Merging with codecov failure.

@alecslupu alecslupu merged commit b08bdc8 into develop Dec 24, 2025
33 of 34 checks passed
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in Maintainers' backlog Dec 24, 2025
@alecslupu alecslupu deleted the fix/proposal-import branch December 24, 2025 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module: admin module: budgets module: proposals release: v0.30 Issues or PRs that need to be tackled for v0.30 release: v0.31 Issues or PRs that need to be tackled for v0.31 type: fix PRs that implement a fix for a bug

Projects

No open projects
Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

Fix import action for proposals into budget projects

3 participants