Skip to content

Comments

[IA-4596] don't allow instance creation#2745

Open
Crebert08 wants to merge 2 commits intodevelopfrom
IA-4596-not-allowing-instance-creation
Open

[IA-4596] don't allow instance creation#2745
Crebert08 wants to merge 2 commits intodevelopfrom
IA-4596-not-allowing-instance-creation

Conversation

@Crebert08
Copy link
Contributor

@Crebert08 Crebert08 commented Feb 16, 2026

What problem is this PR solving?

This PR is about solving the issue of a user trying to create an instance from a form without latest version.

Related JIRA tickets

IA-4596

Changes

Explain the changes that were made.

Exported the props from hat/assets/js/apps/Iaso/domains/instances/Components/CreateReassignDialogComponent.tsx to pass them in the modal in hat/assets/js/apps/Iaso/domains/instances/Components/CreateSubmissionModal.tsx. This allowed the definition of the ButtonProps with a disabled attribute which is used to check if a form has a version or not in hat/assets/js/apps/Iaso/domains/forms/components/FormActions.tsx

How to test

  • Start the app with docker compose -f docker-compose.yml -f docker/docker-compose-enketo.yml up
  • Go to the page of the Forms list
  • Create a form but do not create a version
    The 'add submission' button should be disabled

Print screen / video

Screenshot from 2026-02-16 14-34-22

Notes

Things that the reviewers should know:

  • known bugs that are out of the scope of the PR
  • other trade-offs that were made
  • does the PR depends on a PR in bluesquare-components?
  • should the PR be merged into another PR?

Doc

Tell us where the doc can be found (docs folder, wiki, in the code...).

@Crebert08 Crebert08 requested a review from quang-le February 16, 2026 12:35
@Crebert08 Crebert08 changed the title Adding a check to see if the form has a form version [IA-4596] don't allow instance creation (and tell the user that there's not yet xlsform uploaded) Feb 16, 2026
@Crebert08 Crebert08 changed the title [IA-4596] don't allow instance creation (and tell the user that there's not yet xlsform uploaded) [IA-4596] don't allow instance creation Feb 16, 2026
Copy link
Member

@quang-le quang-le left a comment

Choose a reason for hiding this comment

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

(and tell the user that there's not yet xlsform uploaded) ==> This part of the feature is missing.
Please add a tooltip with the appropriate message when the icon button is disabled

@quang-le quang-le added the release Should be released in production at next deploy label Feb 19, 2026
@Crebert08 Crebert08 requested a review from quang-le February 20, 2026 11:11
type Props = {
onClick: () => void;
disabled?: boolean;
disabled: false;
Copy link
Member

Choose a reason for hiding this comment

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

The previous typing was correct: you set a default value, but we can still pass true

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
disabled: false;
disabled?:boolean;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release Should be released in production at next deploy

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants