-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
fix(files): correct params on Go back link #43116
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -96,7 +96,6 @@ | |||||||||
| data-cy-files-content-empty> | ||||||||||
| <template #action> | ||||||||||
| <NcButton v-if="dir !== '/'" | ||||||||||
| :aria-label="t('files', 'Go to the previous folder')" | ||||||||||
| type="primary" | ||||||||||
| :to="toPreviousDir"> | ||||||||||
| {{ t('files', 'Go back') }} | ||||||||||
|
|
@@ -341,7 +340,9 @@ export default defineComponent({ | |||||||||
| */ | ||||||||||
| toPreviousDir(): Route { | ||||||||||
| const dir = this.dir.split('/').slice(0, -1).join('/') || '/' | ||||||||||
| return { ...this.$route, query: { dir } } | ||||||||||
| const fileid = this.pathsStore.getPath(this.currentView?.id, dir)?.toString() | ||||||||||
| // @ts-expect-error Route expect params to be string, but we need to explicitly set undefined when there is no fileid | ||||||||||
| return { ...this.$route, params: { fileid }, query: { dir } } | ||||||||||
|
Comment on lines
+343
to
+345
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You should not need to provide the fileid.
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I understand our files routing correctly, we always have For example, if I open
Let's say, I'm in the root, then I'm going to Baz and back to Bar.
From 4 shouldn't I return to 3 If going back should be without
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
no, having fileid in the path is optional, we don't rely on it to open folders or browse.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does it mean that links to folders in the files list should not contain For example, if
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can have it or you can't. the fileid, like in older versions, is only used within the Files app to work with a file within a folder (like open the sidebar, etc etc)
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
We try to keep the current fileid for this specific reason: #40515
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Does it mean that opening any folder is supposed to also open a sidebar after it? If it is not, we have a inconsistent here:
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably, there should be a query param for sidebar, like
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No please 🙈
That's not a inconsistency, this is the feature. It's been long discussed and implemented by the design team.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, please, let's not dive into this and reconsider 6 years of feature requests, this is not what this issue is about at all. |
||||||||||
| }, | ||||||||||
|
|
||||||||||
| shareAttributes(): number[]|undefined { | ||||||||||
|
|
@@ -567,7 +568,7 @@ export default defineComponent({ | |||||||||
| * Refreshes the current folder on update. | ||||||||||
| * | ||||||||||
| * @param {Node} node is the file/folder being updated. | ||||||||||
| */ | ||||||||||
| */ | ||||||||||
| onUpdatedNode(node) { | ||||||||||
| if (node?.fileid === this.currentFolder?.fileid) { | ||||||||||
| this.fetchContent() | ||||||||||
|
|
||||||||||
Large diffs are not rendered by default.
Large diffs are not rendered by default.
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.