Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #22969: Rewrite angular app "ComplianceMode" in Elm #4867

Conversation

RaphaelGauthier
Copy link
Member

-- All our data types
--

type ComplianceMode = FullCompliance | ChangesOnly | ReportsDisabled | UnknownMode
Copy link
Member

Choose a reason for hiding this comment

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

I don 't think you need an UnknownMode. It should make an error if the value is invalid.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've renamed UnknownMode to ErrorMode, but I've kept it to make it easier to handle this error case, by displaying a message in the form, preventing it from being saved and displaying an error notification.

Copy link
Member

Choose a reason for hiding this comment

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

GReat !

"full-compliance" -> FullCompliance
"changes-only" -> ChangesOnly
"reports-disabled" -> ReportsDisabled
_ -> UnknownMode
Copy link
Member

Choose a reason for hiding this comment

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

This should either be an error, not ignored

Copy link
Member Author

Choose a reason for hiding this comment

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

I used this "Error" mode to display an error in the form, but the user can still select a new valid report mode and save his changes.

Fixes #22969: Rewrite angular app \"ComplianceMode\" in Elm
@RaphaelGauthier
Copy link
Member Author

PR updated with a new commit

@Normation-Quality-Assistant
Copy link
Contributor

This PR is not mergeable to upper versions.
Since it is "Ready for merge" you must merge it by yourself using the following command:
rudder-dev merge https://github.com/Normation/rudder/pull/4867
-- Your faithful QA
Kant merge: "In law a man is guilty when he violates the rights of others. In ethics he is guilty if he only thinks of doing so."
(https://ci.normation.com/jenkins/job/merge-accepted-pr/70598/console)

@VinceMacBuche VinceMacBuche merged commit 1423909 into Normation:master Jul 7, 2023
15 checks passed
@RaphaelGauthier
Copy link
Member Author

OK, merging this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants