-
Notifications
You must be signed in to change notification settings - Fork 2.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
New folder button #17422
base: dev
Are you sure you want to change the base?
New folder button #17422
Conversation
7144554
to
c72190f
Compare
if (!value) { return; } | ||
|
||
this.storageFilesResourceService.createFolder( | ||
`${this.storage._links.self.href}/folders`, |
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.
Not sure if there's a more appropriate way to build this URL
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.
if you want to keep this URL building out of the modal, you can add it to the locals
map. The createFolderHref
is static, hence this could be an easy solution and you won't rebuilt it:
const locals = {
projectFolderHref: this.projectStorage._links.projectFolder?.href,
projectFolderMode: this.projectStorage.projectFolderMode,
storage,
};
<button | ||
type="button" | ||
class="button spot-action-bar--action" | ||
(click)="newFolderDialog()" |
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.
🟡 I have a naming issue here.
newFolderDialog
is not what really happens here. It is instead a createFolderAndEnter()
.
if (!value) { return; } | ||
|
||
this.storageFilesResourceService.createFolder( | ||
`${this.storage._links.self.href}/folders`, |
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.
if you want to keep this URL building out of the modal, you can add it to the locals
map. The createFolderHref
is static, hence this could be an easy solution and you won't rebuilt it:
const locals = {
projectFolderHref: this.projectStorage._links.projectFolder?.href,
projectFolderMode: this.projectStorage.projectFolderMode,
storage,
};
}, | ||
).subscribe((newlyCreatedDirectory) => { | ||
this.changeLevel(newlyCreatedDirectory); | ||
}); |
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.
🟢 Yes, this implementation pretty much looks like I'd expect it.
4704c93
to
755e181
Compare
b3c299b
to
290974f
Compare
Ticket
https://community.openproject.org/wp/59901
What are you trying to accomplish?
New folder button on the location picker. This allows users to organise their files better.
Screenshots
Screencast.From.2024-12-16.06-49-13.mp4
What approach did you choose and why?
Using a
window.prompt
because it's the easiest to implement for now. Will enable us to move forward. There are follow ups that can be done to improve UX