Merge pull request #17705 from nextcloud/dependabot/npm_and_yarn/eslint-config-nextcloud-0.1.0

Bump eslint-config-nextcloud from 0.0.6 to 0.1.0
This commit is contained in:
Christoph Wurst 2019-12-19 14:58:24 +01:00 committed by GitHub
commit aa46fc26a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
196 changed files with 1258 additions and 1254 deletions

View File

@ -10,5 +10,8 @@ module.exports = {
dayNames: true,
firstDay: true
},
extends: ['nextcloud']
extends: ['nextcloud'],
rules: {
'no-tabs': 'warn',
}
}

File diff suppressed because one or more lines are too long

View File

@ -34,12 +34,12 @@ export default {
props: {
availableConfig: {
type: Object,
required: true
required: true,
},
userConfig: {
type: Object,
required: true
}
required: true,
},
},
computed: {
themes() {
@ -55,7 +55,7 @@ export default {
return {
theme: this.userConfig.theme,
highcontrast: this.userConfig.highcontrast,
font: this.userConfig.font
font: this.userConfig.font,
}
},
description() {
@ -87,7 +87,7 @@ export default {
},
designteamLink() {
return `<a target="_blank" href="https://nextcloud.com/design" rel="noreferrer nofollow">${t('accessibility', 'our design team')}</a>`
}
},
},
methods: {
// SELECT handlers
@ -123,17 +123,17 @@ export default {
url: generateOcsUrl('apps/accessibility/api/v1/config', 2) + type,
method: isDelete ? 'DELETE' : 'PUT',
data: {
value: id
}
value: id,
},
})
this.userConfig[type] = id
// 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) {
// insert new css
let link = document.createElement('link')
const link = document.createElement('link')
link.rel = 'stylesheet'
link.href = generateUrl('/apps/accessibility/css/user-style.css') + '?v=' + new Date().getTime()
document.head.appendChild(link)
@ -157,7 +157,7 @@ export default {
console.error(err, err.response)
OC.Notification.showTemporary(t('accessibility', err.response.data.ocs.meta.message + '. Unable to apply the setting.'))
}
}
}
},
},
}
</script>

View File

@ -19,12 +19,12 @@ export default {
props: {
preview: {
type: Object,
required: true
required: true,
},
selected: {
type: String,
default: null
}
default: null,
},
},
computed: {
checked: {
@ -33,8 +33,8 @@ export default {
},
set(checked) {
this.$emit('select', checked ? this.preview.id : '')
}
}
}
},
},
},
}
</script>

View File

@ -14,7 +14,7 @@ const View = Vue.extend(App)
const accessibility = new View({
propsData: {
availableConfig,
userConfig
}
userConfig,
},
})
accessibility.$mount('#accessibility')

File diff suppressed because one or more lines are too long

View File

@ -27,7 +27,7 @@
$el.addClass('comment')
if (model.get('message') && this._isLong(model.get('message'))) {
$el.addClass('collapsed')
var $overlay = $('<div>').addClass('message-overlay')
const $overlay = $('<div>').addClass('message-overlay')
$el.find('.activitymessage').after($overlay)
$el.on('click', this._onClickCollapsedComment)
}
@ -38,7 +38,7 @@
* Copy of CommentsTabView._onClickComment()
*/
_onClickCollapsedComment: function(ev) {
var $row = $(ev.target)
let $row = $(ev.target)
if (!$row.is('.comment')) {
$row = $row.closest('.comment')
}
@ -50,7 +50,7 @@
*/
_isLong: function(message) {
return message.length > 250 || (message.match(/\n/g) || []).length > 1
}
},
}
})()

View File

@ -20,7 +20,7 @@
PROPERTY_OBJECTTYPE: '{' + OC.Files.Client.NS_OWNCLOUD + '}objectType',
PROPERTY_ACTORDISPLAYNAME: '{' + OC.Files.Client.NS_OWNCLOUD + '}actorDisplayName',
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
*
*/
var CommentModel = OC.Backbone.Model.extend(
const CommentModel = OC.Backbone.Model.extend(
/** @lends OCA.Comments.CommentModel.prototype */ {
sync: OC.Backbone.davSync,
defaults: {
actorType: 'users',
objectType: 'files'
objectType: 'files',
},
davProperties: {
@ -49,7 +49,7 @@
'objectType': OC.Files.Client.PROPERTY_OBJECTTYPE,
'objectId': OC.Files.Client.PROPERTY_OBJECTID,
'isUnread': OC.Files.Client.PROPERTY_ISUNREAD,
'mentions': OC.Files.Client.PROPERTY_MENTIONS
'mentions': OC.Files.Client.PROPERTY_MENTIONS,
},
parse: function(data) {
@ -63,7 +63,7 @@
objectType: data.objectType,
objectId: data.objectId,
isUnread: (data.isUnread === 'true'),
mentions: this._parseMentions(data.mentions)
mentions: this._parseMentions(data.mentions),
}
},
@ -71,14 +71,14 @@
if (_.isUndefined(mentions)) {
return {}
}
var result = {}
for (var i in mentions) {
var mention = mentions[i]
const result = {}
for (const i in mentions) {
const mention = mentions[i]
if (_.isUndefined(mention.localName) || mention.localName !== 'mention') {
continue
}
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')) {
continue
}
@ -86,7 +86,7 @@
}
}
return result
}
},
})
OCA.Comments.CommentModel = CommentModel

View File

@ -16,26 +16,26 @@
* @memberof OC.Comments
* @private
*/
var CommentsModifyMenu = OC.Backbone.View.extend({
const CommentsModifyMenu = OC.Backbone.View.extend({
tagName: 'div',
className: 'commentsModifyMenu popovermenu bubble menu',
_scopes: [
{
name: 'edit',
displayName: t('comments', 'Edit comment'),
iconClass: 'icon-rename'
iconClass: 'icon-rename',
},
{
name: 'delete',
displayName: t('comments', 'Delete comment'),
iconClass: 'icon-delete'
}
iconClass: 'icon-delete',
},
],
initialize: function() {
},
events: {
'click a.action': '_onClickAction'
'click a.action': '_onClickAction',
},
/**
@ -44,7 +44,7 @@
* @param {Object} event event object
*/
_onClickAction: function(event) {
var $target = $(event.currentTarget)
let $target = $(event.currentTarget)
if (!$target.hasClass('menuitem')) {
$target = $target.closest('.menuitem')
}
@ -59,7 +59,7 @@
*/
render: function() {
this.$el.html(OCA.Comments.Templates['commentsmodifymenu']({
items: this._scopes
items: this._scopes,
}))
},
@ -70,19 +70,19 @@
show: function(context) {
this._context = context
for (var i in this._scopes) {
for (const i in this._scopes) {
this._scopes[i].active = false
}
var $el = $(context.target)
var offsetIcon = $el.offset()
var offsetContainer = $el.closest('.authorRow').offset()
const $el = $(context.target)
const offsetIcon = $el.offset()
const offsetContainer = $el.closest('.authorRow').offset()
// adding some extra top offset to push the menu below the button.
var position = {
const position = {
top: offsetIcon.top - offsetContainer.top + 48,
left: '',
right: ''
right: '',
}
position.left = offsetIcon.left - offsetContainer.left
@ -100,7 +100,7 @@
this.$el.removeClass('hidden')
OC.showMenu(null, this.$el)
}
},
})
OCA.Comments = OCA.Comments || {}

View File

@ -11,7 +11,7 @@
(function(OC, OCA) {
_.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.
*
*/
var CommentSummaryModel = OC.Backbone.Model.extend(
const CommentSummaryModel = OC.Backbone.Model.extend(
/** @lends OCA.Comments.CommentSummaryModel.prototype */ {
sync: OC.Backbone.davSync,
@ -41,7 +41,7 @@
_objectId: null,
davProperties: {
'readMarker': OC.Files.Client.PROPERTY_READMARKER
'readMarker': OC.Files.Client.PROPERTY_READMARKER,
},
/**
@ -63,7 +63,7 @@
return OC.linkToRemote('dav') + '/comments/'
+ encodeURIComponent(this._objectType) + '/'
+ encodeURIComponent(this.id) + '/'
}
},
})
OCA.Comments.CommentSummaryModel = CommentSummaryModel

View File

@ -11,7 +11,7 @@
(function() {
_.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)
@ -28,36 +28,36 @@
OCA.Comments.FilesPlugin = {
ignoreLists: [
'trashbin',
'files.public'
'files.public',
],
_formatCommentCount: function(count) {
return OCA.Comments.Templates['filesplugin']({
count: 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) {
var self = this
const self = this
if (this.ignoreLists.indexOf(fileList.id) >= 0) {
return
}
fileList.registerTabView(new OCA.Comments.CommentsTabView('commentsTabView'))
var oldGetWebdavProperties = fileList._getWebdavProperties
const oldGetWebdavProperties = fileList._getWebdavProperties
fileList._getWebdavProperties = function() {
var props = oldGetWebdavProperties.apply(this, arguments)
const props = oldGetWebdavProperties.apply(this, arguments)
props.push(OC.Files.Client.PROPERTY_COMMENTS_UNREAD)
return props
}
fileList.filesClient.addFileInfoParser(function(response) {
var data = {}
var props = response.propStat[0].properties
var commentsUnread = props[OC.Files.Client.PROPERTY_COMMENTS_UNREAD]
const data = {}
const props = response.propStat[0].properties
const commentsUnread = props[OC.Files.Client.PROPERTY_COMMENTS_UNREAD]
if (!_.isUndefined(commentsUnread) && commentsUnread !== '') {
data.commentsUnread = parseInt(commentsUnread, 10)
}
@ -65,9 +65,9 @@
})
fileList.$el.addClass('has-comments')
var oldCreateRow = fileList._createRow
const oldCreateRow = fileList._createRow
fileList._createRow = function(fileData) {
var $tr = oldCreateRow.apply(this, arguments)
const $tr = oldCreateRow.apply(this, arguments)
if (fileData.commentsUnread) {
$tr.attr('data-comments-unread', fileData.commentsUnread)
}
@ -79,7 +79,7 @@
name: 'Comment',
displayName: function(context) {
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) {
return n('comments', '1 new comment', '{unread} new comments', unread, { unread: unread })
}
@ -92,10 +92,10 @@
permissions: OC.PERMISSION_READ,
type: OCA.Files.FileActions.TYPE_INLINE,
render: function(actionSpec, isDefault, context) {
var $file = context.$file
var unreadComments = $file.data('comments-unread')
const $file = context.$file
const unreadComments = $file.data('comments-unread')
if (unreadComments) {
var $actionLink = $(self._formatCommentCount(unreadComments))
const $actionLink = $(self._formatCommentCount(unreadComments))
context.$file.find('a.name>span.fileactions').append($actionLink)
return $actionLink
}
@ -105,20 +105,20 @@
context.$file.find('.action-comment').tooltip('hide')
// open sidebar in comments section
context.fileList.showDetailsView(fileName, 'comments')
}
},
})
// add attribute to "elementToFile"
var oldElementToFile = fileList.elementToFile
const oldElementToFile = fileList.elementToFile
fileList.elementToFile = function($el) {
var fileInfo = oldElementToFile.apply(this, arguments)
var commentsUnread = $el.data('comments-unread')
const fileInfo = oldElementToFile.apply(this, arguments)
const commentsUnread = $el.data('comments-unread')
if (commentsUnread) {
fileInfo.commentsUnread = commentsUnread
}
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

View File

@ -31,22 +31,22 @@ import AppSidebarTab from 'nextcloud-vue/dist/Components/AppSidebarTab'
export default {
name: 'LegacyTab',
components: {
AppSidebarTab: AppSidebarTab
AppSidebarTab: AppSidebarTab,
},
props: {
component: {
type: Object,
required: true
required: true,
},
name: {
type: String,
required: true
required: true,
},
fileInfo: {
type: Object,
default: () => {},
required: true
}
required: true,
},
},
computed: {
icon() {
@ -64,14 +64,14 @@ export default {
// needed because AppSidebarTab also uses $parent.activeTab
activeTab() {
return this.$parent.activeTab
}
},
},
watch: {
activeTab(activeTab) {
if (activeTab === this.id && this.fileInfo) {
this.setFileInfo(this.fileInfo)
}
}
},
},
beforeMount() {
this.setFileInfo(this.fileInfo)
@ -86,8 +86,8 @@ export default {
methods: {
setFileInfo(fileInfo) {
this.component.setFileInfo(new OCA.Files.FileInfoModel(fileInfo))
}
}
},
},
}
</script>
<style>

View File

@ -29,19 +29,19 @@ export default {
props: {
component: {
type: Object,
required: true
required: true,
},
fileInfo: {
type: Object,
default: () => {},
required: true
}
required: true,
},
},
watch: {
fileInfo(fileInfo) {
// update the backbone model FileInfo
this.setFileInfo(fileInfo)
}
},
},
mounted() {
// append the backbone element and set the FileInfo
@ -51,8 +51,8 @@ export default {
methods: {
setFileInfo(fileInfo) {
this.component.setFileInfo(new OCA.Files.FileInfoModel(fileInfo))
}
}
},
},
}
</script>
<style>

View File

@ -32,7 +32,7 @@ import TransferOwnershipDialogue from './TransferOwnershipDialogue'
export default {
name: 'PersonalSettings',
components: {
TransferOwnershipDialogue
}
TransferOwnershipDialogue,
},
}
</script>

View File

@ -50,8 +50,8 @@
:internal-search="false"
:clear-on-select="false"
:user-select="true"
@search-change="findUserDebounced"
class="middle-align" />
class="middle-align"
@search-change="findUserDebounced" />
</label>
</p>
<p>
@ -85,7 +85,7 @@ const picker = getFilePickerBuilder(t('files', 'Choose a file or folder to trans
export default {
name: 'TransferOwnershipDialogue',
components: {
Multiselect
Multiselect,
},
data() {
return {
@ -94,7 +94,7 @@ export default {
submitError: undefined,
loadingUsers: false,
selectedUser: null,
userSuggestions: {}
userSuggestions: {},
}
},
computed: {
@ -107,7 +107,7 @@ export default {
return {
user: user.uid,
displayName: user.displayName,
icon: 'icon-user'
icon: 'icon-user',
}
})
},
@ -123,7 +123,7 @@ export default {
return ''
}
return this.directory.substring(1)
}
},
},
created() {
this.findUserDebounced = debounce(this.findUser, 300)
@ -163,8 +163,8 @@ export default {
itemType: 'file',
search: query,
perPage: 20,
lookup: false
}
lookup: false,
},
})
if (response.data.ocs.meta.statuscode !== 100) {
@ -175,7 +175,7 @@ export default {
response.data.ocs.data.users.forEach(user => {
Vue.set(this.userSuggestions, user.value.shareWith, {
uid: user.value.shareWith,
displayName: user.label
displayName: user.label,
})
})
} catch (error) {
@ -192,7 +192,7 @@ export default {
this.submitError = undefined
const data = {
path: this.directory,
recipient: this.selectedUser.user
recipient: this.selectedUser.user,
}
logger.debug('submit transfer ownership form', data)
@ -212,8 +212,8 @@ export default {
this.submitError = error.message || t('files', 'Unknown error')
})
}
}
},
},
}
</script>

View File

@ -51,7 +51,7 @@ export default async function(url) {
<oc:owner-display-name />
<oc:share-types />
</d:prop>
</d:propfind>`
</d:propfind>`,
})
// TODO: create new parser or use cdav-lib when available

View File

@ -44,8 +44,8 @@ window.addEventListener('DOMContentLoaded', () => {
// Make sure we have a mountpoint
if (!document.getElementById('app-sidebar')) {
var contentElement = document.getElementById('content')
var sidebarElement = document.createElement('div')
const contentElement = document.getElementById('content')
const sidebarElement = document.createElement('div')
sidebarElement.id = 'app-sidebar'
contentElement.appendChild(sidebarElement)
}
@ -55,7 +55,7 @@ window.addEventListener('DOMContentLoaded', () => {
const AppSidebar = new Vue({
// eslint-disable-next-line vue/match-component-file-name
name: 'SidebarRoot',
render: h => h(SidebarView)
render: h => h(SidebarView),
})
AppSidebar.$mount('#app-sidebar')
})

View File

@ -69,7 +69,7 @@ export default {
components: {
AppSidebar,
LegacyView
LegacyView,
},
data() {
@ -78,7 +78,7 @@ export default {
Sidebar: OCA.Files.Sidebar.state,
error: null,
fileInfo: null,
starLoading: false
starLoading: false,
}
},
@ -174,19 +174,19 @@ export default {
'star-loading': this.starLoading,
starred: this.fileInfo.isFavourited,
subtitle: this.subtitle,
title: this.fileInfo.name
title: this.fileInfo.name,
}
} else if (this.error) {
return {
key: 'error', // force key to re-render
subtitle: '',
title: ''
title: '',
}
} else {
return {
class: 'icon-loading',
subtitle: '',
title: ''
title: '',
}
}
},
@ -215,7 +215,7 @@ export default {
*/
defaultActionListener() {
return this.defaultAction ? 'figure-click' : null
}
},
},
watch: {
@ -244,7 +244,7 @@ export default {
console.error('Error while loading the file data', error)
}
}
}
},
},
methods: {
@ -286,7 +286,7 @@ export default {
* @returns {string} Url to the icon for mimeType
*/
getIconUrl(fileInfo) {
var mimeType = fileInfo.mimetype || 'application/octet-stream'
const mimeType = fileInfo.mimetype || 'application/octet-stream'
if (mimeType === 'httpd/unix-directory') {
// use default folder icon
if (fileInfo.mountType === 'shared' || fileInfo.mountType === 'shared-root') {
@ -312,11 +312,11 @@ export default {
if (tab.isLegacyTab) {
return {
is: LegacyTab,
component: tab.component
component: tab.component,
}
}
return {
is: tab.component
is: tab.component,
}
},
@ -348,7 +348,7 @@ export default {
<oc:favorite>1</oc:favorite>
</d:prop>
${state ? '</d:set>' : '</d:remove>'}
</d:propertyupdate>`
</d:propertyupdate>`,
})
// TODO: Obliterate as soon as possible and use events with new files app
@ -371,11 +371,11 @@ export default {
fileInfo: this.fileInfo,
dir: this.fileInfo.dir,
fileList: OCA.Files.App.fileList,
$file: $('body')
$file: $('body'),
})
}
}
}
},
},
}
</script>
<style lang="scss" scoped>

View File

@ -38,7 +38,7 @@ OCA.Sharing.App = {
// The file list is created when a "show" event is handled, so
// it should be marked as "shown" like it would have been done
// 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
// it should be marked as "shown" like it would have been done
// 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
// it should be marked as "shown" like it would have been done
// 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
// it should be marked as "shown" like it would have been done
// 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
// it should be marked as "shown" like it would have been done
// if handling the event with the file list already created.
shown: true
shown: true,
}
)
@ -202,7 +202,7 @@ OCA.Sharing.App = {
_createFileActions: function() {
// 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
// compatible with the sharing overview and need to be adapted first
fileActions.registerDefaultActions()
@ -227,7 +227,7 @@ OCA.Sharing.App = {
},
_restoreShareAction: function() {
var fileActions = new OCA.Files.FileActions()
const fileActions = new OCA.Files.FileActions()
fileActions.registerAction({
name: 'Restore',
displayName: '',
@ -237,14 +237,14 @@ OCA.Sharing.App = {
iconClass: 'icon-history',
type: OCA.Files.FileActions.TYPE_INLINE,
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)
.success(function(result) {
context.fileList.remove(context.fileInfoModel.attributes.name)
}).fail(function() {
OC.Notification.showTemporary(t('files_sharing', 'Something happened. Unable to restore the share.'))
})
}
},
})
return fileActions
},
@ -269,7 +269,7 @@ OCA.Sharing.App = {
_extendFileList: function(fileList) {
// remove size column from summary
fileList.fileSummary.$el.find('.filesize').remove()
}
},
}
$(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

View File

@ -17,5 +17,5 @@ window.OCP.Collaboration.registerType('file', {
})
},
typeString: t('files_sharing', 'Link to a file'),
typeIconClass: 'icon-files-dark'
typeIconClass: 'icon-files-dark',
})

View File

@ -39,7 +39,7 @@ export default {
name: 'PersonalSettings',
data() {
return {
accepting: true
accepting: true,
}
},
mounted() {
@ -50,10 +50,10 @@ export default {
axios.put(
generateUrl('/apps/files_sharing/settings/defaultAccept'),
{
accept: this.accepting
accept: this.accepting,
}
)
}
}
},
},
}
</script>

View File

