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

app-theme support #52

Merged
merged 8 commits into from Nov 22, 2017
Merged

app-theme support #52

merged 8 commits into from Nov 22, 2017

Conversation

phisch
Copy link
Contributor

@phisch phisch commented Apr 26, 2017

This adds app theme support. I also refreshed the code in general, using dependency injection, file naming and more.

This PR has a hard dependency on owncloud/core#27746
Fixes: owncloud/core#27628
Fixes #54

@phisch phisch mentioned this pull request Apr 26, 2017
33 tasks

)));
$application->registerRoutes($this, [
Copy link
Member

Choose a reason for hiding this comment

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

you can just return the array - no need to call registerRoutes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks, didn't know that


use OC\Theme\Theme;
use OCA\TemplateEditor\Http\MailTemplateResponse;
use OC\AppFramework\Middleware\Security\Exceptions\SecurityException;
Copy link
Member

Choose a reason for hiding this comment

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

no ocp for this exception?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

silly me, must have been in there from before, this exception isn't actually been thrown anywhere


namespace OCA\TemplateEditor;

use OC\Theme\Theme;
Copy link
Member

Choose a reason for hiding this comment

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

looks like we need a public api for this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's public now

@@ -0,0 +1,80 @@
<?php
/**
* Created by PhpStorm.
Copy link
Member

Choose a reason for hiding this comment

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

please use our standard header - thx

Copy link
Contributor Author

Choose a reason for hiding this comment

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

damn PhpStorm and its autogenerated stuff...

@phisch
Copy link
Contributor Author

phisch commented May 16, 2017

@DeepDiver1975 please re-check!

@phisch phisch self-assigned this May 16, 2017
@phisch phisch added this to the 10.0.1 milestone May 16, 2017
@PVince81 PVince81 modified the milestones: 10.0.2, 10.0.1 May 19, 2017
@PVince81 PVince81 modified the milestones: 10.0.2, development Jun 29, 2017
@PVince81
Copy link
Contributor

Increased version

@PVince81
Copy link
Contributor

and set min version to 10.0.3

@phisch
Copy link
Contributor Author

phisch commented Aug 11, 2017

Since owncloud/core#27746 is merged, this one can be merged too if we get a positive review. @DeepDiver1975 @PVince81

@PVince81
Copy link
Contributor

a quick retest would be appreciated since this PR is older

@PVince81
Copy link
Contributor

@phisch can you retest ?

@phisch
Copy link
Contributor Author

phisch commented Sep 6, 2017

Somehow something with the DI-Container changed so the templateeditor could not resolve its dependencies anymore. Fix is here: owncloud/core#28925

@phisch
Copy link
Contributor Author

phisch commented Sep 13, 2017

There are some issues where the routes are not being loaded correctly in a setup of @michaelstingl. Trying to find out what is going wrong there atm.

@phisch
Copy link
Contributor Author

phisch commented Sep 27, 2017

The list of themes is empty in @michaelstingl's setup because the themes have never been enabled.
Once an app/theme gets enabled, information about it (from info.xml) is stored in the appconfig table. The entries from that table are used to list apps/themes through the AppManager. Also the app types are read from that table.

That means that there is no obvious way to get a list of all app themes if they have never been enabled before.

Looking for a fix/workaround for that.

@phisch phisch mentioned this pull request Sep 27, 2017
9 tasks
@phisch
Copy link
Contributor Author

phisch commented Sep 27, 2017

This actually needs a fix in the core. A quick fix pr is here: owncloud/core#29110

But i am not sure if we can go that way or have to find a more elegant solution.

@PVince81 PVince81 assigned VicDeo and unassigned phisch Nov 3, 2017
@PVince81
Copy link
Contributor

PVince81 commented Nov 3, 2017

But it doesn't make sense to display anything about the theme in this dropdown if the theme app was never enabled. We don't want to go fiddle with disabled apps.

Philipp Schaffrath and others added 5 commits November 8, 2017 17:35
…re-written some code so it is up to date, also used depencency injection, so we can add tests
…nnotation that isn't actually been thrown, fixed docblock, removed todo that is unnecessary
@VicDeo
Copy link
Member

VicDeo commented Nov 8, 2017

@PVince81 Rebased, squashed a bit, minor cleanup is done, routing issue is fixed.

So the theme should be enabled and only then it is possible edit email templates for this theme?

It differs from the previous approach when we were able to edit templates for any theme from themes dir. Even if it is inactive.

@PVince81
Copy link
Contributor

PVince81 commented Nov 8, 2017

@VicDeo ah, so it was possible before, I didn't know that.

If we consider the actual use case, I don't see a real use case for the ability to edit disabled themes. It's not like someone is switching themes every week or so... So I think the ability to only edit the currently active theme is alright.

cc @pmaier1

@VicDeo
Copy link
Member

VicDeo commented Nov 9, 2017

@PVince81 Ok, only enabled app-themes are available now. As for non-app-themes they are all available as before.

@VicDeo
Copy link
Member

VicDeo commented Nov 9, 2017

@DeepDiver1975 @PVince81 ready for review.

@PVince81
Copy link
Contributor

Code looks good so far.

Does the editor still works with old style themes stored in "/themes" ? I don't remember whether we still support non-app themes at this point.

@VicDeo

@VicDeo
Copy link
Member

VicDeo commented Nov 15, 2017

@PVince81 yes, old style themes are still supported here

@PVince81 PVince81 merged commit 456d068 into master Nov 22, 2017
@PVince81 PVince81 deleted the app-theme-support branch November 22, 2017 08:44
This was referenced Nov 27, 2017
@patrickjahns patrickjahns modified the milestones: development, QA Feb 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants