Skip to content

Commit

Permalink
Get rid of isOcis everywhere else
Browse files Browse the repository at this point in the history
  • Loading branch information
dschmidt committed Mar 17, 2022
1 parent 171a720 commit 53d410e
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 17 deletions.
11 changes: 8 additions & 3 deletions packages/web-app-files/src/mixins/actions/acceptShare.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
import { triggerShareAction } from '../../helpers/share/triggerShareAction'

import { mapActions, mapGetters, mapMutations } from 'vuex'
import { mapActions, mapMutations } from 'vuex'
import PQueue from 'p-queue'
import { ShareStatus } from '../../helpers/share'
import { isLocationSharesActive } from '../../router'
import { useCapabilityFilesSharingResharing } from 'web-runtime/src/composables'

export default {
computed: {
...mapGetters(['isOcis']),
setup() {
return {
resharingCapability: useCapabilityFilesSharingResharing()
}
},
$_acceptShare_items() {
return [
{
Expand Down Expand Up @@ -50,7 +55,7 @@ export default {
const share = await triggerShareAction(
resource,
ShareStatus.accepted,
!this.isOcis,
this.resharingCapability,
this.$client
)
if (share) {
Expand Down
11 changes: 8 additions & 3 deletions packages/web-app-files/src/mixins/actions/declineShare.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
import { triggerShareAction } from '../../helpers/share/triggerShareAction'
import { isLocationSharesActive } from '../../router'
import { mapActions, mapGetters, mapMutations } from 'vuex'
import { mapActions, mapMutations } from 'vuex'
import PQueue from 'p-queue'
import { ShareStatus } from '../../helpers/share'
import { useCapabilityFilesSharingResharing } from 'web-runtime/src/composables'

export default {
setup() {
return {
resharingCapability: useCapabilityFilesSharingResharing()
}
},
computed: {
...mapGetters(['isOcis']),
$_declineShare_items() {
return [
{
Expand Down Expand Up @@ -49,7 +54,7 @@ export default {
const share = await triggerShareAction(
resource,
ShareStatus.declined,
!this.isOcis,
this.resharingCapability,
this.$client
)
if (share) {
Expand Down
2 changes: 1 addition & 1 deletion packages/web-app-files/src/views/shares/SharedWithMe.vue
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ export default {
computed: {
...mapGetters('Files', ['selectedFiles']),
...mapGetters(['isOcis', 'configuration', 'getToken']),
...mapGetters(['configuration', 'getToken']),
...mapState('Files/sidebar', { sidebarClosed: 'closed' }),
// pending shares
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export default {
...mapState(['app']),
...mapState('Files', ['files']),
...mapGetters('Files', ['highlightedFile', 'selectedFiles', 'totalFilesCount']),
...mapGetters(['isOcis', 'configuration', 'getToken', 'user']),
...mapGetters(['configuration', 'getToken', 'user']),
...mapState('Files/sidebar', { sidebarClosed: 'closed' }),
selected: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ const storeOptions = (data, isInLoadingState) => {
}
},
getters: {
isOcis: () => false,
user: () => user,
capabilities: () => {
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ const storeOptions = (data, isInLoadingState) => {
}
},
getters: {
isOcis: () => true,
user: () => user,
capabilities: () => {
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ export const getStore = function ({
slogan = null,
user = null,
generalThemeName = '',
isOcis = true,
selectedResourcesForMove = null,
locationPickerTargetFolder = null
} = {}) {
Expand All @@ -98,7 +97,6 @@ export const getStore = function ({
}
}),
getToken: () => '',
isOcis: () => isOcis,
homeFolder: () => '/',
user: () => user
},
Expand Down
4 changes: 2 additions & 2 deletions packages/web-app-files/tests/unit/views/views.setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export const getStore = function ({
slogan = null,
user = null,
generalThemeName = '',
isOcis = true,
capabilities = {},
selectedResourcesForMove = null,
locationPickerTargetFolder = null
} = {}) {
Expand All @@ -97,8 +97,8 @@ export const getStore = function ({
disablePreviews: disablePreviews
}
}),
capabilities: () => capabilities,
getToken: () => '',
isOcis: () => isOcis,
homeFolder: () => '/',
user: () => user
},
Expand Down
3 changes: 1 addition & 2 deletions packages/web-runtime/src/store/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,7 @@ const getters = {
return state.notifications.data.length && !state.notifications.failed
? state.notifications.data
: false
},
isOcis: (state, getters, rootState) => rootState.user.version.edition === 'reva'
}
}

export default {
Expand Down
2 changes: 1 addition & 1 deletion packages/web-runtime/src/store/user.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import get from 'lodash-es/get.js'
import get from 'lodash-es/get'
import isEmpty from 'lodash-es/isEmpty'
import initVueAuthenticate from '../services/auth'
import { router } from '../router'
Expand Down

0 comments on commit 53d410e

Please sign in to comment.