Skip to content

Commit

Permalink
Merge pull request #9588 from owncloud/revert-revert-recent-commits
Browse files Browse the repository at this point in the history
Revert "chore: revert recent commits until 7.1.0-rc.5 (#9586)"
  • Loading branch information
JammingBen authored Sep 4, 2023
2 parents 7285242 + abc6b6b commit 838f89c
Show file tree
Hide file tree
Showing 15 changed files with 66 additions and 36 deletions.
6 changes: 6 additions & 0 deletions changelog/unreleased/bugfix-pdf-loading-safari
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Bugfix: PDF loading Safari

Loading PDF files with Safari has been fixed.

https://github.com/owncloud/web/issues/9483
https://github.com/owncloud/web/pull/9565
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Bugfix: Set or remove expiration date on group share not possible

We've fixed a bug where setting or removing an expiration on a group share wasn't possible.

https://github.com/owncloud/web/pull/9513
https://github.com/owncloud/web/issues/8419
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,10 @@ export default defineComponent({
return formatRelativeDateFromJSDate(new Date(date), currentLanguage)
}
const getTotalQuota = (space: SpaceResource) => {
if (space.spaceQuota.total === 0) {
return $gettext('Unrestricted')
}
return formatFileSize(space.spaceQuota.total, currentLanguage)
}
const getUsedQuota = (space: SpaceResource) => {
Expand Down
1 change: 1 addition & 0 deletions packages/web-app-files/src/components/Search/List.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
:items="availableTags"
:option-filter-label="$gettext('Filter tags')"
:show-option-filter="true"
:close-on-click="true"
class="files-search-filter-tags oc-mr-s"
display-name-attribute="label"
filter-name="tags"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@
@click="togglePopover"
>
<oc-icon name="calendar-event" fill-type="line" size="medium" variation="passive" />
<span v-if="isExpirationDateSet" v-text="$gettext('Edit expiration date')" />
<span
class="oc-ml-s"
v-if="isExpirationDateSet"
v-text="$gettext('Edit expiration date')"
/>
<span v-else v-text="$gettext('Set expiration date')" />
</oc-button>
</template>
Expand Down Expand Up @@ -186,10 +190,7 @@ export default defineComponent({
},
isExpirationSupported() {
return (
(this.editingUser && this.userExpirationDate) ||
(this.editingGroup && this.groupExpirationDate)
)
return this.editingUser || this.editingGroup
},
isExpirationDateSet() {
Expand Down Expand Up @@ -248,14 +249,14 @@ export default defineComponent({
isExpirationDateEnforced() {
if (this.editingUser) {
return this.userExpirationDate.enforced
return this.userExpirationDate?.enforced
}
if (this.editingGroup) {
return this.groupExpirationDate.enforced
return this.groupExpirationDate?.enforced
}
return this.userExpirationDate.enforced || this.groupExpirationDate.enforced
return this.userExpirationDate?.enforced || this.groupExpirationDate?.enforced
},
maxExpirationDate() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div v-if="available" class="oc-flex oc-flex-middle oc-flex-nowrap">
<div class="oc-flex oc-flex-middle oc-flex-nowrap">
<oc-datepicker
v-model="dateCurrent"
:min-date="dateMin"
Expand Down Expand Up @@ -72,7 +72,6 @@ export default defineComponent({
const capabilities = computed(() => store.getters.capabilities)
const optionsUser = computed(() => capabilities.value.files_sharing.user?.expire_date)
const optionsGroup = computed(() => capabilities.value.files_sharing.group?.expire_date)
const available = computed(() => optionsUser.value || optionsGroup.value)
const enforced = computed(() => optionsUser.value?.enforced || optionsGroup.value?.enforced)
const dateMin = DateTime.now().setLocale(language.current).toJSDate()
const dateDefault = computed(() => {
Expand Down Expand Up @@ -151,7 +150,6 @@ export default defineComponent({
return {
language,
enforced,
available,
dateCurrent,
dateMin,
dateMax,
Expand Down
8 changes: 4 additions & 4 deletions packages/web-app-files/src/helpers/contextualHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const shareInviteCollaboratorHelp = (options: ContextualHelperOptions) =>
)
}
],
readMoreLink: 'https://doc.owncloud.com/webui/next/owncloud_web/web_for_users.html#sharing'
readMoreLink: 'https://doc.owncloud.com/go?to=webui-users-sharing'
},
options
)
Expand Down Expand Up @@ -92,7 +92,7 @@ export const shareSpaceAddMemberHelp = (options: ContextualHelperOptions) =>
)
}
],
readMoreLink: 'https://doc.owncloud.com/webui/next/owncloud_web/web_for_users.html#sharing'
readMoreLink: 'https://doc.owncloud.com/go?to=webui-users-sharing'
},
options
)
Expand Down Expand Up @@ -120,7 +120,7 @@ export const shareViaLinkHelp = (options: ContextualHelperOptions) =>
)
}
],
readMoreLink: 'https://doc.owncloud.com/webui/next/owncloud_web/web_for_users.html#sharing'
readMoreLink: 'https://doc.owncloud.com/go?to=webui-users-sharing'
},
options
)
Expand All @@ -140,7 +140,7 @@ export const shareViaIndirectLinkHelp = (options: ContextualHelperOptions) =>
)
}
],
readMoreLink: 'https://doc.owncloud.com/webui/next/owncloud_web/web_for_users.html#sharing'
readMoreLink: 'https://doc.owncloud.com/go?to=webui-users-sharing'
},
options
)
Expand Down
6 changes: 5 additions & 1 deletion packages/web-app-files/src/views/spaces/Projects.vue
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ export default defineComponent({
const clientService = useClientService()
const { selectedResourcesIds } = useSelectedResources({ store })
const { can } = useAbility()
const { current: currentLanguage } = useGettext()
const { current: currentLanguage, $gettext } = useGettext()
const runtimeSpaces = computed((): SpaceResource[] => {
return store.getters['runtime/spaces/spaces'].filter((s) => isProjectSpaceResource(s)) || []
Expand Down Expand Up @@ -244,6 +244,10 @@ export default defineComponent({
}
const getTotalQuota = (space: SpaceResource) => {
if (space.spaceQuota.total === 0) {
return $gettext('Unrestricted')
}
return formatFileSize(space.spaceQuota.total, currentLanguage)
}
const getUsedQuota = (space: SpaceResource) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,6 @@ const enforcedCapabilities = merge({}, enabledCapabilities, {
})

describe('InviteCollaborator ExpirationDatepicker', () => {
it('only gets displayed if share expiration is supported', () => {
const { wrapper } = createWrapper()
expect(wrapper.html()).toMatchSnapshot()
})

it('renders a button to open the datepicker and set an expiration date', () => {
const { wrapper } = createWrapper({ capabilities: bareCapabilities })
expect(wrapper.find('[data-testid="recipient-datepicker-btn"]').exists()).toBe(true)
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ exports[`FileShares collaborators list renders sharedWithLabel and sharee list 1
<div class="oc-position-relative" id="oc-files-sharing-sidebar">
<div class="oc-flex">
<h3 class="oc-text-bold oc-text-medium oc-m-rm" data-current-language="en" data-msgid="Share with people">Share with people</h3>
<oc-contextual-helper-stub class="oc-pl-xs" endtext="" list="[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]" readmorelink="https://doc.owncloud.com/webui/next/owncloud_web/web_for_users.html#sharing" text="Use the input field to search for users and groups. Select them to share the item." title="Share with people"></oc-contextual-helper-stub>
<oc-contextual-helper-stub class="oc-pl-xs" endtext="" list="[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]" readmorelink="https://doc.owncloud.com/go?to=webui-users-sharing" text="Use the input field to search for users and groups. Select them to share the item." title="Share with people"></oc-contextual-helper-stub>
</div>
<invite-collaborator-form-stub class="oc-my-s" invitelabel="" savebuttonlabel="Share"></invite-collaborator-form-stub>
<div class="avatars-wrapper oc-flex oc-flex-middle oc-flex-between">
Expand Down Expand Up @@ -35,7 +35,7 @@ exports[`FileShares current space loads space members if a space is given and th
<div class="oc-position-relative" id="oc-files-sharing-sidebar">
<div class="oc-flex">
<h3 class="oc-text-bold oc-text-medium oc-m-rm" data-current-language="en" data-msgid="Share with people">Share with people</h3>
<oc-contextual-helper-stub class="oc-pl-xs" endtext="" list="[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]" readmorelink="https://doc.owncloud.com/webui/next/owncloud_web/web_for_users.html#sharing" text="Use the input field to search for users and groups. Select them to share the item." title="Share with people"></oc-contextual-helper-stub>
<oc-contextual-helper-stub class="oc-pl-xs" endtext="" list="[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]" readmorelink="https://doc.owncloud.com/go?to=webui-users-sharing" text="Use the input field to search for users and groups. Select them to share the item." title="Share with people"></oc-contextual-helper-stub>
</div>
<invite-collaborator-form-stub class="oc-my-s" invitelabel="" savebuttonlabel="Share"></invite-collaborator-form-stub>
<div class="avatars-wrapper oc-flex oc-flex-middle oc-flex-between">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ exports[`SpaceMembers filter toggles the filter on click 1`] = `
<dd>Members with the Manager role are able to edit all properties and content of a Space, such as adding or removing members, sharing subfolders with non-members, or creating links to share.</dd>
</dl>
<!--v-if-->
<a class="oc-button oc-rounded oc-button-s oc-button-justify-content-center oc-button-gap-m oc-button-passive oc-button-passive-raw info-more-link" href="https://doc.owncloud.com/webui/next/owncloud_web/web_for_users.html#sharing" target="_blank">Read more</a>
<a class="oc-button oc-rounded oc-button-s oc-button-justify-content-center oc-button-gap-m oc-button-passive oc-button-passive-raw info-more-link" href="https://doc.owncloud.com/go?to=webui-users-sharing" target="_blank">Read more</a>
</div>
</div>
</div>
Expand Down
14 changes: 11 additions & 3 deletions packages/web-app-pdf-viewer/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
<loading-screen v-if="loading" />
<error-screen v-else-if="loadingError" />
<div v-else class="oc-height-1-1">
<object class="pdf-viewer oc-height-1-1 oc-width-1-1" :data="url" type="application/pdf" />
<object class="pdf-viewer oc-height-1-1 oc-width-1-1" :data="url" :type="objectType" />
</div>
</main>
</template>
<script lang="ts">
import { defineComponent } from 'vue'
import { computed, defineComponent } from 'vue'
import { useAppDefaults } from 'web-pkg/src/composables'
import AppTopBar from 'web-pkg/src/components/AppTopBar.vue'
import ErrorScreen from './components/ErrorScreen.vue'
Expand All @@ -23,10 +23,18 @@ export default defineComponent({
LoadingScreen
},
setup() {
const isSafari = () =>
navigator.userAgent?.includes('Safari') && !navigator.userAgent?.includes('Chrome')
const objectType = computed(() => {
// object type must not be 'application/pdf' for Safari due to a bug
return isSafari() ? undefined : 'application/pdf'
})
return {
...useAppDefaults({
applicationId: 'pdf-viewer'
})
}),
objectType
}
},
data: () => ({
Expand Down
5 changes: 5 additions & 0 deletions packages/web-pkg/src/components/ItemFilter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<oc-filter-chip
:filter-label="filterLabel"
:selected-item-names="selectedItems.map((i) => i[displayNameAttribute])"
:close-on-click="closeOnClick"
@clear-filter="clearFilter"
@show-drop="showDrop"
>
Expand Down Expand Up @@ -107,6 +108,10 @@ export default defineComponent({
type: Array,
required: false,
default: () => []
},
closeOnClick: {
type: Boolean,
default: false
}
},
emits: ['selectionChange'],
Expand Down
17 changes: 11 additions & 6 deletions packages/web-pkg/src/components/SearchBarFilter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<oc-filter-chip
:is-toggle="false"
:is-toggle-active="false"
:filter-label="currentSelection.title"
:filter-label="currentSelectionTitle"
:selected-item-names="[]"
class="oc-search-bar-filter"
raw
Expand Down Expand Up @@ -57,15 +57,14 @@ export default defineComponent({
const { $gettext } = useGettext()
const useSopeQueryValue = useRouteQuery('useScope')
const currentFolderEnabled = computed(() => props.currentFolderAvailable)
const currentSelection = ref<LocationOption>()
const userSelection = ref<LocationOption>()
const locationOptions = ref<LocationOption[]>([
const currentSelectionTitle = computed(() => $gettext(currentSelection.value?.title))
const locationOptions = computed<LocationOption[]>(() => [
{
id: SearchLocationFilterConstants.currentFolder,
title: $gettext('Current Folder'),
enabled: currentFolderEnabled
enabled: props.currentFolderAvailable
},
{
id: SearchLocationFilterConstants.allFiles,
Expand Down Expand Up @@ -122,7 +121,13 @@ export default defineComponent({
emit('update:modelValue', { value: option })
}
return { currentSelection, isIndexGreaterZero, onOptionSelected, locationOptions }
return {
currentSelection,
currentSelectionTitle,
isIndexGreaterZero,
onOptionSelected,
locationOptions
}
}
})
</script>
Expand Down

0 comments on commit 838f89c

Please sign in to comment.