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

ROU-3748: Add client action to apply conditional format to the aggregate row #331

Merged
merged 7 commits into from
May 12, 2023

Conversation

OS-giulianasilva
Copy link
Contributor

@OS-giulianasilva OS-giulianasilva commented May 12, 2023

This PR is for add a new client action to apply conditional format to the aggregate row.

What was done

OutSystems.Providers.DataGrid.Wijmo.Feature:

  • Fixed error not being throw for SetRowAsSelected

OutSystems.GridAPI.ConditionalFormat:

  • Created SetNumberAggregateConditionalFormatting function

Providers.DataGrid.Wijmo.Features.ColumnAggregate:

  • Created the _cellClasses Map to store the class to be applied to each column. The keys are the column binding and the element array os string containing the classNames to be added to the cell's aggregate.
  • Implemented setConditionalFormat method:
    • Responsible for check if all the conditions to add the conditional format are respected.
    • Calls the addAggregateRules from Conditional Format
  • Implemented addClass and removeClass methods:
    • Responsible for add and remove the cell aggregate classes from _cellClasses Map element associated with the column binding
  • Implemented _formatItem method:
    • It is the formatItem event handler
    • Responsible for add the classes stored in _cellClasses Map for each column aggregate everytime the view is refreshed.

Providers.DataGrid.Wijmo.Feature.ConditionExecuter

  • Added the _isAggregate flag property
  • Created the _addOrRemoveAggregateClass method, responsible to call the methods to add or remove classes from the column aggregates.
  • Modified the execute handle the case of conditional format for columns aggregate

Providers.DataGrid.Wijmo.Feature.ConditionalFormat

  • Created the _mappedRulesAggregate Map to store the conditional format rules for each column aggregate.
  • Created the _updateAggregateRows to handle classes update based on the conditional format for the aggregate rows
    Created the addAggregateRules to add the conditional format rules to the binding from the aggregate rows.~

Providers.DataGrid.Wijmo.Feature:

  • In setRowAsSelected method, fixed the error not being handled correctly

Test Steps

  1. Create a Grid with a number Column and ShowAggregate parameter set to true.
  2. In the Grid OnInitialize event add the SetNumberAggregateConditionalFormatting
  3. Set the mandatory parameter and the ConditionalFormat rule for the aggregate row
  4. Check if the conditional format is applied to the aggregate row.

Checklist

  • tested locally
  • documented the code
  • clean all warnings and errors of eslint
  • requires changes in OutSystems (if so, provide a module with changes)
  • requires new sample page in OutSystems (if so, provide a module with changes)

@outsystemsbot outsystemsbot bot added the cla:yes This code submission conforms with the OutSystems CLA or the CLA is not required for this PR label May 12, 2023
BenOsodrac
BenOsodrac previously approved these changes May 12, 2023
src/Providers/DataGrid/Wijmo/Features/ColumnAggregate.ts Outdated Show resolved Hide resolved
BenOsodrac
BenOsodrac previously approved these changes May 12, 2023
BenOsodrac
BenOsodrac previously approved these changes May 12, 2023
@sonarcloud
Copy link

sonarcloud bot commented May 12, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

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

No Coverage information No Coverage information
0.0% 0.0% Duplication

@OS-giulianasilva OS-giulianasilva merged commit fc6e1a5 into dev May 12, 2023
7 of 9 checks passed
@OS-giulianasilva OS-giulianasilva deleted the ROU-3748 branch May 12, 2023 09:48
OS-giulianasilva added a commit that referenced this pull request Jul 24, 2023
* ROU-3748: Add client action to apply conditional format to the aggregate row (#331)

* Add conditional format to ColumnAggregate

* Fix SetRowAsSelected not returning error message

* Fix lint warnings

* Fix eslint warnings

* Fix eslint warnings

* Fix error code duplicated

* Fix comments

* Update OutSystems DataGrid version (#332)

* Changed ClearFilter to allow triggering OnFiltersChange event

Implement a way to trigger the OnFiltersChange event when using the ClearFilter

* Update ToolTip.ts

Add validation to check if we do have data available, for instance while using filters that make the Grid without results.

* Adding new config to control the auto generate

* Adding new ErrorMessage

* Adding logic to not allow to generate columns if configs

* Code readability improvement

* Lint fix and adding comment

* Changing language load mechanism

* ROU-4329: Implement the ability to save/load layouts with frozen columns (#338)

* Added ability to save/apply layouts with frozenCols

- Added ability to save/apply layouts with frozenCols
- Updated Lodash version (based on Snyk)
- Updated TypeScript version (based on Snyk)

* Update ColumnFreeze.ts

---------

Co-authored-by: gbnm <goncalo.martins@outsystems.com>

* Fixed issue in moveToPage

Fixed issue in moveToPage() method that was always throwing an error

* Adding changes to context menu

* ROU-4320: Fix setRowAsSelected not working in a Grid with RowCheckboxes (#339)

* Fix setRowAsSelected to work in a Grid with RowCheckboxes

* Update setRowAsSelect method from Selection feature

Add evaluation to check if the row indexes provided exist in the current Grid page

* Update Selection.ts

---------

Co-authored-by: Gonçalo M <goncalo.martins@outsystems.com>

* Avoid raising event

When the context menu event is opening.

* Adding validation for widgetId

* Remove unused url

* Add a simple way to check for platform Id

* Changes to the what is returned in the hit of the context menu

* Fix and adding regional languages

* typo fix

* Adding isArray validation before wrap

* ROU-3901: Update version and license after renewal - release 2023 V1 (#348)

* Update Wijmo version

* Fix issue in View._setGroups caused by WJM-22376

* Update wijmo.cloud.d.ts

* Fix column picker issue after upgrade

* Add comments

* Fix eslint issues

* Add new language "fr-CA"

* Fix SetRowValidation API not working for Group Columns

* Update ContextMenu.ts

Fixed duplicated items inside Context Menu.

* Improve headers accessibility (#350)

Set the headersFocusability property to "All" by default allowing the  Row and column headers to be accessible via keyboard.

* Update ContextMenu.ts

* Update ContextMenu.ts

* Fix validateRow for GroupRows

* New method to get OutSystems column by index

* Check type of column on defining dirty mark

* Fix on how to obtain the column by index

* Update typedoc version

* Fix Filter by Condition

* Fix Filter by Value

* Increment the version of target ES

* Simplifying the code with ES2019

---------

Co-authored-by: gbnm <goncalo.martins@outsystems.com>
Co-authored-by: rug <rmfgoncalves@gmail.com>
Co-authored-by: Marcelino <brunoapmarcelino@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla:yes This code submission conforms with the OutSystems CLA or the CLA is not required for this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants