Skip to content

Commit

Permalink
PENDING PR: fix external apps
Browse files Browse the repository at this point in the history
  • Loading branch information
diocas committed Jun 22, 2022
1 parent 242e838 commit fbf1765
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 8 deletions.
7 changes: 7 additions & 0 deletions changelog/unreleased/bugfix-external-apps
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Bugfix: External apps fixes

Bug introduced in #6870. A method used to communicate with the backend was not properly added to the extension after being moved to a different location.

(bonus: app name back in the title)

https://github.com/owncloud/web/pull/7166
21 changes: 15 additions & 6 deletions packages/web-app-external/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,17 @@ export default {
return this.$route.query.fileId
}
},
mounted() {
if (this.appName) {
document.title = [
this.currentFileContext.fileName,
this.appName,
this.configuration.currentTheme.general.name
]
.filter(Boolean)
.join(' - ')
}
},
async created() {
await unauthenticatedUserReady(this.$router, this.$store)
Expand Down Expand Up @@ -130,19 +141,17 @@ export default {
return
}
const data = await response.json()
if (!data.app_url || !data.method) {
if (!response.data.app_url || !response.data.method) {
this.errorMessage = this.$gettext('Error in app server response')
this.loading = false
this.loadingError = true
console.error('Error in app server response')
return
}
this.appUrl = data.app_url
this.method = data.method
if (data.form_parameters) this.formParameters = data.form_parameters
this.appUrl = response.data.app_url
this.method = response.data.method
if (response.data.form_parameters) this.formParameters = response.data.form_parameters
if (this.method === 'POST' && this.formParameters) {
this.$nextTick(() => this.$refs.subm.click())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { useAppConfig, AppConfigResult } from './useAppConfig'
import { useAppFileHandling, AppFileHandlingResult } from './useAppFileHandling'
import { useAppFolderHandling, AppFolderHandlingResult } from './useAppFolderHandling'
import { useAppDocumentTitle } from './useAppDocumentTitle'
import { usePublicLinkPassword, usePublicLinkContext } from '../authContext'
import { usePublicLinkPassword, usePublicLinkContext, useRequest } from '../authContext'
import { useClientService } from '../clientService'

// TODO: this file/folder contains file/folder loading logic extracted from preview and drawio extensions
Expand Down Expand Up @@ -76,6 +76,7 @@ export function useAppDefaults(options: AppDefaultsOptions): AppDefaultsResult {
isPublicLinkContext,
publicLinkPassword
}),
...useAppFolderHandling({ clientService, store, isPublicLinkContext, publicLinkPassword })
...useAppFolderHandling({ clientService, store, isPublicLinkContext, publicLinkPassword }),
...useRequest({ clientService, store, currentRoute: unref(currentRoute) })
}
}

0 comments on commit fbf1765

Please sign in to comment.