-
Notifications
You must be signed in to change notification settings - Fork 3
New navigation list #37
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
Merged
provokateurin
merged 5 commits into
nextcloud:main
from
smarinier:feature/use_route_and_store
Nov 26, 2024
Merged
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
96fc617
feat: new navigation list, splitted (standard/installed), use routes …
smarinier 34f5acd
feat: use always_enabled, icon_url and @media dark theme
smarinier 6d86293
feat: use getAppIcon
smarinier 1234b52
feat: routes and icons
smarinier ce009c5
feat: ocp is NC29 min now, psalm warnings
smarinier File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
feat: routes and icons
- don't use backend generic home route - use 'specs' and apiSpecs - child apis draw their icon in 16 - keep open states Signed-off-by: Sebastien Marinier <[email protected]>
- Loading branch information
commit 1234b524d674ba2c4c6a375b66358eb016018237
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,8 +4,9 @@ | |
| :key="app.id" | ||
| allow-collapse | ||
| :name="app.name" | ||
| :open="isSelectedChild($route.params.appid, app)" | ||
| :to="{path: `/view/${app.id}`}"> | ||
| :open="isSelectedChild($route.params.appid, app) || isManuallyOpened(app.id)" | ||
| :to="{path: `/view/${app.id}`}" | ||
| @update:open="(open) => onOpen(app.id, open)"> | ||
| <template #icon> | ||
| <AppIcon v-if="app.icon_url" | ||
| :href="app.icon_url" /> | ||
|
|
@@ -14,7 +15,15 @@ | |
| <NcAppNavigationItem v-for="child in childApis(app)" | ||
| :key="child.id" | ||
| :name="child.name" | ||
|
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. I wonder if we should strip the app id prefix so that it's just |
||
| :to="{path: `/view/${child.id}`}" /> | ||
| :to="{path: `/view/${child.id}`}"> | ||
| <template #icon> | ||
| <AppIcon v-if="app.icon_url" | ||
| size="16" | ||
| :href="app.icon_url" /> | ||
| <ApiIcon v-else | ||
| size="16" /> | ||
| </template> | ||
| </NcAppNavigationItem> | ||
| </NcAppNavigationItem> | ||
| </NcAppNavigationList> | ||
| </template> | ||
|
|
@@ -42,31 +51,37 @@ export default { | |
| }, | ||
| computed: { | ||
| apps() { | ||
| const apps = store.apps | ||
| return store.apps | ||
| .filter(app => app.always_enabled === this.alwaysEnabled) | ||
| .sort(function(a, b) { | ||
| // core nextcloud always first | ||
| if (a.id === 'core') return -1 | ||
| if (b.id === 'core') return 1 | ||
| return OC.Util.naturalSortCompare(a.name, b.name) | ||
| }) | ||
| return apps | ||
| }, | ||
| }, | ||
| methods: { | ||
| isSelectedChild(appId, app) { | ||
| if (appId === app.id) { | ||
| return false | ||
| } | ||
| return app.apis.indexOf(appId) >= 0 | ||
| return app.specs.indexOf(appId) >= 0 | ||
| }, | ||
| childApis(app) { | ||
| if (app.apis === undefined || app.apis.length === 1) { | ||
| if (app.specs === undefined || app.specs.length === 1) { | ||
| return [] | ||
| } | ||
| return app.apis.filter(id => id !== app.id) | ||
| return app.specs | ||
| .filter(id => id !== app.id) | ||
| .map(cid => ({ id: cid, name: cid })) | ||
| }, | ||
| isManuallyOpened(appId) { | ||
| return store.isAppOpened(appId) | ||
| }, | ||
| onOpen(appId, open) { | ||
| store.appOpen(appId, open) | ||
| }, | ||
| }, | ||
| } | ||
| </script> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.