@ -130,11 +130,11 @@ export default {
ActionCheckbox,
ActionInput,
ActionTextEditable,
Avatar
Avatar,
},
directives: {
Tooltip
Tooltip,
},
mixins: [SharesMixin],
@ -143,7 +143,7 @@ export default {
return {
permissionsEdit: OC.PERMISSION_UPDATE,
permissionsRead: OC.PERMISSION_READ,
permissionsShare: OC.PERMISSION_SHARE
permissionsShare: OC.PERMISSION_SHARE,
}
},
@ -170,7 +170,7 @@ export default {
// todo: strong or italic?
// but the t function escape any html from the data :/
user: this.share.shareWithDisplayName,
owner: this.share.owner
owner: this.share.owner,
}
if (this.share.type === this.SHARE_TYPES.SHARE_TYPE_GROUP) {
@ -198,7 +198,7 @@ export default {
},
set: function(checked) {
this.updatePermissions(checked, this.canReshare)
}
},
},
/**
@ -210,7 +210,7 @@ export default {
},
set: function(checked) {
this.updatePermissions(this.canEdit, checked)
}
},
},
/**
@ -227,13 +227,13 @@ export default {
? this.config.defaultInternalExpirationDateString
: moment().format('YYYY-MM-DD')
: ''
}
},
},
dateMaxEnforced() {
return this.config.isDefaultInternalExpireDateEnforced
&& moment().add(1 + this.config.defaultInternalExpireDate, 'days')
}
},
},
@ -246,8 +246,8 @@ export default {
this.share.permissions = permissions
this.queueUpdate('permissions')
}
}
},
},
}
</script>

View File

@ -68,7 +68,7 @@ export default {
ActionLink,
ActionText,
Avatar,
SharingEntrySimple
SharingEntrySimple,
},
mixins: [SharesMixin],
@ -76,17 +76,17 @@ export default {
props: {
share: {
type: Share,
required: true
}
required: true,
},
},
computed: {
fileTargetUrl() {
return generateUrl('/f/{fileid}', {
fileid: this.share.fileSource
fileid: this.share.fileSource,
})
}
}
},
},
}
</script>

View File

@ -28,21 +28,21 @@ export default {
components: {
ActionLink,
SharingEntrySimple
SharingEntrySimple,
},
props: {
fileInfo: {
type: Object,
default: () => {},
required: true
}
required: true,
},
},
data() {
return {
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 file')
}
},
},
methods: {
@ -94,8 +94,8 @@ export default {
this.copied = false
}, 4000)
}
}
}
},
},
}
</script>

View File

@ -316,11 +316,11 @@ export default {
ActionLink,
ActionText,
ActionTextEditable,
Avatar
Avatar,
},
directives: {
Tooltip
Tooltip,
},
mixins: [SharesMixin],
@ -328,8 +328,8 @@ export default {
props: {
canReshare: {
type: Boolean,
default: true
}
default: true,
},
},
data() {
@ -341,7 +341,7 @@ export default {
publicUploadRValue: OC.PERMISSION_READ,
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.isShareOwner && this.share.ownerDisplayName) {
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() !== '') {
@ -393,7 +393,7 @@ export default {
? this.config.defaultExpirationDateString
: moment().format('YYYY-MM-DD')
: ''
}
},
},
dateMaxEnforced() {
@ -414,7 +414,7 @@ export default {
// TODO: directly save after generation to make sure the share is always protected
this.share.password = enabled ? await this.generatePassword() : ''
this.share.newPassword = this.share.password
}
},
},
/**
@ -452,7 +452,7 @@ export default {
this.share.permissions = enabled
? OC.PERMISSION_READ | OC.PERMISSION_UPDATE
: OC.PERMISSION_READ
}
},
},
// if newPassword exists, but is empty, it means
@ -510,7 +510,7 @@ export default {
isPasswordPolicyEnabled() {
return typeof this.config.passwordPolicy === 'object'
}
},
},
methods: {
@ -519,7 +519,7 @@ export default {
*/
async onNewLinkShare() {
const shareDefaults = {
share_type: OC.Share.SHARE_TYPE_LINK
share_type: OC.Share.SHARE_TYPE_LINK,
}
if (this.config.isDefaultExpireDateEnforced) {
// default is empty string if not set
@ -588,7 +588,7 @@ export default {
path,
shareType: OC.Share.SHARE_TYPE_LINK,
password: share.password,
expireDate: share.expireDate
expireDate: share.expireDate,
// we do not allow setting the publicUpload
// before the share creation.
// Todo: We also need to fix the createShare method in
@ -747,8 +747,8 @@ export default {
// but is incomplete as not pushed to server
// YET. We can safely delete the share :)
this.$emit('remove:share', this.share)
}
}
},
},
}
</script>

View File

@ -43,28 +43,28 @@ export default {
name: 'SharingEntrySimple',
components: {
Actions
Actions,
},
directives: {
Tooltip
Tooltip,
},
props: {
title: {
type: String,
default: '',
required: true
required: true,
},
tooltip: {
type: String,
default: ''
default: '',
},
subtitle: {
type: String,
default: ''
}
}
default: '',
},
},
}
</script>

View File

@ -61,7 +61,7 @@ export default {
name: 'SharingInput',
components: {
Multiselect
Multiselect,
},
mixins: [ShareTypes, ShareRequests],
@ -70,26 +70,26 @@ export default {
shares: {
type: Array,
default: () => [],
required: true
required: true,
},
linkShares: {
type: Array,
default: () => [],
required: true
required: true,
},
fileInfo: {
type: Object,
default: () => {},
required: true
required: true,
},
reshare: {
type: Share,
default: null
default: null,
},
canReshare: {
type: Boolean,
required: true
}
required: true,
},
},
data() {
@ -99,7 +99,7 @@ export default {
query: '',
recommendations: [],
ShareSearch: OCA.Sharing.ShareSearch.state,
suggestions: []
suggestions: [],
}
},
@ -151,7 +151,7 @@ export default {
return t('files_sharing', 'Searching …')
}
return t('files_sharing', 'No elements found.')
}
},
},
mounted() {
@ -190,8 +190,8 @@ export default {
itemType: this.fileInfo.type === 'dir' ? 'folder' : 'file',
search,
lookup,
perPage: this.config.maxAutocompleteResults
}
perPage: this.config.maxAutocompleteResults,
},
})
if (request.data.ocs.meta.statuscode !== 100) {
@ -224,7 +224,7 @@ export default {
lookupEntry.push({
isNoUser: true,
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', {
params: {
format: 'json',
itemType: this.fileInfo.type
}
itemType: this.fileInfo.type,
},
})
if (request.data.ocs.meta.statuscode !== 100) {
@ -382,7 +382,7 @@ export default {
isNoUser: !result.uuid,
displayName: result.name || result.label,
desc,
icon: this.shareTypeToIcon(result.value.shareType)
icon: this.shareTypeToIcon(result.value.shareType),
}
},
@ -417,7 +417,7 @@ export default {
const share = await this.createShare({
path,
shareType: value.shareType,
shareWith: value.shareWith
shareWith: value.shareWith,
})
this.$emit('add:share', share)
@ -433,8 +433,8 @@ export default {
} finally {
this.loading = false
}
}
}
},
},
}
</script>

View File

@ -31,6 +31,6 @@ Object.assign(OC, {
SHARE_TYPE_CIRCLE: 7,
SHARE_TYPE_GUEST: 8,
SHARE_TYPE_REMOTE_GROUP: 9,
SHARE_TYPE_ROOM: 10
}
SHARE_TYPE_ROOM: 10,
},
})

View File

@ -29,7 +29,7 @@ import Share from '../models/Share'
const shareUrl = generateOcsUrl('apps/files_sharing/api/v1', 2) + 'shares'
const headers = {
'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8',
}
export default {
@ -109,6 +109,6 @@ export default {
const message = error.response.data.ocs.meta.message
throw new Error(`${property}, ${message}`)
}
}
}
},
},
}

View File

@ -32,8 +32,8 @@ export default {
SHARE_TYPE_CIRCLE: OC.Share.SHARE_TYPE_CIRCLE,
SHARE_TYPE_GUEST: OC.Share.SHARE_TYPE_GUEST,
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,
},
}
}
},
}

View File

@ -36,12 +36,12 @@ export default {
fileInfo: {
type: Object,
default: () => {},
required: true
required: true,
},
share: {
type: Share,
default: null
}
default: null,
},
},
data() {
@ -75,8 +75,8 @@ export default {
SHARE_TYPE_CIRCLE: OC.Share.SHARE_TYPE_CIRCLE,
SHARE_TYPE_GUEST: OC.Share.SHARE_TYPE_GUEST,
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
? t('files_sharing', 'Enter a note for the share recipient')
: ''
}
},
},
dateTomorrow() {
@ -123,14 +123,14 @@ export default {
? window.monthNamesShort // provided by nextcloud
: ['Jan.', 'Feb.', 'Mar.', 'Apr.', 'May.', 'Jun.', 'Jul.', 'Aug.', 'Sep.', 'Oct.', 'Nov.', 'Dec.'],
placeholder: {
date: 'Select Date' // TODO: Translate
}
date: 'Select Date', // TODO: Translate
},
}
},
isShareOwner() {
return this.share && this.share.owner === getCurrentUser().uid
}
},
},
@ -217,7 +217,7 @@ export default {
try {
await this.updateShare(this.share.id, {
property,
value
value,
})
// clear any previous errors
@ -276,6 +276,6 @@ export default {
*/
debounceQueueUpdate: debounce(function(property) {
this.queueUpdate(property)
}, 500)
}
}, 500),
},
}

View File

@ -23,10 +23,10 @@
(function() {
'use strict'
var BreadCrumbView = OC.Backbone.View.extend({
const BreadCrumbView = OC.Backbone.View.extend({
tagName: 'span',
events: {
click: '_onClick'
click: '_onClick',
},
_dirInfo: undefined,
@ -34,7 +34,7 @@
this._dirInfo = data.dirInfo || null
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')
if (isShared) {
this.$el.addClass('shared')
@ -58,18 +58,18 @@
_onClick: function(e) {
e.preventDefault()
var fileInfoModel = new OCA.Files.FileInfoModel(this._dirInfo)
var self = this
const fileInfoModel = new OCA.Files.FileInfoModel(this._dirInfo)
const self = this
fileInfoModel.on('change', function() {
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.setActiveTab('sharing')
}
},
})
OCA.Sharing.ShareBreadCrumbView = BreadCrumbView

View File

@ -33,7 +33,7 @@ const shareWithTitle = function(share) {
'Shared with you and the group {group} by {owner}',
{
group: share.shareWithDisplayName,
owner: share.ownerDisplayName
owner: share.ownerDisplayName,
},
undefined,
{ escape: false }
@ -44,7 +44,7 @@ const shareWithTitle = function(share) {
'Shared with you and {circle} by {owner}',
{
circle: share.shareWithDisplayName,
owner: share.ownerDisplayName
owner: share.ownerDisplayName,
},
undefined,
{ escape: false }
@ -56,7 +56,7 @@ const shareWithTitle = function(share) {
'Shared with you and the conversation {conversation} by {owner}',
{
conversation: share.shareWithDisplayName,
owner: share.ownerDisplayName
owner: share.ownerDisplayName,
},
undefined,
{ escape: false }
@ -66,7 +66,7 @@ const shareWithTitle = function(share) {
'files_sharing',
'Shared with you in a conversation by {owner}',
{
owner: share.ownerDisplayName
owner: share.ownerDisplayName,
},
undefined,
{ escape: false }

View File

@ -56,15 +56,15 @@ export default {
components: {
ActionButton,
SharingEntryInherited,
SharingEntrySimple
SharingEntrySimple,
},
props: {
fileInfo: {
type: Object,
default: () => {},
required: true
}
required: true,
},
},
data() {
@ -72,7 +72,7 @@ export default {
loaded: false,
loading: false,
showInheritedShares: false,
shares: []
shares: [],
}
},
computed: {
@ -96,12 +96,12 @@ export default {
fullPath() {
const path = `${this.fileInfo.path}/${this.fileInfo.name}`
return path.replace('//', '/')
}
},
},
watch: {
fileInfo() {
this.resetState()
}
},
},
methods: {
/**
@ -142,8 +142,8 @@ export default {
this.loading = false
this.showInheritedShares = false
this.shares = []
}
}
},
},
}
</script>

View File

@ -53,7 +53,7 @@ export default {
name: 'SharingLinkList',
components: {
SharingEntryLink
SharingEntryLink,
},
mixins: [ShareTypes],
@ -62,17 +62,17 @@ export default {
fileInfo: {
type: Object,
default: () => {},
required: true
required: true,
},
shares: {
type: Array,
default: () => [],
required: true
required: true,
},
canReshare: {
type: Boolean,
required: true
}
required: true,
},
},
computed: {
@ -94,7 +94,7 @@ export default {
*/
hasShares() {
return this.shares.length > 0
}
},
},
methods: {
@ -135,7 +135,7 @@ export default {
removeShare(share) {
const index = this.shares.findIndex(item => item === share)
this.shares.splice(index, 1)
}
}
},
},
}
</script>

View File

@ -39,26 +39,26 @@ export default {
name: 'SharingList',
components: {
SharingEntry
SharingEntry,
},
props: {
fileInfo: {
type: Object,
default: () => {},
required: true
required: true,
},
shares: {
type: Array,
default: () => [],
required: true
}
required: true,
},
},
computed: {
hasShares() {
return this.shares.length === 0
}
},
},
methods: {
@ -70,7 +70,7 @@ export default {
removeShare(share) {
const index = this.shares.findIndex(item => item === share)
this.shares.splice(index, 1)
}
}
},
},
}
</script>

View File

@ -114,7 +114,7 @@ export default {
SharingInput,
SharingLinkList,
SharingList,
Tab
Tab,
},
mixins: [ShareTypes],
@ -123,8 +123,8 @@ export default {
fileInfo: {
type: Object,
default: () => {},
required: true
}
required: true,
},
},
data() {
@ -139,7 +139,7 @@ export default {
sharedWithMe: {},
shares: [],
linkShares: [],
sections: OCA.Sharing.ShareTabSections.getSections()
sections: OCA.Sharing.ShareTabSections.getSections(),
}
},
@ -176,14 +176,14 @@ export default {
canReshare() {
return !!(this.fileInfo.permissions & OC.PERMISSION_SHARE)
|| !!(this.reshare && this.reshare.hasSharePermission)
}
},
},
watch: {
fileInfo() {
this.resetState()
this.getShares()
}
},
},
beforeMount() {
@ -209,15 +209,15 @@ export default {
params: {
format,
path,
reshares: true
}
reshares: true,
},
})
const fetchSharedWithMe = axios.get(shareUrl, {
params: {
format,
path,
shared_with_me: true
}
shared_with_me: true,
},
})
// wait for data
@ -254,7 +254,7 @@ export default {
updateExpirationSubtitle(share) {
const expiration = moment(share.expireDate).unix()
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
@ -301,7 +301,7 @@ export default {
this.sharedWithMe = {
displayName,
title,
user
user,
}
this.reshare = share
@ -329,8 +329,8 @@ export default {
} else {
this.shares.unshift(share)
}
}
}
},
},
}
</script>

File diff suppressed because one or more lines are too long

View File

@ -30,9 +30,9 @@ OCA.Trashbin.App = {
host: OC.getHost(),
port: OC.getPort(),
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(
$('#app-content-trashbin'), {
fileActions: this._createFileActions(),
@ -43,28 +43,28 @@ OCA.Trashbin.App = {
{
name: 'restore',
displayName: t('files_trashbin', 'Restore'),
iconClass: 'icon-history'
iconClass: 'icon-history',
},
{
name: 'delete',
displayName: t('files_trashbin', 'Delete permanently'),
iconClass: 'icon-delete'
}
iconClass: 'icon-delete',
},
],
client: this.client,
// The file list is created when a "show" event is handled, so
// it should be marked as "shown" like it would have been done
// if handling the event with the file list already created.
shown: true
shown: true,
}
)
},
_createFileActions: function() {
var client = this.client
var fileActions = new OCA.Files.FileActions()
const client = this.client
const fileActions = new OCA.Files.FileActions()
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))
})
@ -78,10 +78,10 @@ OCA.Trashbin.App = {
permissions: OC.PERMISSION_READ,
iconClass: 'icon-history',
actionHandler: function(filename, context) {
var fileList = context.fileList
var tr = fileList.findFileEl(filename)
const fileList = context.fileList
const tr = fileList.findFileEl(filename)
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)
.then(
fileList._removeCallback.bind(fileList, [filename]),
@ -90,7 +90,7 @@ OCA.Trashbin.App = {
OC.Notification.show(t('files_trashbin', 'Error while restoring file from trashbin'))
}
)
}
},
})
fileActions.registerAction({
@ -100,18 +100,18 @@ OCA.Trashbin.App = {
permissions: OC.PERMISSION_READ,
iconClass: 'icon-delete',
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.children('img').attr('alt', t('files_trashbin', 'Delete permanently'))
context.$file.find('td:last').append($actionLink)
return $actionLink
},
actionHandler: function(filename, context) {
var fileList = context.fileList
const fileList = context.fileList
$('.tipsy').remove()
var tr = fileList.findFileEl(filename)
const tr = fileList.findFileEl(filename)
fileList.showFileBusyState(tr, true)
var dir = context.fileList.getCurrentDirectory()
const dir = context.fileList.getCurrentDirectory()
client.remove(OC.joinPaths('trash', dir, filename))
.then(
fileList._removeCallback.bind(fileList, [filename]),
@ -120,15 +120,15 @@ OCA.Trashbin.App = {
OC.Notification.show(t('files_trashbin', 'Error while removing file from trashbin'))
}
)
}
},
})
return fileActions
}
},
}
$(document).ready(function() {
$('#app-content-trashbin').one('show', function() {
var App = OCA.Trashbin.App
const App = OCA.Trashbin.App
App.initialize($('#app-content-trashbin'))
// force breadcrumb init
// 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

View File

@ -26,7 +26,7 @@
}
fileList.registerTabView(new OCA.Versions.VersionsTabView('versionsTabView', { order: -10 }))
}
},
}
})()

View File

@ -12,7 +12,7 @@
/**
* @memberof OCA.Versions
*/
var VersionCollection = OC.Backbone.Collection.extend({
const VersionCollection = OC.Backbone.Collection.extend({
model: OCA.Versions.VersionModel,
sync: OC.Backbone.davSync,
@ -49,7 +49,7 @@
return this._client || new OC.Files.Client({
host: OC.getHost(),
root: OC.linkToRemoteBase('dav') + '/versions/' + this.getCurrentUser(),
useHTTPS: OC.getProtocol() === 'https'
useHTTPS: OC.getProtocol() === 'https',
})
},
@ -58,11 +58,11 @@
},
parse: function(result) {
var fullPath = this._fileInfo.getFullPath()
var fileId = this._fileInfo.get('id')
var name = this._fileInfo.get('name')
var user = this.getCurrentUser()
var client = this.getClient()
const fullPath = this._fileInfo.getFullPath()
const fileId = this._fileInfo.get('id')
const name = this._fileInfo.get('name')
const user = this.getCurrentUser()
const client = this.getClient()
return _.map(result, function(version) {
version.fullPath = fullPath
version.fileId = fileId
@ -74,7 +74,7 @@
version.client = client
return version
})
}
},
})
OCA.Versions = OCA.Versions || {}

View File

@ -12,13 +12,13 @@
/**
* @memberof OCA.Versions
*/
var VersionModel = OC.Backbone.Model.extend({
const VersionModel = OC.Backbone.Model.extend({
sync: OC.Backbone.davSync,
davProperties: {
'size': '{DAV:}getcontentlength',
'mimetype': '{DAV:}getcontenttype',
'timestamp': '{DAV:}getlastmodified'
'timestamp': '{DAV:}getlastmodified',
},
/**
@ -29,9 +29,9 @@
*/
revert: function(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)
.done(function() {
@ -53,17 +53,17 @@
},
getPreviewUrl: function() {
var url = OC.generateUrl('/apps/files_versions/preview')
var params = {
const url = OC.generateUrl('/apps/files_versions/preview')
const params = {
file: this.get('fullPath'),
version: this.get('id')
version: this.get('id'),
}
return url + '?' + OC.buildQueryString(params)
},
getDownloadUrl: function() {
return OC.linkToRemoteBase('dav') + '/versions/' + this.get('user') + '/versions/' + this.get('fileId') + '/' + this.get('id')
}
},
})
OCA.Versions = OCA.Versions || {}

View File

@ -15,7 +15,7 @@ import Template from './templates/template.handlebars';
/**
* @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',
className: 'tab versionsTabView',
@ -24,7 +24,7 @@ import Template from './templates/template.handlebars';
$versionsContainer: null,
events: {
'click .revertVersion': '_onClickRevertVersion'
'click .revertVersion': '_onClickRevertVersion',
},
initialize: function() {
@ -57,18 +57,17 @@ import Template from './templates/template.handlebars';
},
_onClickRevertVersion: function(ev) {
var self = this
var $target = $(ev.target)
var fileInfoModel = this.collection.getFileInfo()
var revision
const self = this
let $target = $(ev.target)
const fileInfoModel = this.collection.getFileInfo()
if (!$target.is('li')) {
$target = $target.closest('li')
}
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({
success: function() {
// reset and re-fetch the updated collection
@ -85,7 +84,7 @@ import Template from './templates/template.handlebars';
size: versionModel.get('size'),
mtime: versionModel.get('timestamp') * 1000,
// 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}.',
{
file: versionModel.getFullPath(),
timestamp: OC.Util.formatDate(versionModel.get('timestamp') * 1000)
timestamp: OC.Util.formatDate(versionModel.get('timestamp') * 1000),
}),
{
type: 'error'
type: 'error',
}
)
}
},
})
// spinner
@ -125,7 +124,7 @@ import Template from './templates/template.handlebars';
},
_onAddModel: function(model) {
var $el = $(this.itemTemplate(this._formatItem(model)))
const $el = $(this.itemTemplate(this._formatItem(model)))
this.$versionsContainer.append($el)
$el.find('.has-tooltip').tooltip()
},
@ -151,10 +150,10 @@ import Template from './templates/template.handlebars';
},
_formatItem: function(version) {
var timestamp = version.get('timestamp') * 1000
var size = version.has('size') ? version.get('size') : 0
var preview = OC.MimeType.getIconUrl(version.get('mimetype'))
var img = new Image()
const timestamp = version.get('timestamp') * 1000
const size = version.has('size') ? version.get('size') : 0
const preview = OC.MimeType.getIconUrl(version.get('mimetype'))
const img = new Image()
img.onload = function() {
$('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'),
previewUrl: preview,
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)
},
@ -183,7 +182,7 @@ import Template from './templates/template.handlebars';
*/
render: function() {
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.$versionsContainer = this.$el.find('ul.versions')
@ -200,7 +199,7 @@ import Template from './templates/template.handlebars';
return false
}
return !fileInfo.isDirectory()
}
},
})
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

View File

@ -80,13 +80,13 @@ import { generateUrl } from '@nextcloud/router'
export default {
name: 'App',
components: {
OAuthItem
OAuthItem,
},
props: {
clients: {
type: Array,
required: true
}
required: true,
},
},
data: function() {
return {
@ -94,8 +94,8 @@ export default {
name: '',
redirectUri: '',
errorMsg: '',
error: false
}
error: false,
},
}
},
methods: {
@ -112,7 +112,7 @@ export default {
generateUrl('apps/oauth2/clients'),
{
name: this.newClient.name,
redirectUri: this.newClient.redirectUri
redirectUri: this.newClient.redirectUri,
}
).then(response => {
this.clients.push(response.data)
@ -123,7 +123,7 @@ export default {
this.newClient.error = true
this.newClient.errorMsg = reason.response.data.message
})
}
}
},
},
}
</script>

View File

@ -37,8 +37,8 @@ export default {
props: {
client: {
type: Object,
required: true
}
required: true,
},
},
data: function() {
return {
@ -47,7 +47,7 @@ export default {
redirectUri: this.client.redirectUri,
clientId: this.client.clientId,
clientSecret: this.client.clientSecret,
renderSecret: false
renderSecret: false,
}
},
computed: {
@ -57,13 +57,13 @@ export default {
} else {
return '****'
}
}
},
},
methods: {
toggleSecret() {
this.renderSecret = !this.renderSecret
}
}
},
},
}
</script>

View File

@ -32,7 +32,7 @@ const clients = loadState('oauth2', 'clients')
const View = Vue.extend(App)
const oauth = new View({
propsData: {
clients
}
clients,
},
})
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

View File

@ -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/>.
*/
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

View File

@ -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
* (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")}]);
//# 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

View File

@ -33,6 +33,6 @@ export default {
if (serverDataElmt !== null) {
this.$store.commit('setServerData', JSON.parse(document.getElementById('serverData').dataset.server))
}
}
},
}
</script>

View File

@ -73,14 +73,14 @@ import _ from 'lodash'
export default {
name: 'AdminTwoFactor',
components: {
Multiselect
Multiselect,
},
data() {
return {
loading: false,
dirty: false,
groups: [],
loadingGroups: false
loadingGroups: false,
}
},
computed: {
@ -91,7 +91,7 @@ export default {
set: function(val) {
this.dirty = true
this.$store.commit('setEnforced', val)
}
},
},
enforcedGroups: {
get: function() {
@ -100,7 +100,7 @@ export default {
set: function(val) {
this.dirty = true
this.$store.commit('setEnforcedGroups', val)
}
},
},
excludedGroups: {
get: function() {
@ -109,8 +109,8 @@ export default {
set: function(val) {
this.dirty = true
this.$store.commit('setExcludedGroups', val)
}
}
},
},
},
mounted() {
// Groups are loaded dynamically, but the assigned ones *should*
@ -138,7 +138,7 @@ export default {
const data = {
enforced: this.enforced,
enforcedGroups: this.enforcedGroups,
excludedGroups: this.excludedGroups
excludedGroups: this.excludedGroups,
}
axios.put(OC.generateUrl('/settings/api/admin/twofactorauth'), data)
.then(resp => resp.data)
@ -150,8 +150,8 @@ export default {
console.error('could not save changes', err)
})
.then(() => { this.loading = false })
}
}
},
},
}
</script>

View File

@ -200,13 +200,13 @@ export default {
name: 'AppDetails',
components: {
Multiselect,
AppScore
AppScore,
},
mixins: [AppManagement, PrefixMixin, SvgFilterMixin],
props: ['category', 'app'],
data() {
return {
groupCheckedAppsData: false
groupCheckedAppsData: false,
}
},
computed: {
@ -226,8 +226,8 @@ export default {
if (typeof this.app.author === 'string') {
return [
{
'@value': this.app.author
}
'@value': this.app.author,
},
]
}
if (this.app.author['@value']) {
@ -244,10 +244,11 @@ export default {
.sort((a, b) => a.name.localeCompare(b.name))
},
renderMarkdown() {
var renderer = new marked.Renderer()
const renderer = new marked.Renderer()
renderer.link = function(href, title, text) {
let prot
try {
var prot = decodeURIComponent(unescape(href))
prot = decodeURIComponent(unescape(href))
.replace(/[^\w:]/g, '')
.toLowerCase()
} catch (e) {
@ -258,7 +259,7 @@ export default {
return ''
}
var out = '<a href="' + href + '" rel="noreferrer noopener"'
let out = '<a href="' + href + '" rel="noreferrer noopener"'
if (title) {
out += ' title="' + title + '"'
}
@ -284,7 +285,7 @@ export default {
pedantic: false,
sanitize: true,
smartLists: true,
smartypants: false
smartypants: false,
}),
{
SAFE_FOR_JQUERY: true,
@ -297,17 +298,17 @@ export default {
'li',
'em',
'del',
'blockquote'
]
'blockquote',
],
}
)
}
},
},
mounted() {
if (this.app.groups.length > 0) {
this.groupCheckedAppsData = true
}
}
},
}
</script>

View File

@ -105,7 +105,7 @@ import pLimit from 'p-limit'
export default {
name: 'AppList',
components: {
AppItem
AppItem,
},
mixins: [PrefixMixin],
props: ['category', 'app', 'search'],
@ -123,7 +123,7 @@ export default {
return this.hasPendingUpdate && ['installed', 'updates'].includes(this.category)
},
apps() {
let apps = this.$store.getters.getAllApps
const apps = this.$store.getters.getAllApps
.filter(app => app.name.toLowerCase().search(this.search.toLowerCase()) !== -1)
.sort(function(a, b) {
const sortStringA = '' + (a.active ? 0 : 1) + (a.update ? 0 : 1) + a.name
@ -183,20 +183,20 @@ export default {
return (this.category === 'app-bundles')
},
allBundlesEnabled() {
let self = this
const self = this
return function(id) {
return self.bundleApps(id).filter(app => !app.active).length === 0
}
},
bundleToggleText() {
let self = this
const self = this
return function(id) {
if (self.allBundlesEnabled(id)) {
return t('settings', 'Disable all')
}
return t('settings', 'Enable all')
}
}
},
},
methods: {
toggleBundle(id) {
@ -206,7 +206,7 @@ export default {
return this.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: [] })
.catch((error) => {
console.error(error)
@ -214,7 +214,7 @@ export default {
})
},
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: [] })
.catch((error) => {
OC.Notification.show(error)
@ -226,7 +226,7 @@ export default {
.filter(app => app.update)
.map(app => limit(() => this.$store.dispatch('updateApp', { appId: app.id }))
)
}
}
},
},
}
</script>

View File

@ -114,7 +114,7 @@ import SvgFilterMixin from '../SvgFilterMixin'
export default {
name: 'AppItem',
components: {
AppScore
AppScore,
},
mixins: [AppManagement, SvgFilterMixin],
props: {
@ -122,24 +122,24 @@ export default {
category: {},
listView: {
type: Boolean,
default: true
}
default: true,
},
},
data() {
return {
isSelected: false,
scrolled: false
scrolled: false,
}
},
computed: {
hasRating() {
return this.app.appstoreData && this.app.appstoreData.ratingNumOverall > 5
}
},
},
watch: {
'$route.params.id': function(id) {
this.isSelected = (this.app.id === id)
}
},
},
mounted() {
this.isSelected = (this.app.id === this.$route.params.id)
@ -155,7 +155,7 @@ export default {
try {
await this.$router.push({
name: 'apps-details',
params: { category: this.category, id: this.app.id }
params: { category: this.category, id: this.app.id },
})
} catch (e) {
// we already view this app
@ -163,8 +163,8 @@ export default {
},
prefix(prefix, content) {
return prefix + '_' + content
}
}
},
},
}
</script>

View File

@ -29,10 +29,10 @@ export default {
props: ['score'],
computed: {
scoreImage() {
let score = Math.round(this.score * 10)
let imageName = 'rating/s' + score + '.svg'
const score = Math.round(this.score * 10)
const imageName = 'rating/s' + score + '.svg'
return OC.imagePath('core', imageName)
}
}
},
},
}
</script>

View File

@ -27,7 +27,7 @@ export default {
return this.app.groups.map(group => { return { id: group, name: group } })
},
loading() {
let self = this
const self = this
return function(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
}
},
},
mounted() {
if (this.app.groups.length > 0) {
@ -92,12 +92,12 @@ export default {
return true
},
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 })
},
removeGroupLimitation(group) {
let currentGroups = this.app.groups.concat([])
let index = currentGroups.indexOf(group.id)
const currentGroups = this.app.groups.concat([])
const index = currentGroups.indexOf(group.id)
if (index > -1) {
currentGroups.splice(index, 1)
}
@ -132,7 +132,7 @@ export default {
this.$store.dispatch('updateApp', { appId: appId })
.then((response) => { OC.Settings.Apps.rebuildNavigation() })
.catch((error) => { OC.Notification.show(error) })
}
}
},
},
}
</script>

