-
Notifications
You must be signed in to change notification settings - Fork 117
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
Use FileCreatedFromTemplateEvent to inject the already existing empty templates #1377
Conversation
260a04c
to
4a10f4b
Compare
/backport to stable4 |
/backport to stable23 |
4a10f4b
to
4dc9d04
Compare
2744c1b
to
84b6a96
Compare
// Expire template mappings for file creation | ||
$query = $this->db->getQueryBuilder(); | ||
$query->delete('richdocuments_template') | ||
->where($query->expr()->lte('timestamp', $query->createNamedParameter(time() - 60, IQueryBuilder::PARAM_INT))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets maybe reconsider the cleanup here in case a file is for some reason not opened properly and then retried after 1 hour.
… template files for Collabora Signed-off-by: Julius Härtl <[email protected]> Cleanup template loading Signed-off-by: Julius Härtl <[email protected]> Fix template handling Signed-off-by: Julius Härtl <[email protected]>
Signed-off-by: Julius Härtl <[email protected]>
Signed-off-by: Julius Härtl <[email protected]>
Signed-off-by: Julius Härtl <[email protected]>
Signed-off-by: Julius Härtl <[email protected]>
368f4f6
to
b15c6be
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good, tested all creation scenarios with/without using templates (except direct editing ones).
A few minor inline remarks.
Also, it could be useful to have a short high level dev doc, like a brief abstract description of what happens, who calls what, what comes from where for all the use cases as this app is rather complex but not so complicated in the end 😁.
@@ -393,7 +409,7 @@ public function getUserTemplateDir() { | |||
} | |||
|
|||
// has the user manually set a directory as the default template dir ? | |||
$templateDirPath = $this->config->getUserValue($this->userId, $this->appName, 'templateFolder', false); | |||
$templateDirPath = $this->config->getUserValue($this->userId, Application::APPNAME, 'templateFolder', false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpicking and out of topic 😁 : Might be confusing to call this APPNAME instead of APPID or APP_ID. Don't you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, lets do that after the merge in a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep
@@ -80,17 +83,21 @@ const NewFileMenu = { | |||
OCA.Files.Files.isFileNameValid(filename) | |||
filename = FileList.getUniqueName(filename) | |||
|
|||
$.post( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to self, TODO: get rid of JQuery in this file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added to #541
Signed-off-by: Julius Härtl <[email protected]>
Yes, fully agree on that. Maybe also some quick diagram drawings might help to explain that a bit better. Something for a documentation ticket then I'd say. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
/backport to stable23 |
The backport to stable4 failed. Please do this backport manually. |
This comment has been minimized.
This comment has been minimized.
Backporting (at least partially) to stable4 might be needed but could be tricky (ref #2008) |
Scenarios to test:
mobile apps (direct editing server)not yet implemented Implement direct editing API #721