Skip to content

feat: Add Excel themes, curate list, and show color counts in UI #453

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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

dradoudine
Copy link

This commit introduces several enhancements to the color palette feature:

  1. Adds 4 new Excel-inspired color palettes:

    • EXCEL_OFFICE_DEFAULT
    • EXCEL_BLUE_II
    • EXCEL_GREEN_II
    • EXCEL_RED_VIOLET_II
  2. Curates the existing list of ~20 themes for better distinctiveness:

    • Removes 3 themes: PLASMA, TOMORROW, and TOMORROW_NIGHT.
    • The total number of predefined themes is now 21 (plus RANDOM).
  3. Enhances the UI for palette selection:

    • The dropdown in the publishReport step now displays the number of defined colors for each palette (e.g., "Rainbow (7 colors)").
    • This is achieved by a new method getDefinedColorCount in ColorPalette.java and corresponding changes in PublishReportStep.Descriptor.
  4. Updates unit tests in ColorPaletteTest.java to reflect these additions, removals, and to test the new color count functionality.

Testing done

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests that demonstrate the feature works or the issue is fixed

This commit introduces several enhancements to the color palette feature:

1.  Adds 4 new Excel-inspired color palettes:
    - EXCEL_OFFICE_DEFAULT
    - EXCEL_BLUE_II
    - EXCEL_GREEN_II
    - EXCEL_RED_VIOLET_II

2.  Curates the existing list of ~20 themes for better distinctiveness:
    - Removes 3 themes: PLASMA, TOMORROW, and TOMORROW_NIGHT.
    - The total number of predefined themes is now 21 (plus RANDOM).

3.  Enhances the UI for palette selection:
    - The dropdown in the `publishReport` step now displays the number
      of defined colors for each palette (e.g., "Rainbow (7 colors)").
    - This is achieved by a new method `getDefinedColorCount` in
      `ColorPalette.java` and corresponding changes in
      `PublishReportStep.Descriptor`.

4.  Updates unit tests in `ColorPaletteTest.java` to reflect these
    additions, removals, and to test the new color count functionality.
Previously, the build was failing because it couldn't find some necessary components for testing. I've now added `mockito-core` (version 5.12.0) to your `pom.xml` file. This should resolve the compilation errors and allow your unit tests to run correctly.
This commit addresses several compilation errors in
`ReportRecorderIntegrationTest.java`:

- Corrected mocking of `Provider` to use `getSymbolName()` instead of
  a non-existent `getName()` method.
- Updated item handling in test setup for `Report` objects to use
  `setItems(List<Item>)` as `addItem(Item)` is not available.
- Ensured `Provider.scan()` is mocked correctly to return a
  pre-populated `Report` object for the `ReportScanner` to process.
- Made `ColorPalette.THEMES` map public to allow access from tests in
  different packages for verifying theme color definitions.

These changes should allow the test suite to compile and run successfully.
This commit addresses the following issues:

1.  Fixes a compilation error in `ReportRecorderIntegrationTest.java`
    by correctly using `item.setResult(map)` instead of the
    non-existent `item.addResult()` method for setting up test data.
2.  Adds `javax.annotation:javax.annotation-api:1.3.2` with
    `provided` scope to `pom.xml`. This is to resolve build warnings
    related to `javax.annotation.meta.When` not being found during
    compilation.

These changes should allow the test suite to compile successfully and
reduce build log warnings.

// called by jelly view
@POST
public ListBoxModel doFillColorPaletteItems(@AncestorInPath final AbstractProject<?, ?> project) {

Check warning

Code scanning / Jenkins Security Scan

Stapler: Missing permission check

Potential missing permission check in Descriptor#doFillColorPaletteItems
Replaces `mockito-core` with `mockito-inline` (version 5.12.0)
in `pom.xml`. This change is to resolve errors during test execution
where the JVM failed to initialize due to `mockito-core.jar` being
incorrectly used as a Java agent by Surefire.

`mockito-inline` includes the necessary agent capabilities and allows
for more advanced mocking features, which should prevent the
"Failed to find Premain-Class manifest attribute" error and allow
tests to run correctly.
I've changed the version of the `mockito-inline` test dependency
from 5.12.0 to 5.11.0 in `pom.xml`.

This is to resolve an issue where version 5.12.0 could not be found
in the configured Maven repositories. Version 5.11.0 is a known
stable version and should be resolvable, allowing the build to proceed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants