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

Theme manager integration #107

Merged
merged 8 commits into from
Sep 15, 2023
Merged

Conversation

timja
Copy link
Member

@timja timja commented Aug 20, 2023

Closes #41

see jenkinsci/theme-manager-plugin#103
jenkinsci/theme-manager-plugin#171
and
jenkinsci/dark-theme-plugin#194
jenkinsci/dark-theme-plugin#385

Testing done

Tested with jenkinsci/design-library-plugin#72 in mvn hpi:run

By going to the design library views and clicking through them

Note: Design library is quite a complex integration for this as it loads sources dynamically after Prism runs in some cases so it has some extra hardening to make it more reliable, simple integrations should be a lot easier

jenkinsci/configuration-as-code-plugin#2342 is an example of a trivial integration

Tested with:

  • Light
  • Dark
  • System - light and dark
  • Live theme switching
  • Selecting a non default theme and seeing it used instead

Submitter checklist

Preview Give feedback

@timja timja force-pushed the theme-manager-integration branch from 75dbea5 to bb98cf6 Compare August 20, 2023 10:52
@codecov
Copy link

codecov bot commented Aug 20, 2023

Codecov Report

Merging #107 (a87ebe0) into main (55a96be) will not change coverage.
The diff coverage is 50.00%.

@@            Coverage Diff            @@
##               main     #107   +/-   ##
=========================================
  Coverage     75.13%   75.13%           
  Complexity       87       87           
=========================================
  Files            12       12           
  Lines           366      366           
  Branches         30       30           
=========================================
  Hits            275      275           
  Misses           88       88           
  Partials          3        3           
Files Changed Coverage Δ
.../io/jenkins/plugins/prism/SourceCodeViewModel.java 0.00% <0.00%> (ø)
...main/java/io/jenkins/plugins/prism/PrismTheme.java 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

package.json Show resolved Hide resolved
pom.xml Show resolved Hide resolved
pom.xml Outdated
<!-- </includes>-->
<!-- </fileset>-->
<!-- <fileset>-->
<!-- <directory>node_modules</directory>-->
Copy link
Member Author

Choose a reason for hiding this comment

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

incredibly annoying to delete this every time, just disabled temporarily

pom.xml Outdated Show resolved Hide resolved
pom.xml Outdated
@@ -201,7 +189,7 @@
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/${project.artifactId}/js</outputDirectory>
<outputDirectory>${project.basedir}/src/main/webapp/js</outputDirectory>
Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

also note that without this change it is unusable in mvn hpi:run.
Yes this could be better in maven-hpi-plugin but better the plugin works in development mode than being completely broken

@timja timja added the enhancement Enhancement of existing functionality label Aug 20, 2023
@timja timja force-pushed the theme-manager-integration branch 3 times, most recently from 78b39a3 to 758e4d5 Compare August 20, 2023 14:50
Copy link
Member

@uhafner uhafner left a comment

Choose a reason for hiding this comment

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

Thanks, looks good to me!

I also converted the source code view to use the new approach. I'll push these changes to your branch.

The only missing thing is the missing custom-prism.css now. I'll debug into it a little bit deeper to see if we can have a clean separation between generated (copied) files and the source code files.

pom.xml Show resolved Hide resolved
.gitignore Outdated
Comment on lines 16 to 18
src/main/webapp/css/**/prism*.css
src/main/webapp/js/**/prism*.js
src/main/webapp/js/index.js
Copy link
Member

Choose a reason for hiding this comment

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

Maybe it makes more sense to use a subfolder for the generated files, otherwise it is hard in IntelliJ to see the difference between copied files and created files.

Copy link
Member Author

Choose a reason for hiding this comment

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

sure

pom.xml Outdated Show resolved Hide resolved
pom.xml Outdated
<include>**/*</include>
</includes>
<excludes>
<exclude>css/custom-prism.css</exclude>
Copy link
Member

Choose a reason for hiding this comment

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

This seems to delete the css/custom-prism.css file. At least it is not part of the plugin anymore.

Copy link
Member Author

Choose a reason for hiding this comment

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

doesn't this exclude it from clean?

pom.xml Show resolved Hide resolved
@timja
Copy link
Member Author

timja commented Sep 15, 2023

Thanks for the fixups changes look good

@uhafner uhafner merged commit fe8956b into jenkinsci:main Sep 15, 2023
@timja timja deleted the theme-manager-integration branch September 15, 2023 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement of existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants