Skip to content
This repository was archived by the owner on Mar 25, 2021. It is now read-only.

Modified the store to handle conditionRelations#170

Merged
guergana merged 2 commits into
masterfrom
add-or-connection
Feb 1, 2021
Merged

Modified the store to handle conditionRelations#170
guergana merged 2 commits into
masterfrom
add-or-connection

Conversation

@guergana
Copy link
Copy Markdown
Contributor

No description provided.

@Ladsgroup
Copy link
Copy Markdown
Contributor

Your package-lock.json is now exploded. You really like the Chinese npm.

@guergana
Copy link
Copy Markdown
Contributor Author

Your package-lock.json is now exploded. You really like the Chinese npm.

ugh! gross!! will remove asap.

@guergana guergana requested review from Ladsgroup and bereket-WMDE and removed request for Ladsgroup January 27, 2021 10:47
Comment thread src/store/actions.ts Outdated
},
setConditionRelation(
context: ActionContext<RootState, RootState>,
payload: { value: ConditionRelation; conditionIndex: number } ): void {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this should also accept null.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

agree! :)

Comment thread src/store/mutations.ts Outdated
},
addCondition( state: RootState ): void {
state.conditionRows.push( getFreshConditionRow() );
if ( state.conditionRows.length === 0 ) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This can be easily summarized:
state.conditionRows.push( getFreshConditionRow( state.conditionRows.length === 0 ) );

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

wait what???

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think that is not very easy to read, IMHO

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

On second thoughts.. yes, it looks better.

propertyValueRelation: PropertyValueRelation;
value: string | Value;
subclasses: boolean;
conditionRelation: ConditionRelation | null;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The logic in the code implies this condition relation is between this condition and the condition above (funnily enough, when implementing the component, I went with the exact opposite). This should be documented.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

You mean by adding a comment? Or documented how?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes. Technically the relation doesn't belong to the query condition. It determines the relation between two. A comment in the QueryCondition would be good enough IMO

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I added some comments here

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks. It's just it's below it and it should be usually above. Also maybe it should be in the RootState? here is mostly about sharing the link.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done. 🙄

@guergana guergana force-pushed the add-or-connection branch 4 times, most recently from 3701042 to 736794a Compare February 1, 2021 13:30
Copy link
Copy Markdown
Contributor

@Ladsgroup Ladsgroup left a comment

Choose a reason for hiding this comment

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

Thanks!

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Feb 1, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

88.9% 88.9% Coverage
0.0% 0.0% Duplication

@guergana guergana merged commit baef80f into master Feb 1, 2021
@guergana guergana deleted the add-or-connection branch February 1, 2021 14:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants