Systemtags and external actions update

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
This commit is contained in:
John Molakvoæ (skjnldsv) 2019-10-09 07:53:30 +02:00 committed by Daniel Calviño Sánchez
parent ae59edc6bf
commit 1c13c52acf
6 changed files with 23 additions and 10 deletions

View File

@ -113,7 +113,7 @@ export default {
*/
davPath() {
const user = OC.getCurrentUser().uid
return OC.linkToRemote(`dav/files/${user}${encodeURIComponent(this.file)}`)
return OC.linkToRemote(`dav/files/${user}${this.file}`)
},
/**

View File

@ -247,7 +247,14 @@
@update:value="debounceQueueUpdate('note')" />
</template>
<components :is="action" v-for="(action, index) in externalActions" :key="index" />
<!-- external sharing via url (social...) -->
<ActionLink v-for="({icon, url, name}, index) in externalActions"
:key="index"
:href="url(shareLink)"
:icon="icon"
target="_blank">
{{ name }}
</ActionLink>
<ActionButton icon="icon-delete" :disabled="saving" @click.prevent="onDelete">
{{ t('files_sharing', 'Delete share') }}

View File

@ -52,11 +52,11 @@ export default class ExternalLinkActions {
* @returns {boolean}
*/
registerAction(action) {
if (typeof action === 'object' && action.render && action.components) {
if (typeof action === 'object' && action.icon && action.name && action.url) {
this.#state.actions.push(action)
return true
}
console.error(`Invalid action component provided`, action)
console.error(`Invalid action provided`, action)
return false
}

View File

@ -69,6 +69,14 @@
:id="`${fileInfo.id}`"
type="file"
:name="fileInfo.name" />
<!-- additionnal entries, use it with cautious -->
<div v-for="(section, index) in sections"
:ref="'section-' + index"
:key="index"
class="sharingTab__additionalContent">
<component :is="section($refs['section-'+index], fileInfo)" :file-info="fileInfo" />
</div>
</template>
</Tab>
</template>

View File

@ -30,7 +30,7 @@
_rendered: false,
className: 'systemTagsInfoView hidden',
className: 'systemTagsInfoView',
/**
* @type OC.SystemTags.SystemTagsInputField
@ -123,11 +123,7 @@
var appliedTags = collection.map(modelToSelection)
self._inputView.setData(appliedTags)
if (appliedTags.length !== 0) {
self.show()
} else {
self.hide()
}
self.show()
}
})
}

View File

@ -69,8 +69,10 @@
}
}
.systemTagsInfoView,
.systemtags-select2-container {
width: 100%;
.select2-choices .select2-search-choice.select2-locked .label {
opacity: 0.5;
}