Bump eslint-config-nextcloud from 0.0.6 to 0.1.0
Bumps [eslint-config-nextcloud](https://github.com/nextcloud/eslint-config-nextcloud) from 0.0.6 to 0.1.0. - [Release notes](https://github.com/nextcloud/eslint-config-nextcloud/releases) - [Commits](https://github.com/nextcloud/eslint-config-nextcloud/compare/v0.0.6...v0.1.0) Co-authored-by: Christoph Wurst <christoph@winzerhof-wurst.at> Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
This commit is contained in:
parent
5d9fd7ba0c
commit
ec01e0a790
|
@ -10,5 +10,8 @@ module.exports = {
|
||||||
dayNames: true,
|
dayNames: true,
|
||||||
firstDay: true
|
firstDay: true
|
||||||
},
|
},
|
||||||
extends: ['nextcloud']
|
extends: ['nextcloud'],
|
||||||
|
rules: {
|
||||||
|
'no-tabs': 'warn',
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -34,12 +34,12 @@ export default {
|
||||||
props: {
|
props: {
|
||||||
availableConfig: {
|
availableConfig: {
|
||||||
type: Object,
|
type: Object,
|
||||||
required: true
|
required: true,
|
||||||
},
|
},
|
||||||
userConfig: {
|
userConfig: {
|
||||||
type: Object,
|
type: Object,
|
||||||
required: true
|
required: true,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
themes() {
|
themes() {
|
||||||
|
@ -55,7 +55,7 @@ export default {
|
||||||
return {
|
return {
|
||||||
theme: this.userConfig.theme,
|
theme: this.userConfig.theme,
|
||||||
highcontrast: this.userConfig.highcontrast,
|
highcontrast: this.userConfig.highcontrast,
|
||||||
font: this.userConfig.font
|
font: this.userConfig.font,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
description() {
|
description() {
|
||||||
|
@ -87,7 +87,7 @@ export default {
|
||||||
},
|
},
|
||||||
designteamLink() {
|
designteamLink() {
|
||||||
return `<a target="_blank" href="https://nextcloud.com/design" rel="noreferrer nofollow">${t('accessibility', 'our design team')}</a>`
|
return `<a target="_blank" href="https://nextcloud.com/design" rel="noreferrer nofollow">${t('accessibility', 'our design team')}</a>`
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// SELECT handlers
|
// SELECT handlers
|
||||||
|
@ -123,17 +123,17 @@ export default {
|
||||||
url: generateOcsUrl('apps/accessibility/api/v1/config', 2) + type,
|
url: generateOcsUrl('apps/accessibility/api/v1/config', 2) + type,
|
||||||
method: isDelete ? 'DELETE' : 'PUT',
|
method: isDelete ? 'DELETE' : 'PUT',
|
||||||
data: {
|
data: {
|
||||||
value: id
|
value: id,
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
this.userConfig[type] = id
|
this.userConfig[type] = id
|
||||||
|
|
||||||
// Remove old link
|
// Remove old link
|
||||||
let link = document.querySelector('link[rel=stylesheet][href*=accessibility][href*=user-]')
|
const link = document.querySelector('link[rel=stylesheet][href*=accessibility][href*=user-]')
|
||||||
if (!link) {
|
if (!link) {
|
||||||
// insert new css
|
// insert new css
|
||||||
let link = document.createElement('link')
|
const link = document.createElement('link')
|
||||||
link.rel = 'stylesheet'
|
link.rel = 'stylesheet'
|
||||||
link.href = generateUrl('/apps/accessibility/css/user-style.css') + '?v=' + new Date().getTime()
|
link.href = generateUrl('/apps/accessibility/css/user-style.css') + '?v=' + new Date().getTime()
|
||||||
document.head.appendChild(link)
|
document.head.appendChild(link)
|
||||||
|
@ -157,7 +157,7 @@ export default {
|
||||||
console.error(err, err.response)
|
console.error(err, err.response)
|
||||||
OC.Notification.showTemporary(t('accessibility', err.response.data.ocs.meta.message + '. Unable to apply the setting.'))
|
OC.Notification.showTemporary(t('accessibility', err.response.data.ocs.meta.message + '. Unable to apply the setting.'))
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -19,12 +19,12 @@ export default {
|
||||||
props: {
|
props: {
|
||||||
preview: {
|
preview: {
|
||||||
type: Object,
|
type: Object,
|
||||||
required: true
|
required: true,
|
||||||
},
|
},
|
||||||
selected: {
|
selected: {
|
||||||
type: String,
|
type: String,
|
||||||
default: null
|
default: null,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
checked: {
|
checked: {
|
||||||
|
@ -33,8 +33,8 @@ export default {
|
||||||
},
|
},
|
||||||
set(checked) {
|
set(checked) {
|
||||||
this.$emit('select', checked ? this.preview.id : '')
|
this.$emit('select', checked ? this.preview.id : '')
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -14,7 +14,7 @@ const View = Vue.extend(App)
|
||||||
const accessibility = new View({
|
const accessibility = new View({
|
||||||
propsData: {
|
propsData: {
|
||||||
availableConfig,
|
availableConfig,
|
||||||
userConfig
|
userConfig,
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
accessibility.$mount('#accessibility')
|
accessibility.$mount('#accessibility')
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -27,7 +27,7 @@
|
||||||
$el.addClass('comment')
|
$el.addClass('comment')
|
||||||
if (model.get('message') && this._isLong(model.get('message'))) {
|
if (model.get('message') && this._isLong(model.get('message'))) {
|
||||||
$el.addClass('collapsed')
|
$el.addClass('collapsed')
|
||||||
var $overlay = $('<div>').addClass('message-overlay')
|
const $overlay = $('<div>').addClass('message-overlay')
|
||||||
$el.find('.activitymessage').after($overlay)
|
$el.find('.activitymessage').after($overlay)
|
||||||
$el.on('click', this._onClickCollapsedComment)
|
$el.on('click', this._onClickCollapsedComment)
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@
|
||||||
* Copy of CommentsTabView._onClickComment()
|
* Copy of CommentsTabView._onClickComment()
|
||||||
*/
|
*/
|
||||||
_onClickCollapsedComment: function(ev) {
|
_onClickCollapsedComment: function(ev) {
|
||||||
var $row = $(ev.target)
|
let $row = $(ev.target)
|
||||||
if (!$row.is('.comment')) {
|
if (!$row.is('.comment')) {
|
||||||
$row = $row.closest('.comment')
|
$row = $row.closest('.comment')
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,7 @@
|
||||||
*/
|
*/
|
||||||
_isLong: function(message) {
|
_isLong: function(message) {
|
||||||
return message.length > 250 || (message.match(/\n/g) || []).length > 1
|
return message.length > 250 || (message.match(/\n/g) || []).length > 1
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
})()
|
})()
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
PROPERTY_OBJECTTYPE: '{' + OC.Files.Client.NS_OWNCLOUD + '}objectType',
|
PROPERTY_OBJECTTYPE: '{' + OC.Files.Client.NS_OWNCLOUD + '}objectType',
|
||||||
PROPERTY_ACTORDISPLAYNAME: '{' + OC.Files.Client.NS_OWNCLOUD + '}actorDisplayName',
|
PROPERTY_ACTORDISPLAYNAME: '{' + OC.Files.Client.NS_OWNCLOUD + '}actorDisplayName',
|
||||||
PROPERTY_CREATIONDATETIME: '{' + OC.Files.Client.NS_OWNCLOUD + '}creationDateTime',
|
PROPERTY_CREATIONDATETIME: '{' + OC.Files.Client.NS_OWNCLOUD + '}creationDateTime',
|
||||||
PROPERTY_MENTIONS: '{' + OC.Files.Client.NS_OWNCLOUD + '}mentions'
|
PROPERTY_MENTIONS: '{' + OC.Files.Client.NS_OWNCLOUD + '}mentions',
|
||||||
})
|
})
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -30,13 +30,13 @@
|
||||||
* Comment
|
* Comment
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
var CommentModel = OC.Backbone.Model.extend(
|
const CommentModel = OC.Backbone.Model.extend(
|
||||||
/** @lends OCA.Comments.CommentModel.prototype */ {
|
/** @lends OCA.Comments.CommentModel.prototype */ {
|
||||||
sync: OC.Backbone.davSync,
|
sync: OC.Backbone.davSync,
|
||||||
|
|
||||||
defaults: {
|
defaults: {
|
||||||
actorType: 'users',
|
actorType: 'users',
|
||||||
objectType: 'files'
|
objectType: 'files',
|
||||||
},
|
},
|
||||||
|
|
||||||
davProperties: {
|
davProperties: {
|
||||||
|
@ -49,7 +49,7 @@
|
||||||
'objectType': OC.Files.Client.PROPERTY_OBJECTTYPE,
|
'objectType': OC.Files.Client.PROPERTY_OBJECTTYPE,
|
||||||
'objectId': OC.Files.Client.PROPERTY_OBJECTID,
|
'objectId': OC.Files.Client.PROPERTY_OBJECTID,
|
||||||
'isUnread': OC.Files.Client.PROPERTY_ISUNREAD,
|
'isUnread': OC.Files.Client.PROPERTY_ISUNREAD,
|
||||||
'mentions': OC.Files.Client.PROPERTY_MENTIONS
|
'mentions': OC.Files.Client.PROPERTY_MENTIONS,
|
||||||
},
|
},
|
||||||
|
|
||||||
parse: function(data) {
|
parse: function(data) {
|
||||||
|
@ -63,7 +63,7 @@
|
||||||
objectType: data.objectType,
|
objectType: data.objectType,
|
||||||
objectId: data.objectId,
|
objectId: data.objectId,
|
||||||
isUnread: (data.isUnread === 'true'),
|
isUnread: (data.isUnread === 'true'),
|
||||||
mentions: this._parseMentions(data.mentions)
|
mentions: this._parseMentions(data.mentions),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -71,14 +71,14 @@
|
||||||
if (_.isUndefined(mentions)) {
|
if (_.isUndefined(mentions)) {
|
||||||
return {}
|
return {}
|
||||||
}
|
}
|
||||||
var result = {}
|
const result = {}
|
||||||
for (var i in mentions) {
|
for (const i in mentions) {
|
||||||
var mention = mentions[i]
|
const mention = mentions[i]
|
||||||
if (_.isUndefined(mention.localName) || mention.localName !== 'mention') {
|
if (_.isUndefined(mention.localName) || mention.localName !== 'mention') {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
result[i] = {}
|
result[i] = {}
|
||||||
for (var child = mention.firstChild; child; child = child.nextSibling) {
|
for (let child = mention.firstChild; child; child = child.nextSibling) {
|
||||||
if (_.isUndefined(child.localName) || !child.localName.startsWith('mention')) {
|
if (_.isUndefined(child.localName) || !child.localName.startsWith('mention')) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
@ -86,7 +86,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result
|
return result
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
OCA.Comments.CommentModel = CommentModel
|
OCA.Comments.CommentModel = CommentModel
|
||||||
|
|
|
@ -16,26 +16,26 @@
|
||||||
* @memberof OC.Comments
|
* @memberof OC.Comments
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
var CommentsModifyMenu = OC.Backbone.View.extend({
|
const CommentsModifyMenu = OC.Backbone.View.extend({
|
||||||
tagName: 'div',
|
tagName: 'div',
|
||||||
className: 'commentsModifyMenu popovermenu bubble menu',
|
className: 'commentsModifyMenu popovermenu bubble menu',
|
||||||
_scopes: [
|
_scopes: [
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
displayName: t('comments', 'Edit comment'),
|
displayName: t('comments', 'Edit comment'),
|
||||||
iconClass: 'icon-rename'
|
iconClass: 'icon-rename',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'delete',
|
name: 'delete',
|
||||||
displayName: t('comments', 'Delete comment'),
|
displayName: t('comments', 'Delete comment'),
|
||||||
iconClass: 'icon-delete'
|
iconClass: 'icon-delete',
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
initialize: function() {
|
initialize: function() {
|
||||||
|
|
||||||
},
|
},
|
||||||
events: {
|
events: {
|
||||||
'click a.action': '_onClickAction'
|
'click a.action': '_onClickAction',
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -44,7 +44,7 @@
|
||||||
* @param {Object} event event object
|
* @param {Object} event event object
|
||||||
*/
|
*/
|
||||||
_onClickAction: function(event) {
|
_onClickAction: function(event) {
|
||||||
var $target = $(event.currentTarget)
|
let $target = $(event.currentTarget)
|
||||||
if (!$target.hasClass('menuitem')) {
|
if (!$target.hasClass('menuitem')) {
|
||||||
$target = $target.closest('.menuitem')
|
$target = $target.closest('.menuitem')
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,7 @@
|
||||||
*/
|
*/
|
||||||
render: function() {
|
render: function() {
|
||||||
this.$el.html(OCA.Comments.Templates['commentsmodifymenu']({
|
this.$el.html(OCA.Comments.Templates['commentsmodifymenu']({
|
||||||
items: this._scopes
|
items: this._scopes,
|
||||||
}))
|
}))
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -70,19 +70,19 @@
|
||||||
show: function(context) {
|
show: function(context) {
|
||||||
this._context = context
|
this._context = context
|
||||||
|
|
||||||
for (var i in this._scopes) {
|
for (const i in this._scopes) {
|
||||||
this._scopes[i].active = false
|
this._scopes[i].active = false
|
||||||
}
|
}
|
||||||
|
|
||||||
var $el = $(context.target)
|
const $el = $(context.target)
|
||||||
var offsetIcon = $el.offset()
|
const offsetIcon = $el.offset()
|
||||||
var offsetContainer = $el.closest('.authorRow').offset()
|
const offsetContainer = $el.closest('.authorRow').offset()
|
||||||
|
|
||||||
// adding some extra top offset to push the menu below the button.
|
// adding some extra top offset to push the menu below the button.
|
||||||
var position = {
|
const position = {
|
||||||
top: offsetIcon.top - offsetContainer.top + 48,
|
top: offsetIcon.top - offsetContainer.top + 48,
|
||||||
left: '',
|
left: '',
|
||||||
right: ''
|
right: '',
|
||||||
}
|
}
|
||||||
|
|
||||||
position.left = offsetIcon.left - offsetContainer.left
|
position.left = offsetIcon.left - offsetContainer.left
|
||||||
|
@ -100,7 +100,7 @@
|
||||||
this.$el.removeClass('hidden')
|
this.$el.removeClass('hidden')
|
||||||
|
|
||||||
OC.showMenu(null, this.$el)
|
OC.showMenu(null, this.$el)
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
OCA.Comments = OCA.Comments || {}
|
OCA.Comments = OCA.Comments || {}
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
(function(OC, OCA) {
|
(function(OC, OCA) {
|
||||||
|
|
||||||
_.extend(OC.Files.Client, {
|
_.extend(OC.Files.Client, {
|
||||||
PROPERTY_READMARKER: '{' + OC.Files.Client.NS_OWNCLOUD + '}readMarker'
|
PROPERTY_READMARKER: '{' + OC.Files.Client.NS_OWNCLOUD + '}readMarker',
|
||||||
})
|
})
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -22,7 +22,7 @@
|
||||||
* like the read marker.
|
* like the read marker.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
var CommentSummaryModel = OC.Backbone.Model.extend(
|
const CommentSummaryModel = OC.Backbone.Model.extend(
|
||||||
/** @lends OCA.Comments.CommentSummaryModel.prototype */ {
|
/** @lends OCA.Comments.CommentSummaryModel.prototype */ {
|
||||||
sync: OC.Backbone.davSync,
|
sync: OC.Backbone.davSync,
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@
|
||||||
_objectId: null,
|
_objectId: null,
|
||||||
|
|
||||||
davProperties: {
|
davProperties: {
|
||||||
'readMarker': OC.Files.Client.PROPERTY_READMARKER
|
'readMarker': OC.Files.Client.PROPERTY_READMARKER,
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -63,7 +63,7 @@
|
||||||
return OC.linkToRemote('dav') + '/comments/'
|
return OC.linkToRemote('dav') + '/comments/'
|
||||||
+ encodeURIComponent(this._objectType) + '/'
|
+ encodeURIComponent(this._objectType) + '/'
|
||||||
+ encodeURIComponent(this.id) + '/'
|
+ encodeURIComponent(this.id) + '/'
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
OCA.Comments.CommentSummaryModel = CommentSummaryModel
|
OCA.Comments.CommentSummaryModel = CommentSummaryModel
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
(function() {
|
(function() {
|
||||||
|
|
||||||
_.extend(OC.Files.Client, {
|
_.extend(OC.Files.Client, {
|
||||||
PROPERTY_COMMENTS_UNREAD: '{' + OC.Files.Client.NS_OWNCLOUD + '}comments-unread'
|
PROPERTY_COMMENTS_UNREAD: '{' + OC.Files.Client.NS_OWNCLOUD + '}comments-unread',
|
||||||
})
|
})
|
||||||
|
|
||||||
OCA.Comments = _.extend({}, OCA.Comments)
|
OCA.Comments = _.extend({}, OCA.Comments)
|
||||||
|
@ -28,36 +28,36 @@
|
||||||
OCA.Comments.FilesPlugin = {
|
OCA.Comments.FilesPlugin = {
|
||||||
ignoreLists: [
|
ignoreLists: [
|
||||||
'trashbin',
|
'trashbin',
|
||||||
'files.public'
|
'files.public',
|
||||||
],
|
],
|
||||||
|
|
||||||
_formatCommentCount: function(count) {
|
_formatCommentCount: function(count) {
|
||||||
return OCA.Comments.Templates['filesplugin']({
|
return OCA.Comments.Templates['filesplugin']({
|
||||||
count: count,
|
count: count,
|
||||||
countMessage: n('comments', '%n unread comment', '%n unread comments', count),
|
countMessage: n('comments', '%n unread comment', '%n unread comments', count),
|
||||||
iconUrl: OC.imagePath('core', 'actions/comment')
|
iconUrl: OC.imagePath('core', 'actions/comment'),
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
attach: function(fileList) {
|
attach: function(fileList) {
|
||||||
var self = this
|
const self = this
|
||||||
if (this.ignoreLists.indexOf(fileList.id) >= 0) {
|
if (this.ignoreLists.indexOf(fileList.id) >= 0) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
fileList.registerTabView(new OCA.Comments.CommentsTabView('commentsTabView'))
|
fileList.registerTabView(new OCA.Comments.CommentsTabView('commentsTabView'))
|
||||||
|
|
||||||
var oldGetWebdavProperties = fileList._getWebdavProperties
|
const oldGetWebdavProperties = fileList._getWebdavProperties
|
||||||
fileList._getWebdavProperties = function() {
|
fileList._getWebdavProperties = function() {
|
||||||
var props = oldGetWebdavProperties.apply(this, arguments)
|
const props = oldGetWebdavProperties.apply(this, arguments)
|
||||||
props.push(OC.Files.Client.PROPERTY_COMMENTS_UNREAD)
|
props.push(OC.Files.Client.PROPERTY_COMMENTS_UNREAD)
|
||||||
return props
|
return props
|
||||||
}
|
}
|
||||||
|
|
||||||
fileList.filesClient.addFileInfoParser(function(response) {
|
fileList.filesClient.addFileInfoParser(function(response) {
|
||||||
var data = {}
|
const data = {}
|
||||||
var props = response.propStat[0].properties
|
const props = response.propStat[0].properties
|
||||||
var commentsUnread = props[OC.Files.Client.PROPERTY_COMMENTS_UNREAD]
|
const commentsUnread = props[OC.Files.Client.PROPERTY_COMMENTS_UNREAD]
|
||||||
if (!_.isUndefined(commentsUnread) && commentsUnread !== '') {
|
if (!_.isUndefined(commentsUnread) && commentsUnread !== '') {
|
||||||
data.commentsUnread = parseInt(commentsUnread, 10)
|
data.commentsUnread = parseInt(commentsUnread, 10)
|
||||||
}
|
}
|
||||||
|
@ -65,9 +65,9 @@
|
||||||
})
|
})
|
||||||
|
|
||||||
fileList.$el.addClass('has-comments')
|
fileList.$el.addClass('has-comments')
|
||||||
var oldCreateRow = fileList._createRow
|
const oldCreateRow = fileList._createRow
|
||||||
fileList._createRow = function(fileData) {
|
fileList._createRow = function(fileData) {
|
||||||
var $tr = oldCreateRow.apply(this, arguments)
|
const $tr = oldCreateRow.apply(this, arguments)
|
||||||
if (fileData.commentsUnread) {
|
if (fileData.commentsUnread) {
|
||||||
$tr.attr('data-comments-unread', fileData.commentsUnread)
|
$tr.attr('data-comments-unread', fileData.commentsUnread)
|
||||||
}
|
}
|
||||||
|
@ -79,7 +79,7 @@
|
||||||
name: 'Comment',
|
name: 'Comment',
|
||||||
displayName: function(context) {
|
displayName: function(context) {
|
||||||
if (context && context.$file) {
|
if (context && context.$file) {
|
||||||
var unread = parseInt(context.$file.data('comments-unread'), 10)
|
const unread = parseInt(context.$file.data('comments-unread'), 10)
|
||||||
if (unread >= 0) {
|
if (unread >= 0) {
|
||||||
return n('comments', '1 new comment', '{unread} new comments', unread, { unread: unread })
|
return n('comments', '1 new comment', '{unread} new comments', unread, { unread: unread })
|
||||||
}
|
}
|
||||||
|
@ -92,10 +92,10 @@
|
||||||
permissions: OC.PERMISSION_READ,
|
permissions: OC.PERMISSION_READ,
|
||||||
type: OCA.Files.FileActions.TYPE_INLINE,
|
type: OCA.Files.FileActions.TYPE_INLINE,
|
||||||
render: function(actionSpec, isDefault, context) {
|
render: function(actionSpec, isDefault, context) {
|
||||||
var $file = context.$file
|
const $file = context.$file
|
||||||
var unreadComments = $file.data('comments-unread')
|
const unreadComments = $file.data('comments-unread')
|
||||||
if (unreadComments) {
|
if (unreadComments) {
|
||||||
var $actionLink = $(self._formatCommentCount(unreadComments))
|
const $actionLink = $(self._formatCommentCount(unreadComments))
|
||||||
context.$file.find('a.name>span.fileactions').append($actionLink)
|
context.$file.find('a.name>span.fileactions').append($actionLink)
|
||||||
return $actionLink
|
return $actionLink
|
||||||
}
|
}
|
||||||
|
@ -105,20 +105,20 @@
|
||||||
context.$file.find('.action-comment').tooltip('hide')
|
context.$file.find('.action-comment').tooltip('hide')
|
||||||
// open sidebar in comments section
|
// open sidebar in comments section
|
||||||
context.fileList.showDetailsView(fileName, 'comments')
|
context.fileList.showDetailsView(fileName, 'comments')
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
// add attribute to "elementToFile"
|
// add attribute to "elementToFile"
|
||||||
var oldElementToFile = fileList.elementToFile
|
const oldElementToFile = fileList.elementToFile
|
||||||
fileList.elementToFile = function($el) {
|
fileList.elementToFile = function($el) {
|
||||||
var fileInfo = oldElementToFile.apply(this, arguments)
|
const fileInfo = oldElementToFile.apply(this, arguments)
|
||||||
var commentsUnread = $el.data('comments-unread')
|
const commentsUnread = $el.data('comments-unread')
|
||||||
if (commentsUnread) {
|
if (commentsUnread) {
|
||||||
fileInfo.commentsUnread = commentsUnread
|
fileInfo.commentsUnread = commentsUnread
|
||||||
}
|
}
|
||||||
return fileInfo
|
return fileInfo
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
})()
|
})()
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -31,22 +31,22 @@ import AppSidebarTab from 'nextcloud-vue/dist/Components/AppSidebarTab'
|
||||||
export default {
|
export default {
|
||||||
name: 'LegacyTab',
|
name: 'LegacyTab',
|
||||||
components: {
|
components: {
|
||||||
AppSidebarTab: AppSidebarTab
|
AppSidebarTab: AppSidebarTab,
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
component: {
|
component: {
|
||||||
type: Object,
|
type: Object,
|
||||||
required: true
|
required: true,
|
||||||
},
|
},
|
||||||
name: {
|
name: {
|
||||||
type: String,
|
type: String,
|
||||||
required: true
|
required: true,
|
||||||
},
|
},
|
||||||
fileInfo: {
|
fileInfo: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => {},
|
default: () => {},
|
||||||
required: true
|
required: true,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
icon() {
|
icon() {
|
||||||
|
@ -64,14 +64,14 @@ export default {
|
||||||
// needed because AppSidebarTab also uses $parent.activeTab
|
// needed because AppSidebarTab also uses $parent.activeTab
|
||||||
activeTab() {
|
activeTab() {
|
||||||
return this.$parent.activeTab
|
return this.$parent.activeTab
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
activeTab(activeTab) {
|
activeTab(activeTab) {
|
||||||
if (activeTab === this.id && this.fileInfo) {
|
if (activeTab === this.id && this.fileInfo) {
|
||||||
this.setFileInfo(this.fileInfo)
|
this.setFileInfo(this.fileInfo)
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
beforeMount() {
|
beforeMount() {
|
||||||
this.setFileInfo(this.fileInfo)
|
this.setFileInfo(this.fileInfo)
|
||||||
|
@ -86,8 +86,8 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
setFileInfo(fileInfo) {
|
setFileInfo(fileInfo) {
|
||||||
this.component.setFileInfo(new OCA.Files.FileInfoModel(fileInfo))
|
this.component.setFileInfo(new OCA.Files.FileInfoModel(fileInfo))
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style>
|
||||||
|
|
|
@ -29,19 +29,19 @@ export default {
|
||||||
props: {
|
props: {
|
||||||
component: {
|
component: {
|
||||||
type: Object,
|
type: Object,
|
||||||
required: true
|
required: true,
|
||||||
},
|
},
|
||||||
fileInfo: {
|
fileInfo: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => {},
|
default: () => {},
|
||||||
required: true
|
required: true,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
fileInfo(fileInfo) {
|
fileInfo(fileInfo) {
|
||||||
// update the backbone model FileInfo
|
// update the backbone model FileInfo
|
||||||
this.setFileInfo(fileInfo)
|
this.setFileInfo(fileInfo)
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
// append the backbone element and set the FileInfo
|
// append the backbone element and set the FileInfo
|
||||||
|
@ -51,8 +51,8 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
setFileInfo(fileInfo) {
|
setFileInfo(fileInfo) {
|
||||||
this.component.setFileInfo(new OCA.Files.FileInfoModel(fileInfo))
|
this.component.setFileInfo(new OCA.Files.FileInfoModel(fileInfo))
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style>
|
||||||
|
|
|
@ -32,7 +32,7 @@ import TransferOwnershipDialogue from './TransferOwnershipDialogue'
|
||||||
export default {
|
export default {
|
||||||
name: 'PersonalSettings',
|
name: 'PersonalSettings',
|
||||||
components: {
|
components: {
|
||||||
TransferOwnershipDialogue
|
TransferOwnershipDialogue,
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -50,8 +50,8 @@
|
||||||
:internal-search="false"
|
:internal-search="false"
|
||||||
:clear-on-select="false"
|
:clear-on-select="false"
|
||||||
:user-select="true"
|
:user-select="true"
|
||||||
@search-change="findUserDebounced"
|
class="middle-align"
|
||||||
class="middle-align" />
|
@search-change="findUserDebounced" />
|
||||||
</label>
|
</label>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
|
@ -85,7 +85,7 @@ const picker = getFilePickerBuilder(t('files', 'Choose a file or folder to trans
|
||||||
export default {
|
export default {
|
||||||
name: 'TransferOwnershipDialogue',
|
name: 'TransferOwnershipDialogue',
|
||||||
components: {
|
components: {
|
||||||
Multiselect
|
Multiselect,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -94,7 +94,7 @@ export default {
|
||||||
submitError: undefined,
|
submitError: undefined,
|
||||||
loadingUsers: false,
|
loadingUsers: false,
|
||||||
selectedUser: null,
|
selectedUser: null,
|
||||||
userSuggestions: {}
|
userSuggestions: {},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -107,7 +107,7 @@ export default {
|
||||||
return {
|
return {
|
||||||
user: user.uid,
|
user: user.uid,
|
||||||
displayName: user.displayName,
|
displayName: user.displayName,
|
||||||
icon: 'icon-user'
|
icon: 'icon-user',
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -123,7 +123,7 @@ export default {
|
||||||
return ''
|
return ''
|
||||||
}
|
}
|
||||||
return this.directory.substring(1)
|
return this.directory.substring(1)
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.findUserDebounced = debounce(this.findUser, 300)
|
this.findUserDebounced = debounce(this.findUser, 300)
|
||||||
|
@ -163,8 +163,8 @@ export default {
|
||||||
itemType: 'file',
|
itemType: 'file',
|
||||||
search: query,
|
search: query,
|
||||||
perPage: 20,
|
perPage: 20,
|
||||||
lookup: false
|
lookup: false,
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
if (response.data.ocs.meta.statuscode !== 100) {
|
if (response.data.ocs.meta.statuscode !== 100) {
|
||||||
|
@ -175,7 +175,7 @@ export default {
|
||||||
response.data.ocs.data.users.forEach(user => {
|
response.data.ocs.data.users.forEach(user => {
|
||||||
Vue.set(this.userSuggestions, user.value.shareWith, {
|
Vue.set(this.userSuggestions, user.value.shareWith, {
|
||||||
uid: user.value.shareWith,
|
uid: user.value.shareWith,
|
||||||
displayName: user.label
|
displayName: user.label,
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
@ -192,7 +192,7 @@ export default {
|
||||||
this.submitError = undefined
|
this.submitError = undefined
|
||||||
const data = {
|
const data = {
|
||||||
path: this.directory,
|
path: this.directory,
|
||||||
recipient: this.selectedUser.user
|
recipient: this.selectedUser.user,
|
||||||
}
|
}
|
||||||
logger.debug('submit transfer ownership form', data)
|
logger.debug('submit transfer ownership form', data)
|
||||||
|
|
||||||
|
@ -212,8 +212,8 @@ export default {
|
||||||
|
|
||||||
this.submitError = error.message || t('files', 'Unknown error')
|
this.submitError = error.message || t('files', 'Unknown error')
|
||||||
})
|
})
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,7 @@ export default async function(url) {
|
||||||
<oc:owner-display-name />
|
<oc:owner-display-name />
|
||||||
<oc:share-types />
|
<oc:share-types />
|
||||||
</d:prop>
|
</d:prop>
|
||||||
</d:propfind>`
|
</d:propfind>`,
|
||||||
})
|
})
|
||||||
|
|
||||||
// TODO: create new parser or use cdav-lib when available
|
// TODO: create new parser or use cdav-lib when available
|
||||||
|
|
|
@ -44,8 +44,8 @@ window.addEventListener('DOMContentLoaded', () => {
|
||||||
|
|
||||||
// Make sure we have a mountpoint
|
// Make sure we have a mountpoint
|
||||||
if (!document.getElementById('app-sidebar')) {
|
if (!document.getElementById('app-sidebar')) {
|
||||||
var contentElement = document.getElementById('content')
|
const contentElement = document.getElementById('content')
|
||||||
var sidebarElement = document.createElement('div')
|
const sidebarElement = document.createElement('div')
|
||||||
sidebarElement.id = 'app-sidebar'
|
sidebarElement.id = 'app-sidebar'
|
||||||
contentElement.appendChild(sidebarElement)
|
contentElement.appendChild(sidebarElement)
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,7 @@ window.addEventListener('DOMContentLoaded', () => {
|
||||||
const AppSidebar = new Vue({
|
const AppSidebar = new Vue({
|
||||||
// eslint-disable-next-line vue/match-component-file-name
|
// eslint-disable-next-line vue/match-component-file-name
|
||||||
name: 'SidebarRoot',
|
name: 'SidebarRoot',
|
||||||
render: h => h(SidebarView)
|
render: h => h(SidebarView),
|
||||||
})
|
})
|
||||||
AppSidebar.$mount('#app-sidebar')
|
AppSidebar.$mount('#app-sidebar')
|
||||||
})
|
})
|
||||||
|
|
|
@ -69,7 +69,7 @@ export default {
|
||||||
|
|
||||||
components: {
|
components: {
|
||||||
AppSidebar,
|
AppSidebar,
|
||||||
LegacyView
|
LegacyView,
|
||||||
},
|
},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
|
@ -78,7 +78,7 @@ export default {
|
||||||
Sidebar: OCA.Files.Sidebar.state,
|
Sidebar: OCA.Files.Sidebar.state,
|
||||||
error: null,
|
error: null,
|
||||||
fileInfo: null,
|
fileInfo: null,
|
||||||
starLoading: false
|
starLoading: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -174,19 +174,19 @@ export default {
|
||||||
'star-loading': this.starLoading,
|
'star-loading': this.starLoading,
|
||||||
starred: this.fileInfo.isFavourited,
|
starred: this.fileInfo.isFavourited,
|
||||||
subtitle: this.subtitle,
|
subtitle: this.subtitle,
|
||||||
title: this.fileInfo.name
|
title: this.fileInfo.name,
|
||||||
}
|
}
|
||||||
} else if (this.error) {
|
} else if (this.error) {
|
||||||
return {
|
return {
|
||||||
key: 'error', // force key to re-render
|
key: 'error', // force key to re-render
|
||||||
subtitle: '',
|
subtitle: '',
|
||||||
title: ''
|
title: '',
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return {
|
return {
|
||||||
class: 'icon-loading',
|
class: 'icon-loading',
|
||||||
subtitle: '',
|
subtitle: '',
|
||||||
title: ''
|
title: '',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -215,7 +215,7 @@ export default {
|
||||||
*/
|
*/
|
||||||
defaultActionListener() {
|
defaultActionListener() {
|
||||||
return this.defaultAction ? 'figure-click' : null
|
return this.defaultAction ? 'figure-click' : null
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
watch: {
|
watch: {
|
||||||
|
@ -244,7 +244,7 @@ export default {
|
||||||
console.error('Error while loading the file data', error)
|
console.error('Error while loading the file data', error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -286,7 +286,7 @@ export default {
|
||||||
* @returns {string} Url to the icon for mimeType
|
* @returns {string} Url to the icon for mimeType
|
||||||
*/
|
*/
|
||||||
getIconUrl(fileInfo) {
|
getIconUrl(fileInfo) {
|
||||||
var mimeType = fileInfo.mimetype || 'application/octet-stream'
|
const mimeType = fileInfo.mimetype || 'application/octet-stream'
|
||||||
if (mimeType === 'httpd/unix-directory') {
|
if (mimeType === 'httpd/unix-directory') {
|
||||||
// use default folder icon
|
// use default folder icon
|
||||||
if (fileInfo.mountType === 'shared' || fileInfo.mountType === 'shared-root') {
|
if (fileInfo.mountType === 'shared' || fileInfo.mountType === 'shared-root') {
|
||||||
|
@ -312,11 +312,11 @@ export default {
|
||||||
if (tab.isLegacyTab) {
|
if (tab.isLegacyTab) {
|
||||||
return {
|
return {
|
||||||
is: LegacyTab,
|
is: LegacyTab,
|
||||||
component: tab.component
|
component: tab.component,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
is: tab.component
|
is: tab.component,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -348,7 +348,7 @@ export default {
|
||||||
<oc:favorite>1</oc:favorite>
|
<oc:favorite>1</oc:favorite>
|
||||||
</d:prop>
|
</d:prop>
|
||||||
${state ? '</d:set>' : '</d:remove>'}
|
${state ? '</d:set>' : '</d:remove>'}
|
||||||
</d:propertyupdate>`
|
</d:propertyupdate>`,
|
||||||
})
|
})
|
||||||
|
|
||||||
// TODO: Obliterate as soon as possible and use events with new files app
|
// TODO: Obliterate as soon as possible and use events with new files app
|
||||||
|
@ -371,11 +371,11 @@ export default {
|
||||||
fileInfo: this.fileInfo,
|
fileInfo: this.fileInfo,
|
||||||
dir: this.fileInfo.dir,
|
dir: this.fileInfo.dir,
|
||||||
fileList: OCA.Files.App.fileList,
|
fileList: OCA.Files.App.fileList,
|
||||||
$file: $('body')
|
$file: $('body'),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
|
@ -38,7 +38,7 @@ OCA.Sharing.App = {
|
||||||
// The file list is created when a "show" event is handled, so
|
// The file list is created when a "show" event is handled, so
|
||||||
// it should be marked as "shown" like it would have been done
|
// it should be marked as "shown" like it would have been done
|
||||||
// if handling the event with the file list already created.
|
// if handling the event with the file list already created.
|
||||||
shown: true
|
shown: true,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ OCA.Sharing.App = {
|
||||||
// The file list is created when a "show" event is handled, so
|
// The file list is created when a "show" event is handled, so
|
||||||
// it should be marked as "shown" like it would have been done
|
// it should be marked as "shown" like it would have been done
|
||||||
// if handling the event with the file list already created.
|
// if handling the event with the file list already created.
|
||||||
shown: true
|
shown: true,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -90,7 +90,7 @@ OCA.Sharing.App = {
|
||||||
// The file list is created when a "show" event is handled, so
|
// The file list is created when a "show" event is handled, so
|
||||||
// it should be marked as "shown" like it would have been done
|
// it should be marked as "shown" like it would have been done
|
||||||
// if handling the event with the file list already created.
|
// if handling the event with the file list already created.
|
||||||
shown: true
|
shown: true,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -117,7 +117,7 @@ OCA.Sharing.App = {
|
||||||
// The file list is created when a "show" event is handled, so
|
// The file list is created when a "show" event is handled, so
|
||||||
// it should be marked as "shown" like it would have been done
|
// it should be marked as "shown" like it would have been done
|
||||||
// if handling the event with the file list already created.
|
// if handling the event with the file list already created.
|
||||||
shown: true
|
shown: true,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -142,7 +142,7 @@ OCA.Sharing.App = {
|
||||||
// The file list is created when a "show" event is handled, so
|
// The file list is created when a "show" event is handled, so
|
||||||
// it should be marked as "shown" like it would have been done
|
// it should be marked as "shown" like it would have been done
|
||||||
// if handling the event with the file list already created.
|
// if handling the event with the file list already created.
|
||||||
shown: true
|
shown: true,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -202,7 +202,7 @@ OCA.Sharing.App = {
|
||||||
|
|
||||||
_createFileActions: function() {
|
_createFileActions: function() {
|
||||||
// inherit file actions from the files app
|
// inherit file actions from the files app
|
||||||
var fileActions = new OCA.Files.FileActions()
|
const fileActions = new OCA.Files.FileActions()
|
||||||
// note: not merging the legacy actions because legacy apps are not
|
// note: not merging the legacy actions because legacy apps are not
|
||||||
// compatible with the sharing overview and need to be adapted first
|
// compatible with the sharing overview and need to be adapted first
|
||||||
fileActions.registerDefaultActions()
|
fileActions.registerDefaultActions()
|
||||||
|
@ -227,7 +227,7 @@ OCA.Sharing.App = {
|
||||||
},
|
},
|
||||||
|
|
||||||
_restoreShareAction: function() {
|
_restoreShareAction: function() {
|
||||||
var fileActions = new OCA.Files.FileActions()
|
const fileActions = new OCA.Files.FileActions()
|
||||||
fileActions.registerAction({
|
fileActions.registerAction({
|
||||||
name: 'Restore',
|
name: 'Restore',
|
||||||
displayName: '',
|
displayName: '',
|
||||||
|
@ -237,14 +237,14 @@ OCA.Sharing.App = {
|
||||||
iconClass: 'icon-history',
|
iconClass: 'icon-history',
|
||||||
type: OCA.Files.FileActions.TYPE_INLINE,
|
type: OCA.Files.FileActions.TYPE_INLINE,
|
||||||
actionHandler: function(fileName, context) {
|
actionHandler: function(fileName, context) {
|
||||||
var shareId = context.$file.data('shareId')
|
const shareId = context.$file.data('shareId')
|
||||||
$.post(OC.linkToOCS('apps/files_sharing/api/v1/deletedshares', 2) + shareId)
|
$.post(OC.linkToOCS('apps/files_sharing/api/v1/deletedshares', 2) + shareId)
|
||||||
.success(function(result) {
|
.success(function(result) {
|
||||||
context.fileList.remove(context.fileInfoModel.attributes.name)
|
context.fileList.remove(context.fileInfoModel.attributes.name)
|
||||||
}).fail(function() {
|
}).fail(function() {
|
||||||
OC.Notification.showTemporary(t('files_sharing', 'Something happened. Unable to restore the share.'))
|
OC.Notification.showTemporary(t('files_sharing', 'Something happened. Unable to restore the share.'))
|
||||||
})
|
})
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
return fileActions
|
return fileActions
|
||||||
},
|
},
|
||||||
|
@ -269,7 +269,7 @@ OCA.Sharing.App = {
|
||||||
_extendFileList: function(fileList) {
|
_extendFileList: function(fileList) {
|
||||||
// remove size column from summary
|
// remove size column from summary
|
||||||
fileList.fileSummary.$el.find('.filesize').remove()
|
fileList.fileSummary.$el.find('.filesize').remove()
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -17,5 +17,5 @@ window.OCP.Collaboration.registerType('file', {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
typeString: t('files_sharing', 'Link to a file'),
|
typeString: t('files_sharing', 'Link to a file'),
|
||||||
typeIconClass: 'icon-files-dark'
|
typeIconClass: 'icon-files-dark',
|
||||||
})
|
})
|
||||||
|
|
|
@ -39,7 +39,7 @@ export default {
|
||||||
name: 'PersonalSettings',
|
name: 'PersonalSettings',
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
accepting: true
|
accepting: true,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
@ -50,10 +50,10 @@ export default {
|
||||||
axios.put(
|
axios.put(
|
||||||
generateUrl('/apps/files_sharing/settings/defaultAccept'),
|
generateUrl('/apps/files_sharing/settings/defaultAccept'),
|
||||||
{
|
{
|
||||||
accept: this.accepting
|
accept: this.accepting,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -130,11 +130,11 @@ export default {
|
||||||
ActionCheckbox,
|
ActionCheckbox,
|
||||||
ActionInput,
|
ActionInput,
|
||||||
ActionTextEditable,
|
ActionTextEditable,
|
||||||
Avatar
|
Avatar,
|
||||||
},
|
},
|
||||||
|
|
||||||
directives: {
|
directives: {
|
||||||
Tooltip
|
Tooltip,
|
||||||
},
|
},
|
||||||
|
|
||||||
mixins: [SharesMixin],
|
mixins: [SharesMixin],
|
||||||
|
@ -143,7 +143,7 @@ export default {
|
||||||
return {
|
return {
|
||||||
permissionsEdit: OC.PERMISSION_UPDATE,
|
permissionsEdit: OC.PERMISSION_UPDATE,
|
||||||
permissionsRead: OC.PERMISSION_READ,
|
permissionsRead: OC.PERMISSION_READ,
|
||||||
permissionsShare: OC.PERMISSION_SHARE
|
permissionsShare: OC.PERMISSION_SHARE,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -170,7 +170,7 @@ export default {
|
||||||
// todo: strong or italic?
|
// todo: strong or italic?
|
||||||
// but the t function escape any html from the data :/
|
// but the t function escape any html from the data :/
|
||||||
user: this.share.shareWithDisplayName,
|
user: this.share.shareWithDisplayName,
|
||||||
owner: this.share.owner
|
owner: this.share.owner,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.share.type === this.SHARE_TYPES.SHARE_TYPE_GROUP) {
|
if (this.share.type === this.SHARE_TYPES.SHARE_TYPE_GROUP) {
|
||||||
|
@ -198,7 +198,7 @@ export default {
|
||||||
},
|
},
|
||||||
set: function(checked) {
|
set: function(checked) {
|
||||||
this.updatePermissions(checked, this.canReshare)
|
this.updatePermissions(checked, this.canReshare)
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -210,7 +210,7 @@ export default {
|
||||||
},
|
},
|
||||||
set: function(checked) {
|
set: function(checked) {
|
||||||
this.updatePermissions(this.canEdit, checked)
|
this.updatePermissions(this.canEdit, checked)
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -227,13 +227,13 @@ export default {
|
||||||
? this.config.defaultInternalExpirationDateString
|
? this.config.defaultInternalExpirationDateString
|
||||||
: moment().format('YYYY-MM-DD')
|
: moment().format('YYYY-MM-DD')
|
||||||
: ''
|
: ''
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
dateMaxEnforced() {
|
dateMaxEnforced() {
|
||||||
return this.config.isDefaultInternalExpireDateEnforced
|
return this.config.isDefaultInternalExpireDateEnforced
|
||||||
&& moment().add(1 + this.config.defaultInternalExpireDate, 'days')
|
&& moment().add(1 + this.config.defaultInternalExpireDate, 'days')
|
||||||
}
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -246,8 +246,8 @@ export default {
|
||||||
|
|
||||||
this.share.permissions = permissions
|
this.share.permissions = permissions
|
||||||
this.queueUpdate('permissions')
|
this.queueUpdate('permissions')
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -68,7 +68,7 @@ export default {
|
||||||
ActionLink,
|
ActionLink,
|
||||||
ActionText,
|
ActionText,
|
||||||
Avatar,
|
Avatar,
|
||||||
SharingEntrySimple
|
SharingEntrySimple,
|
||||||
},
|
},
|
||||||
|
|
||||||
mixins: [SharesMixin],
|
mixins: [SharesMixin],
|
||||||
|
@ -76,17 +76,17 @@ export default {
|
||||||
props: {
|
props: {
|
||||||
share: {
|
share: {
|
||||||
type: Share,
|
type: Share,
|
||||||
required: true
|
required: true,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
fileTargetUrl() {
|
fileTargetUrl() {
|
||||||
return generateUrl('/f/{fileid}', {
|
return generateUrl('/f/{fileid}', {
|
||||||
fileid: this.share.fileSource
|
fileid: this.share.fileSource,
|
||||||
})
|
})
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -28,21 +28,21 @@ export default {
|
||||||
|
|
||||||
components: {
|
components: {
|
||||||
ActionLink,
|
ActionLink,
|
||||||
SharingEntrySimple
|
SharingEntrySimple,
|
||||||
},
|
},
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
fileInfo: {
|
fileInfo: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => {},
|
default: () => {},
|
||||||
required: true
|
required: true,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
copied: false,
|
copied: false,
|
||||||
copySuccess: false
|
copySuccess: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ export default {
|
||||||
return t('files_sharing', 'Only works for users with access to this folder')
|
return t('files_sharing', 'Only works for users with access to this folder')
|
||||||
}
|
}
|
||||||
return t('files_sharing', 'Only works for users with access to this file')
|
return t('files_sharing', 'Only works for users with access to this file')
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -94,8 +94,8 @@ export default {
|
||||||
this.copied = false
|
this.copied = false
|
||||||
}, 4000)
|
}, 4000)
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -316,11 +316,11 @@ export default {
|
||||||
ActionLink,
|
ActionLink,
|
||||||
ActionText,
|
ActionText,
|
||||||
ActionTextEditable,
|
ActionTextEditable,
|
||||||
Avatar
|
Avatar,
|
||||||
},
|
},
|
||||||
|
|
||||||
directives: {
|
directives: {
|
||||||
Tooltip
|
Tooltip,
|
||||||
},
|
},
|
||||||
|
|
||||||
mixins: [SharesMixin],
|
mixins: [SharesMixin],
|
||||||
|
@ -328,8 +328,8 @@ export default {
|
||||||
props: {
|
props: {
|
||||||
canReshare: {
|
canReshare: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true
|
default: true,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
|
@ -341,7 +341,7 @@ export default {
|
||||||
publicUploadRValue: OC.PERMISSION_READ,
|
publicUploadRValue: OC.PERMISSION_READ,
|
||||||
publicUploadWValue: OC.PERMISSION_CREATE,
|
publicUploadWValue: OC.PERMISSION_CREATE,
|
||||||
|
|
||||||
ExternalLinkActions: OCA.Sharing.ExternalLinkActions.state
|
ExternalLinkActions: OCA.Sharing.ExternalLinkActions.state,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -366,7 +366,7 @@ export default {
|
||||||
if (this.share && this.share.id) {
|
if (this.share && this.share.id) {
|
||||||
if (!this.isShareOwner && this.share.ownerDisplayName) {
|
if (!this.isShareOwner && this.share.ownerDisplayName) {
|
||||||
return t('files_sharing', 'Shared via link by {initiator}', {
|
return t('files_sharing', 'Shared via link by {initiator}', {
|
||||||
initiator: this.share.ownerDisplayName
|
initiator: this.share.ownerDisplayName,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if (this.share.label && this.share.label.trim() !== '') {
|
if (this.share.label && this.share.label.trim() !== '') {
|
||||||
|
@ -393,7 +393,7 @@ export default {
|
||||||
? this.config.defaultExpirationDateString
|
? this.config.defaultExpirationDateString
|
||||||
: moment().format('YYYY-MM-DD')
|
: moment().format('YYYY-MM-DD')
|
||||||
: ''
|
: ''
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
dateMaxEnforced() {
|
dateMaxEnforced() {
|
||||||
|
@ -414,7 +414,7 @@ export default {
|
||||||
// TODO: directly save after generation to make sure the share is always protected
|
// TODO: directly save after generation to make sure the share is always protected
|
||||||
this.share.password = enabled ? await this.generatePassword() : ''
|
this.share.password = enabled ? await this.generatePassword() : ''
|
||||||
this.share.newPassword = this.share.password
|
this.share.newPassword = this.share.password
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -452,7 +452,7 @@ export default {
|
||||||
this.share.permissions = enabled
|
this.share.permissions = enabled
|
||||||
? OC.PERMISSION_READ | OC.PERMISSION_UPDATE
|
? OC.PERMISSION_READ | OC.PERMISSION_UPDATE
|
||||||
: OC.PERMISSION_READ
|
: OC.PERMISSION_READ
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
// if newPassword exists, but is empty, it means
|
// if newPassword exists, but is empty, it means
|
||||||
|
@ -510,7 +510,7 @@ export default {
|
||||||
|
|
||||||
isPasswordPolicyEnabled() {
|
isPasswordPolicyEnabled() {
|
||||||
return typeof this.config.passwordPolicy === 'object'
|
return typeof this.config.passwordPolicy === 'object'
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -519,7 +519,7 @@ export default {
|
||||||
*/
|
*/
|
||||||
async onNewLinkShare() {
|
async onNewLinkShare() {
|
||||||
const shareDefaults = {
|
const shareDefaults = {
|
||||||
share_type: OC.Share.SHARE_TYPE_LINK
|
share_type: OC.Share.SHARE_TYPE_LINK,
|
||||||
}
|
}
|
||||||
if (this.config.isDefaultExpireDateEnforced) {
|
if (this.config.isDefaultExpireDateEnforced) {
|
||||||
// default is empty string if not set
|
// default is empty string if not set
|
||||||
|
@ -588,7 +588,7 @@ export default {
|
||||||
path,
|
path,
|
||||||
shareType: OC.Share.SHARE_TYPE_LINK,
|
shareType: OC.Share.SHARE_TYPE_LINK,
|
||||||
password: share.password,
|
password: share.password,
|
||||||
expireDate: share.expireDate
|
expireDate: share.expireDate,
|
||||||
// we do not allow setting the publicUpload
|
// we do not allow setting the publicUpload
|
||||||
// before the share creation.
|
// before the share creation.
|
||||||
// Todo: We also need to fix the createShare method in
|
// Todo: We also need to fix the createShare method in
|
||||||
|
@ -747,8 +747,8 @@ export default {
|
||||||
// but is incomplete as not pushed to server
|
// but is incomplete as not pushed to server
|
||||||
// YET. We can safely delete the share :)
|
// YET. We can safely delete the share :)
|
||||||
this.$emit('remove:share', this.share)
|
this.$emit('remove:share', this.share)
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -43,28 +43,28 @@ export default {
|
||||||
name: 'SharingEntrySimple',
|
name: 'SharingEntrySimple',
|
||||||
|
|
||||||
components: {
|
components: {
|
||||||
Actions
|
Actions,
|
||||||
},
|
},
|
||||||
|
|
||||||
directives: {
|
directives: {
|
||||||
Tooltip
|
Tooltip,
|
||||||
},
|
},
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
title: {
|
title: {
|
||||||
type: String,
|
type: String,
|
||||||
default: '',
|
default: '',
|
||||||
required: true
|
required: true,
|
||||||
},
|
},
|
||||||
tooltip: {
|
tooltip: {
|
||||||
type: String,
|
type: String,
|
||||||
default: ''
|
default: '',
|
||||||
},
|
},
|
||||||
subtitle: {
|
subtitle: {
|
||||||
type: String,
|
type: String,
|
||||||
default: ''
|
default: '',
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -61,7 +61,7 @@ export default {
|
||||||
name: 'SharingInput',
|
name: 'SharingInput',
|
||||||
|
|
||||||
components: {
|
components: {
|
||||||
Multiselect
|
Multiselect,
|
||||||
},
|
},
|
||||||
|
|
||||||
mixins: [ShareTypes, ShareRequests],
|
mixins: [ShareTypes, ShareRequests],
|
||||||
|
@ -70,26 +70,26 @@ export default {
|
||||||
shares: {
|
shares: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: () => [],
|
default: () => [],
|
||||||
required: true
|
required: true,
|
||||||
},
|
},
|
||||||
linkShares: {
|
linkShares: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: () => [],
|
default: () => [],
|
||||||
required: true
|
required: true,
|
||||||
},
|
},
|
||||||
fileInfo: {
|
fileInfo: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => {},
|
default: () => {},
|
||||||
required: true
|
required: true,
|
||||||
},
|
},
|
||||||
reshare: {
|
reshare: {
|
||||||
type: Share,
|
type: Share,
|
||||||
default: null
|
default: null,
|
||||||
},
|
},
|
||||||
canReshare: {
|
canReshare: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
required: true
|
required: true,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
|
@ -99,7 +99,7 @@ export default {
|
||||||
query: '',
|
query: '',
|
||||||
recommendations: [],
|
recommendations: [],
|
||||||
ShareSearch: OCA.Sharing.ShareSearch.state,
|
ShareSearch: OCA.Sharing.ShareSearch.state,
|
||||||
suggestions: []
|
suggestions: [],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -151,7 +151,7 @@ export default {
|
||||||
return t('files_sharing', 'Searching …')
|
return t('files_sharing', 'Searching …')
|
||||||
}
|
}
|
||||||
return t('files_sharing', 'No elements found.')
|
return t('files_sharing', 'No elements found.')
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
|
@ -190,8 +190,8 @@ export default {
|
||||||
itemType: this.fileInfo.type === 'dir' ? 'folder' : 'file',
|
itemType: this.fileInfo.type === 'dir' ? 'folder' : 'file',
|
||||||
search,
|
search,
|
||||||
lookup,
|
lookup,
|
||||||
perPage: this.config.maxAutocompleteResults
|
perPage: this.config.maxAutocompleteResults,
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
if (request.data.ocs.meta.statuscode !== 100) {
|
if (request.data.ocs.meta.statuscode !== 100) {
|
||||||
|
@ -224,7 +224,7 @@ export default {
|
||||||
lookupEntry.push({
|
lookupEntry.push({
|
||||||
isNoUser: true,
|
isNoUser: true,
|
||||||
displayName: t('files_sharing', 'Search globally'),
|
displayName: t('files_sharing', 'Search globally'),
|
||||||
lookup: true
|
lookup: true,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -255,8 +255,8 @@ export default {
|
||||||
const request = await axios.get(generateOcsUrl('apps/files_sharing/api/v1') + 'sharees_recommended', {
|
const request = await axios.get(generateOcsUrl('apps/files_sharing/api/v1') + 'sharees_recommended', {
|
||||||
params: {
|
params: {
|
||||||
format: 'json',
|
format: 'json',
|
||||||
itemType: this.fileInfo.type
|
itemType: this.fileInfo.type,
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
if (request.data.ocs.meta.statuscode !== 100) {
|
if (request.data.ocs.meta.statuscode !== 100) {
|
||||||
|
@ -382,7 +382,7 @@ export default {
|
||||||
isNoUser: !result.uuid,
|
isNoUser: !result.uuid,
|
||||||
displayName: result.name || result.label,
|
displayName: result.name || result.label,
|
||||||
desc,
|
desc,
|
||||||
icon: this.shareTypeToIcon(result.value.shareType)
|
icon: this.shareTypeToIcon(result.value.shareType),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -417,7 +417,7 @@ export default {
|
||||||
const share = await this.createShare({
|
const share = await this.createShare({
|
||||||
path,
|
path,
|
||||||
shareType: value.shareType,
|
shareType: value.shareType,
|
||||||
shareWith: value.shareWith
|
shareWith: value.shareWith,
|
||||||
})
|
})
|
||||||
this.$emit('add:share', share)
|
this.$emit('add:share', share)
|
||||||
|
|
||||||
|
@ -433,8 +433,8 @@ export default {
|
||||||
} finally {
|
} finally {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,6 @@ Object.assign(OC, {
|
||||||
SHARE_TYPE_CIRCLE: 7,
|
SHARE_TYPE_CIRCLE: 7,
|
||||||
SHARE_TYPE_GUEST: 8,
|
SHARE_TYPE_GUEST: 8,
|
||||||
SHARE_TYPE_REMOTE_GROUP: 9,
|
SHARE_TYPE_REMOTE_GROUP: 9,
|
||||||
SHARE_TYPE_ROOM: 10
|
SHARE_TYPE_ROOM: 10,
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
|
|
|
@ -29,7 +29,7 @@ import Share from '../models/Share'
|
||||||
|
|
||||||
const shareUrl = generateOcsUrl('apps/files_sharing/api/v1', 2) + 'shares'
|
const shareUrl = generateOcsUrl('apps/files_sharing/api/v1', 2) + 'shares'
|
||||||
const headers = {
|
const headers = {
|
||||||
'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
|
'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8',
|
||||||
}
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -109,6 +109,6 @@ export default {
|
||||||
const message = error.response.data.ocs.meta.message
|
const message = error.response.data.ocs.meta.message
|
||||||
throw new Error(`${property}, ${message}`)
|
throw new Error(`${property}, ${message}`)
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,8 +32,8 @@ export default {
|
||||||
SHARE_TYPE_CIRCLE: OC.Share.SHARE_TYPE_CIRCLE,
|
SHARE_TYPE_CIRCLE: OC.Share.SHARE_TYPE_CIRCLE,
|
||||||
SHARE_TYPE_GUEST: OC.Share.SHARE_TYPE_GUEST,
|
SHARE_TYPE_GUEST: OC.Share.SHARE_TYPE_GUEST,
|
||||||
SHARE_TYPE_REMOTE_GROUP: OC.Share.SHARE_TYPE_REMOTE_GROUP,
|
SHARE_TYPE_REMOTE_GROUP: OC.Share.SHARE_TYPE_REMOTE_GROUP,
|
||||||
SHARE_TYPE_ROOM: OC.Share.SHARE_TYPE_ROOM
|
SHARE_TYPE_ROOM: OC.Share.SHARE_TYPE_ROOM,
|
||||||
}
|
},
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,12 +36,12 @@ export default {
|
||||||
fileInfo: {
|
fileInfo: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => {},
|
default: () => {},
|
||||||
required: true
|
required: true,
|
||||||
},
|
},
|
||||||
share: {
|
share: {
|
||||||
type: Share,
|
type: Share,
|
||||||
default: null
|
default: null,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
|
@ -75,8 +75,8 @@ export default {
|
||||||
SHARE_TYPE_CIRCLE: OC.Share.SHARE_TYPE_CIRCLE,
|
SHARE_TYPE_CIRCLE: OC.Share.SHARE_TYPE_CIRCLE,
|
||||||
SHARE_TYPE_GUEST: OC.Share.SHARE_TYPE_GUEST,
|
SHARE_TYPE_GUEST: OC.Share.SHARE_TYPE_GUEST,
|
||||||
SHARE_TYPE_REMOTE_GROUP: OC.Share.SHARE_TYPE_REMOTE_GROUP,
|
SHARE_TYPE_REMOTE_GROUP: OC.Share.SHARE_TYPE_REMOTE_GROUP,
|
||||||
SHARE_TYPE_ROOM: OC.Share.SHARE_TYPE_ROOM
|
SHARE_TYPE_ROOM: OC.Share.SHARE_TYPE_ROOM,
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -94,7 +94,7 @@ export default {
|
||||||
this.share.note = enabled
|
this.share.note = enabled
|
||||||
? t('files_sharing', 'Enter a note for the share recipient')
|
? t('files_sharing', 'Enter a note for the share recipient')
|
||||||
: ''
|
: ''
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
dateTomorrow() {
|
dateTomorrow() {
|
||||||
|
@ -123,14 +123,14 @@ export default {
|
||||||
? window.monthNamesShort // provided by nextcloud
|
? window.monthNamesShort // provided by nextcloud
|
||||||
: ['Jan.', 'Feb.', 'Mar.', 'Apr.', 'May.', 'Jun.', 'Jul.', 'Aug.', 'Sep.', 'Oct.', 'Nov.', 'Dec.'],
|
: ['Jan.', 'Feb.', 'Mar.', 'Apr.', 'May.', 'Jun.', 'Jul.', 'Aug.', 'Sep.', 'Oct.', 'Nov.', 'Dec.'],
|
||||||
placeholder: {
|
placeholder: {
|
||||||
date: 'Select Date' // TODO: Translate
|
date: 'Select Date', // TODO: Translate
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
isShareOwner() {
|
isShareOwner() {
|
||||||
return this.share && this.share.owner === getCurrentUser().uid
|
return this.share && this.share.owner === getCurrentUser().uid
|
||||||
}
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -217,7 +217,7 @@ export default {
|
||||||
try {
|
try {
|
||||||
await this.updateShare(this.share.id, {
|
await this.updateShare(this.share.id, {
|
||||||
property,
|
property,
|
||||||
value
|
value,
|
||||||
})
|
})
|
||||||
|
|
||||||
// clear any previous errors
|
// clear any previous errors
|
||||||
|
@ -276,6 +276,6 @@ export default {
|
||||||
*/
|
*/
|
||||||
debounceQueueUpdate: debounce(function(property) {
|
debounceQueueUpdate: debounce(function(property) {
|
||||||
this.queueUpdate(property)
|
this.queueUpdate(property)
|
||||||
}, 500)
|
}, 500),
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,10 +23,10 @@
|
||||||
(function() {
|
(function() {
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
var BreadCrumbView = OC.Backbone.View.extend({
|
const BreadCrumbView = OC.Backbone.View.extend({
|
||||||
tagName: 'span',
|
tagName: 'span',
|
||||||
events: {
|
events: {
|
||||||
click: '_onClick'
|
click: '_onClick',
|
||||||
},
|
},
|
||||||
_dirInfo: undefined,
|
_dirInfo: undefined,
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@
|
||||||
this._dirInfo = data.dirInfo || null
|
this._dirInfo = data.dirInfo || null
|
||||||
|
|
||||||
if (this._dirInfo !== null && (this._dirInfo.path !== '/' || this._dirInfo.name !== '')) {
|
if (this._dirInfo !== null && (this._dirInfo.path !== '/' || this._dirInfo.name !== '')) {
|
||||||
var isShared = data.dirInfo && data.dirInfo.shareTypes && data.dirInfo.shareTypes.length > 0
|
const isShared = data.dirInfo && data.dirInfo.shareTypes && data.dirInfo.shareTypes.length > 0
|
||||||
this.$el.removeClass('shared icon-public icon-shared')
|
this.$el.removeClass('shared icon-public icon-shared')
|
||||||
if (isShared) {
|
if (isShared) {
|
||||||
this.$el.addClass('shared')
|
this.$el.addClass('shared')
|
||||||
|
@ -58,18 +58,18 @@
|
||||||
_onClick: function(e) {
|
_onClick: function(e) {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
|
|
||||||
var fileInfoModel = new OCA.Files.FileInfoModel(this._dirInfo)
|
const fileInfoModel = new OCA.Files.FileInfoModel(this._dirInfo)
|
||||||
var self = this
|
const self = this
|
||||||
fileInfoModel.on('change', function() {
|
fileInfoModel.on('change', function() {
|
||||||
self.render({
|
self.render({
|
||||||
dirInfo: self._dirInfo
|
dirInfo: self._dirInfo,
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
var path = fileInfoModel.attributes.path + '/' + fileInfoModel.attributes.name
|
const path = fileInfoModel.attributes.path + '/' + fileInfoModel.attributes.name
|
||||||
OCA.Files.Sidebar.open(path)
|
OCA.Files.Sidebar.open(path)
|
||||||
OCA.Files.Sidebar.setActiveTab('sharing')
|
OCA.Files.Sidebar.setActiveTab('sharing')
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
OCA.Sharing.ShareBreadCrumbView = BreadCrumbView
|
OCA.Sharing.ShareBreadCrumbView = BreadCrumbView
|
||||||
|
|
|
@ -33,7 +33,7 @@ const shareWithTitle = function(share) {
|
||||||
'Shared with you and the group {group} by {owner}',
|
'Shared with you and the group {group} by {owner}',
|
||||||
{
|
{
|
||||||
group: share.shareWithDisplayName,
|
group: share.shareWithDisplayName,
|
||||||
owner: share.ownerDisplayName
|
owner: share.ownerDisplayName,
|
||||||
},
|
},
|
||||||
undefined,
|
undefined,
|
||||||
{ escape: false }
|
{ escape: false }
|
||||||
|
@ -44,7 +44,7 @@ const shareWithTitle = function(share) {
|
||||||
'Shared with you and {circle} by {owner}',
|
'Shared with you and {circle} by {owner}',
|
||||||
{
|
{
|
||||||
circle: share.shareWithDisplayName,
|
circle: share.shareWithDisplayName,
|
||||||
owner: share.ownerDisplayName
|
owner: share.ownerDisplayName,
|
||||||
},
|
},
|
||||||
undefined,
|
undefined,
|
||||||
{ escape: false }
|
{ escape: false }
|
||||||
|
@ -56,7 +56,7 @@ const shareWithTitle = function(share) {
|
||||||
'Shared with you and the conversation {conversation} by {owner}',
|
'Shared with you and the conversation {conversation} by {owner}',
|
||||||
{
|
{
|
||||||
conversation: share.shareWithDisplayName,
|
conversation: share.shareWithDisplayName,
|
||||||
owner: share.ownerDisplayName
|
owner: share.ownerDisplayName,
|
||||||
},
|
},
|
||||||
undefined,
|
undefined,
|
||||||
{ escape: false }
|
{ escape: false }
|
||||||
|
@ -66,7 +66,7 @@ const shareWithTitle = function(share) {
|
||||||
'files_sharing',
|
'files_sharing',
|
||||||
'Shared with you in a conversation by {owner}',
|
'Shared with you in a conversation by {owner}',
|
||||||
{
|
{
|
||||||
owner: share.ownerDisplayName
|
owner: share.ownerDisplayName,
|
||||||
},
|
},
|
||||||
undefined,
|
undefined,
|
||||||
{ escape: false }
|
{ escape: false }
|
||||||
|
|
|
@ -56,15 +56,15 @@ export default {
|
||||||
components: {
|
components: {
|
||||||
ActionButton,
|
ActionButton,
|
||||||
SharingEntryInherited,
|
SharingEntryInherited,
|
||||||
SharingEntrySimple
|
SharingEntrySimple,
|
||||||
},
|
},
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
fileInfo: {
|
fileInfo: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => {},
|
default: () => {},
|
||||||
required: true
|
required: true,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
|
@ -72,7 +72,7 @@ export default {
|
||||||
loaded: false,
|
loaded: false,
|
||||||
loading: false,
|
loading: false,
|
||||||
showInheritedShares: false,
|
showInheritedShares: false,
|
||||||
shares: []
|
shares: [],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -96,12 +96,12 @@ export default {
|
||||||
fullPath() {
|
fullPath() {
|
||||||
const path = `${this.fileInfo.path}/${this.fileInfo.name}`
|
const path = `${this.fileInfo.path}/${this.fileInfo.name}`
|
||||||
return path.replace('//', '/')
|
return path.replace('//', '/')
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
fileInfo() {
|
fileInfo() {
|
||||||
this.resetState()
|
this.resetState()
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/**
|
/**
|
||||||
|
@ -142,8 +142,8 @@ export default {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
this.showInheritedShares = false
|
this.showInheritedShares = false
|
||||||
this.shares = []
|
this.shares = []
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@ export default {
|
||||||
name: 'SharingLinkList',
|
name: 'SharingLinkList',
|
||||||
|
|
||||||
components: {
|
components: {
|
||||||
SharingEntryLink
|
SharingEntryLink,
|
||||||
},
|
},
|
||||||
|
|
||||||
mixins: [ShareTypes],
|
mixins: [ShareTypes],
|
||||||
|
@ -62,17 +62,17 @@ export default {
|
||||||
fileInfo: {
|
fileInfo: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => {},
|
default: () => {},
|
||||||
required: true
|
required: true,
|
||||||
},
|
},
|
||||||
shares: {
|
shares: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: () => [],
|
default: () => [],
|
||||||
required: true
|
required: true,
|
||||||
},
|
},
|
||||||
canReshare: {
|
canReshare: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
required: true
|
required: true,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -94,7 +94,7 @@ export default {
|
||||||
*/
|
*/
|
||||||
hasShares() {
|
hasShares() {
|
||||||
return this.shares.length > 0
|
return this.shares.length > 0
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -135,7 +135,7 @@ export default {
|
||||||
removeShare(share) {
|
removeShare(share) {
|
||||||
const index = this.shares.findIndex(item => item === share)
|
const index = this.shares.findIndex(item => item === share)
|
||||||
this.shares.splice(index, 1)
|
this.shares.splice(index, 1)
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -39,26 +39,26 @@ export default {
|
||||||
name: 'SharingList',
|
name: 'SharingList',
|
||||||
|
|
||||||
components: {
|
components: {
|
||||||
SharingEntry
|
SharingEntry,
|
||||||
},
|
},
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
fileInfo: {
|
fileInfo: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => {},
|
default: () => {},
|
||||||
required: true
|
required: true,
|
||||||
},
|
},
|
||||||
shares: {
|
shares: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: () => [],
|
default: () => [],
|
||||||
required: true
|
required: true,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
hasShares() {
|
hasShares() {
|
||||||
return this.shares.length === 0
|
return this.shares.length === 0
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -70,7 +70,7 @@ export default {
|
||||||
removeShare(share) {
|
removeShare(share) {
|
||||||
const index = this.shares.findIndex(item => item === share)
|
const index = this.shares.findIndex(item => item === share)
|
||||||
this.shares.splice(index, 1)
|
this.shares.splice(index, 1)
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -114,7 +114,7 @@ export default {
|
||||||
SharingInput,
|
SharingInput,
|
||||||
SharingLinkList,
|
SharingLinkList,
|
||||||
SharingList,
|
SharingList,
|
||||||
Tab
|
Tab,
|
||||||
},
|
},
|
||||||
|
|
||||||
mixins: [ShareTypes],
|
mixins: [ShareTypes],
|
||||||
|
@ -123,8 +123,8 @@ export default {
|
||||||
fileInfo: {
|
fileInfo: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => {},
|
default: () => {},
|
||||||
required: true
|
required: true,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
|
@ -139,7 +139,7 @@ export default {
|
||||||
sharedWithMe: {},
|
sharedWithMe: {},
|
||||||
shares: [],
|
shares: [],
|
||||||
linkShares: [],
|
linkShares: [],
|
||||||
sections: OCA.Sharing.ShareTabSections.getSections()
|
sections: OCA.Sharing.ShareTabSections.getSections(),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -176,14 +176,14 @@ export default {
|
||||||
canReshare() {
|
canReshare() {
|
||||||
return !!(this.fileInfo.permissions & OC.PERMISSION_SHARE)
|
return !!(this.fileInfo.permissions & OC.PERMISSION_SHARE)
|
||||||
|| !!(this.reshare && this.reshare.hasSharePermission)
|
|| !!(this.reshare && this.reshare.hasSharePermission)
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
watch: {
|
watch: {
|
||||||
fileInfo() {
|
fileInfo() {
|
||||||
this.resetState()
|
this.resetState()
|
||||||
this.getShares()
|
this.getShares()
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
beforeMount() {
|
beforeMount() {
|
||||||
|
@ -209,15 +209,15 @@ export default {
|
||||||
params: {
|
params: {
|
||||||
format,
|
format,
|
||||||
path,
|
path,
|
||||||
reshares: true
|
reshares: true,
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
const fetchSharedWithMe = axios.get(shareUrl, {
|
const fetchSharedWithMe = axios.get(shareUrl, {
|
||||||
params: {
|
params: {
|
||||||
format,
|
format,
|
||||||
path,
|
path,
|
||||||
shared_with_me: true
|
shared_with_me: true,
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
// wait for data
|
// wait for data
|
||||||
|
@ -254,7 +254,7 @@ export default {
|
||||||
updateExpirationSubtitle(share) {
|
updateExpirationSubtitle(share) {
|
||||||
const expiration = moment(share.expireDate).unix()
|
const expiration = moment(share.expireDate).unix()
|
||||||
this.$set(this.sharedWithMe, 'subtitle', t('files_sharing', 'Expires {relativetime}', {
|
this.$set(this.sharedWithMe, 'subtitle', t('files_sharing', 'Expires {relativetime}', {
|
||||||
relativetime: OC.Util.relativeModifiedDate(expiration * 1000)
|
relativetime: OC.Util.relativeModifiedDate(expiration * 1000),
|
||||||
}))
|
}))
|
||||||
|
|
||||||
// share have expired
|
// share have expired
|
||||||
|
@ -301,7 +301,7 @@ export default {
|
||||||
this.sharedWithMe = {
|
this.sharedWithMe = {
|
||||||
displayName,
|
displayName,
|
||||||
title,
|
title,
|
||||||
user
|
user,
|
||||||
}
|
}
|
||||||
this.reshare = share
|
this.reshare = share
|
||||||
|
|
||||||
|
@ -329,8 +329,8 @@ export default {
|
||||||
} else {
|
} else {
|
||||||
this.shares.unshift(share)
|
this.shares.unshift(share)
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -30,9 +30,9 @@ OCA.Trashbin.App = {
|
||||||
host: OC.getHost(),
|
host: OC.getHost(),
|
||||||
port: OC.getPort(),
|
port: OC.getPort(),
|
||||||
root: OC.linkToRemoteBase('dav') + '/trashbin/' + OC.getCurrentUser().uid,
|
root: OC.linkToRemoteBase('dav') + '/trashbin/' + OC.getCurrentUser().uid,
|
||||||
useHTTPS: OC.getProtocol() === 'https'
|
useHTTPS: OC.getProtocol() === 'https',
|
||||||
})
|
})
|
||||||
var urlParams = OC.Util.History.parseUrlQuery()
|
const urlParams = OC.Util.History.parseUrlQuery()
|
||||||
this.fileList = new OCA.Trashbin.FileList(
|
this.fileList = new OCA.Trashbin.FileList(
|
||||||
$('#app-content-trashbin'), {
|
$('#app-content-trashbin'), {
|
||||||
fileActions: this._createFileActions(),
|
fileActions: this._createFileActions(),
|
||||||
|
@ -43,28 +43,28 @@ OCA.Trashbin.App = {
|
||||||
{
|
{
|
||||||
name: 'restore',
|
name: 'restore',
|
||||||
displayName: t('files_trashbin', 'Restore'),
|
displayName: t('files_trashbin', 'Restore'),
|
||||||
iconClass: 'icon-history'
|
iconClass: 'icon-history',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'delete',
|
name: 'delete',
|
||||||
displayName: t('files_trashbin', 'Delete permanently'),
|
displayName: t('files_trashbin', 'Delete permanently'),
|
||||||
iconClass: 'icon-delete'
|
iconClass: 'icon-delete',
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
client: this.client,
|
client: this.client,
|
||||||
// The file list is created when a "show" event is handled, so
|
// The file list is created when a "show" event is handled, so
|
||||||
// it should be marked as "shown" like it would have been done
|
// it should be marked as "shown" like it would have been done
|
||||||
// if handling the event with the file list already created.
|
// if handling the event with the file list already created.
|
||||||
shown: true
|
shown: true,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
|
||||||
_createFileActions: function() {
|
_createFileActions: function() {
|
||||||
var client = this.client
|
const client = this.client
|
||||||
var fileActions = new OCA.Files.FileActions()
|
const fileActions = new OCA.Files.FileActions()
|
||||||
fileActions.register('dir', 'Open', OC.PERMISSION_READ, '', function(filename, context) {
|
fileActions.register('dir', 'Open', OC.PERMISSION_READ, '', function(filename, context) {
|
||||||
var dir = context.fileList.getCurrentDirectory()
|
const dir = context.fileList.getCurrentDirectory()
|
||||||
context.fileList.changeDirectory(OC.joinPaths(dir, filename))
|
context.fileList.changeDirectory(OC.joinPaths(dir, filename))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -78,10 +78,10 @@ OCA.Trashbin.App = {
|
||||||
permissions: OC.PERMISSION_READ,
|
permissions: OC.PERMISSION_READ,
|
||||||
iconClass: 'icon-history',
|
iconClass: 'icon-history',
|
||||||
actionHandler: function(filename, context) {
|
actionHandler: function(filename, context) {
|
||||||
var fileList = context.fileList
|
const fileList = context.fileList
|
||||||
var tr = fileList.findFileEl(filename)
|
const tr = fileList.findFileEl(filename)
|
||||||
fileList.showFileBusyState(tr, true)
|
fileList.showFileBusyState(tr, true)
|
||||||
var dir = context.fileList.getCurrentDirectory()
|
const dir = context.fileList.getCurrentDirectory()
|
||||||
client.move(OC.joinPaths('trash', dir, filename), OC.joinPaths('restore', filename), true)
|
client.move(OC.joinPaths('trash', dir, filename), OC.joinPaths('restore', filename), true)
|
||||||
.then(
|
.then(
|
||||||
fileList._removeCallback.bind(fileList, [filename]),
|
fileList._removeCallback.bind(fileList, [filename]),
|
||||||
|
@ -90,7 +90,7 @@ OCA.Trashbin.App = {
|
||||||
OC.Notification.show(t('files_trashbin', 'Error while restoring file from trashbin'))
|
OC.Notification.show(t('files_trashbin', 'Error while restoring file from trashbin'))
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
fileActions.registerAction({
|
fileActions.registerAction({
|
||||||
|
@ -100,18 +100,18 @@ OCA.Trashbin.App = {
|
||||||
permissions: OC.PERMISSION_READ,
|
permissions: OC.PERMISSION_READ,
|
||||||
iconClass: 'icon-delete',
|
iconClass: 'icon-delete',
|
||||||
render: function(actionSpec, isDefault, context) {
|
render: function(actionSpec, isDefault, context) {
|
||||||
var $actionLink = fileActions._makeActionLink(actionSpec, context)
|
const $actionLink = fileActions._makeActionLink(actionSpec, context)
|
||||||
$actionLink.attr('original-title', t('files_trashbin', 'Delete permanently'))
|
$actionLink.attr('original-title', t('files_trashbin', 'Delete permanently'))
|
||||||
$actionLink.children('img').attr('alt', t('files_trashbin', 'Delete permanently'))
|
$actionLink.children('img').attr('alt', t('files_trashbin', 'Delete permanently'))
|
||||||
context.$file.find('td:last').append($actionLink)
|
context.$file.find('td:last').append($actionLink)
|
||||||
return $actionLink
|
return $actionLink
|
||||||
},
|
},
|
||||||
actionHandler: function(filename, context) {
|
actionHandler: function(filename, context) {
|
||||||
var fileList = context.fileList
|
const fileList = context.fileList
|
||||||
$('.tipsy').remove()
|
$('.tipsy').remove()
|
||||||
var tr = fileList.findFileEl(filename)
|
const tr = fileList.findFileEl(filename)
|
||||||
fileList.showFileBusyState(tr, true)
|
fileList.showFileBusyState(tr, true)
|
||||||
var dir = context.fileList.getCurrentDirectory()
|
const dir = context.fileList.getCurrentDirectory()
|
||||||
client.remove(OC.joinPaths('trash', dir, filename))
|
client.remove(OC.joinPaths('trash', dir, filename))
|
||||||
.then(
|
.then(
|
||||||
fileList._removeCallback.bind(fileList, [filename]),
|
fileList._removeCallback.bind(fileList, [filename]),
|
||||||
|
@ -120,15 +120,15 @@ OCA.Trashbin.App = {
|
||||||
OC.Notification.show(t('files_trashbin', 'Error while removing file from trashbin'))
|
OC.Notification.show(t('files_trashbin', 'Error while removing file from trashbin'))
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
return fileActions
|
return fileActions
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$('#app-content-trashbin').one('show', function() {
|
$('#app-content-trashbin').one('show', function() {
|
||||||
var App = OCA.Trashbin.App
|
const App = OCA.Trashbin.App
|
||||||
App.initialize($('#app-content-trashbin'))
|
App.initialize($('#app-content-trashbin'))
|
||||||
// force breadcrumb init
|
// force breadcrumb init
|
||||||
// App.fileList.changeDirectory(App.fileList.getCurrentDirectory(), false, true);
|
// App.fileList.changeDirectory(App.fileList.getCurrentDirectory(), false, true);
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -26,7 +26,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
fileList.registerTabView(new OCA.Versions.VersionsTabView('versionsTabView', { order: -10 }))
|
fileList.registerTabView(new OCA.Versions.VersionsTabView('versionsTabView', { order: -10 }))
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
})()
|
})()
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
/**
|
/**
|
||||||
* @memberof OCA.Versions
|
* @memberof OCA.Versions
|
||||||
*/
|
*/
|
||||||
var VersionCollection = OC.Backbone.Collection.extend({
|
const VersionCollection = OC.Backbone.Collection.extend({
|
||||||
model: OCA.Versions.VersionModel,
|
model: OCA.Versions.VersionModel,
|
||||||
sync: OC.Backbone.davSync,
|
sync: OC.Backbone.davSync,
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@
|
||||||
return this._client || new OC.Files.Client({
|
return this._client || new OC.Files.Client({
|
||||||
host: OC.getHost(),
|
host: OC.getHost(),
|
||||||
root: OC.linkToRemoteBase('dav') + '/versions/' + this.getCurrentUser(),
|
root: OC.linkToRemoteBase('dav') + '/versions/' + this.getCurrentUser(),
|
||||||
useHTTPS: OC.getProtocol() === 'https'
|
useHTTPS: OC.getProtocol() === 'https',
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -58,11 +58,11 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
parse: function(result) {
|
parse: function(result) {
|
||||||
var fullPath = this._fileInfo.getFullPath()
|
const fullPath = this._fileInfo.getFullPath()
|
||||||
var fileId = this._fileInfo.get('id')
|
const fileId = this._fileInfo.get('id')
|
||||||
var name = this._fileInfo.get('name')
|
const name = this._fileInfo.get('name')
|
||||||
var user = this.getCurrentUser()
|
const user = this.getCurrentUser()
|
||||||
var client = this.getClient()
|
const client = this.getClient()
|
||||||
return _.map(result, function(version) {
|
return _.map(result, function(version) {
|
||||||
version.fullPath = fullPath
|
version.fullPath = fullPath
|
||||||
version.fileId = fileId
|
version.fileId = fileId
|
||||||
|
@ -74,7 +74,7 @@
|
||||||
version.client = client
|
version.client = client
|
||||||
return version
|
return version
|
||||||
})
|
})
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
OCA.Versions = OCA.Versions || {}
|
OCA.Versions = OCA.Versions || {}
|
||||||
|
|
|
@ -12,13 +12,13 @@
|
||||||
/**
|
/**
|
||||||
* @memberof OCA.Versions
|
* @memberof OCA.Versions
|
||||||
*/
|
*/
|
||||||
var VersionModel = OC.Backbone.Model.extend({
|
const VersionModel = OC.Backbone.Model.extend({
|
||||||
sync: OC.Backbone.davSync,
|
sync: OC.Backbone.davSync,
|
||||||
|
|
||||||
davProperties: {
|
davProperties: {
|
||||||
'size': '{DAV:}getcontentlength',
|
'size': '{DAV:}getcontentlength',
|
||||||
'mimetype': '{DAV:}getcontenttype',
|
'mimetype': '{DAV:}getcontenttype',
|
||||||
'timestamp': '{DAV:}getlastmodified'
|
'timestamp': '{DAV:}getlastmodified',
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -29,9 +29,9 @@
|
||||||
*/
|
*/
|
||||||
revert: function(options) {
|
revert: function(options) {
|
||||||
options = options ? _.clone(options) : {}
|
options = options ? _.clone(options) : {}
|
||||||
var model = this
|
const model = this
|
||||||
|
|
||||||
var client = this.get('client')
|
const client = this.get('client')
|
||||||
|
|
||||||
return client.move('/versions/' + this.get('fileId') + '/' + this.get('id'), '/restore/target', true)
|
return client.move('/versions/' + this.get('fileId') + '/' + this.get('id'), '/restore/target', true)
|
||||||
.done(function() {
|
.done(function() {
|
||||||
|
@ -53,17 +53,17 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
getPreviewUrl: function() {
|
getPreviewUrl: function() {
|
||||||
var url = OC.generateUrl('/apps/files_versions/preview')
|
const url = OC.generateUrl('/apps/files_versions/preview')
|
||||||
var params = {
|
const params = {
|
||||||
file: this.get('fullPath'),
|
file: this.get('fullPath'),
|
||||||
version: this.get('id')
|
version: this.get('id'),
|
||||||
}
|
}
|
||||||
return url + '?' + OC.buildQueryString(params)
|
return url + '?' + OC.buildQueryString(params)
|
||||||
},
|
},
|
||||||
|
|
||||||
getDownloadUrl: function() {
|
getDownloadUrl: function() {
|
||||||
return OC.linkToRemoteBase('dav') + '/versions/' + this.get('user') + '/versions/' + this.get('fileId') + '/' + this.get('id')
|
return OC.linkToRemoteBase('dav') + '/versions/' + this.get('user') + '/versions/' + this.get('fileId') + '/' + this.get('id')
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
OCA.Versions = OCA.Versions || {}
|
OCA.Versions = OCA.Versions || {}
|
||||||
|
|
|
@ -15,7 +15,7 @@ import Template from './templates/template.handlebars';
|
||||||
/**
|
/**
|
||||||
* @memberof OCA.Versions
|
* @memberof OCA.Versions
|
||||||
*/
|
*/
|
||||||
var VersionsTabView = OCA.Files.DetailTabView.extend(/** @lends OCA.Versions.VersionsTabView.prototype */{
|
const VersionsTabView = OCA.Files.DetailTabView.extend(/** @lends OCA.Versions.VersionsTabView.prototype */{
|
||||||
id: 'versionsTabView',
|
id: 'versionsTabView',
|
||||||
className: 'tab versionsTabView',
|
className: 'tab versionsTabView',
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ import Template from './templates/template.handlebars';
|
||||||
$versionsContainer: null,
|
$versionsContainer: null,
|
||||||
|
|
||||||
events: {
|
events: {
|
||||||
'click .revertVersion': '_onClickRevertVersion'
|
'click .revertVersion': '_onClickRevertVersion',
|
||||||
},
|
},
|
||||||
|
|
||||||
initialize: function() {
|
initialize: function() {
|
||||||
|
@ -57,18 +57,17 @@ import Template from './templates/template.handlebars';
|
||||||
},
|
},
|
||||||
|
|
||||||
_onClickRevertVersion: function(ev) {
|
_onClickRevertVersion: function(ev) {
|
||||||
var self = this
|
const self = this
|
||||||
var $target = $(ev.target)
|
let $target = $(ev.target)
|
||||||
var fileInfoModel = this.collection.getFileInfo()
|
const fileInfoModel = this.collection.getFileInfo()
|
||||||
var revision
|
|
||||||
if (!$target.is('li')) {
|
if (!$target.is('li')) {
|
||||||
$target = $target.closest('li')
|
$target = $target.closest('li')
|
||||||
}
|
}
|
||||||
|
|
||||||
ev.preventDefault()
|
ev.preventDefault()
|
||||||
revision = $target.attr('data-revision')
|
const revision = $target.attr('data-revision')
|
||||||
|
|
||||||
var versionModel = this.collection.get(revision)
|
const versionModel = this.collection.get(revision)
|
||||||
versionModel.revert({
|
versionModel.revert({
|
||||||
success: function() {
|
success: function() {
|
||||||
// reset and re-fetch the updated collection
|
// reset and re-fetch the updated collection
|
||||||
|
@ -85,7 +84,7 @@ import Template from './templates/template.handlebars';
|
||||||
size: versionModel.get('size'),
|
size: versionModel.get('size'),
|
||||||
mtime: versionModel.get('timestamp') * 1000,
|
mtime: versionModel.get('timestamp') * 1000,
|
||||||
// temp dummy, until we can do a PROPFIND
|
// temp dummy, until we can do a PROPFIND
|
||||||
etag: versionModel.get('id') + versionModel.get('timestamp')
|
etag: versionModel.get('id') + versionModel.get('timestamp'),
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -96,13 +95,13 @@ import Template from './templates/template.handlebars';
|
||||||
OC.Notification.show(t('files_version', 'Failed to revert {file} to revision {timestamp}.',
|
OC.Notification.show(t('files_version', 'Failed to revert {file} to revision {timestamp}.',
|
||||||
{
|
{
|
||||||
file: versionModel.getFullPath(),
|
file: versionModel.getFullPath(),
|
||||||
timestamp: OC.Util.formatDate(versionModel.get('timestamp') * 1000)
|
timestamp: OC.Util.formatDate(versionModel.get('timestamp') * 1000),
|
||||||
}),
|
}),
|
||||||
{
|
{
|
||||||
type: 'error'
|
type: 'error',
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
// spinner
|
// spinner
|
||||||
|
@ -125,7 +124,7 @@ import Template from './templates/template.handlebars';
|
||||||
},
|
},
|
||||||
|
|
||||||
_onAddModel: function(model) {
|
_onAddModel: function(model) {
|
||||||
var $el = $(this.itemTemplate(this._formatItem(model)))
|
const $el = $(this.itemTemplate(this._formatItem(model)))
|
||||||
this.$versionsContainer.append($el)
|
this.$versionsContainer.append($el)
|
||||||
$el.find('.has-tooltip').tooltip()
|
$el.find('.has-tooltip').tooltip()
|
||||||
},
|
},
|
||||||
|
@ -151,10 +150,10 @@ import Template from './templates/template.handlebars';
|
||||||
},
|
},
|
||||||
|
|
||||||
_formatItem: function(version) {
|
_formatItem: function(version) {
|
||||||
var timestamp = version.get('timestamp') * 1000
|
const timestamp = version.get('timestamp') * 1000
|
||||||
var size = version.has('size') ? version.get('size') : 0
|
const size = version.has('size') ? version.get('size') : 0
|
||||||
var preview = OC.MimeType.getIconUrl(version.get('mimetype'))
|
const preview = OC.MimeType.getIconUrl(version.get('mimetype'))
|
||||||
var img = new Image()
|
const img = new Image()
|
||||||
img.onload = function() {
|
img.onload = function() {
|
||||||
$('li[data-revision=' + version.get('id') + '] .preview').attr('src', version.getPreviewUrl())
|
$('li[data-revision=' + version.get('id') + '] .preview').attr('src', version.getPreviewUrl())
|
||||||
}
|
}
|
||||||
|
@ -174,7 +173,7 @@ import Template from './templates/template.handlebars';
|
||||||
revertIconUrl: OC.imagePath('core', 'actions/history'),
|
revertIconUrl: OC.imagePath('core', 'actions/history'),
|
||||||
previewUrl: preview,
|
previewUrl: preview,
|
||||||
revertLabel: t('files_versions', 'Restore'),
|
revertLabel: t('files_versions', 'Restore'),
|
||||||
canRevert: (this.collection.getFileInfo().get('permissions') & OC.PERMISSION_UPDATE) !== 0
|
canRevert: (this.collection.getFileInfo().get('permissions') & OC.PERMISSION_UPDATE) !== 0,
|
||||||
}, version.attributes)
|
}, version.attributes)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -183,7 +182,7 @@ import Template from './templates/template.handlebars';
|
||||||
*/
|
*/
|
||||||
render: function() {
|
render: function() {
|
||||||
this.$el.html(this.template({
|
this.$el.html(this.template({
|
||||||
emptyResultLabel: t('files_versions', 'No other versions available')
|
emptyResultLabel: t('files_versions', 'No other versions available'),
|
||||||
}))
|
}))
|
||||||
this.$el.find('.has-tooltip').tooltip()
|
this.$el.find('.has-tooltip').tooltip()
|
||||||
this.$versionsContainer = this.$el.find('ul.versions')
|
this.$versionsContainer = this.$el.find('ul.versions')
|
||||||
|
@ -200,7 +199,7 @@ import Template from './templates/template.handlebars';
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
return !fileInfo.isDirectory()
|
return !fileInfo.isDirectory()
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
OCA.Versions = OCA.Versions || {}
|
OCA.Versions = OCA.Versions || {}
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -80,13 +80,13 @@ import { generateUrl } from '@nextcloud/router'
|
||||||
export default {
|
export default {
|
||||||
name: 'App',
|
name: 'App',
|
||||||
components: {
|
components: {
|
||||||
OAuthItem
|
OAuthItem,
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
clients: {
|
clients: {
|
||||||
type: Array,
|
type: Array,
|
||||||
required: true
|
required: true,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
data: function() {
|
data: function() {
|
||||||
return {
|
return {
|
||||||
|
@ -94,8 +94,8 @@ export default {
|
||||||
name: '',
|
name: '',
|
||||||
redirectUri: '',
|
redirectUri: '',
|
||||||
errorMsg: '',
|
errorMsg: '',
|
||||||
error: false
|
error: false,
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -112,7 +112,7 @@ export default {
|
||||||
generateUrl('apps/oauth2/clients'),
|
generateUrl('apps/oauth2/clients'),
|
||||||
{
|
{
|
||||||
name: this.newClient.name,
|
name: this.newClient.name,
|
||||||
redirectUri: this.newClient.redirectUri
|
redirectUri: this.newClient.redirectUri,
|
||||||
}
|
}
|
||||||
).then(response => {
|
).then(response => {
|
||||||
this.clients.push(response.data)
|
this.clients.push(response.data)
|
||||||
|
@ -123,7 +123,7 @@ export default {
|
||||||
this.newClient.error = true
|
this.newClient.error = true
|
||||||
this.newClient.errorMsg = reason.response.data.message
|
this.newClient.errorMsg = reason.response.data.message
|
||||||
})
|
})
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -37,8 +37,8 @@ export default {
|
||||||
props: {
|
props: {
|
||||||
client: {
|
client: {
|
||||||
type: Object,
|
type: Object,
|
||||||
required: true
|
required: true,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
data: function() {
|
data: function() {
|
||||||
return {
|
return {
|
||||||
|
@ -47,7 +47,7 @@ export default {
|
||||||
redirectUri: this.client.redirectUri,
|
redirectUri: this.client.redirectUri,
|
||||||
clientId: this.client.clientId,
|
clientId: this.client.clientId,
|
||||||
clientSecret: this.client.clientSecret,
|
clientSecret: this.client.clientSecret,
|
||||||
renderSecret: false
|
renderSecret: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -57,13 +57,13 @@ export default {
|
||||||
} else {
|
} else {
|
||||||
return '****'
|
return '****'
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
toggleSecret() {
|
toggleSecret() {
|
||||||
this.renderSecret = !this.renderSecret
|
this.renderSecret = !this.renderSecret
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ const clients = loadState('oauth2', 'clients')
|
||||||
const View = Vue.extend(App)
|
const View = Vue.extend(App)
|
||||||
const oauth = new View({
|
const oauth = new View({
|
||||||
propsData: {
|
propsData: {
|
||||||
clients
|
clients,
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
oauth.$mount('#oauth2')
|
oauth.$mount('#oauth2')
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -921,4 +921,4 @@ t.exports=function(t){return null!=t&&null!=t.constructor&&"function"==typeof t.
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
o.default.use(h.a);var v={setEnforced:function(t,e){o.default.set(t,"enforced",e)},setEnforcedGroups:function(t,e){o.default.set(t,"enforcedGroups",e)},setExcludedGroups:function(t,e){o.default.set(t,"excludedGroups",e)}},m=new h.a.Store({strict:!1,state:{enforced:!1,enforcedGroups:[],excludedGroups:[]},mutations:v});r.nc=btoa(OC.requestToken),o.default.prototype.t=t,window.OC=window.OC||{},window.OC.Settings=window.OC.Settings||{},m.replaceState(Object(i.loadState)("settings","mandatory2FAState")),new(o.default.extend(p))({store:m}).$mount("#two-factor-auth-settings")}]);
|
o.default.use(h.a);var v={setEnforced:function(t,e){o.default.set(t,"enforced",e)},setEnforcedGroups:function(t,e){o.default.set(t,"enforcedGroups",e)},setExcludedGroups:function(t,e){o.default.set(t,"excludedGroups",e)}},m=new h.a.Store({strict:!1,state:{enforced:!1,enforcedGroups:[],excludedGroups:[]},mutations:v});r.nc=btoa(OC.requestToken),o.default.prototype.t=t,window.OC=window.OC||{},window.OC.Settings=window.OC.Settings||{},m.replaceState(Object(i.loadState)("settings","mandatory2FAState")),new(o.default.extend(p))({store:m}).$mount("#two-factor-auth-settings")}]);
|
||||||
//# sourceMappingURL=vue-settings-admin-security.js.map?v=0ab9f09cf79b04037213
|
//# sourceMappingURL=vue-settings-admin-security.js.map?v=6e8c9e3db75e17c36aad
|
File diff suppressed because one or more lines are too long
|
@ -1,4 +1,4 @@
|
||||||
!function(t){function e(e){for(var n,o,i=e[0],a=e[1],s=0,c=[];s<i.length;s++)o=i[s],Object.prototype.hasOwnProperty.call(r,o)&&r[o]&&c.push(r[o][0]),r[o]=0;for(n in a)Object.prototype.hasOwnProperty.call(a,n)&&(t[n]=a[n]);for(u&&u(e);c.length;)c.shift()()}var n={},r={2:0};function o(e){if(n[e])return n[e].exports;var r=n[e]={i:e,l:!1,exports:{}};return t[e].call(r.exports,r,r.exports,o),r.l=!0,r.exports}o.e=function(t){var e=[],n=r[t];if(0!==n)if(n)e.push(n[2]);else{var i=new Promise((function(e,o){n=r[t]=[e,o]}));e.push(n[2]=i);var a,s=document.createElement("script");s.charset="utf-8",s.timeout=120,o.nc&&s.setAttribute("nonce",o.nc),s.src=function(t){return o.p+"vue-"+({}[t]||t)+".js?v="+{0:"6cde90fa478918b686d5",4:"fa1fbd638f369d75fbcb",5:"26d8064c66ba6737646f",6:"513d7884f7066d3aab7f"}[t]}(t);var u=new Error;a=function(e){s.onerror=s.onload=null,clearTimeout(c);var n=r[t];if(0!==n){if(n){var o=e&&("load"===e.type?"missing":e.type),i=e&&e.target&&e.target.src;u.message="Loading chunk "+t+" failed.\n("+o+": "+i+")",u.name="ChunkLoadError",u.type=o,u.request=i,n[1](u)}r[t]=void 0}};var c=setTimeout((function(){a({type:"timeout",target:s})}),12e4);s.onerror=s.onload=a,document.head.appendChild(s)}return Promise.all(e)},o.m=t,o.c=n,o.d=function(t,e,n){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)o.d(n,r,function(e){return t[e]}.bind(null,r));return n},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="/js/",o.oe=function(t){throw console.error(t),t};var i=window.webpackJsonpSettings=window.webpackJsonpSettings||[],a=i.push.bind(i);i.push=e,i=i.slice();for(var s=0;s<i.length;s++)e(i[s]);var u=a;o(o.s=313)}([function(t,e,n){var r=n(2),o=n(34),i=n(50),a=n(224),s=r.Symbol,u=o("wks");t.exports=function(t){return u[t]||(u[t]=a&&s[t]||(a?s:i)("Symbol."+t))}},function(t,e,n){"use strict";var r=n(79),o=n(164),i=Object.prototype.toString;function a(t){return"[object Array]"===i.call(t)}function s(t){return null!==t&&"object"==typeof t}function u(t){return"[object Function]"===i.call(t)}function c(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),a(t))for(var n=0,r=t.length;n<r;n++)e.call(null,t[n],n,t);else for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.call(null,t[o],o,t)}t.exports={isArray:a,isArrayBuffer:function(t){return"[object ArrayBuffer]"===i.call(t)},isBuffer:o,isFormData:function(t){return"undefined"!=typeof FormData&&t instanceof FormData},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:s,isUndefined:function(t){return void 0===t},isDate:function(t){return"[object Date]"===i.call(t)},isFile:function(t){return"[object File]"===i.call(t)},isBlob:function(t){return"[object Blob]"===i.call(t)},isFunction:u,isStream:function(t){return s(t)&&u(t.pipe)},isURLSearchParams:function(t){return"undefined"!=typeof URLSearchParams&&t instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:c,merge:function t(){var e={};function n(n,r){"object"==typeof e[r]&&"object"==typeof n?e[r]=t(e[r],n):e[r]=n}for(var r=0,o=arguments.length;r<o;r++)c(arguments[r],n);return e},deepMerge:function t(){var e={};function n(n,r){"object"==typeof e[r]&&"object"==typeof n?e[r]=t(e[r],n):e[r]="object"==typeof n?t({},n):n}for(var r=0,o=arguments.length;r<o;r++)c(arguments[r],n);return e},extend:function(t,e,n){return c(e,(function(e,o){t[o]=n&&"function"==typeof e?r(e,n):e})),t},trim:function(t){return t.replace(/^\s*/,"").replace(/\s*$/,"")}}},function(t,e,n){(function(e){var n="object",r=function(t){return t&&t.Math==Math&&t};t.exports=r(typeof globalThis==n&&globalThis)||r(typeof window==n&&window)||r(typeof self==n&&self)||r(typeof e==n&&e)||Function("return this")()}).call(this,n(7))},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,n){"use strict";n.r(e),function(t,n){
|
!function(t){function e(e){for(var n,o,i=e[0],a=e[1],s=0,c=[];s<i.length;s++)o=i[s],Object.prototype.hasOwnProperty.call(r,o)&&r[o]&&c.push(r[o][0]),r[o]=0;for(n in a)Object.prototype.hasOwnProperty.call(a,n)&&(t[n]=a[n]);for(u&&u(e);c.length;)c.shift()()}var n={},r={2:0};function o(e){if(n[e])return n[e].exports;var r=n[e]={i:e,l:!1,exports:{}};return t[e].call(r.exports,r,r.exports,o),r.l=!0,r.exports}o.e=function(t){var e=[],n=r[t];if(0!==n)if(n)e.push(n[2]);else{var i=new Promise((function(e,o){n=r[t]=[e,o]}));e.push(n[2]=i);var a,s=document.createElement("script");s.charset="utf-8",s.timeout=120,o.nc&&s.setAttribute("nonce",o.nc),s.src=function(t){return o.p+"vue-"+({}[t]||t)+".js?v="+{0:"6cde90fa478918b686d5",4:"1304c639cab971673636",5:"26d8064c66ba6737646f",6:"04d7a14dc0bda35628ab"}[t]}(t);var u=new Error;a=function(e){s.onerror=s.onload=null,clearTimeout(c);var n=r[t];if(0!==n){if(n){var o=e&&("load"===e.type?"missing":e.type),i=e&&e.target&&e.target.src;u.message="Loading chunk "+t+" failed.\n("+o+": "+i+")",u.name="ChunkLoadError",u.type=o,u.request=i,n[1](u)}r[t]=void 0}};var c=setTimeout((function(){a({type:"timeout",target:s})}),12e4);s.onerror=s.onload=a,document.head.appendChild(s)}return Promise.all(e)},o.m=t,o.c=n,o.d=function(t,e,n){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)o.d(n,r,function(e){return t[e]}.bind(null,r));return n},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="/js/",o.oe=function(t){throw console.error(t),t};var i=window.webpackJsonpSettings=window.webpackJsonpSettings||[],a=i.push.bind(i);i.push=e,i=i.slice();for(var s=0;s<i.length;s++)e(i[s]);var u=a;o(o.s=313)}([function(t,e,n){var r=n(2),o=n(34),i=n(50),a=n(224),s=r.Symbol,u=o("wks");t.exports=function(t){return u[t]||(u[t]=a&&s[t]||(a?s:i)("Symbol."+t))}},function(t,e,n){"use strict";var r=n(79),o=n(164),i=Object.prototype.toString;function a(t){return"[object Array]"===i.call(t)}function s(t){return null!==t&&"object"==typeof t}function u(t){return"[object Function]"===i.call(t)}function c(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),a(t))for(var n=0,r=t.length;n<r;n++)e.call(null,t[n],n,t);else for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.call(null,t[o],o,t)}t.exports={isArray:a,isArrayBuffer:function(t){return"[object ArrayBuffer]"===i.call(t)},isBuffer:o,isFormData:function(t){return"undefined"!=typeof FormData&&t instanceof FormData},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:s,isUndefined:function(t){return void 0===t},isDate:function(t){return"[object Date]"===i.call(t)},isFile:function(t){return"[object File]"===i.call(t)},isBlob:function(t){return"[object Blob]"===i.call(t)},isFunction:u,isStream:function(t){return s(t)&&u(t.pipe)},isURLSearchParams:function(t){return"undefined"!=typeof URLSearchParams&&t instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:c,merge:function t(){var e={};function n(n,r){"object"==typeof e[r]&&"object"==typeof n?e[r]=t(e[r],n):e[r]=n}for(var r=0,o=arguments.length;r<o;r++)c(arguments[r],n);return e},deepMerge:function t(){var e={};function n(n,r){"object"==typeof e[r]&&"object"==typeof n?e[r]=t(e[r],n):e[r]="object"==typeof n?t({},n):n}for(var r=0,o=arguments.length;r<o;r++)c(arguments[r],n);return e},extend:function(t,e,n){return c(e,(function(e,o){t[o]=n&&"function"==typeof e?r(e,n):e})),t},trim:function(t){return t.replace(/^\s*/,"").replace(/\s*$/,"")}}},function(t,e,n){(function(e){var n="object",r=function(t){return t&&t.Math==Math&&t};t.exports=r(typeof globalThis==n&&globalThis)||r(typeof window==n&&window)||r(typeof self==n&&self)||r(typeof e==n&&e)||Function("return this")()}).call(this,n(7))},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,n){"use strict";n.r(e),function(t,n){
|
||||||
/*!
|
/*!
|
||||||
* Vue.js v2.6.10
|
* Vue.js v2.6.10
|
||||||
* (c) 2014-2019 Evan You
|
* (c) 2014-2019 Evan You
|
||||||
|
@ -110,4 +110,4 @@ o.default.use(Yt.a);var pe={API_FAILURE:function(e,n){try{var r=n.error.response
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
o.default.use(i.a,{defaultHtml:!1}),Object(a.sync)(de,Kt),r.nc=btoa(OC.requestToken),r.p=OC.linkTo("settings","js/"),o.default.prototype.t=t,o.default.prototype.OC=OC,o.default.prototype.OCA=OCA,o.default.prototype.oc_userconfig=oc_userconfig;var he=new o.default({router:Kt,store:de,render:function(t){return t(c)}}).$mount("#content")}]);
|
o.default.use(i.a,{defaultHtml:!1}),Object(a.sync)(de,Kt),r.nc=btoa(OC.requestToken),r.p=OC.linkTo("settings","js/"),o.default.prototype.t=t,o.default.prototype.OC=OC,o.default.prototype.OCA=OCA,o.default.prototype.oc_userconfig=oc_userconfig;var he=new o.default({router:Kt,store:de,render:function(t){return t(c)}}).$mount("#content")}]);
|
||||||
//# sourceMappingURL=vue-settings-apps-users-management.js.map?v=5ba48f9cdc82bfa53304
|
//# sourceMappingURL=vue-settings-apps-users-management.js.map?v=2de90d033e602f5d6be1
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -33,6 +33,6 @@ export default {
|
||||||
if (serverDataElmt !== null) {
|
if (serverDataElmt !== null) {
|
||||||
this.$store.commit('setServerData', JSON.parse(document.getElementById('serverData').dataset.server))
|
this.$store.commit('setServerData', JSON.parse(document.getElementById('serverData').dataset.server))
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -73,14 +73,14 @@ import _ from 'lodash'
|
||||||
export default {
|
export default {
|
||||||
name: 'AdminTwoFactor',
|
name: 'AdminTwoFactor',
|
||||||
components: {
|
components: {
|
||||||
Multiselect
|
Multiselect,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: false,
|
loading: false,
|
||||||
dirty: false,
|
dirty: false,
|
||||||
groups: [],
|
groups: [],
|
||||||
loadingGroups: false
|
loadingGroups: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -91,7 +91,7 @@ export default {
|
||||||
set: function(val) {
|
set: function(val) {
|
||||||
this.dirty = true
|
this.dirty = true
|
||||||
this.$store.commit('setEnforced', val)
|
this.$store.commit('setEnforced', val)
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
enforcedGroups: {
|
enforcedGroups: {
|
||||||
get: function() {
|
get: function() {
|
||||||
|
@ -100,7 +100,7 @@ export default {
|
||||||
set: function(val) {
|
set: function(val) {
|
||||||
this.dirty = true
|
this.dirty = true
|
||||||
this.$store.commit('setEnforcedGroups', val)
|
this.$store.commit('setEnforcedGroups', val)
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
excludedGroups: {
|
excludedGroups: {
|
||||||
get: function() {
|
get: function() {
|
||||||
|
@ -109,8 +109,8 @@ export default {
|
||||||
set: function(val) {
|
set: function(val) {
|
||||||
this.dirty = true
|
this.dirty = true
|
||||||
this.$store.commit('setExcludedGroups', val)
|
this.$store.commit('setExcludedGroups', val)
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
// Groups are loaded dynamically, but the assigned ones *should*
|
// Groups are loaded dynamically, but the assigned ones *should*
|
||||||
|
@ -138,7 +138,7 @@ export default {
|
||||||
const data = {
|
const data = {
|
||||||
enforced: this.enforced,
|
enforced: this.enforced,
|
||||||
enforcedGroups: this.enforcedGroups,
|
enforcedGroups: this.enforcedGroups,
|
||||||
excludedGroups: this.excludedGroups
|
excludedGroups: this.excludedGroups,
|
||||||
}
|
}
|
||||||
axios.put(OC.generateUrl('/settings/api/admin/twofactorauth'), data)
|
axios.put(OC.generateUrl('/settings/api/admin/twofactorauth'), data)
|
||||||
.then(resp => resp.data)
|
.then(resp => resp.data)
|
||||||
|
@ -150,8 +150,8 @@ export default {
|
||||||
console.error('could not save changes', err)
|
console.error('could not save changes', err)
|
||||||
})
|
})
|
||||||
.then(() => { this.loading = false })
|
.then(() => { this.loading = false })
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -200,13 +200,13 @@ export default {
|
||||||
name: 'AppDetails',
|
name: 'AppDetails',
|
||||||
components: {
|
components: {
|
||||||
Multiselect,
|
Multiselect,
|
||||||
AppScore
|
AppScore,
|
||||||
},
|
},
|
||||||
mixins: [AppManagement, PrefixMixin, SvgFilterMixin],
|
mixins: [AppManagement, PrefixMixin, SvgFilterMixin],
|
||||||
props: ['category', 'app'],
|
props: ['category', 'app'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
groupCheckedAppsData: false
|
groupCheckedAppsData: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -226,8 +226,8 @@ export default {
|
||||||
if (typeof this.app.author === 'string') {
|
if (typeof this.app.author === 'string') {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
'@value': this.app.author
|
'@value': this.app.author,
|
||||||
}
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
if (this.app.author['@value']) {
|
if (this.app.author['@value']) {
|
||||||
|
@ -244,10 +244,11 @@ export default {
|
||||||
.sort((a, b) => a.name.localeCompare(b.name))
|
.sort((a, b) => a.name.localeCompare(b.name))
|
||||||
},
|
},
|
||||||
renderMarkdown() {
|
renderMarkdown() {
|
||||||
var renderer = new marked.Renderer()
|
const renderer = new marked.Renderer()
|
||||||
renderer.link = function(href, title, text) {
|
renderer.link = function(href, title, text) {
|
||||||
|
let prot
|
||||||
try {
|
try {
|
||||||
var prot = decodeURIComponent(unescape(href))
|
prot = decodeURIComponent(unescape(href))
|
||||||
.replace(/[^\w:]/g, '')
|
.replace(/[^\w:]/g, '')
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -258,7 +259,7 @@ export default {
|
||||||
return ''
|
return ''
|
||||||
}
|
}
|
||||||
|
|
||||||
var out = '<a href="' + href + '" rel="noreferrer noopener"'
|
let out = '<a href="' + href + '" rel="noreferrer noopener"'
|
||||||
if (title) {
|
if (title) {
|
||||||
out += ' title="' + title + '"'
|
out += ' title="' + title + '"'
|
||||||
}
|
}
|
||||||
|
@ -284,7 +285,7 @@ export default {
|
||||||
pedantic: false,
|
pedantic: false,
|
||||||
sanitize: true,
|
sanitize: true,
|
||||||
smartLists: true,
|
smartLists: true,
|
||||||
smartypants: false
|
smartypants: false,
|
||||||
}),
|
}),
|
||||||
{
|
{
|
||||||
SAFE_FOR_JQUERY: true,
|
SAFE_FOR_JQUERY: true,
|
||||||
|
@ -297,17 +298,17 @@ export default {
|
||||||
'li',
|
'li',
|
||||||
'em',
|
'em',
|
||||||
'del',
|
'del',
|
||||||
'blockquote'
|
'blockquote',
|
||||||
]
|
],
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
if (this.app.groups.length > 0) {
|
if (this.app.groups.length > 0) {
|
||||||
this.groupCheckedAppsData = true
|
this.groupCheckedAppsData = true
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -105,7 +105,7 @@ import pLimit from 'p-limit'
|
||||||
export default {
|
export default {
|
||||||
name: 'AppList',
|
name: 'AppList',
|
||||||
components: {
|
components: {
|
||||||
AppItem
|
AppItem,
|
||||||
},
|
},
|
||||||
mixins: [PrefixMixin],
|
mixins: [PrefixMixin],
|
||||||
props: ['category', 'app', 'search'],
|
props: ['category', 'app', 'search'],
|
||||||
|
@ -123,7 +123,7 @@ export default {
|
||||||
return this.hasPendingUpdate && ['installed', 'updates'].includes(this.category)
|
return this.hasPendingUpdate && ['installed', 'updates'].includes(this.category)
|
||||||
},
|
},
|
||||||
apps() {
|
apps() {
|
||||||
let apps = this.$store.getters.getAllApps
|
const apps = this.$store.getters.getAllApps
|
||||||
.filter(app => app.name.toLowerCase().search(this.search.toLowerCase()) !== -1)
|
.filter(app => app.name.toLowerCase().search(this.search.toLowerCase()) !== -1)
|
||||||
.sort(function(a, b) {
|
.sort(function(a, b) {
|
||||||
const sortStringA = '' + (a.active ? 0 : 1) + (a.update ? 0 : 1) + a.name
|
const sortStringA = '' + (a.active ? 0 : 1) + (a.update ? 0 : 1) + a.name
|
||||||
|
@ -183,20 +183,20 @@ export default {
|
||||||
return (this.category === 'app-bundles')
|
return (this.category === 'app-bundles')
|
||||||
},
|
},
|
||||||
allBundlesEnabled() {
|
allBundlesEnabled() {
|
||||||
let self = this
|
const self = this
|
||||||
return function(id) {
|
return function(id) {
|
||||||
return self.bundleApps(id).filter(app => !app.active).length === 0
|
return self.bundleApps(id).filter(app => !app.active).length === 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
bundleToggleText() {
|
bundleToggleText() {
|
||||||
let self = this
|
const self = this
|
||||||
return function(id) {
|
return function(id) {
|
||||||
if (self.allBundlesEnabled(id)) {
|
if (self.allBundlesEnabled(id)) {
|
||||||
return t('settings', 'Disable all')
|
return t('settings', 'Disable all')
|
||||||
}
|
}
|
||||||
return t('settings', 'Enable all')
|
return t('settings', 'Enable all')
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
toggleBundle(id) {
|
toggleBundle(id) {
|
||||||
|
@ -206,7 +206,7 @@ export default {
|
||||||
return this.enableBundle(id)
|
return this.enableBundle(id)
|
||||||
},
|
},
|
||||||
enableBundle(id) {
|
enableBundle(id) {
|
||||||
let apps = this.bundleApps(id).map(app => app.id)
|
const apps = this.bundleApps(id).map(app => app.id)
|
||||||
this.$store.dispatch('enableApp', { appId: apps, groups: [] })
|
this.$store.dispatch('enableApp', { appId: apps, groups: [] })
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
|
@ -214,7 +214,7 @@ export default {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
disableBundle(id) {
|
disableBundle(id) {
|
||||||
let apps = this.bundleApps(id).map(app => app.id)
|
const apps = this.bundleApps(id).map(app => app.id)
|
||||||
this.$store.dispatch('disableApp', { appId: apps, groups: [] })
|
this.$store.dispatch('disableApp', { appId: apps, groups: [] })
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
OC.Notification.show(error)
|
OC.Notification.show(error)
|
||||||
|
@ -226,7 +226,7 @@ export default {
|
||||||
.filter(app => app.update)
|
.filter(app => app.update)
|
||||||
.map(app => limit(() => this.$store.dispatch('updateApp', { appId: app.id }))
|
.map(app => limit(() => this.$store.dispatch('updateApp', { appId: app.id }))
|
||||||
)
|
)
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -114,7 +114,7 @@ import SvgFilterMixin from '../SvgFilterMixin'
|
||||||
export default {
|
export default {
|
||||||
name: 'AppItem',
|
name: 'AppItem',
|
||||||
components: {
|
components: {
|
||||||
AppScore
|
AppScore,
|
||||||
},
|
},
|
||||||
mixins: [AppManagement, SvgFilterMixin],
|
mixins: [AppManagement, SvgFilterMixin],
|
||||||
props: {
|
props: {
|
||||||
|
@ -122,24 +122,24 @@ export default {
|
||||||
category: {},
|
category: {},
|
||||||
listView: {
|
listView: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true
|
default: true,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
isSelected: false,
|
isSelected: false,
|
||||||
scrolled: false
|
scrolled: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
hasRating() {
|
hasRating() {
|
||||||
return this.app.appstoreData && this.app.appstoreData.ratingNumOverall > 5
|
return this.app.appstoreData && this.app.appstoreData.ratingNumOverall > 5
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
'$route.params.id': function(id) {
|
'$route.params.id': function(id) {
|
||||||
this.isSelected = (this.app.id === id)
|
this.isSelected = (this.app.id === id)
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.isSelected = (this.app.id === this.$route.params.id)
|
this.isSelected = (this.app.id === this.$route.params.id)
|
||||||
|
@ -155,7 +155,7 @@ export default {
|
||||||
try {
|
try {
|
||||||
await this.$router.push({
|
await this.$router.push({
|
||||||
name: 'apps-details',
|
name: 'apps-details',
|
||||||
params: { category: this.category, id: this.app.id }
|
params: { category: this.category, id: this.app.id },
|
||||||
})
|
})
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// we already view this app
|
// we already view this app
|
||||||
|
@ -163,8 +163,8 @@ export default {
|
||||||
},
|
},
|
||||||
prefix(prefix, content) {
|
prefix(prefix, content) {
|
||||||
return prefix + '_' + content
|
return prefix + '_' + content
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -29,10 +29,10 @@ export default {
|
||||||
props: ['score'],
|
props: ['score'],
|
||||||
computed: {
|
computed: {
|
||||||
scoreImage() {
|
scoreImage() {
|
||||||
let score = Math.round(this.score * 10)
|
const score = Math.round(this.score * 10)
|
||||||
let imageName = 'rating/s' + score + '.svg'
|
const imageName = 'rating/s' + score + '.svg'
|
||||||
return OC.imagePath('core', imageName)
|
return OC.imagePath('core', imageName)
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -27,7 +27,7 @@ export default {
|
||||||
return this.app.groups.map(group => { return { id: group, name: group } })
|
return this.app.groups.map(group => { return { id: group, name: group } })
|
||||||
},
|
},
|
||||||
loading() {
|
loading() {
|
||||||
let self = this
|
const self = this
|
||||||
return function(id) {
|
return function(id) {
|
||||||
return self.$store.getters.loading(id)
|
return self.$store.getters.loading(id)
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,7 @@ export default {
|
||||||
return base + ' ' + t('settings', 'The app will be downloaded from the app store')
|
return base + ' ' + t('settings', 'The app will be downloaded from the app store')
|
||||||
}
|
}
|
||||||
return base
|
return base
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
if (this.app.groups.length > 0) {
|
if (this.app.groups.length > 0) {
|
||||||
|
@ -92,12 +92,12 @@ export default {
|
||||||
return true
|
return true
|
||||||
},
|
},
|
||||||
addGroupLimitation(group) {
|
addGroupLimitation(group) {
|
||||||
let groups = this.app.groups.concat([]).concat([group.id])
|
const groups = this.app.groups.concat([]).concat([group.id])
|
||||||
this.$store.dispatch('enableApp', { appId: this.app.id, groups: groups })
|
this.$store.dispatch('enableApp', { appId: this.app.id, groups: groups })
|
||||||
},
|
},
|
||||||
removeGroupLimitation(group) {
|
removeGroupLimitation(group) {
|
||||||
let currentGroups = this.app.groups.concat([])
|
const currentGroups = this.app.groups.concat([])
|
||||||
let index = currentGroups.indexOf(group.id)
|
const index = currentGroups.indexOf(group.id)
|
||||||
if (index > -1) {
|
if (index > -1) {
|
||||||
currentGroups.splice(index, 1)
|
currentGroups.splice(index, 1)
|
||||||
}
|
}
|
||||||
|
@ -132,7 +132,7 @@ export default {
|
||||||
this.$store.dispatch('updateApp', { appId: appId })
|
this.$store.dispatch('updateApp', { appId: appId })
|
||||||
.then((response) => { OC.Settings.Apps.rebuildNavigation() })
|
.then((response) => { OC.Settings.Apps.rebuildNavigation() })
|
||||||
.catch((error) => { OC.Notification.show(error) })
|
.catch((error) => { OC.Notification.show(error) })
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -88,7 +88,7 @@
|
||||||
import {
|
import {
|
||||||
Actions,
|
Actions,
|
||||||
ActionButton,
|
ActionButton,
|
||||||
ActionCheckbox
|
ActionCheckbox,
|
||||||
} from 'nextcloud-vue'
|
} from 'nextcloud-vue'
|
||||||
|
|
||||||
const userAgentMap = {
|
const userAgentMap = {
|
||||||
|
@ -114,7 +114,7 @@ const userAgentMap = {
|
||||||
// Mozilla/5.0 (U; Linux; Maemo; Jolla; Sailfish; like Android 4.3) AppleWebKit/538.1 (KHTML, like Gecko) WebPirate/2.0 like Mobile Safari/538.1 (compatible)
|
// Mozilla/5.0 (U; Linux; Maemo; Jolla; Sailfish; like Android 4.3) AppleWebKit/538.1 (KHTML, like Gecko) WebPirate/2.0 like Mobile Safari/538.1 (compatible)
|
||||||
webPirate: /(Sailfish).*WebPirate\/(\d+)/,
|
webPirate: /(Sailfish).*WebPirate\/(\d+)/,
|
||||||
// Mozilla/5.0 (Maemo; Linux; U; Jolla; Sailfish; Mobile; rv:31.0) Gecko/31.0 Firefox/31.0 SailfishBrowser/1.0
|
// Mozilla/5.0 (Maemo; Linux; U; Jolla; Sailfish; Mobile; rv:31.0) Gecko/31.0 Firefox/31.0 SailfishBrowser/1.0
|
||||||
sailfishBrowser: /(Sailfish).*SailfishBrowser\/(\d+)/
|
sailfishBrowser: /(Sailfish).*SailfishBrowser\/(\d+)/,
|
||||||
}
|
}
|
||||||
const nameMap = {
|
const nameMap = {
|
||||||
ie: t('setting', 'Internet Explorer'),
|
ie: t('setting', 'Internet Explorer'),
|
||||||
|
@ -131,7 +131,7 @@ const nameMap = {
|
||||||
androidTalkClient: t('setting', 'Nextcloud Talk for Android'),
|
androidTalkClient: t('setting', 'Nextcloud Talk for Android'),
|
||||||
davDroid: 'DAVdroid',
|
davDroid: 'DAVdroid',
|
||||||
webPirate: 'WebPirate',
|
webPirate: 'WebPirate',
|
||||||
sailfishBrowser: 'SailfishBrowser'
|
sailfishBrowser: 'SailfishBrowser',
|
||||||
}
|
}
|
||||||
const iconMap = {
|
const iconMap = {
|
||||||
ie: 'icon-desktop',
|
ie: 'icon-desktop',
|
||||||
|
@ -148,7 +148,7 @@ const iconMap = {
|
||||||
androidTalkClient: 'icon-phone',
|
androidTalkClient: 'icon-phone',
|
||||||
davDroid: 'icon-phone',
|
davDroid: 'icon-phone',
|
||||||
webPirate: 'icon-link',
|
webPirate: 'icon-link',
|
||||||
sailfishBrowser: 'icon-link'
|
sailfishBrowser: 'icon-link',
|
||||||
}
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -156,20 +156,20 @@ export default {
|
||||||
components: {
|
components: {
|
||||||
Actions,
|
Actions,
|
||||||
ActionButton,
|
ActionButton,
|
||||||
ActionCheckbox
|
ActionCheckbox,
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
token: {
|
token: {
|
||||||
type: Object,
|
type: Object,
|
||||||
required: true
|
required: true,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
showMore: this.token.canScope || this.token.canDelete,
|
showMore: this.token.canScope || this.token.canDelete,
|
||||||
renaming: false,
|
renaming: false,
|
||||||
newName: '',
|
newName: '',
|
||||||
actionOpen: false
|
actionOpen: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -181,14 +181,14 @@ export default {
|
||||||
},
|
},
|
||||||
iconName() {
|
iconName() {
|
||||||
// pretty format sync client user agent
|
// pretty format sync client user agent
|
||||||
let matches = this.token.name.match(/Mozilla\/5\.0 \((\w+)\) (?:mirall|csyncoC)\/(\d+\.\d+\.\d+)/)
|
const matches = this.token.name.match(/Mozilla\/5\.0 \((\w+)\) (?:mirall|csyncoC)\/(\d+\.\d+\.\d+)/)
|
||||||
|
|
||||||
let icon = ''
|
let icon = ''
|
||||||
if (matches) {
|
if (matches) {
|
||||||
/* eslint-disable-next-line */
|
/* eslint-disable-next-line */
|
||||||
this.token.name = t('settings', 'Sync client - {os}', {
|
this.token.name = t('settings', 'Sync client - {os}', {
|
||||||
os: matches[1],
|
os: matches[1],
|
||||||
version: matches[2]
|
version: matches[2],
|
||||||
})
|
})
|
||||||
icon = 'icon-desktop'
|
icon = 'icon-desktop'
|
||||||
}
|
}
|
||||||
|
@ -196,7 +196,7 @@ export default {
|
||||||
// preserve title for cases where we format it further
|
// preserve title for cases where we format it further
|
||||||
const title = this.token.name
|
const title = this.token.name
|
||||||
let name = this.token.name
|
let name = this.token.name
|
||||||
for (let client in userAgentMap) {
|
for (const client in userAgentMap) {
|
||||||
const matches = title.match(userAgentMap[client])
|
const matches = title.match(userAgentMap[client])
|
||||||
if (matches) {
|
if (matches) {
|
||||||
if (matches[2] && matches[1]) { // version number and os
|
if (matches[2] && matches[1]) { // version number and os
|
||||||
|
@ -216,12 +216,12 @@ export default {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
icon,
|
icon,
|
||||||
name
|
name,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
wiping() {
|
wiping() {
|
||||||
return this.token.type === 2
|
return this.token.type === 2
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
startRename() {
|
startRename() {
|
||||||
|
@ -248,8 +248,8 @@ export default {
|
||||||
wipe() {
|
wipe() {
|
||||||
this.actionOpen = false
|
this.actionOpen = false
|
||||||
this.$emit('wipe', this.token)
|
this.$emit('wipe', this.token)
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -47,22 +47,22 @@ import AuthToken from './AuthToken'
|
||||||
export default {
|
export default {
|
||||||
name: 'AuthTokenList',
|
name: 'AuthTokenList',
|
||||||
components: {
|
components: {
|
||||||
AuthToken
|
AuthToken,
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
tokens: {
|
tokens: {
|
||||||
type: Array,
|
type: Array,
|
||||||
required: true
|
required: true,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
sortedTokens() {
|
sortedTokens() {
|
||||||
return this.tokens.slice().sort((t1, t2) => {
|
return this.tokens.slice().sort((t1, t2) => {
|
||||||
var ts1 = parseInt(t1.lastActivity, 10)
|
const ts1 = parseInt(t1.lastActivity, 10)
|
||||||
var ts2 = parseInt(t2.lastActivity, 10)
|
const ts2 = parseInt(t2.lastActivity, 10)
|
||||||
return ts2 - ts1
|
return ts2 - ts1
|
||||||
})
|
})
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
toggleScope(token, scope, value) {
|
toggleScope(token, scope, value) {
|
||||||
|
@ -80,8 +80,8 @@ export default {
|
||||||
onWipe(token) {
|
onWipe(token) {
|
||||||
// Just pass it on
|
// Just pass it on
|
||||||
this.$emit('wipe', token)
|
this.$emit('wipe', token)
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -66,21 +66,21 @@ export default {
|
||||||
name: 'AuthTokenSection',
|
name: 'AuthTokenSection',
|
||||||
components: {
|
components: {
|
||||||
AuthTokenSetupDialogue,
|
AuthTokenSetupDialogue,
|
||||||
AuthTokenList
|
AuthTokenList,
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
tokens: {
|
tokens: {
|
||||||
type: Array,
|
type: Array,
|
||||||
required: true
|
required: true,
|
||||||
},
|
},
|
||||||
canCreateToken: {
|
canCreateToken: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
required: true
|
required: true,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
baseUrl: OC.generateUrl('/settings/personal/authtokens')
|
baseUrl: OC.generateUrl('/settings/personal/authtokens'),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -88,7 +88,7 @@ export default {
|
||||||
console.debug('creating a new app token', name)
|
console.debug('creating a new app token', name)
|
||||||
|
|
||||||
const data = {
|
const data = {
|
||||||
name
|
name,
|
||||||
}
|
}
|
||||||
return axios.post(this.baseUrl, data)
|
return axios.post(this.baseUrl, data)
|
||||||
.then(resp => resp.data)
|
.then(resp => resp.data)
|
||||||
|
@ -172,8 +172,8 @@ export default {
|
||||||
console.error('could not wipe app token', err)
|
console.error('could not wipe app token', err)
|
||||||
OC.Notification.showTemporary(t('core', 'Error while wiping the device with the token'))
|
OC.Notification.showTemporary(t('core', 'Error while wiping the device with the token'))
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -83,13 +83,13 @@ import confirmPassword from 'nextcloud-password-confirmation'
|
||||||
export default {
|
export default {
|
||||||
name: 'AuthTokenSetupDialogue',
|
name: 'AuthTokenSetupDialogue',
|
||||||
components: {
|
components: {
|
||||||
QR
|
QR,
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
add: {
|
add: {
|
||||||
type: Function,
|
type: Function,
|
||||||
required: true
|
required: true,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -101,31 +101,31 @@ export default {
|
||||||
passwordCopied: false,
|
passwordCopied: false,
|
||||||
showQR: false,
|
showQR: false,
|
||||||
qrUrl: '',
|
qrUrl: '',
|
||||||
hoveringCopyButton: false
|
hoveringCopyButton: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
copyTooltipOptions() {
|
copyTooltipOptions() {
|
||||||
const base = {
|
const base = {
|
||||||
hideOnTargetClick: false,
|
hideOnTargetClick: false,
|
||||||
trigger: 'manual'
|
trigger: 'manual',
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.passwordCopied) {
|
if (this.passwordCopied) {
|
||||||
return {
|
return {
|
||||||
...base,
|
...base,
|
||||||
content: t('core', 'Copied!'),
|
content: t('core', 'Copied!'),
|
||||||
show: true
|
show: true,
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return {
|
return {
|
||||||
...base,
|
...base,
|
||||||
content: t('core', 'Copy'),
|
content: t('core', 'Copy'),
|
||||||
show: this.hoveringCopyButton
|
show: this.hoveringCopyButton,
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
selectInput(e) {
|
selectInput(e) {
|
||||||
e.currentTarget.select()
|
e.currentTarget.select()
|
||||||
|
@ -171,8 +171,8 @@ export default {
|
||||||
this.deviceName = ''
|
this.deviceName = ''
|
||||||
this.appPassword = ''
|
this.appPassword = ''
|
||||||
this.loginName = ''
|
this.loginName = ''
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
prefix(prefix, content) {
|
prefix(prefix, content) {
|
||||||
return prefix + '_' + content
|
return prefix + '_' + content
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -25,16 +25,16 @@ export default {
|
||||||
name: 'SvgFilterMixin',
|
name: 'SvgFilterMixin',
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
filterId: ''
|
filterId: '',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
filterUrl() {
|
filterUrl() {
|
||||||
return `url(#${this.filterId})`
|
return `url(#${this.filterId})`
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.filterId = 'invertIconApps' + Math.floor((Math.random() * 100)) + new Date().getSeconds() + new Date().getMilliseconds()
|
this.filterId = 'invertIconApps' + Math.floor((Math.random() * 100)) + new Date().getSeconds() + new Date().getMilliseconds()
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -242,11 +242,11 @@ import Vue from 'vue'
|
||||||
|
|
||||||
const unlimitedQuota = {
|
const unlimitedQuota = {
|
||||||
id: 'none',
|
id: 'none',
|
||||||
label: t('settings', 'Unlimited')
|
label: t('settings', 'Unlimited'),
|
||||||
}
|
}
|
||||||
const defaultQuota = {
|
const defaultQuota = {
|
||||||
id: 'default',
|
id: 'default',
|
||||||
label: t('settings', 'Default quota')
|
label: t('settings', 'Default quota'),
|
||||||
}
|
}
|
||||||
const newUser = {
|
const newUser = {
|
||||||
id: '',
|
id: '',
|
||||||
|
@ -258,8 +258,8 @@ const newUser = {
|
||||||
quota: defaultQuota,
|
quota: defaultQuota,
|
||||||
language: {
|
language: {
|
||||||
code: 'en',
|
code: 'en',
|
||||||
name: t('settings', 'Default language')
|
name: t('settings', 'Default language'),
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -267,25 +267,25 @@ export default {
|
||||||
components: {
|
components: {
|
||||||
userRow,
|
userRow,
|
||||||
Multiselect,
|
Multiselect,
|
||||||
InfiniteLoading
|
InfiniteLoading,
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
users: {
|
users: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: () => []
|
default: () => [],
|
||||||
},
|
},
|
||||||
showConfig: {
|
showConfig: {
|
||||||
type: Object,
|
type: Object,
|
||||||
required: true
|
required: true,
|
||||||
},
|
},
|
||||||
selectedGroup: {
|
selectedGroup: {
|
||||||
type: String,
|
type: String,
|
||||||
default: null
|
default: null,
|
||||||
},
|
},
|
||||||
externalActions: {
|
externalActions: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: () => []
|
default: () => [],
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -293,11 +293,11 @@ export default {
|
||||||
defaultQuota,
|
defaultQuota,
|
||||||
loading: {
|
loading: {
|
||||||
all: false,
|
all: false,
|
||||||
groups: false
|
groups: false,
|
||||||
},
|
},
|
||||||
scrolled: false,
|
scrolled: false,
|
||||||
searchQuery: '',
|
searchQuery: '',
|
||||||
newUser: Object.assign({}, newUser)
|
newUser: Object.assign({}, newUser),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -336,9 +336,9 @@ export default {
|
||||||
},
|
},
|
||||||
quotaOptions() {
|
quotaOptions() {
|
||||||
// convert the preset array into objects
|
// convert the preset array into objects
|
||||||
let quotaPreset = this.settings.quotaPreset.reduce((acc, cur) => acc.concat({
|
const quotaPreset = this.settings.quotaPreset.reduce((acc, cur) => acc.concat({
|
||||||
id: cur,
|
id: cur,
|
||||||
label: cur
|
label: cur,
|
||||||
}), [])
|
}), [])
|
||||||
// add default presets
|
// add default presets
|
||||||
quotaPreset.unshift(this.unlimitedQuota)
|
quotaPreset.unshift(this.unlimitedQuota)
|
||||||
|
@ -363,14 +363,14 @@ export default {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
label: t('settings', 'Common languages'),
|
label: t('settings', 'Common languages'),
|
||||||
languages: this.settings.languages.commonlanguages
|
languages: this.settings.languages.commonlanguages,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('settings', 'All languages'),
|
label: t('settings', 'All languages'),
|
||||||
languages: this.settings.languages.languages
|
languages: this.settings.languages.languages,
|
||||||
}
|
},
|
||||||
]
|
]
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
// watch url change and group select
|
// watch url change and group select
|
||||||
|
@ -394,7 +394,7 @@ export default {
|
||||||
} else if (val === 1 && old === 0) {
|
} else if (val === 1 && old === 0) {
|
||||||
this.$refs.infiniteLoading.stateChanger.loaded()
|
this.$refs.infiniteLoading.stateChanger.loaded()
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
if (!this.settings.canChangePassword) {
|
if (!this.settings.canChangePassword) {
|
||||||
|
@ -429,7 +429,7 @@ export default {
|
||||||
*/
|
*/
|
||||||
validateQuota(quota) {
|
validateQuota(quota) {
|
||||||
// only used for new presets sent through @Tag
|
// only used for new presets sent through @Tag
|
||||||
let validQuota = OC.Util.computerFileSize(quota)
|
const validQuota = OC.Util.computerFileSize(quota)
|
||||||
if (validQuota !== null && validQuota >= 0) {
|
if (validQuota !== null && validQuota >= 0) {
|
||||||
// unify format output
|
// unify format output
|
||||||
quota = OC.Util.humanFileSize(OC.Util.computerFileSize(quota))
|
quota = OC.Util.humanFileSize(OC.Util.computerFileSize(quota))
|
||||||
|
@ -446,7 +446,7 @@ export default {
|
||||||
offset: this.usersOffset,
|
offset: this.usersOffset,
|
||||||
limit: this.usersLimit,
|
limit: this.usersLimit,
|
||||||
group: this.selectedGroup !== 'disabled' ? this.selectedGroup : '',
|
group: this.selectedGroup !== 'disabled' ? this.selectedGroup : '',
|
||||||
search: this.searchQuery
|
search: this.searchQuery,
|
||||||
})
|
})
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
response ? $state.loaded() : $state.complete()
|
response ? $state.loaded() : $state.complete()
|
||||||
|
@ -494,7 +494,7 @@ export default {
|
||||||
groups: this.newUser.groups.map(group => group.id),
|
groups: this.newUser.groups.map(group => group.id),
|
||||||
subadmin: this.newUser.subAdminsGroups.map(group => group.id),
|
subadmin: this.newUser.subAdminsGroups.map(group => group.id),
|
||||||
quota: this.newUser.quota.id,
|
quota: this.newUser.quota.id,
|
||||||
language: this.newUser.language.code
|
language: this.newUser.language.code,
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.resetForm()
|
this.resetForm()
|
||||||
|
@ -517,7 +517,7 @@ export default {
|
||||||
setNewUserDefaultGroup(value) {
|
setNewUserDefaultGroup(value) {
|
||||||
if (value && value.length > 0) {
|
if (value && value.length > 0) {
|
||||||
// setting new user default group to the current selected one
|
// setting new user default group to the current selected one
|
||||||
let currentGroup = this.groups.find(group => group.id === value)
|
const currentGroup = this.groups.find(group => group.id === value)
|
||||||
if (currentGroup) {
|
if (currentGroup) {
|
||||||
this.newUser.groups = [currentGroup]
|
this.newUser.groups = [currentGroup]
|
||||||
return
|
return
|
||||||
|
@ -560,7 +560,7 @@ export default {
|
||||||
this.$router.push({ name: 'users' })
|
this.$router.push({ name: 'users' })
|
||||||
this.$refs.infiniteLoading.stateChanger.reset()
|
this.$refs.infiniteLoading.stateChanger.reset()
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -241,7 +241,7 @@ import {
|
||||||
PopoverMenu,
|
PopoverMenu,
|
||||||
Multiselect,
|
Multiselect,
|
||||||
Actions,
|
Actions,
|
||||||
ActionButton
|
ActionButton,
|
||||||
} from 'nextcloud-vue'
|
} from 'nextcloud-vue'
|
||||||
import UserRowSimple from './UserRowSimple'
|
import UserRowSimple from './UserRowSimple'
|
||||||
import UserRowMixin from '../../mixins/UserRowMixin'
|
import UserRowMixin from '../../mixins/UserRowMixin'
|
||||||
|
@ -255,45 +255,45 @@ export default {
|
||||||
PopoverMenu,
|
PopoverMenu,
|
||||||
Actions,
|
Actions,
|
||||||
ActionButton,
|
ActionButton,
|
||||||
Multiselect
|
Multiselect,
|
||||||
},
|
},
|
||||||
directives: {
|
directives: {
|
||||||
ClickOutside
|
ClickOutside,
|
||||||
},
|
},
|
||||||
mixins: [UserRowMixin],
|
mixins: [UserRowMixin],
|
||||||
props: {
|
props: {
|
||||||
user: {
|
user: {
|
||||||
type: Object,
|
type: Object,
|
||||||
required: true
|
required: true,
|
||||||
},
|
},
|
||||||
settings: {
|
settings: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => ({})
|
default: () => ({}),
|
||||||
},
|
},
|
||||||
groups: {
|
groups: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: () => []
|
default: () => [],
|
||||||
},
|
},
|
||||||
subAdminsGroups: {
|
subAdminsGroups: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: () => []
|
default: () => [],
|
||||||
},
|
},
|
||||||
quotaOptions: {
|
quotaOptions: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: () => []
|
default: () => [],
|
||||||
},
|
},
|
||||||
showConfig: {
|
showConfig: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => ({})
|
default: () => ({}),
|
||||||
},
|
},
|
||||||
languages: {
|
languages: {
|
||||||
type: Array,
|
type: Array,
|
||||||
required: true
|
required: true,
|
||||||
},
|
},
|
||||||
externalActions: {
|
externalActions: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: () => []
|
default: () => [],
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -312,39 +312,39 @@ export default {
|
||||||
delete: false,
|
delete: false,
|
||||||
disable: false,
|
disable: false,
|
||||||
languages: false,
|
languages: false,
|
||||||
wipe: false
|
wipe: false,
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
/* USER POPOVERMENU ACTIONS */
|
/* USER POPOVERMENU ACTIONS */
|
||||||
userActions() {
|
userActions() {
|
||||||
let actions = [
|
const actions = [
|
||||||
{
|
{
|
||||||
icon: 'icon-delete',
|
icon: 'icon-delete',
|
||||||
text: t('settings', 'Delete user'),
|
text: t('settings', 'Delete user'),
|
||||||
action: this.deleteUser
|
action: this.deleteUser,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon: 'icon-delete',
|
icon: 'icon-delete',
|
||||||
text: t('settings', 'Wipe all devices'),
|
text: t('settings', 'Wipe all devices'),
|
||||||
action: this.wipeUserDevices
|
action: this.wipeUserDevices,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon: this.user.enabled ? 'icon-close' : 'icon-add',
|
icon: this.user.enabled ? 'icon-close' : 'icon-add',
|
||||||
text: this.user.enabled ? t('settings', 'Disable user') : t('settings', 'Enable user'),
|
text: this.user.enabled ? t('settings', 'Disable user') : t('settings', 'Enable user'),
|
||||||
action: this.enableDisableUser
|
action: this.enableDisableUser,
|
||||||
}
|
},
|
||||||
]
|
]
|
||||||
if (this.user.email !== null && this.user.email !== '') {
|
if (this.user.email !== null && this.user.email !== '') {
|
||||||
actions.push({
|
actions.push({
|
||||||
icon: 'icon-mail',
|
icon: 'icon-mail',
|
||||||
text: t('settings', 'Resend welcome email'),
|
text: t('settings', 'Resend welcome email'),
|
||||||
action: this.sendWelcomeMail
|
action: this.sendWelcomeMail,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
return actions.concat(this.externalActions)
|
return actions.concat(this.externalActions)
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -357,7 +357,7 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
wipeUserDevices() {
|
wipeUserDevices() {
|
||||||
let userid = this.user.id
|
const userid = this.user.id
|
||||||
OC.dialogs.confirmDestructive(
|
OC.dialogs.confirmDestructive(
|
||||||
t('settings', 'In case of lost device or exiting the organization, this can remotely wipe the Nextcloud data from all devices associated with {userid}. Only works if the devices are connected to the internet.', { userid: userid }),
|
t('settings', 'In case of lost device or exiting the organization, this can remotely wipe the Nextcloud data from all devices associated with {userid}. Only works if the devices are connected to the internet.', { userid: userid }),
|
||||||
t('settings', 'Remote wipe of devices'),
|
t('settings', 'Remote wipe of devices'),
|
||||||
|
@ -365,7 +365,7 @@ export default {
|
||||||
type: OC.dialogs.YES_NO_BUTTONS,
|
type: OC.dialogs.YES_NO_BUTTONS,
|
||||||
confirm: t('settings', 'Wipe {userid}\'s devices', { userid: userid }),
|
confirm: t('settings', 'Wipe {userid}\'s devices', { userid: userid }),
|
||||||
confirmClasses: 'error',
|
confirmClasses: 'error',
|
||||||
cancel: t('settings', 'Cancel')
|
cancel: t('settings', 'Cancel'),
|
||||||
},
|
},
|
||||||
(result) => {
|
(result) => {
|
||||||
if (result) {
|
if (result) {
|
||||||
|
@ -383,7 +383,7 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
deleteUser() {
|
deleteUser() {
|
||||||
let userid = this.user.id
|
const userid = this.user.id
|
||||||
OC.dialogs.confirmDestructive(
|
OC.dialogs.confirmDestructive(
|
||||||
t('settings', 'Fully delete {userid}\'s account including all their personal files, app data, etc.', { userid: userid }),
|
t('settings', 'Fully delete {userid}\'s account including all their personal files, app data, etc.', { userid: userid }),
|
||||||
t('settings', 'Account deletion'),
|
t('settings', 'Account deletion'),
|
||||||
|
@ -391,7 +391,7 @@ export default {
|
||||||
type: OC.dialogs.YES_NO_BUTTONS,
|
type: OC.dialogs.YES_NO_BUTTONS,
|
||||||
confirm: t('settings', 'Delete {userid}\'s account', { userid: userid }),
|
confirm: t('settings', 'Delete {userid}\'s account', { userid: userid }),
|
||||||
confirmClasses: 'error',
|
confirmClasses: 'error',
|
||||||
cancel: t('settings', 'Cancel')
|
cancel: t('settings', 'Cancel'),
|
||||||
},
|
},
|
||||||
(result) => {
|
(result) => {
|
||||||
if (result) {
|
if (result) {
|
||||||
|
@ -411,11 +411,11 @@ export default {
|
||||||
enableDisableUser() {
|
enableDisableUser() {
|
||||||
this.loading.delete = true
|
this.loading.delete = true
|
||||||
this.loading.all = true
|
this.loading.all = true
|
||||||
let userid = this.user.id
|
const userid = this.user.id
|
||||||
let enabled = !this.user.enabled
|
const enabled = !this.user.enabled
|
||||||
return this.$store.dispatch('enableDisableUser', {
|
return this.$store.dispatch('enableDisableUser', {
|
||||||
userid,
|
userid,
|
||||||
enabled
|
enabled,
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.loading.delete = false
|
this.loading.delete = false
|
||||||
|
@ -429,12 +429,12 @@ export default {
|
||||||
* @param {string} displayName The display name
|
* @param {string} displayName The display name
|
||||||
*/
|
*/
|
||||||
updateDisplayName() {
|
updateDisplayName() {
|
||||||
let displayName = this.$refs.displayName.value
|
const displayName = this.$refs.displayName.value
|
||||||
this.loading.displayName = true
|
this.loading.displayName = true
|
||||||
this.$store.dispatch('setUserData', {
|
this.$store.dispatch('setUserData', {
|
||||||
userid: this.user.id,
|
userid: this.user.id,
|
||||||
key: 'displayname',
|
key: 'displayname',
|
||||||
value: displayName
|
value: displayName,
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.loading.displayName = false
|
this.loading.displayName = false
|
||||||
this.$refs.displayName.value = displayName
|
this.$refs.displayName.value = displayName
|
||||||
|
@ -447,12 +447,12 @@ export default {
|
||||||
* @param {string} password The email adress
|
* @param {string} password The email adress
|
||||||
*/
|
*/
|
||||||
updatePassword() {
|
updatePassword() {
|
||||||
let password = this.$refs.password.value
|
const password = this.$refs.password.value
|
||||||
this.loading.password = true
|
this.loading.password = true
|
||||||
this.$store.dispatch('setUserData', {
|
this.$store.dispatch('setUserData', {
|
||||||
userid: this.user.id,
|
userid: this.user.id,
|
||||||
key: 'password',
|
key: 'password',
|
||||||
value: password
|
value: password,
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.loading.password = false
|
this.loading.password = false
|
||||||
this.$refs.password.value = '' // empty & show placeholder
|
this.$refs.password.value = '' // empty & show placeholder
|
||||||
|
@ -465,12 +465,12 @@ export default {
|
||||||
* @param {string} mailAddress The email adress
|
* @param {string} mailAddress The email adress
|
||||||
*/
|
*/
|
||||||
updateEmail() {
|
updateEmail() {
|
||||||
let mailAddress = this.$refs.mailAddress.value
|
const mailAddress = this.$refs.mailAddress.value
|
||||||
this.loading.mailAddress = true
|
this.loading.mailAddress = true
|
||||||
this.$store.dispatch('setUserData', {
|
this.$store.dispatch('setUserData', {
|
||||||
userid: this.user.id,
|
userid: this.user.id,
|
||||||
key: 'email',
|
key: 'email',
|
||||||
value: mailAddress
|
value: mailAddress,
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.loading.mailAddress = false
|
this.loading.mailAddress = false
|
||||||
this.$refs.mailAddress.value = mailAddress
|
this.$refs.mailAddress.value = mailAddress
|
||||||
|
@ -486,7 +486,7 @@ export default {
|
||||||
this.loading = { groups: true, subadmins: true }
|
this.loading = { groups: true, subadmins: true }
|
||||||
try {
|
try {
|
||||||
await this.$store.dispatch('addGroup', gid)
|
await this.$store.dispatch('addGroup', gid)
|
||||||
let userid = this.user.id
|
const userid = this.user.id
|
||||||
await this.$store.dispatch('addUserGroup', { userid, gid })
|
await this.$store.dispatch('addUserGroup', { userid, gid })
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
|
@ -506,8 +506,8 @@ export default {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
this.loading.groups = true
|
this.loading.groups = true
|
||||||
let userid = this.user.id
|
const userid = this.user.id
|
||||||
let gid = group.id
|
const gid = group.id
|
||||||
try {
|
try {
|
||||||
await this.$store.dispatch('addUserGroup', { userid, gid })
|
await this.$store.dispatch('addUserGroup', { userid, gid })
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
@ -528,13 +528,13 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.loading.groups = true
|
this.loading.groups = true
|
||||||
let userid = this.user.id
|
const userid = this.user.id
|
||||||
let gid = group.id
|
const gid = group.id
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await this.$store.dispatch('removeUserGroup', {
|
await this.$store.dispatch('removeUserGroup', {
|
||||||
userid,
|
userid,
|
||||||
gid
|
gid,
|
||||||
})
|
})
|
||||||
this.loading.groups = false
|
this.loading.groups = false
|
||||||
// remove user from current list if current list is the removed group
|
// remove user from current list if current list is the removed group
|
||||||
|
@ -553,13 +553,13 @@ export default {
|
||||||
*/
|
*/
|
||||||
async addUserSubAdmin(group) {
|
async addUserSubAdmin(group) {
|
||||||
this.loading.subadmins = true
|
this.loading.subadmins = true
|
||||||
let userid = this.user.id
|
const userid = this.user.id
|
||||||
let gid = group.id
|
const gid = group.id
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await this.$store.dispatch('addUserSubAdmin', {
|
await this.$store.dispatch('addUserSubAdmin', {
|
||||||
userid,
|
userid,
|
||||||
gid
|
gid,
|
||||||
})
|
})
|
||||||
this.loading.subadmins = false
|
this.loading.subadmins = false
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
@ -574,13 +574,13 @@ export default {
|
||||||
*/
|
*/
|
||||||
async removeUserSubAdmin(group) {
|
async removeUserSubAdmin(group) {
|
||||||
this.loading.subadmins = true
|
this.loading.subadmins = true
|
||||||
let userid = this.user.id
|
const userid = this.user.id
|
||||||
let gid = group.id
|
const gid = group.id
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await this.$store.dispatch('removeUserSubAdmin', {
|
await this.$store.dispatch('removeUserSubAdmin', {
|
||||||
userid,
|
userid,
|
||||||
gid
|
gid,
|
||||||
})
|
})
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
|
@ -604,7 +604,7 @@ export default {
|
||||||
await this.$store.dispatch('setUserData', {
|
await this.$store.dispatch('setUserData', {
|
||||||
userid: this.user.id,
|
userid: this.user.id,
|
||||||
key: 'quota',
|
key: 'quota',
|
||||||
value: quota
|
value: quota,
|
||||||
})
|
})
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
|
@ -622,7 +622,7 @@ export default {
|
||||||
*/
|
*/
|
||||||
validateQuota(quota) {
|
validateQuota(quota) {
|
||||||
// only used for new presets sent through @Tag
|
// only used for new presets sent through @Tag
|
||||||
let validQuota = OC.Util.computerFileSize(quota)
|
const validQuota = OC.Util.computerFileSize(quota)
|
||||||
if (validQuota !== null && validQuota >= 0) {
|
if (validQuota !== null && validQuota >= 0) {
|
||||||
// unify format output
|
// unify format output
|
||||||
return this.setUserQuota(OC.Util.humanFileSize(OC.Util.computerFileSize(quota)))
|
return this.setUserQuota(OC.Util.humanFileSize(OC.Util.computerFileSize(quota)))
|
||||||
|
@ -644,7 +644,7 @@ export default {
|
||||||
await this.$store.dispatch('setUserData', {
|
await this.$store.dispatch('setUserData', {
|
||||||
userid: this.user.id,
|
userid: this.user.id,
|
||||||
key: 'language',
|
key: 'language',
|
||||||
value: lang.code
|
value: lang.code,
|
||||||
})
|
})
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
|
@ -670,8 +670,8 @@ export default {
|
||||||
}
|
}
|
||||||
this.loading.all = false
|
this.loading.all = false
|
||||||
})
|
})
|
||||||
}
|
},
|
||||||
|
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -81,45 +81,45 @@ export default {
|
||||||
components: {
|
components: {
|
||||||
PopoverMenu,
|
PopoverMenu,
|
||||||
ActionButton,
|
ActionButton,
|
||||||
Actions
|
Actions,
|
||||||
},
|
},
|
||||||
directives: {
|
directives: {
|
||||||
ClickOutside
|
ClickOutside,
|
||||||
},
|
},
|
||||||
mixins: [UserRowMixin],
|
mixins: [UserRowMixin],
|
||||||
props: {
|
props: {
|
||||||
user: {
|
user: {
|
||||||
type: Object,
|
type: Object,
|
||||||
required: true
|
required: true,
|
||||||
},
|
},
|
||||||
loading: {
|
loading: {
|
||||||
type: Object,
|
type: Object,
|
||||||
required: true
|
required: true,
|
||||||
},
|
},
|
||||||
showConfig: {
|
showConfig: {
|
||||||
type: Object,
|
type: Object,
|
||||||
required: true
|
required: true,
|
||||||
},
|
},
|
||||||
userActions: {
|
userActions: {
|
||||||
type: Array,
|
type: Array,
|
||||||
required: true
|
required: true,
|
||||||
},
|
},
|
||||||
openedMenu: {
|
openedMenu: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
required: true
|
required: true,
|
||||||
},
|
},
|
||||||
feedbackMessage: {
|
feedbackMessage: {
|
||||||
type: String,
|
type: String,
|
||||||
required: true
|
required: true,
|
||||||
},
|
},
|
||||||
subAdminsGroups: {
|
subAdminsGroups: {
|
||||||
type: Array,
|
type: Array,
|
||||||
required: true
|
required: true,
|
||||||
},
|
},
|
||||||
settings: {
|
settings: {
|
||||||
type: Object,
|
type: Object,
|
||||||
required: true
|
required: true,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
userGroupsLabels() {
|
userGroupsLabels() {
|
||||||
|
@ -140,7 +140,7 @@ export default {
|
||||||
},
|
},
|
||||||
canEdit() {
|
canEdit() {
|
||||||
return getCurrentUser().uid !== this.user.id && this.user.id !== 'admin'
|
return getCurrentUser().uid !== this.user.id && this.user.id !== 'admin'
|
||||||
}
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -149,8 +149,8 @@ export default {
|
||||||
},
|
},
|
||||||
toggleEdit() {
|
toggleEdit() {
|
||||||
this.$emit('update:editing', true)
|
this.$emit('update:editing', true)
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -19,5 +19,5 @@ store.replaceState(
|
||||||
|
|
||||||
const View = Vue.extend(AdminTwoFactor)
|
const View = Vue.extend(AdminTwoFactor)
|
||||||
new View({
|
new View({
|
||||||
store
|
store,
|
||||||
}).$mount('#two-factor-auth-settings')
|
}).$mount('#two-factor-auth-settings')
|
||||||
|
|
|
@ -52,7 +52,7 @@ Vue.prototype.oc_userconfig = oc_userconfig
|
||||||
const app = new Vue({
|
const app = new Vue({
|
||||||
router,
|
router,
|
||||||
store,
|
store,
|
||||||
render: h => h(App)
|
render: h => h(App),
|
||||||
}).$mount('#content')
|
}).$mount('#content')
|
||||||
|
|
||||||
export { app, router, store }
|
export { app, router, store }
|
||||||
|
|
|
@ -37,6 +37,6 @@ const View = Vue.extend(AuthTokenSection)
|
||||||
new View({
|
new View({
|
||||||
propsData: {
|
propsData: {
|
||||||
tokens: loadState('settings', 'app_tokens'),
|
tokens: loadState('settings', 'app_tokens'),
|
||||||
canCreateToken: loadState('settings', 'can_create_app_token')
|
canCreateToken: loadState('settings', 'can_create_app_token'),
|
||||||
}
|
},
|
||||||
}).$mount('#security-authtokens')
|
}).$mount('#security-authtokens')
|
||||||
|
|
|
@ -24,36 +24,36 @@ export default {
|
||||||
props: {
|
props: {
|
||||||
user: {
|
user: {
|
||||||
type: Object,
|
type: Object,
|
||||||
required: true
|
required: true,
|
||||||
},
|
},
|
||||||
settings: {
|
settings: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => ({})
|
default: () => ({}),
|
||||||
},
|
},
|
||||||
groups: {
|
groups: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: () => []
|
default: () => [],
|
||||||
},
|
},
|
||||||
subAdminsGroups: {
|
subAdminsGroups: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: () => []
|
default: () => [],
|
||||||
},
|
},
|
||||||
quotaOptions: {
|
quotaOptions: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: () => []
|
default: () => [],
|
||||||
},
|
},
|
||||||
showConfig: {
|
showConfig: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => ({})
|
default: () => ({}),
|
||||||
},
|
},
|
||||||
languages: {
|
languages: {
|
||||||
type: Array,
|
type: Array,
|
||||||
required: true
|
required: true,
|
||||||
},
|
},
|
||||||
externalActions: {
|
externalActions: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: () => []
|
default: () => [],
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
/* GROUPS MANAGEMENT */
|
/* GROUPS MANAGEMENT */
|
||||||
|
@ -69,7 +69,7 @@ export default {
|
||||||
return this.groups.map((group) => {
|
return this.groups.map((group) => {
|
||||||
// clone object because we don't want
|
// clone object because we don't want
|
||||||
// to edit the original groups
|
// to edit the original groups
|
||||||
let groupClone = Object.assign({}, group)
|
const groupClone = Object.assign({}, group)
|
||||||
|
|
||||||
// two settings here:
|
// two settings here:
|
||||||
// 1. user NOT in group but no permission to add
|
// 1. user NOT in group but no permission to add
|
||||||
|
@ -95,7 +95,7 @@ export default {
|
||||||
if (quota > 0) {
|
if (quota > 0) {
|
||||||
quota = Math.min(100, Math.round(this.user.quota.used / quota * 100))
|
quota = Math.min(100, Math.round(this.user.quota.used / quota * 100))
|
||||||
} else {
|
} else {
|
||||||
var usedInGB = this.user.quota.used / (10 * Math.pow(2, 30))
|
const usedInGB = this.user.quota.used / (10 * Math.pow(2, 30))
|
||||||
// asymptotic curve approaching 50% at 10GB to visualize used stace with infinite quota
|
// asymptotic curve approaching 50% at 10GB to visualize used stace with infinite quota
|
||||||
quota = 95 * (1 - (1 / (usedInGB + 1)))
|
quota = 95 * (1 - (1 / (usedInGB + 1)))
|
||||||
}
|
}
|
||||||
|
@ -105,8 +105,8 @@ export default {
|
||||||
userQuota() {
|
userQuota() {
|
||||||
if (this.user.quota.quota >= 0) {
|
if (this.user.quota.quota >= 0) {
|
||||||
// if value is valid, let's map the quotaOptions or return custom quota
|
// if value is valid, let's map the quotaOptions or return custom quota
|
||||||
let humanQuota = OC.Util.humanFileSize(this.user.quota.quota)
|
const humanQuota = OC.Util.humanFileSize(this.user.quota.quota)
|
||||||
let userQuota = this.quotaOptions.find(quota => quota.id === humanQuota)
|
const userQuota = this.quotaOptions.find(quota => quota.id === humanQuota)
|
||||||
return userQuota || { id: humanQuota, label: humanQuota }
|
return userQuota || { id: humanQuota, label: humanQuota }
|
||||||
} else if (this.user.quota.quota === 'default') {
|
} else if (this.user.quota.quota === 'default') {
|
||||||
// default quota is replaced by the proper value on load
|
// default quota is replaced by the proper value on load
|
||||||
|
@ -122,12 +122,12 @@ export default {
|
||||||
|
|
||||||
/* LANGUAGE */
|
/* LANGUAGE */
|
||||||
userLanguage() {
|
userLanguage() {
|
||||||
let availableLanguages = this.languages[0].languages.concat(this.languages[1].languages)
|
const availableLanguages = this.languages[0].languages.concat(this.languages[1].languages)
|
||||||
let userLang = availableLanguages.find(lang => lang.code === this.user.language)
|
const userLang = availableLanguages.find(lang => lang.code === this.user.language)
|
||||||
if (typeof userLang !== 'object' && this.user.language !== '') {
|
if (typeof userLang !== 'object' && this.user.language !== '') {
|
||||||
return {
|
return {
|
||||||
code: this.user.language,
|
code: this.user.language,
|
||||||
name: this.user.language
|
name: this.user.language,
|
||||||
}
|
}
|
||||||
} else if (this.user.language === '') {
|
} else if (this.user.language === '') {
|
||||||
return false
|
return false
|
||||||
|
@ -147,7 +147,7 @@ export default {
|
||||||
return OC.Util.relativeModifiedDate(this.user.lastLogin)
|
return OC.Util.relativeModifiedDate(this.user.lastLogin)
|
||||||
}
|
}
|
||||||
return t('settings', 'Never')
|
return t('settings', 'Never')
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/**
|
/**
|
||||||
|
@ -163,9 +163,9 @@ export default {
|
||||||
{
|
{
|
||||||
user: user,
|
user: user,
|
||||||
size: size,
|
size: size,
|
||||||
version: oc_userconfig.avatar.version
|
version: oc_userconfig.avatar.version,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,9 +55,9 @@ export default new Router({
|
||||||
{
|
{
|
||||||
path: ':selectedGroup(.*)',
|
path: ':selectedGroup(.*)',
|
||||||
name: 'group',
|
name: 'group',
|
||||||
component: Users
|
component: Users,
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/:index(index.php/)?settings/apps',
|
path: '/:index(index.php/)?settings/apps',
|
||||||
|
@ -73,11 +73,11 @@ export default new Router({
|
||||||
{
|
{
|
||||||
path: ':id',
|
path: ':id',
|
||||||
name: 'apps-details',
|
name: 'apps-details',
|
||||||
component: Apps
|
component: Apps,
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
})
|
})
|
||||||
|
|
|
@ -27,7 +27,7 @@ Vue.use(Vuex)
|
||||||
const state = {
|
const state = {
|
||||||
enforced: false,
|
enforced: false,
|
||||||
enforcedGroups: [],
|
enforcedGroups: [],
|
||||||
excludedGroups: []
|
excludedGroups: [],
|
||||||
}
|
}
|
||||||
|
|
||||||
const mutations = {
|
const mutations = {
|
||||||
|
@ -39,11 +39,11 @@ const mutations = {
|
||||||
},
|
},
|
||||||
setExcludedGroups(state, used) {
|
setExcludedGroups(state, used) {
|
||||||
Vue.set(state, 'excludedGroups', used)
|
Vue.set(state, 'excludedGroups', used)
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
export default new Vuex.Store({
|
export default new Vuex.Store({
|
||||||
strict: process.env.NODE_ENV !== 'production',
|
strict: process.env.NODE_ENV !== 'production',
|
||||||
state,
|
state,
|
||||||
mutations
|
mutations,
|
||||||
})
|
})
|
||||||
|
|
|
@ -77,5 +77,5 @@ export default {
|
||||||
},
|
},
|
||||||
delete(url, data) {
|
delete(url, data) {
|
||||||
return axios.delete(sanitize(url), { data: data })
|
return axios.delete(sanitize(url), { data: data })
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ const state = {
|
||||||
categories: [],
|
categories: [],
|
||||||
updateCount: 0,
|
updateCount: 0,
|
||||||
loading: {},
|
loading: {},
|
||||||
loadingList: false
|
loadingList: false,
|
||||||
}
|
}
|
||||||
|
|
||||||
const mutations = {
|
const mutations = {
|
||||||
|
@ -65,24 +65,24 @@ const mutations = {
|
||||||
appId = [appId]
|
appId = [appId]
|
||||||
}
|
}
|
||||||
appId.forEach((_id) => {
|
appId.forEach((_id) => {
|
||||||
let app = state.apps.find(app => app.id === _id)
|
const app = state.apps.find(app => app.id === _id)
|
||||||
app.error = error
|
app.error = error
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
clearError(state, { appId, error }) {
|
clearError(state, { appId, error }) {
|
||||||
let app = state.apps.find(app => app.id === appId)
|
const app = state.apps.find(app => app.id === appId)
|
||||||
app.error = null
|
app.error = null
|
||||||
},
|
},
|
||||||
|
|
||||||
enableApp(state, { appId, groups }) {
|
enableApp(state, { appId, groups }) {
|
||||||
let app = state.apps.find(app => app.id === appId)
|
const app = state.apps.find(app => app.id === appId)
|
||||||
app.active = true
|
app.active = true
|
||||||
app.groups = groups
|
app.groups = groups
|
||||||
},
|
},
|
||||||
|
|
||||||
disableApp(state, appId) {
|
disableApp(state, appId) {
|
||||||
let app = state.apps.find(app => app.id === appId)
|
const app = state.apps.find(app => app.id === appId)
|
||||||
app.active = false
|
app.active = false
|
||||||
app.groups = []
|
app.groups = []
|
||||||
if (app.removable) {
|
if (app.removable) {
|
||||||
|
@ -100,8 +100,8 @@ const mutations = {
|
||||||
},
|
},
|
||||||
|
|
||||||
updateApp(state, appId) {
|
updateApp(state, appId) {
|
||||||
let app = state.apps.find(app => app.id === appId)
|
const app = state.apps.find(app => app.id === appId)
|
||||||
let version = app.update
|
const version = app.update
|
||||||
app.update = null
|
app.update = null
|
||||||
app.version = version
|
app.version = version
|
||||||
state.updateCount--
|
state.updateCount--
|
||||||
|
@ -133,7 +133,7 @@ const mutations = {
|
||||||
} else {
|
} else {
|
||||||
Vue.set(state.loading, id, false)
|
Vue.set(state.loading, id, false)
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
const getters = {
|
const getters = {
|
||||||
|
@ -150,7 +150,7 @@ const getters = {
|
||||||
},
|
},
|
||||||
getUpdateCount(state) {
|
getUpdateCount(state) {
|
||||||
return state.updateCount
|
return state.updateCount
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
const actions = {
|
const actions = {
|
||||||
|
@ -197,7 +197,7 @@ const actions = {
|
||||||
if (!Array.isArray(appId)) {
|
if (!Array.isArray(appId)) {
|
||||||
context.commit('setError', {
|
context.commit('setError', {
|
||||||
appId: apps,
|
appId: apps,
|
||||||
error: t('settings', 'Error: This app can not be enabled because it makes the server unstable')
|
error: t('settings', 'Error: This app can not be enabled because it makes the server unstable'),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -207,7 +207,7 @@ const actions = {
|
||||||
context.commit('stopLoading', 'install')
|
context.commit('stopLoading', 'install')
|
||||||
context.commit('setError', {
|
context.commit('setError', {
|
||||||
appId: apps,
|
appId: apps,
|
||||||
error: error.response.data.data.message
|
error: error.response.data.data.message,
|
||||||
})
|
})
|
||||||
context.commit('APPS_API_FAILURE', { appId, error })
|
context.commit('APPS_API_FAILURE', { appId, error })
|
||||||
})
|
})
|
||||||
|
@ -233,7 +233,7 @@ const actions = {
|
||||||
context.commit('stopLoading', 'install')
|
context.commit('stopLoading', 'install')
|
||||||
context.commit('setError', {
|
context.commit('setError', {
|
||||||
appId: apps,
|
appId: apps,
|
||||||
error: error.response.data.data.message
|
error: error.response.data.data.message,
|
||||||
})
|
})
|
||||||
context.commit('APPS_API_FAILURE', { appId, error })
|
context.commit('APPS_API_FAILURE', { appId, error })
|
||||||
})
|
})
|
||||||
|
@ -320,7 +320,7 @@ const actions = {
|
||||||
return false
|
return false
|
||||||
})
|
})
|
||||||
.catch((error) => context.commit('API_FAILURE', error))
|
.catch((error) => context.commit('API_FAILURE', error))
|
||||||
}
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,13 +35,13 @@ const debug = process.env.NODE_ENV !== 'production'
|
||||||
const mutations = {
|
const mutations = {
|
||||||
API_FAILURE(state, error) {
|
API_FAILURE(state, error) {
|
||||||
try {
|
try {
|
||||||
let message = error.error.response.data.ocs.meta.message
|
const message = error.error.response.data.ocs.meta.message
|
||||||
OC.Notification.showHtml(t('settings', 'An error occured during the request. Unable to proceed.') + '<br>' + message, { timeout: 7 })
|
OC.Notification.showHtml(t('settings', 'An error occured during the request. Unable to proceed.') + '<br>' + message, { timeout: 7 })
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
OC.Notification.showTemporary(t('settings', 'An error occured during the request. Unable to proceed.'))
|
OC.Notification.showTemporary(t('settings', 'An error occured during the request. Unable to proceed.'))
|
||||||
}
|
}
|
||||||
console.error(state, error)
|
console.error(state, error)
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
export default new Vuex.Store({
|
export default new Vuex.Store({
|
||||||
|
@ -49,9 +49,9 @@ export default new Vuex.Store({
|
||||||
users,
|
users,
|
||||||
apps,
|
apps,
|
||||||
settings,
|
settings,
|
||||||
oc
|
oc,
|
||||||
},
|
},
|
||||||
strict: debug,
|
strict: debug,
|
||||||
|
|
||||||
mutations
|
mutations,
|
||||||
})
|
})
|
||||||
|
|
|
@ -41,7 +41,7 @@ const actions = {
|
||||||
return api.post(OC.linkToOCS(`apps/provisioning_api/api/v1/config/apps/${app}/${key}`, 2), { value: value })
|
return api.post(OC.linkToOCS(`apps/provisioning_api/api/v1/config/apps/${app}/${key}`, 2), { value: value })
|
||||||
.catch((error) => { throw error })
|
.catch((error) => { throw error })
|
||||||
}).catch((error) => context.commit('API_FAILURE', { app, key, value, error }))
|
}).catch((error) => context.commit('API_FAILURE', { app, key, value, error }))
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
export default { state, mutations, getters, actions }
|
export default { state, mutations, getters, actions }
|
||||||
|
|
|
@ -21,17 +21,17 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const state = {
|
const state = {
|
||||||
serverData: {}
|
serverData: {},
|
||||||
}
|
}
|
||||||
const mutations = {
|
const mutations = {
|
||||||
setServerData(state, data) {
|
setServerData(state, data) {
|
||||||
state.serverData = data
|
state.serverData = data
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
const getters = {
|
const getters = {
|
||||||
getServerData(state) {
|
getServerData(state) {
|
||||||
return state.serverData
|
return state.serverData
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
const actions = {}
|
const actions = {}
|
||||||
|
|
||||||
|
|
|
@ -41,8 +41,8 @@ const defaults = {
|
||||||
usercount: 0,
|
usercount: 0,
|
||||||
disabled: 0,
|
disabled: 0,
|
||||||
canAdd: true,
|
canAdd: true,
|
||||||
canRemove: true
|
canRemove: true,
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
const state = {
|
const state = {
|
||||||
|
@ -52,13 +52,13 @@ const state = {
|
||||||
minPasswordLength: 0,
|
minPasswordLength: 0,
|
||||||
usersOffset: 0,
|
usersOffset: 0,
|
||||||
usersLimit: 25,
|
usersLimit: 25,
|
||||||
userCount: 0
|
userCount: 0,
|
||||||
}
|
}
|
||||||
|
|
||||||
const mutations = {
|
const mutations = {
|
||||||
appendUsers(state, usersObj) {
|
appendUsers(state, usersObj) {
|
||||||
// convert obj to array
|
// convert obj to array
|
||||||
let users = state.users.concat(Object.keys(usersObj).map(userid => usersObj[userid]))
|
const users = state.users.concat(Object.keys(usersObj).map(userid => usersObj[userid]))
|
||||||
state.usersOffset += state.usersLimit
|
state.usersOffset += state.usersLimit
|
||||||
state.users = users
|
state.users = users
|
||||||
},
|
},
|
||||||
|
@ -78,9 +78,9 @@ const mutations = {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// extend group to default values
|
// extend group to default values
|
||||||
let group = Object.assign({}, defaults.group, {
|
const group = Object.assign({}, defaults.group, {
|
||||||
id: gid,
|
id: gid,
|
||||||
name: displayName
|
name: displayName,
|
||||||
})
|
})
|
||||||
state.groups.push(group)
|
state.groups.push(group)
|
||||||
state.groups = orderGroups(state.groups, state.orderBy)
|
state.groups = orderGroups(state.groups, state.orderBy)
|
||||||
|
@ -89,50 +89,50 @@ const mutations = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
removeGroup(state, gid) {
|
removeGroup(state, gid) {
|
||||||
let groupIndex = state.groups.findIndex(groupSearch => groupSearch.id === gid)
|
const groupIndex = state.groups.findIndex(groupSearch => groupSearch.id === gid)
|
||||||
if (groupIndex >= 0) {
|
if (groupIndex >= 0) {
|
||||||
state.groups.splice(groupIndex, 1)
|
state.groups.splice(groupIndex, 1)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
addUserGroup(state, { userid, gid }) {
|
addUserGroup(state, { userid, gid }) {
|
||||||
let group = state.groups.find(groupSearch => groupSearch.id === gid)
|
const group = state.groups.find(groupSearch => groupSearch.id === gid)
|
||||||
let user = state.users.find(user => user.id === userid)
|
const user = state.users.find(user => user.id === userid)
|
||||||
// increase count if user is enabled
|
// increase count if user is enabled
|
||||||
if (group && user.enabled && state.userCount > 0) {
|
if (group && user.enabled && state.userCount > 0) {
|
||||||
group.usercount++
|
group.usercount++
|
||||||
}
|
}
|
||||||
let groups = user.groups
|
const groups = user.groups
|
||||||
groups.push(gid)
|
groups.push(gid)
|
||||||
state.groups = orderGroups(state.groups, state.orderBy)
|
state.groups = orderGroups(state.groups, state.orderBy)
|
||||||
},
|
},
|
||||||
removeUserGroup(state, { userid, gid }) {
|
removeUserGroup(state, { userid, gid }) {
|
||||||
let group = state.groups.find(groupSearch => groupSearch.id === gid)
|
const group = state.groups.find(groupSearch => groupSearch.id === gid)
|
||||||
let user = state.users.find(user => user.id === userid)
|
const user = state.users.find(user => user.id === userid)
|
||||||
// lower count if user is enabled
|
// lower count if user is enabled
|
||||||
if (group && user.enabled && state.userCount > 0) {
|
if (group && user.enabled && state.userCount > 0) {
|
||||||
group.usercount--
|
group.usercount--
|
||||||
}
|
}
|
||||||
let groups = user.groups
|
const groups = user.groups
|
||||||
groups.splice(groups.indexOf(gid), 1)
|
groups.splice(groups.indexOf(gid), 1)
|
||||||
state.groups = orderGroups(state.groups, state.orderBy)
|
state.groups = orderGroups(state.groups, state.orderBy)
|
||||||
},
|
},
|
||||||
addUserSubAdmin(state, { userid, gid }) {
|
addUserSubAdmin(state, { userid, gid }) {
|
||||||
let groups = state.users.find(user => user.id === userid).subadmin
|
const groups = state.users.find(user => user.id === userid).subadmin
|
||||||
groups.push(gid)
|
groups.push(gid)
|
||||||
},
|
},
|
||||||
removeUserSubAdmin(state, { userid, gid }) {
|
removeUserSubAdmin(state, { userid, gid }) {
|
||||||
let groups = state.users.find(user => user.id === userid).subadmin
|
const groups = state.users.find(user => user.id === userid).subadmin
|
||||||
groups.splice(groups.indexOf(gid), 1)
|
groups.splice(groups.indexOf(gid), 1)
|
||||||
},
|
},
|
||||||
deleteUser(state, userid) {
|
deleteUser(state, userid) {
|
||||||
let userIndex = state.users.findIndex(user => user.id === userid)
|
const userIndex = state.users.findIndex(user => user.id === userid)
|
||||||
state.users.splice(userIndex, 1)
|
state.users.splice(userIndex, 1)
|
||||||
},
|
},
|
||||||
addUserData(state, response) {
|
addUserData(state, response) {
|
||||||
state.users.push(response.data.ocs.data)
|
state.users.push(response.data.ocs.data)
|
||||||
},
|
},
|
||||||
enableDisableUser(state, { userid, enabled }) {
|
enableDisableUser(state, { userid, enabled }) {
|
||||||
let user = state.users.find(user => user.id === userid)
|
const user = state.users.find(user => user.id === userid)
|
||||||
user.enabled = enabled
|
user.enabled = enabled
|
||||||
// increment or not
|
// increment or not
|
||||||
if (state.userCount > 0) {
|
if (state.userCount > 0) {
|
||||||
|
@ -146,7 +146,7 @@ const mutations = {
|
||||||
},
|
},
|
||||||
setUserData(state, { userid, key, value }) {
|
setUserData(state, { userid, key, value }) {
|
||||||
if (key === 'quota') {
|
if (key === 'quota') {
|
||||||
let humanValue = OC.Util.computerFileSize(value)
|
const humanValue = OC.Util.computerFileSize(value)
|
||||||
state.users.find(user => user.id === userid)[key][key] = humanValue !== null ? humanValue : value
|
state.users.find(user => user.id === userid)[key][key] = humanValue !== null ? humanValue : value
|
||||||
} else {
|
} else {
|
||||||
state.users.find(user => user.id === userid)[key] = value
|
state.users.find(user => user.id === userid)[key] = value
|
||||||
|
@ -160,7 +160,7 @@ const mutations = {
|
||||||
resetUsers(state) {
|
resetUsers(state) {
|
||||||
state.users = []
|
state.users = []
|
||||||
state.usersOffset = 0
|
state.usersOffset = 0
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
const getters = {
|
const getters = {
|
||||||
|
@ -185,7 +185,7 @@ const getters = {
|
||||||
},
|
},
|
||||||
getUserCount(state) {
|
getUserCount(state) {
|
||||||
return state.userCount
|
return state.userCount
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
const actions = {
|
const actions = {
|
||||||
|
@ -229,7 +229,7 @@ const actions = {
|
||||||
|
|
||||||
getGroups(context, { offset, limit, search }) {
|
getGroups(context, { offset, limit, search }) {
|
||||||
search = typeof search === 'string' ? search : ''
|
search = typeof search === 'string' ? search : ''
|
||||||
let limitParam = limit === -1 ? '' : `&limit=${limit}`
|
const limitParam = limit === -1 ? '' : `&limit=${limit}`
|
||||||
return api.get(OC.linkToOCS(`cloud/groups?offset=${offset}&search=${search}${limitParam}`, 2))
|
return api.get(OC.linkToOCS(`cloud/groups?offset=${offset}&search=${search}${limitParam}`, 2))
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
if (Object.keys(response.data.ocs.data.groups).length > 0) {
|
if (Object.keys(response.data.ocs.data.groups).length > 0) {
|
||||||
|
@ -477,7 +477,7 @@ const actions = {
|
||||||
* @returns {Promise}
|
* @returns {Promise}
|
||||||
*/
|
*/
|
||||||
enableDisableUser(context, { userid, enabled = true }) {
|
enableDisableUser(context, { userid, enabled = true }) {
|
||||||
let userStatus = enabled ? 'enable' : 'disable'
|
const userStatus = enabled ? 'enable' : 'disable'
|
||||||
return api.requireAdmin().then((response) => {
|
return api.requireAdmin().then((response) => {
|
||||||
return api.put(OC.linkToOCS(`cloud/users/${userid}/${userStatus}`, 2))
|
return api.put(OC.linkToOCS(`cloud/users/${userid}/${userStatus}`, 2))
|
||||||
.then((response) => context.commit('enableDisableUser', { userid, enabled }))
|
.then((response) => context.commit('enableDisableUser', { userid, enabled }))
|
||||||
|
@ -496,7 +496,7 @@ const actions = {
|
||||||
* @returns {Promise}
|
* @returns {Promise}
|
||||||
*/
|
*/
|
||||||
setUserData(context, { userid, key, value }) {
|
setUserData(context, { userid, key, value }) {
|
||||||
let allowedEmpty = ['email', 'displayname']
|
const allowedEmpty = ['email', 'displayname']
|
||||||
if (['email', 'language', 'quota', 'displayname', 'password'].indexOf(key) !== -1) {
|
if (['email', 'language', 'quota', 'displayname', 'password'].indexOf(key) !== -1) {
|
||||||
// We allow empty email or displayname
|
// We allow empty email or displayname
|
||||||
if (typeof value === 'string'
|
if (typeof value === 'string'
|
||||||
|
@ -528,7 +528,7 @@ const actions = {
|
||||||
.then(response => true)
|
.then(response => true)
|
||||||
.catch((error) => { throw error })
|
.catch((error) => { throw error })
|
||||||
}).catch((error) => context.commit('API_FAILURE', { userid, error }))
|
}).catch((error) => context.commit('API_FAILURE', { userid, error }))
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
export default { state, mutations, getters, actions }
|
export default { state, mutations, getters, actions }
|
||||||
|
|
|
@ -45,7 +45,7 @@ import {
|
||||||
AppNavigation,
|
AppNavigation,
|
||||||
AppNavigationItem,
|
AppNavigationItem,
|
||||||
AppSidebar,
|
AppSidebar,
|
||||||
Content
|
Content,
|
||||||
} from 'nextcloud-vue'
|
} from 'nextcloud-vue'
|
||||||
import AppList from '../components/AppList'
|
import AppList from '../components/AppList'
|
||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
|
@ -63,21 +63,21 @@ export default {
|
||||||
AppSidebar,
|
AppSidebar,
|
||||||
Content,
|
Content,
|
||||||
AppDetails,
|
AppDetails,
|
||||||
AppList
|
AppList,
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
category: {
|
category: {
|
||||||
type: String,
|
type: String,
|
||||||
default: 'installed'
|
default: 'installed',
|
||||||
},
|
},
|
||||||
id: {
|
id: {
|
||||||
type: String,
|
type: String,
|
||||||
default: ''
|
default: '',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
searchQuery: ''
|
searchQuery: '',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -111,13 +111,13 @@ export default {
|
||||||
|
|
||||||
// Map groups
|
// Map groups
|
||||||
categories = categories.map(category => {
|
categories = categories.map(category => {
|
||||||
let item = {}
|
const item = {}
|
||||||
item.id = 'app-category-' + category.ident
|
item.id = 'app-category-' + category.ident
|
||||||
item.icon = 'icon-category-' + category.ident
|
item.icon = 'icon-category-' + category.ident
|
||||||
item.classes = [] // empty classes, active will be set later
|
item.classes = [] // empty classes, active will be set later
|
||||||
item.router = { // router link to
|
item.router = { // router link to
|
||||||
name: 'apps-category',
|
name: 'apps-category',
|
||||||
params: { category: category.ident }
|
params: { category: category.ident },
|
||||||
}
|
}
|
||||||
item.text = category.displayName
|
item.text = category.displayName
|
||||||
|
|
||||||
|
@ -125,27 +125,27 @@ export default {
|
||||||
})
|
})
|
||||||
|
|
||||||
// Add everyone group
|
// Add everyone group
|
||||||
let defaultCategories = [
|
const defaultCategories = [
|
||||||
{
|
{
|
||||||
id: 'app-category-your-apps',
|
id: 'app-category-your-apps',
|
||||||
classes: [],
|
classes: [],
|
||||||
router: { name: 'apps' },
|
router: { name: 'apps' },
|
||||||
icon: 'icon-category-installed',
|
icon: 'icon-category-installed',
|
||||||
text: t('settings', 'Your apps')
|
text: t('settings', 'Your apps'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'app-category-enabled',
|
id: 'app-category-enabled',
|
||||||
classes: [],
|
classes: [],
|
||||||
icon: 'icon-category-enabled',
|
icon: 'icon-category-enabled',
|
||||||
router: { name: 'apps-category', params: { category: 'enabled' } },
|
router: { name: 'apps-category', params: { category: 'enabled' } },
|
||||||
text: t('settings', 'Active apps')
|
text: t('settings', 'Active apps'),
|
||||||
}, {
|
}, {
|
||||||
id: 'app-category-disabled',
|
id: 'app-category-disabled',
|
||||||
classes: [],
|
classes: [],
|
||||||
icon: 'icon-category-disabled',
|
icon: 'icon-category-disabled',
|
||||||
router: { name: 'apps-category', params: { category: 'disabled' } },
|
router: { name: 'apps-category', params: { category: 'disabled' } },
|
||||||
text: t('settings', 'Disabled apps')
|
text: t('settings', 'Disabled apps'),
|
||||||
}
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
if (!this.settings.appstoreEnabled) {
|
if (!this.settings.appstoreEnabled) {
|
||||||
|
@ -159,7 +159,7 @@ export default {
|
||||||
icon: 'icon-download',
|
icon: 'icon-download',
|
||||||
router: { name: 'apps-category', params: { category: 'updates' } },
|
router: { name: 'apps-category', params: { category: 'updates' } },
|
||||||
text: t('settings', 'Updates'),
|
text: t('settings', 'Updates'),
|
||||||
utils: { counter: this.$store.getters.getUpdateCount }
|
utils: { counter: this.$store.getters.getUpdateCount },
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -168,13 +168,13 @@ export default {
|
||||||
classes: [],
|
classes: [],
|
||||||
icon: 'icon-category-app-bundles',
|
icon: 'icon-category-app-bundles',
|
||||||
router: { name: 'apps-category', params: { category: 'app-bundles' } },
|
router: { name: 'apps-category', params: { category: 'app-bundles' } },
|
||||||
text: t('settings', 'App bundles')
|
text: t('settings', 'App bundles'),
|
||||||
})
|
})
|
||||||
|
|
||||||
categories = defaultCategories.concat(categories)
|
categories = defaultCategories.concat(categories)
|
||||||
|
|
||||||
// Set current group as active
|
// Set current group as active
|
||||||
let activeGroup = categories.findIndex(group => group.id === 'app-category-' + this.category)
|
const activeGroup = categories.findIndex(group => group.id === 'app-category-' + this.category)
|
||||||
if (activeGroup >= 0) {
|
if (activeGroup >= 0) {
|
||||||
categories[activeGroup].classes.push('active')
|
categories[activeGroup].classes.push('active')
|
||||||
} else {
|
} else {
|
||||||
|
@ -185,17 +185,17 @@ export default {
|
||||||
id: 'app-developer-docs',
|
id: 'app-developer-docs',
|
||||||
classes: [],
|
classes: [],
|
||||||
href: this.settings.developerDocumentation,
|
href: this.settings.developerDocumentation,
|
||||||
text: t('settings', 'Developer documentation') + ' ↗'
|
text: t('settings', 'Developer documentation') + ' ↗',
|
||||||
})
|
})
|
||||||
|
|
||||||
// Return
|
// Return
|
||||||
return categories
|
return categories
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
category: function(val, old) {
|
category: function(val, old) {
|
||||||
this.setSearch('')
|
this.setSearch('')
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
beforeMount() {
|
beforeMount() {
|
||||||
this.$store.dispatch('getCategories')
|
this.$store.dispatch('getCategories')
|
||||||
|
@ -219,9 +219,9 @@ export default {
|
||||||
hideAppDetails() {
|
hideAppDetails() {
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
name: 'apps-category',
|
name: 'apps-category',
|
||||||
params: { category: this.category }
|
params: { category: this.category },
|
||||||
})
|
})
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue