Skip to content

extended theme service#27746

Merged
PVince81 merged 5 commits into
masterfrom
extend-theme-service
Aug 10, 2017
Merged

extended theme service#27746
PVince81 merged 5 commits into
masterfrom
extend-theme-service

Conversation

@phisch

@phisch phisch commented Apr 26, 2017

Copy link
Copy Markdown
Contributor

Description

This adds the functionality to get a list of all available themes or search for one through the ThemeService.

Related Issue

Templateditor PR owncloud/templateeditor#52, which fixes #27628, has a hard dependency on this extension

Motivation and Context

The mail template editor needs to know which themes there are, and i don't want too much theme logic it its repository, this way we can keep it clean.

How Has This Been Tested?

Partially tested through unittests. Fully tested by hand.
The usual overwrites: css, js, img, templates, translations, mimetype icons all work for legacy and app themes, for subdir and normal deployments.

Tested the following overwrites:

app theme - regular deployment:

  • css
  • js
  • img
  • template
  • mimetype icons
  • translations

app theme - subdir deployment:

  • css
  • js
  • img
  • template
  • mimetype icons
  • translations

legacy theme - regular deployment:

  • css
  • js
  • img
  • template
  • mimetype icons
  • translations

legacy theme - sub dir deployment:

  • css
  • js
  • img
  • template
  • mimetype icons
  • translations

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@PVince81

PVince81 commented May 4, 2017

Copy link
Copy Markdown
Contributor

Is this done ? If yes, please set the "3 - To Review" label and summon reviewers.

@phisch

phisch commented May 5, 2017

Copy link
Copy Markdown
Contributor Author

Since the changes are used in an app, should i move this to the public api?

$this->setDefaultThemeDirectory($defaultThemeDirectory);
$this->createTheme($themeName);

if ($themeName === '' && $this->defaultThemeExists()) {

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.

weird, why does Github show && in red now ?

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.

Github had a syntax highlighting hickup. (<- just for the history)

@PVince81

PVince81 commented May 5, 2017

Copy link
Copy Markdown
Contributor

Since the changes are used in an app, should i move this to the public api?

If some functions need to be called by apps, please make these public.

The code checker would complain when scanning the app if you're using private APIs

@phisch

phisch commented May 5, 2017

Copy link
Copy Markdown
Contributor Author

Ok, going to update.

@DeepDiver1975 DeepDiver1975 added this to the 10.0.1 milestone May 12, 2017

@DeepDiver1975 DeepDiver1975 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

public api is required

@PVince81

Copy link
Copy Markdown
Contributor

@phisch any update ?

@phisch

phisch commented May 16, 2017

Copy link
Copy Markdown
Contributor Author

@DeepDiver1975 please give me feedback if this is okay.

Updating the TemplateEditor regardingly, and checking if this is being used somewhere else.

@phisch phisch self-assigned this May 16, 2017
@DeepDiver1975

Copy link
Copy Markdown
Member

@DeepDiver1975 please give me feedback if this is okay.

OCP shall only hold interfaces - no classes. the idea here is to separate the public interface declaration from its implementation.

@DeepDiver1975

Copy link
Copy Markdown
Member

setting back to '2 - developing' because of missing proper public interfaces

@PVince81

Copy link
Copy Markdown
Contributor

Without this it will not be possible to theme the setup page as it was before, which is a regression.

Not sure how bad this is and whether it can wait for 10.0.2 @felixboehm ...

@PVince81

Copy link
Copy Markdown
Contributor

@phisch or is that only needed for the email template app?

@phisch phisch force-pushed the extend-theme-service branch from cf2f8e4 to 74e6e41 Compare May 18, 2017 10:07
Comment thread lib/private/Server.php Outdated
$this->registerService('ThemeService', function ($c) {
return new ThemeService($this->getSystemConfig()->getValue('theme'));
});
$this->registerAlias('IThemeService', 'ThemeService');

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Try 'OCP\Theme\IThemeService'

@PVince81

Copy link
Copy Markdown
Contributor

@phisch how much work is missing to have this working ?

@phisch

phisch commented May 19, 2017

Copy link
Copy Markdown
Contributor Author

@PVince81 ups, i just forgot to switch to review label again. It should be done.

@PVince81

Copy link
Copy Markdown
Contributor

It's still a huge thing, looks a bit risk to merge now.

@PVince81

Copy link
Copy Markdown
Contributor

moving to 10.0.2

@PVince81 PVince81 modified the milestones: 10.0.2, 10.0.1 May 19, 2017
@PVince81 PVince81 modified the milestones: 10.0.3, 10.0.2 May 26, 2017
@PVince81

PVince81 commented Jul 4, 2017

Copy link
Copy Markdown
Contributor

@phisch phinisch this ?

@phisch

phisch commented Jul 12, 2017

Copy link
Copy Markdown
Contributor Author

@PVince81 this has been complete the whole time, we just did not want to merge because it was too close to a release.
@DeepDiver1975 can you re-review?

@DeepDiver1975

Copy link
Copy Markdown
Member

translation have been tested? php as well as js translations?

I don't see any related change in the code which could make it possible - see #28167 (comment)

@phisch

@phisch

phisch commented Jul 13, 2017

Copy link
Copy Markdown
Contributor Author

I tested the JS translations which could be affected by this. And yes they work as expected.
Mainly this PR helps other apps interacting with themes, especially getting information about available ones.

This should not affect existing behavior. And to make sure it doesn't i re-tested all the points mentioned in the first comment.

@DeepDiver1975

@felixboehm felixboehm added p1-urgent Critical issue, need to consider hotfix with just that issue feature:theming labels Jul 17, 2017
@PVince81

PVince81 commented Aug 3, 2017

Copy link
Copy Markdown
Contributor

@phisch can you rebase to refresh CI ?

@DeepDiver1975 so this can be merged ?

Philipp Schaffrath and others added 5 commits August 10, 2017 09:05
…eme, refactored theme object so it can also set the web path through constructor, added setters to manipulate the current theme, removed unnecessary slash, added/modified tests
@PVince81 PVince81 force-pushed the extend-theme-service branch from c14cdc0 to 1f25c61 Compare August 10, 2017 07:06
@PVince81

Copy link
Copy Markdown
Contributor

rebased

@PVince81

Copy link
Copy Markdown
Contributor

@DeepDiver1975 no feedback from you, assuming you don't have any comment to add

@PVince81 PVince81 merged commit 7c587c8 into master Aug 10, 2017
@PVince81 PVince81 deleted the extend-theme-service branch August 10, 2017 19:01
@lock

lock Bot commented Aug 2, 2019

Copy link
Copy Markdown

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock Bot locked as resolved and limited conversation to collaborators Aug 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

3 - To Review feature:theming p1-urgent Critical issue, need to consider hotfix with just that issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Email templates cannot be loaded.

4 participants