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

Action Manager | Refactor API to future-proof property assignment on construction. #9554

Conversation

AMZN-daimini
Copy link
Contributor

Applied minor changes to API arguments ordering to uniform them between calls. Moving ActionContext and Action properties to struct to future-proof future API changes in case we need more properties to be added. Updated the tests accordingly.

No behavior changes, just changes to the API.

…ping to reflect it to BehaviorContext.

Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
…ork module

Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
… functions to Python via a bus.

Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
…itorActionHandler

Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
…of nullptr handler.

Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
…ad of all properties explicitly. This should make the API easier to extend and more readable, albeit more verbose.

Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
…des to work on Test submodule of EditorPythonBindings

Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
@AMZN-daimini AMZN-daimini requested review from cgalvan, hultonha, amzn-tmryan and a team May 14, 2022 02:23
@AMZN-daimini AMZN-daimini requested a review from a team as a code owner May 14, 2022 02:23
@AMZN-daimini
Copy link
Contributor Author

@hultonha I have discussed this change with @cgalvan and after a bit of back and forth I determined I will get over my concerns about conciseness in favor of readability and future-proofing the API. Thanks for the recommendations :D

@forhalle forhalle added the sig/content Categorizes an issue or PR as relevant to SIG Content. label May 16, 2022
@AMZN-daimini AMZN-daimini merged commit 38272ee into o3de:development May 16, 2022
@AMZN-daimini AMZN-daimini deleted the daimini/ActionManager/ArgumentsRefactoring branch May 16, 2022 18:27
Copy link
Contributor

@hultonha hultonha left a comment

Choose a reason for hiding this comment

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

Updates look good! Sorry missed looking at this again before the merge, only a couple of comments

Comment on lines +23 to +33
struct ActionContextProperties
{
AZ_RTTI(ActionProperties, "{74694A62-E3FF-43EE-98DF-D66731DC2286}");

ActionContextProperties() = default;
virtual ~ActionContextProperties() = default;

AZStd::string m_name = "";
};

struct ActionProperties
Copy link
Contributor

Choose a reason for hiding this comment

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

These looks great! Thanks for adding 👍 (might be worth an API comment for a little more context but otherwise all good!

EXPECT_FALSE(outcome.IsSuccess());
}

TEST_F(ActionManagerFixture, RegisterActionContext)
{
auto outcome = m_actionManagerInterface->RegisterActionContext(m_widget, "o3de.context.test", "Test", "");
auto outcome =
m_actionManagerInterface->RegisterActionContext("", "o3de.context.test", {}, m_widget);
Copy link
Contributor

Choose a reason for hiding this comment

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

nit/suggestion: I've found actually using AzToolsFramework::ActionProperties{} instead of {} makes it a lot easier to track down usages of ActionProperties - not super important but one of those things that in practice for maintenance can be useful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/content Categorizes an issue or PR as relevant to SIG Content.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants