Skip to content

Commit

Permalink
Make use of new productversion field if available
Browse files Browse the repository at this point in the history
  • Loading branch information
kulmann committed May 23, 2022
1 parent 31ba516 commit d4b976c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
6 changes: 6 additions & 0 deletions changelog/unreleased/enhancement-productversion-log
@@ -0,0 +1,6 @@
Enhancement: Log correct oCIS version if available

oCIS has introduced a new `productversion` field to announce it's correct version while maintaining a fake 10.x.x version in the `versionstring` field to keep clients compatible. We're using the new productversion field when it exists and use versionstring as a fallback. Thus the backend product information prints the correct oCIS version now.

https://github.com/owncloud/ocis/pull/3805
https://github.com/owncloud/web/pull/7045
10 changes: 5 additions & 5 deletions packages/web-runtime/src/container/versions.ts
Expand Up @@ -6,12 +6,12 @@ export const getWebVersion = (): string => {
}

export const getBackendVersion = ({ store }: { store: Store<unknown> }): string => {
const backendVersion = store.getters.user.version
if (!backendVersion || !backendVersion.string) {
const backendStatus = store.getters.capabilities?.core?.status
if (!backendStatus || !backendStatus.versionstring) {
return undefined
}
const product = backendVersion.product || 'ownCloud'
const version = backendVersion.string
const edition = backendVersion.edition
const product = backendStatus.product || 'ownCloud'
const version = backendStatus.productversion || backendStatus.versionstring
const edition = backendStatus.edition
return `${product} ${version} ${edition}`
}

0 comments on commit d4b976c

Please sign in to comment.