View File

@ -88,7 +88,7 @@
import {
Actions,
ActionButton,
ActionCheckbox
ActionCheckbox,
} from 'nextcloud-vue'
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)
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
sailfishBrowser: /(Sailfish).*SailfishBrowser\/(\d+)/
sailfishBrowser: /(Sailfish).*SailfishBrowser\/(\d+)/,
}
const nameMap = {
ie: t('setting', 'Internet Explorer'),
@ -131,7 +131,7 @@ const nameMap = {
androidTalkClient: t('setting', 'Nextcloud Talk for Android'),
davDroid: 'DAVdroid',
webPirate: 'WebPirate',
sailfishBrowser: 'SailfishBrowser'
sailfishBrowser: 'SailfishBrowser',
}
const iconMap = {
ie: 'icon-desktop',
@ -148,7 +148,7 @@ const iconMap = {
androidTalkClient: 'icon-phone',
davDroid: 'icon-phone',
webPirate: 'icon-link',
sailfishBrowser: 'icon-link'
sailfishBrowser: 'icon-link',
}
export default {
@ -156,20 +156,20 @@ export default {
components: {
Actions,
ActionButton,
ActionCheckbox
ActionCheckbox,
},
props: {
token: {
type: Object,
required: true
}
required: true,
},
},
data() {
return {
showMore: this.token.canScope || this.token.canDelete,
renaming: false,
newName: '',
actionOpen: false
actionOpen: false,
}
},
computed: {
@ -181,14 +181,14 @@ export default {
},
iconName() {
// 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 = ''
if (matches) {
/* eslint-disable-next-line */
this.token.name = t('settings', 'Sync client - {os}', {
os: matches[1],
version: matches[2]
version: matches[2],
})
icon = 'icon-desktop'
}
@ -196,7 +196,7 @@ export default {
// preserve title for cases where we format it further
const title = this.token.name
let name = this.token.name
for (let client in userAgentMap) {
for (const client in userAgentMap) {
const matches = title.match(userAgentMap[client])
if (matches) {
if (matches[2] && matches[1]) { // version number and os
@ -216,12 +216,12 @@ export default {
return {
icon,
name
name,
}
},
wiping() {
return this.token.type === 2
}
},
},
methods: {
startRename() {
@ -248,8 +248,8 @@ export default {
wipe() {
this.actionOpen = false
this.$emit('wipe', this.token)
}
}
},
},
}
</script>

View File

@ -47,22 +47,22 @@ import AuthToken from './AuthToken'
export default {
name: 'AuthTokenList',
components: {
AuthToken
AuthToken,
},
props: {
tokens: {
type: Array,
required: true
}
required: true,
},
},
computed: {
sortedTokens() {
return this.tokens.slice().sort((t1, t2) => {
var ts1 = parseInt(t1.lastActivity, 10)
var ts2 = parseInt(t2.lastActivity, 10)
const ts1 = parseInt(t1.lastActivity, 10)
const ts2 = parseInt(t2.lastActivity, 10)
return ts2 - ts1
})
}
},
},
methods: {
toggleScope(token, scope, value) {
@ -80,8 +80,8 @@ export default {
onWipe(token) {
// Just pass it on
this.$emit('wipe', token)
}
}
},
},
}
</script>

View File

@ -66,21 +66,21 @@ export default {
name: 'AuthTokenSection',
components: {
AuthTokenSetupDialogue,
AuthTokenList
AuthTokenList,
},
props: {
tokens: {
type: Array,
required: true
required: true,
},
canCreateToken: {
type: Boolean,
required: true
}
required: true,
},
},
data() {
return {
baseUrl: OC.generateUrl('/settings/personal/authtokens')
baseUrl: OC.generateUrl('/settings/personal/authtokens'),
}
},
methods: {
@ -88,7 +88,7 @@ export default {
console.debug('creating a new app token', name)
const data = {
name
name,
}
return axios.post(this.baseUrl, data)
.then(resp => resp.data)
@ -172,8 +172,8 @@ export default {
console.error('could not wipe app token', err)
OC.Notification.showTemporary(t('core', 'Error while wiping the device with the token'))
}
}
}
},
},
}
</script>

View File

@ -83,13 +83,13 @@ import confirmPassword from 'nextcloud-password-confirmation'
export default {
name: 'AuthTokenSetupDialogue',
components: {
QR
QR,
},
props: {
add: {
type: Function,
required: true
}
required: true,
},
},
data() {
return {
@ -101,30 +101,30 @@ export default {
passwordCopied: false,
showQR: false,
qrUrl: '',
hoveringCopyButton: false
hoveringCopyButton: false,
}
},
computed: {
copyTooltipOptions() {
const base = {
hideOnTargetClick: false,
trigger: 'manual'
trigger: 'manual',
}
if (this.passwordCopied) {
return {
...base,
content: t('core', 'Copied!'),
show: true
show: true,
}
} else {
return {
...base,
content: t('core', 'Copy'),
show: this.hoveringCopyButton
show: this.hoveringCopyButton,
}
}
}
},
},
methods: {
selectInput(e) {
@ -171,8 +171,8 @@ export default {
this.deviceName = ''
this.appPassword = ''
this.loginName = ''
}
}
},
},
}
</script>

View File

@ -26,7 +26,7 @@ export default {
methods: {
prefix(prefix, content) {
return prefix + '_' + content
}
}
},
},
}
</script>

View File

@ -25,16 +25,16 @@ export default {
name: 'SvgFilterMixin',
data() {
return {
filterId: ''
filterId: '',
}
},
computed: {
filterUrl() {
return `url(#${this.filterId})`
}
},
},
mounted() {
this.filterId = 'invertIconApps' + Math.floor((Math.random() * 100)) + new Date().getSeconds() + new Date().getMilliseconds()
}
},
}
</script>

View File

