-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
feat: Add office switcher with feature comparison #57555
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
Open
juliusknorr
wants to merge
1
commit into
master
Choose a base branch
from
feat/office-switcher
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+326
−3
Open
Changes from all commits
Commits
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
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
220 changes: 220 additions & 0 deletions
220
apps/settings/src/components/AppList/OfficeSuiteSwitcher.vue
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 |
|---|---|---|
| @@ -0,0 +1,220 @@ | ||
| <!-- | ||
| - SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors | ||
| - SPDX-License-Identifier: AGPL-3.0-or-later | ||
| --> | ||
|
|
||
| <template> | ||
| <div class="office-suite-switcher"> | ||
| <div v-if="isAllInOne" class="office-suite-switcher__aio-message"> | ||
| <p>{{ t('settings', 'Office suite switching is managed through the Nextcloud All-in-One interface.') }}</p> | ||
| <p>{{ t('settings', 'Please use the AIO interface to switch between office suites.') }}</p> | ||
| </div> | ||
| <template v-else> | ||
| <p>{{ t('settings', 'Select your preferred office suite. Please note that installing requires manual server setup.') }}</p> | ||
| <div class="office-suite-cards"> | ||
| <div | ||
| v-for="suite in officeSuites" | ||
| :key="suite.id" | ||
| class="office-suite-card" | ||
| :class="{ | ||
| 'office-suite-card--primary': suite.isPrimary, | ||
| 'office-suite-card--selected': selectedSuite === suite.id, | ||
| }" | ||
| @click="selectSuite(suite.id)"> | ||
| <div class="office-suite-card__header"> | ||
| <h3 class="office-suite-card__title"> | ||
| {{ suite.name }} | ||
| </h3> | ||
| <IconCheck v-if="selectedSuite === suite.id" class="office-suite-card__check" :size="24" /> | ||
| </div> | ||
| <ul class="office-suite-card__features"> | ||
| <li v-for="(feature, index) in suite.features" :key="index"> | ||
| {{ t('settings', feature) }} | ||
| </li> | ||
| </ul> | ||
| <a | ||
| :href="suite.learnMoreUrl" | ||
| target="_blank" | ||
| rel="noopener noreferrer" | ||
| class="office-suite-card__link" | ||
| @click.stop> | ||
| {{ t('settings', 'Learn more') }} | ||
| <IconArrowRight :size="20" /> | ||
| </a> | ||
| </div> | ||
| </div> | ||
| </template> | ||
| </div> | ||
| </template> | ||
|
|
||
| <script> | ||
| import { loadState } from '@nextcloud/initial-state' | ||
| import { translate as t } from '@nextcloud/l10n' | ||
| import IconArrowRight from 'vue-material-design-icons/ArrowRight.vue' | ||
| import IconCheck from 'vue-material-design-icons/Check.vue' | ||
| import { OFFICE_SUITES } from '../../constants/OfficeSuites.js' | ||
|
|
||
| export default { | ||
| name: 'OfficeSuiteSwitcher', | ||
|
|
||
| components: { | ||
| IconCheck, | ||
| IconArrowRight, | ||
| }, | ||
|
|
||
| props: { | ||
| installedApps: { | ||
| type: Array, | ||
| default: () => [], | ||
| }, | ||
| }, | ||
|
|
||
| emits: ['suite-selected'], | ||
|
|
||
| data() { | ||
| return { | ||
| isAllInOne: loadState('settings', 'isAllInOne', false), | ||
| selectedSuite: this.getInitialSuite(), | ||
| officeSuites: OFFICE_SUITES, | ||
| } | ||
| }, | ||
|
|
||
| methods: { | ||
| t, | ||
| getInitialSuite() { | ||
| for (const suite of OFFICE_SUITES) { | ||
| const app = this.installedApps.find((a) => a.id === suite.appId) | ||
| if (app && app.active) { | ||
| return suite.id | ||
| } | ||
| } | ||
|
|
||
| return null | ||
| }, | ||
|
|
||
| selectSuite(suiteId) { | ||
| if (this.selectedSuite === suiteId) { | ||
| this.selectedSuite = null | ||
| this.$emit('suite-selected', null) | ||
| } else { | ||
| this.selectedSuite = suiteId | ||
| this.$emit('suite-selected', suiteId) | ||
| } | ||
| }, | ||
| }, | ||
| } | ||
| </script> | ||
|
|
||
| <style lang="scss" scoped> | ||
| .office-suite-switcher { | ||
| padding: 20px; | ||
| margin-bottom: 30px; | ||
|
|
||
| &__aio-message { | ||
| background-color: var(--color-background-dark); | ||
| border: 1px solid var(--color-border); | ||
| border-radius: var(--border-radius-large); | ||
| padding: 20px; | ||
| text-align: center; | ||
| } | ||
|
|
||
| p { | ||
| margin: 8px 0; | ||
|
|
||
| &:first-child { | ||
| font-weight: 600; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| .office-suite-cards { | ||
| display: flex; | ||
| gap: 20px; | ||
| max-width: 1200px; | ||
| } | ||
|
|
||
| .office-suite-card { | ||
| flex: 1; | ||
| background-color: var(--color-main-background); | ||
| border: 2px solid var(--color-border); | ||
| border-radius: var(--border-radius-large); | ||
| padding: 24px; | ||
| cursor: pointer; | ||
| transition: all 0.2s ease; | ||
| display: flex; | ||
| flex-direction: column; | ||
|
|
||
| &:hover { | ||
| border-color: var(--color-primary-element); | ||
| box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); | ||
| } | ||
|
|
||
| &--selected { | ||
| background: linear-gradient(135deg, var(--color-primary-element-light) 0%, var(--color-main-background) 100%); | ||
| color: var(--color-main-text); | ||
| border-color: var(--color-primary-element); | ||
| } | ||
|
|
||
| &__header { | ||
| display: flex; | ||
| justify-content: space-between; | ||
| align-items: center; | ||
| margin-bottom: 16px; | ||
| } | ||
|
|
||
| &__title { | ||
| font-size: 24px; | ||
| font-weight: 600; | ||
| margin: 0; | ||
| } | ||
|
|
||
| .office-suite-card--primary &__check { | ||
| color: var(--color-primary-element); | ||
| } | ||
|
|
||
| &__features { | ||
| list-style: none; | ||
| padding: 0; | ||
| margin: 0 0 20px 0; | ||
| flex-grow: 1; | ||
|
|
||
| li { | ||
| padding: 4px 0; | ||
| padding-inline-start: 20px; | ||
| position: relative; | ||
| line-height: 1.5; | ||
|
|
||
| &::before { | ||
| content: '•'; | ||
| position: absolute; | ||
| inset-inline-start: 0; | ||
| font-weight: bold; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| &__link { | ||
| display: inline-flex; | ||
| align-items: center; | ||
| gap: 6px; | ||
| color: var(--color-main-text); | ||
| text-decoration: none; | ||
| font-weight: 500; | ||
| margin-top: auto; | ||
|
|
||
| &:hover { | ||
| text-decoration: underline; | ||
| } | ||
| } | ||
|
|
||
| .office-suite-card--selected &__link { | ||
| color: var(--color-main-text); | ||
| } | ||
| } | ||
|
|
||
| @media (max-width: 768px) { | ||
| .office-suite-cards { | ||
| flex-direction: column; | ||
| } | ||
| } | ||
| </style> | ||
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 |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| /** | ||
| * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors | ||
| * SPDX-License-Identifier: AGPL-3.0-or-later | ||
| */ | ||
|
|
||
| export const OFFICE_SUITES = [ | ||
| { | ||
| id: 'nextcloud-office', | ||
| appId: 'richdocuments', | ||
| name: 'Nextcloud Office', | ||
| features: [ | ||
| 'Best Nextcloud integration', | ||
| 'Open source', | ||
| 'Good performance', | ||
| 'Best security: documents never leave your server', | ||
| 'Best ODF compatibility', | ||
| 'Best support for legacy files', | ||
| ], | ||
| learnMoreUrl: 'https://nextcloud.com/collaboraonline/', | ||
| isPrimary: true, | ||
| }, | ||
| { | ||
| id: 'onlyoffice', | ||
| appId: 'onlyoffice', | ||
| name: 'Onlyoffice', | ||
| features: [ | ||
| 'Good Nextcloud integration', | ||
| 'Open core', | ||
| 'Best performance', | ||
| 'Limited ODF compatibility', | ||
| 'Best Microsoft compatibility', | ||
| ], | ||
| learnMoreUrl: 'https://nextcloud.com/onlyoffice/', | ||
| isPrimary: false, | ||
| }, | ||
| ] | ||
|
|
||
| /** | ||
| * Get office suite configuration by ID | ||
| * | ||
| * @param {string} id - The suite ID | ||
| * @return {object|undefined} The suite configuration or undefined if not found | ||
| */ | ||
| export function getOfficeSuiteById(id) { | ||
| return OFFICE_SUITES.find((suite) => suite.id === id) | ||
| } | ||
|
|
||
| /** | ||
| * Get office suite configuration by app ID | ||
| * | ||
| * @param {string} appId - The app ID (richdocuments, onlyoffice, etc.) | ||
| * @return {object|undefined} The suite configuration or undefined if not found | ||
| */ | ||
| export function getOfficeSuiteByAppId(appId) { | ||
| return OFFICE_SUITES.find((suite) => suite.appId === appId) | ||
| } |
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 |
|---|---|---|
|
|
@@ -99,7 +99,6 @@ | |
| </template> | ||
| </NcAppNavigationItem> | ||
| </template> | ||
|
|
||
| </template> | ||
| </NcAppNavigation> | ||
| </template> | ||
|
|
||
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.
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 would add a
here, otherwise the
divs andlis lose the cursor when hovered