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

Refactor of table commands #131

Merged
merged 9 commits into from
Jul 26, 2021
Merged

Conversation

RobbeDP
Copy link
Contributor

@RobbeDP RobbeDP commented Jul 13, 2021

Some small changes to commands that work on tables.
Combine insert row above and below + insert column before and after.

@RobbeDP RobbeDP requested review from nvdk and abeforgit July 13, 2021 14:56
@abeforgit abeforgit added the internal Version bumps, chores, tooling label Jul 16, 2021
execute(): void {

const selection= this.model.selection;
execute(above: boolean, selection: ModelSelection = this.model.selection) {
Copy link
Member

@nvdk nvdk Jul 20, 2021

Choose a reason for hiding this comment

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

using a boolean to determine behavior is a bit of a code smell IMHO. I find that usually it's better to have two differently named methods in such cases. In this case I think that translates here into having two separate commands. We can still use abstractions to avoid code duplication, but giving the specific behavior its own name makes it easier to look for the specific usage later on. It's usually quite hard to search for a method with a certain param value (though some IDE's can do that for you)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a good point. I wasn't too sure about this either. I gave the insert column before and after + row above and below their own classes again, that make use of the abstraction made earlier.

@RobbeDP RobbeDP changed the base branch from master to development July 20, 2021 15:09
Copy link
Member

@abeforgit abeforgit left a comment

Choose a reason for hiding this comment

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

Looks good!

@abeforgit abeforgit merged commit 871bba3 into development Jul 26, 2021
@abeforgit abeforgit deleted the feature/table-commands-refactor branch July 26, 2021 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal Version bumps, chores, tooling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants