-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
File templates #25090
File templates #25090
Conversation
This comment has been minimized.
This comment has been minimized.
I think that is fine as is, no? Do we need a custom setting to allow users to change the folder name? |
I think we should still offer changing the path in case you have your templates somewhere else, but I'd leave that to @jancborchardt to decide. |
Yoooo super nice work @juliushaertl! Already looks very good. 2 small pieces of feedback before I look more into the design and templates:
Yes, probably makes sense to have that in the bottom left settings as "Templates folder". Especially if people just sync their normal folders and on different operating systems they have different naming conventions. |
Forwarding all the praise for the nice looking UI to @skjnldsv 👏 |
No, that's not how the new file menu was designed.
👍 |
37862d2
to
0d50147
Compare
1c9c031
to
a899278
Compare
ba56348
to
a474041
Compare
a474041
to
e2cd842
Compare
e2cd842
to
a94db75
Compare
a94db75
to
4fc3d42
Compare
Time to get this in 🏓 for reviews |
Found some things (maybe they can be done now or in a followup)
|
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.
See my comment. I guess some can be moved to follow up tickets some should be fixed here.
But the general concept with text works! Whoohoo
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.
some feedback on the OCP changes :)
Thanks a lot, makes all sense. I'll adjust that tomorrow morning. |
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
…mplates by default Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
…isting directories Signed-off-by: Julius Härtl <jus@bitgrid.net>
…type registration lazy Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
bb6fdd4
to
c1a25ea
Compare
/compile amend / |
/** | ||
* Register a template type support | ||
* | ||
* @param callable(): TemplateFileCreator $callback A callback which returns the TemplateFileCreator instance to register |
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.
nit: @psalm-param callable():TemplateFileCreator $callback
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.
Code looks good
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.
Tested with Text and works flawless (once I figured out how it actually works, I expected new entries in the + menu somehow)
👍 💯
c1a25ea
to
5197006
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.
Whoohoo let's go
Signed-off-by: Julius Härtl <jus@bitgrid.net>
af18372
to
63a2ea8
Compare
Ok, bundles happy after i removed the stupid random files i committed 🙈 |
Follow up polishing tasks are in #25358 |
@@ -198,7 +203,21 @@ | |||
iconClass: actionSpec.iconClass, | |||
fileType: actionSpec.fileType, | |||
actionHandler: actionSpec.actionHandler, | |||
}); | |||
checkFilename: actionSpec.checkFilename |
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.
@juliushaertl do you recall why/where we're actually using this?
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.
No I cannot remember anything in that regard 🙈
Also no other occurrence in my local checkouts, so I'd say this can be dropped.
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.
Good! I'll see with the new implementation :)
Fixes #22426
OCP.InitialState.loadState('files', 'templates')
OCP.InitialState.loadState('files', 'template_path')
, will throw an error if no template path is availableSeparate pull requests
Possible follow up enhancements
Editor app integrations
API endpoints
GET /ocs/v2.php/apps/files/api/v1/templates
Example response:
POST /ocs/v2.php/apps/files/api/v1/templates/create
Parameters:
200 Success
403
POST /ocs/v2.php/apps/files/api/v1/templates/path
Parameters:
200 Success