@ -242,11 +242,11 @@ import Vue from 'vue'
const unlimitedQuota = {
id: 'none',
label: t('settings', 'Unlimited')
label: t('settings', 'Unlimited'),
}
const defaultQuota = {
id: 'default',
label: t('settings', 'Default quota')
label: t('settings', 'Default quota'),
}
const newUser = {
id: '',
@ -258,8 +258,8 @@ const newUser = {
quota: defaultQuota,
language: {
code: 'en',
name: t('settings', 'Default language')
}
name: t('settings', 'Default language'),
},
}
export default {
@ -267,25 +267,25 @@ export default {
components: {
userRow,
Multiselect,
InfiniteLoading
InfiniteLoading,
},
props: {
users: {
type: Array,
default: () => []
default: () => [],
},
showConfig: {
type: Object,
required: true
required: true,
},
selectedGroup: {
type: String,
default: null
default: null,
},
externalActions: {
type: Array,
default: () => []
}
default: () => [],
},
},
data() {
return {
@ -293,11 +293,11 @@ export default {
defaultQuota,
loading: {
all: false,
groups: false
groups: false,
},
scrolled: false,
searchQuery: '',
newUser: Object.assign({}, newUser)
newUser: Object.assign({}, newUser),
}
},
computed: {
@ -336,9 +336,9 @@ export default {
},
quotaOptions() {
// 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,
label: cur
label: cur,
}), [])
// add default presets
quotaPreset.unshift(this.unlimitedQuota)
@ -363,14 +363,14 @@ export default {
return [
{
label: t('settings', 'Common languages'),
languages: this.settings.languages.commonlanguages
languages: this.settings.languages.commonlanguages,
},
{
label: t('settings', 'All languages'),
languages: this.settings.languages.languages
}
languages: this.settings.languages.languages,
},
]
}
},
},
watch: {
// watch url change and group select
@ -394,7 +394,7 @@ export default {
} else if (val === 1 && old === 0) {
this.$refs.infiniteLoading.stateChanger.loaded()
}
}
},
},
mounted() {
if (!this.settings.canChangePassword) {
@ -429,7 +429,7 @@ export default {
*/
validateQuota(quota) {
// 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) {
// unify format output
quota = OC.Util.humanFileSize(OC.Util.computerFileSize(quota))
@ -446,7 +446,7 @@ export default {
offset: this.usersOffset,
limit: this.usersLimit,
group: this.selectedGroup !== 'disabled' ? this.selectedGroup : '',
search: this.searchQuery
search: this.searchQuery,
})
.then((response) => {
response ? $state.loaded() : $state.complete()
@ -494,7 +494,7 @@ export default {
groups: this.newUser.groups.map(group => group.id),
subadmin: this.newUser.subAdminsGroups.map(group => group.id),
quota: this.newUser.quota.id,
language: this.newUser.language.code
language: this.newUser.language.code,
})
.then(() => {
this.resetForm()
@ -517,7 +517,7 @@ export default {
setNewUserDefaultGroup(value) {
if (value && value.length > 0) {
// 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) {
this.newUser.groups = [currentGroup]
return
@ -560,7 +560,7 @@ export default {
this.$router.push({ name: 'users' })
this.$refs.infiniteLoading.stateChanger.reset()
}
}
}
},
},
}
</script>

View File

@ -241,7 +241,7 @@ import {
PopoverMenu,
Multiselect,
Actions,
ActionButton
ActionButton,
} from 'nextcloud-vue'
import UserRowSimple from './UserRowSimple'
import UserRowMixin from '../../mixins/UserRowMixin'
@ -255,45 +255,45 @@ export default {
PopoverMenu,
Actions,
ActionButton,
Multiselect
Multiselect,
},
directives: {
ClickOutside
ClickOutside,
},
mixins: [UserRowMixin],
props: {
user: {
type: Object,
required: true
required: true,
},
settings: {
type: Object,
default: () => ({})
default: () => ({}),
},
groups: {
type: Array,
default: () => []
default: () => [],
},
subAdminsGroups: {
type: Array,
default: () => []
default: () => [],
},
quotaOptions: {
type: Array,
default: () => []
default: () => [],
},
showConfig: {
type: Object,
default: () => ({})
default: () => ({}),
},
languages: {
type: Array,
required: true
required: true,
},
externalActions: {
type: Array,
default: () => []
}
default: () => [],
},
},
data() {
return {
@ -312,39 +312,39 @@ export default {
delete: false,
disable: false,
languages: false,
wipe: false
}
wipe: false,
},
}
},
computed: {
/* USER POPOVERMENU ACTIONS */
userActions() {
let actions = [
const actions = [
{
icon: 'icon-delete',
text: t('settings', 'Delete user'),
action: this.deleteUser
action: this.deleteUser,
},
{
icon: 'icon-delete',
text: t('settings', 'Wipe all devices'),
action: this.wipeUserDevices
action: this.wipeUserDevices,
},
{
icon: this.user.enabled ? 'icon-close' : 'icon-add',
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 !== '') {
actions.push({
icon: 'icon-mail',
text: t('settings', 'Resend welcome email'),
action: this.sendWelcomeMail
action: this.sendWelcomeMail,
})
}
return actions.concat(this.externalActions)
}
},
},
methods: {
@ -357,7 +357,7 @@ export default {
},
wipeUserDevices() {
let userid = this.user.id
const userid = this.user.id
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', 'Remote wipe of devices'),
@ -365,7 +365,7 @@ export default {
type: OC.dialogs.YES_NO_BUTTONS,
confirm: t('settings', 'Wipe {userid}\'s devices', { userid: userid }),
confirmClasses: 'error',
cancel: t('settings', 'Cancel')
cancel: t('settings', 'Cancel'),
},
(result) => {
if (result) {
@ -383,7 +383,7 @@ export default {
},
deleteUser() {
let userid = this.user.id
const userid = this.user.id
OC.dialogs.confirmDestructive(
t('settings', 'Fully delete {userid}\'s account including all their personal files, app data, etc.', { userid: userid }),
t('settings', 'Account deletion'),
@ -391,7 +391,7 @@ export default {
type: OC.dialogs.YES_NO_BUTTONS,
confirm: t('settings', 'Delete {userid}\'s account', { userid: userid }),
confirmClasses: 'error',
cancel: t('settings', 'Cancel')
cancel: t('settings', 'Cancel'),
},
(result) => {
if (result) {
@ -411,11 +411,11 @@ export default {
enableDisableUser() {
this.loading.delete = true
this.loading.all = true
let userid = this.user.id
let enabled = !this.user.enabled
const userid = this.user.id
const enabled = !this.user.enabled
return this.$store.dispatch('enableDisableUser', {
userid,
enabled
enabled,
})
.then(() => {
this.loading.delete = false
@ -429,12 +429,12 @@ export default {
* @param {string} displayName The display name
*/
updateDisplayName() {
let displayName = this.$refs.displayName.value
const displayName = this.$refs.displayName.value
this.loading.displayName = true
this.$store.dispatch('setUserData', {
userid: this.user.id,
key: 'displayname',
value: displayName
value: displayName,
}).then(() => {
this.loading.displayName = false
this.$refs.displayName.value = displayName
@ -447,12 +447,12 @@ export default {
* @param {string} password The email adress
*/
updatePassword() {
let password = this.$refs.password.value
const password = this.$refs.password.value
this.loading.password = true
this.$store.dispatch('setUserData', {
userid: this.user.id,
key: 'password',
value: password
value: password,
}).then(() => {
this.loading.password = false
this.$refs.password.value = '' // empty & show placeholder
@ -465,12 +465,12 @@ export default {
* @param {string} mailAddress The email adress
*/
updateEmail() {
let mailAddress = this.$refs.mailAddress.value
const mailAddress = this.$refs.mailAddress.value
this.loading.mailAddress = true
this.$store.dispatch('setUserData', {
userid: this.user.id,
key: 'email',
value: mailAddress
value: mailAddress,
}).then(() => {
this.loading.mailAddress = false
this.$refs.mailAddress.value = mailAddress
@ -486,7 +486,7 @@ export default {
this.loading = { groups: true, subadmins: true }
try {
await this.$store.dispatch('addGroup', gid)
let userid = this.user.id
const userid = this.user.id
await this.$store.dispatch('addUserGroup', { userid, gid })
} catch (error) {
console.error(error)
@ -506,8 +506,8 @@ export default {
return false
}
this.loading.groups = true
let userid = this.user.id
let gid = group.id
const userid = this.user.id
const gid = group.id
try {
await this.$store.dispatch('addUserGroup', { userid, gid })
} catch (error) {
@ -528,13 +528,13 @@ export default {
}
this.loading.groups = true
let userid = this.user.id
let gid = group.id
const userid = this.user.id
const gid = group.id
try {
await this.$store.dispatch('removeUserGroup', {
userid,
gid
gid,
})
this.loading.groups = false
// remove user from current list if current list is the removed group
@ -553,13 +553,13 @@ export default {
*/
async addUserSubAdmin(group) {
this.loading.subadmins = true
let userid = this.user.id
let gid = group.id
const userid = this.user.id
const gid = group.id
try {
await this.$store.dispatch('addUserSubAdmin', {
userid,
gid
gid,
})
this.loading.subadmins = false
} catch (error) {
@ -574,13 +574,13 @@ export default {
*/
async removeUserSubAdmin(group) {
this.loading.subadmins = true
let userid = this.user.id
let gid = group.id
const userid = this.user.id
const gid = group.id
try {
await this.$store.dispatch('removeUserSubAdmin', {
userid,
gid
gid,
})
} catch (error) {
console.error(error)
@ -604,7 +604,7 @@ export default {
await this.$store.dispatch('setUserData', {
userid: this.user.id,
key: 'quota',
value: quota
value: quota,
})
} catch (error) {
console.error(error)
@ -622,7 +622,7 @@ export default {
*/
validateQuota(quota) {
// 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) {
// unify format output
return this.setUserQuota(OC.Util.humanFileSize(OC.Util.computerFileSize(quota)))
@ -644,7 +644,7 @@ export default {
await this.$store.dispatch('setUserData', {
userid: this.user.id,
key: 'language',
value: lang.code
value: lang.code,
})
} catch (error) {
console.error(error)
@ -670,8 +670,8 @@ export default {
}
this.loading.all = false
})
}
},
}
},
}
</script>

View File

@ -81,45 +81,45 @@ export default {
components: {
PopoverMenu,
ActionButton,
Actions
Actions,
},
directives: {
ClickOutside
ClickOutside,
},
mixins: [UserRowMixin],
props: {
user: {
type: Object,
required: true
required: true,
},
loading: {
type: Object,
required: true
required: true,
},
showConfig: {
type: Object,
required: true
required: true,
},
userActions: {
type: Array,
required: true
required: true,
},
openedMenu: {
type: Boolean,
required: true
required: true,
},
feedbackMessage: {
type: String,
required: true
required: true,
},
subAdminsGroups: {
type: Array,
required: true
required: true,
},
settings: {
type: Object,
required: true
}
required: true,
},
},
computed: {
userGroupsLabels() {
@ -140,7 +140,7 @@ export default {
},
canEdit() {
return getCurrentUser().uid !== this.user.id && this.user.id !== 'admin'
}
},
},
methods: {
@ -149,8 +149,8 @@ export default {
},
toggleEdit() {
this.$emit('update:editing', true)
}
}
},
},
}
</script>

View File

@ -19,5 +19,5 @@ store.replaceState(
const View = Vue.extend(AdminTwoFactor)
new View({
store
store,
}).$mount('#two-factor-auth-settings')

View File

@ -52,7 +52,7 @@ Vue.prototype.oc_userconfig = oc_userconfig
const app = new Vue({
router,
store,
render: h => h(App)
render: h => h(App),
}).$mount('#content')
export { app, router, store }

View File

@ -37,6 +37,6 @@ const View = Vue.extend(AuthTokenSection)
new View({
propsData: {
tokens: loadState('settings', 'app_tokens'),
canCreateToken: loadState('settings', 'can_create_app_token')
}
canCreateToken: loadState('settings', 'can_create_app_token'),
},
}).$mount('#security-authtokens')

View File

@ -24,36 +24,36 @@ export default {
props: {
user: {
type: Object,
required: true
required: true,
},
settings: {
type: Object,
default: () => ({})
default: () => ({}),
},
groups: {
type: Array,
default: () => []
default: () => [],
},
subAdminsGroups: {
type: Array,
default: () => []
default: () => [],
},
quotaOptions: {
type: Array,
default: () => []
default: () => [],
},
showConfig: {
type: Object,
default: () => ({})
default: () => ({}),
},
languages: {
type: Array,
required: true
required: true,
},
externalActions: {
type: Array,
default: () => []
}
default: () => [],
},
},
computed: {
/* GROUPS MANAGEMENT */
@ -69,7 +69,7 @@ export default {
return this.groups.map((group) => {
// clone object because we don't want
// to edit the original groups
let groupClone = Object.assign({}, group)
const groupClone = Object.assign({}, group)
// two settings here:
// 1. user NOT in group but no permission to add
@ -95,7 +95,7 @@ export default {
if (quota > 0) {
quota = Math.min(100, Math.round(this.user.quota.used / quota * 100))
} 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
quota = 95 * (1 - (1 / (usedInGB + 1)))
}
@ -105,8 +105,8 @@ export default {
userQuota() {
if (this.user.quota.quota >= 0) {
// if value is valid, let's map the quotaOptions or return custom quota
let humanQuota = OC.Util.humanFileSize(this.user.quota.quota)
let userQuota = this.quotaOptions.find(quota => quota.id === humanQuota)
const humanQuota = OC.Util.humanFileSize(this.user.quota.quota)
const userQuota = this.quotaOptions.find(quota => quota.id === humanQuota)
return userQuota || { id: humanQuota, label: humanQuota }
} else if (this.user.quota.quota === 'default') {
// default quota is replaced by the proper value on load
@ -122,12 +122,12 @@ export default {
/* LANGUAGE */
userLanguage() {
let availableLanguages = this.languages[0].languages.concat(this.languages[1].languages)
let userLang = availableLanguages.find(lang => lang.code === this.user.language)
const availableLanguages = this.languages[0].languages.concat(this.languages[1].languages)
const userLang = availableLanguages.find(lang => lang.code === this.user.language)
if (typeof userLang !== 'object' && this.user.language !== '') {
return {
code: this.user.language,
name: this.user.language
name: this.user.language,
}
} else if (this.user.language === '') {
return false
@ -147,7 +147,7 @@ export default {
return OC.Util.relativeModifiedDate(this.user.lastLogin)
}
return t('settings', 'Never')
}
},
},
methods: {
/**
@ -163,9 +163,9 @@ export default {
{
user: user,
size: size,
version: oc_userconfig.avatar.version
version: oc_userconfig.avatar.version,
}
)
}
}
},
},
}

View File

@ -55,9 +55,9 @@ export default new Router({
{
path: ':selectedGroup(.*)',
name: 'group',
component: Users
}
]
component: Users,
},
],
},
{
path: '/:index(index.php/)?settings/apps',
@ -73,11 +73,11 @@ export default new Router({
{
path: ':id',
name: 'apps-details',
component: Apps
}
]
}
]
}
]
component: Apps,
},
],
},
],
},
],
})

View File

@ -27,7 +27,7 @@ Vue.use(Vuex)
const state = {
enforced: false,
enforcedGroups: [],
excludedGroups: []
excludedGroups: [],
}
const mutations = {
@ -39,11 +39,11 @@ const mutations = {
},
setExcludedGroups(state, used) {
Vue.set(state, 'excludedGroups', used)
}
},
}
export default new Vuex.Store({
strict: process.env.NODE_ENV !== 'production',
state,
mutations
mutations,
})

View File

@ -77,5 +77,5 @@ export default {
},
delete(url, data) {
return axios.delete(sanitize(url), { data: data })
}
},
}

View File

@ -28,7 +28,7 @@ const state = {
categories: [],
updateCount: 0,
loading: {},
loadingList: false
loadingList: false,
}
const mutations = {
@ -65,24 +65,24 @@ const mutations = {
appId = [appId]
}
appId.forEach((_id) => {
let app = state.apps.find(app => app.id === _id)
const app = state.apps.find(app => app.id === _id)
app.error = 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
},
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.groups = groups
},
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.groups = []
if (app.removable) {
@ -100,8 +100,8 @@ const mutations = {
},
updateApp(state, appId) {
let app = state.apps.find(app => app.id === appId)
let version = app.update
const app = state.apps.find(app => app.id === appId)
const version = app.update
app.update = null
app.version = version
state.updateCount--
@ -133,7 +133,7 @@ const mutations = {
} else {
Vue.set(state.loading, id, false)
}
}
},
}
const getters = {
@ -150,7 +150,7 @@ const getters = {
},
getUpdateCount(state) {
return state.updateCount
}
},
}
const actions = {
@ -197,7 +197,7 @@ const actions = {
if (!Array.isArray(appId)) {
context.commit('setError', {
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('setError', {
appId: apps,
error: error.response.data.data.message
error: error.response.data.data.message,
})
context.commit('APPS_API_FAILURE', { appId, error })
})
@ -233,7 +233,7 @@ const actions = {
context.commit('stopLoading', 'install')
context.commit('setError', {
appId: apps,
error: error.response.data.data.message
error: error.response.data.data.message,
})
context.commit('APPS_API_FAILURE', { appId, error })
})
@ -320,7 +320,7 @@ const actions = {
return false
})
.catch((error) => context.commit('API_FAILURE', error))
}
},
}

View File

@ -35,13 +35,13 @@ const debug = process.env.NODE_ENV !== 'production'
const mutations = {
API_FAILURE(state, error) {
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 })
} catch (e) {
OC.Notification.showTemporary(t('settings', 'An error occured during the request. Unable to proceed.'))
}
console.error(state, error)
}
},
}
export default new Vuex.Store({
@ -49,9 +49,9 @@ export default new Vuex.Store({
users,
apps,
settings,
oc
oc,
},
strict: debug,
mutations
mutations,
})

View File

@ -41,7 +41,7 @@ const actions = {
return api.post(OC.linkToOCS(`apps/provisioning_api/api/v1/config/apps/${app}/${key}`, 2), { value: value })
.catch((error) => { throw error })
}).catch((error) => context.commit('API_FAILURE', { app, key, value, error }))
}
},
}
export default { state, mutations, getters, actions }

View File

@ -21,17 +21,17 @@
*/
const state = {
serverData: {}
serverData: {},
}
const mutations = {
setServerData(state, data) {
state.serverData = data
}
},
}
const getters = {
getServerData(state) {
return state.serverData
}
},
}
const actions = {}

View File

@ -41,8 +41,8 @@ const defaults = {
usercount: 0,
disabled: 0,
canAdd: true,
canRemove: true
}
canRemove: true,
},
}
const state = {
@ -52,13 +52,13 @@ const state = {
minPasswordLength: 0,
usersOffset: 0,
usersLimit: 25,
userCount: 0
userCount: 0,
}
const mutations = {
appendUsers(state, usersObj) {
// 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.users = users
},
@ -78,9 +78,9 @@ const mutations = {
return
}
// extend group to default values
let group = Object.assign({}, defaults.group, {
const group = Object.assign({}, defaults.group, {
id: gid,
name: displayName
name: displayName,
})
state.groups.push(group)
state.groups = orderGroups(state.groups, state.orderBy)
@ -89,50 +89,50 @@ const mutations = {
}
},
removeGroup(state, gid) {
let groupIndex = state.groups.findIndex(groupSearch => groupSearch.id === gid)
const groupIndex = state.groups.findIndex(groupSearch => groupSearch.id === gid)
if (groupIndex >= 0) {
state.groups.splice(groupIndex, 1)
}
},
addUserGroup(state, { userid, gid }) {
let group = state.groups.find(groupSearch => groupSearch.id === gid)
let user = state.users.find(user => user.id === userid)
const group = state.groups.find(groupSearch => groupSearch.id === gid)
const user = state.users.find(user => user.id === userid)
// increase count if user is enabled
if (group && user.enabled && state.userCount > 0) {
group.usercount++
}
let groups = user.groups
const groups = user.groups
groups.push(gid)
state.groups = orderGroups(state.groups, state.orderBy)
},
removeUserGroup(state, { userid, gid }) {
let group = state.groups.find(groupSearch => groupSearch.id === gid)
let user = state.users.find(user => user.id === userid)
const group = state.groups.find(groupSearch => groupSearch.id === gid)
const user = state.users.find(user => user.id === userid)
// lower count if user is enabled
if (group && user.enabled && state.userCount > 0) {
group.usercount--
}
let groups = user.groups
const groups = user.groups
groups.splice(groups.indexOf(gid), 1)
state.groups = orderGroups(state.groups, state.orderBy)
},
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)
},
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)
},
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)
},
addUserData(state, response) {
state.users.push(response.data.ocs.data)
},
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
// increment or not
if (state.userCount > 0) {
@ -146,7 +146,7 @@ const mutations = {
},
setUserData(state, { userid, key, value }) {
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
} else {
state.users.find(user => user.id === userid)[key] = value
@ -160,7 +160,7 @@ const mutations = {
resetUsers(state) {
state.users = []
state.usersOffset = 0
}
},
}
const getters = {
@ -185,7 +185,7 @@ const getters = {
},
getUserCount(state) {
return state.userCount
}
},
}
const actions = {
@ -229,7 +229,7 @@ const actions = {
getGroups(context, { offset, limit, 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))
.then((response) => {
if (Object.keys(response.data.ocs.data.groups).length > 0) {
@ -477,7 +477,7 @@ const actions = {
* @returns {Promise}
*/
enableDisableUser(context, { userid, enabled = true }) {
let userStatus = enabled ? 'enable' : 'disable'
const userStatus = enabled ? 'enable' : 'disable'
return api.requireAdmin().then((response) => {
return api.put(OC.linkToOCS(`cloud/users/${userid}/${userStatus}`, 2))
.then((response) => context.commit('enableDisableUser', { userid, enabled }))
@ -496,7 +496,7 @@ const actions = {
* @returns {Promise}
*/
setUserData(context, { userid, key, value }) {
let allowedEmpty = ['email', 'displayname']
const allowedEmpty = ['email', 'displayname']
if (['email', 'language', 'quota', 'displayname', 'password'].indexOf(key) !== -1) {
// We allow empty email or displayname
if (typeof value === 'string'
@ -528,7 +528,7 @@ const actions = {
.then(response => true)
.catch((error) => { throw error })
}).catch((error) => context.commit('API_FAILURE', { userid, error }))
}
},
}
export default { state, mutations, getters, actions }

View File

@ -45,7 +45,7 @@ import {
AppNavigation,
AppNavigationItem,
AppSidebar,
Content
Content,
} from 'nextcloud-vue'
import AppList from '../components/AppList'
import Vue from 'vue'
@ -63,21 +63,21 @@ export default {
AppSidebar,
Content,
AppDetails,
AppList
AppList,
},
props: {
category: {
type: String,
default: 'installed'
default: 'installed',
},
id: {
type: String,
default: ''
}
default: '',
},
},
data() {
return {
searchQuery: ''
searchQuery: '',
}
},
computed: {
@ -111,13 +111,13 @@ export default {
// Map groups
categories = categories.map(category => {
let item = {}
const item = {}
item.id = 'app-category-' + category.ident
item.icon = 'icon-category-' + category.ident
item.classes = [] // empty classes, active will be set later
item.router = { // router link to
name: 'apps-category',
params: { category: category.ident }
params: { category: category.ident },
}
item.text = category.displayName
@ -125,27 +125,27 @@ export default {
})
// Add everyone group
let defaultCategories = [
const defaultCategories = [
{
id: 'app-category-your-apps',
classes: [],
router: { name: 'apps' },
icon: 'icon-category-installed',
text: t('settings', 'Your apps')
text: t('settings', 'Your apps'),
},
{
id: 'app-category-enabled',
classes: [],
icon: 'icon-category-enabled',
router: { name: 'apps-category', params: { category: 'enabled' } },
text: t('settings', 'Active apps')
text: t('settings', 'Active apps'),
}, {
id: 'app-category-disabled',
classes: [],
icon: 'icon-category-disabled',
router: { name: 'apps-category', params: { category: 'disabled' } },
text: t('settings', 'Disabled apps')
}
text: t('settings', 'Disabled apps'),
},
]
if (!this.settings.appstoreEnabled) {
@ -159,7 +159,7 @@ export default {
icon: 'icon-download',
router: { name: 'apps-category', params: { category: 'updates' } },
text: t('settings', 'Updates'),
utils: { counter: this.$store.getters.getUpdateCount }
utils: { counter: this.$store.getters.getUpdateCount },
})
}
@ -168,13 +168,13 @@ export default {
classes: [],
icon: 'icon-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)
// 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) {
categories[activeGroup].classes.push('active')
} else {
@ -185,17 +185,17 @@ export default {
id: 'app-developer-docs',
classes: [],
href: this.settings.developerDocumentation,
text: t('settings', 'Developer documentation') + ' ↗'
text: t('settings', 'Developer documentation') + ' ↗',
})
// Return
return categories
}
},
},
watch: {
category: function(val, old) {
this.setSearch('')
}
},
},
beforeMount() {
this.$store.dispatch('getCategories')
@ -219,9 +219,9 @@ export default {
hideAppDetails() {
this.$router.push({
name: 'apps-category',
params: { category: this.category }
params: { category: this.category },
})
}
}
},
},
}
</script>

Some files were not shown because too many files have changed in this diff Show More