Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'apps/settings/src')
-rw-r--r--apps/settings/src/App.vue2
-rw-r--r--apps/settings/src/components/AdminTwoFactor.vue18
-rw-r--r--apps/settings/src/components/AppDetails.vue25
-rw-r--r--apps/settings/src/components/AppList.vue18
-rw-r--r--apps/settings/src/components/AppList/AppItem.vue18
-rw-r--r--apps/settings/src/components/AppList/AppScore.vue8
-rw-r--r--apps/settings/src/components/AppManagement.vue14
-rw-r--r--apps/settings/src/components/AuthToken.vue30
-rw-r--r--apps/settings/src/components/AuthTokenList.vue16
-rw-r--r--apps/settings/src/components/AuthTokenSection.vue16
-rw-r--r--apps/settings/src/components/AuthTokenSetupDialogue.vue20
-rw-r--r--apps/settings/src/components/PrefixMixin.vue4
-rw-r--r--apps/settings/src/components/SvgFilterMixin.vue6
-rw-r--r--apps/settings/src/components/UserList.vue50
-rw-r--r--apps/settings/src/components/UserList/UserRow.vue102
-rw-r--r--apps/settings/src/components/UserList/UserRowSimple.vue28
-rw-r--r--apps/settings/src/main-admin-security.js2
-rw-r--r--apps/settings/src/main-apps-users-management.js2
-rw-r--r--apps/settings/src/main-personal-security.js4
-rw-r--r--apps/settings/src/mixins/UserRowMixin.js40
-rw-r--r--apps/settings/src/router.js20
-rw-r--r--apps/settings/src/store/admin-security.js6
-rw-r--r--apps/settings/src/store/api.js2
-rw-r--r--apps/settings/src/store/apps.js26
-rw-r--r--apps/settings/src/store/index.js8
-rw-r--r--apps/settings/src/store/oc.js2
-rw-r--r--apps/settings/src/store/settings.js6
-rw-r--r--apps/settings/src/store/users.js48
-rw-r--r--apps/settings/src/views/Apps.vue44
-rw-r--r--apps/settings/src/views/Users.vue82
30 files changed, 334 insertions, 333 deletions
diff --git a/apps/settings/src/App.vue b/apps/settings/src/App.vue
index 591a784c02a..ed0441fa40a 100644
--- a/apps/settings/src/App.vue
+++ b/apps/settings/src/App.vue
@@ -33,6 +33,6 @@ export default {
if (serverDataElmt !== null) {
this.$store.commit('setServerData', JSON.parse(document.getElementById('serverData').dataset.server))
}
- }
+ },
}
</script>
diff --git a/apps/settings/src/components/AdminTwoFactor.vue b/apps/settings/src/components/AdminTwoFactor.vue
index 7a9645527c1..45643dc84b6 100644
--- a/apps/settings/src/components/AdminTwoFactor.vue
+++ b/apps/settings/src/components/AdminTwoFactor.vue
@@ -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>
diff --git a/apps/settings/src/components/AppDetails.vue b/apps/settings/src/components/AppDetails.vue
index 4300ccf0673..c20819f297e 100644
--- a/apps/settings/src/components/AppDetails.vue
+++ b/apps/settings/src/components/AppDetails.vue
@@ -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>
diff --git a/apps/settings/src/components/AppList.vue b/apps/settings/src/components/AppList.vue
index 3259011497a..2fecf137dd8 100644
--- a/apps/settings/src/components/AppList.vue
+++ b/apps/settings/src/components/AppList.vue
@@ -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>
diff --git a/apps/settings/src/components/AppList/AppItem.vue b/apps/settings/src/components/AppList/AppItem.vue
index d6d27cc6f8c..d00c62910f7 100644
--- a/apps/settings/src/components/AppList/AppItem.vue
+++ b/apps/settings/src/components/AppList/AppItem.vue
@@ -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>
diff --git a/apps/settings/src/components/AppList/AppScore.vue b/apps/settings/src/components/AppList/AppScore.vue
index 810a8b54e8f..f3ff80b7792 100644
--- a/apps/settings/src/components/AppList/AppScore.vue
+++ b/apps/settings/src/components/AppList/AppScore.vue
@@ -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>
diff --git a/apps/settings/src/components/AppManagement.vue b/apps/settings/src/components/AppManagement.vue
index 4de40728c5d..8d9ebed5e42 100644
--- a/apps/settings/src/components/AppManagement.vue
+++ b/apps/settings/src/components/AppManagement.vue
@@ -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>
diff --git a/apps/settings/src/components/AuthToken.vue b/apps/settings/src/components/AuthToken.vue
index 034efc4b6a8..7486aa6089a 100644
--- a/apps/settings/src/components/AuthToken.vue
+++ b/apps/settings/src/components/AuthToken.vue
@@ -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>
diff --git a/apps/settings/src/components/AuthTokenList.vue b/apps/settings/src/components/AuthTokenList.vue
index 65f42197eda..d0dfa6d92fc 100644
--- a/apps/settings/src/components/AuthTokenList.vue
+++ b/apps/settings/src/components/AuthTokenList.vue
@@ -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>
diff --git a/apps/settings/src/components/AuthTokenSection.vue b/apps/settings/src/components/AuthTokenSection.vue
index 72fadcd2fe2..e6643903cdc 100644
--- a/apps/settings/src/components/AuthTokenSection.vue
+++ b/apps/settings/src/components/AuthTokenSection.vue
@@ -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>
diff --git a/apps/settings/src/components/AuthTokenSetupDialogue.vue b/apps/settings/src/components/AuthTokenSetupDialogue.vue
index 22c867b3c96..0ffd0f25323 100644
--- a/apps/settings/src/components/AuthTokenSetupDialogue.vue
+++ b/apps/settings/src/components/AuthTokenSetupDialogue.vue
@@ -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>
diff --git a/apps/settings/src/components/PrefixMixin.vue b/apps/settings/src/components/PrefixMixin.vue
index e43063d25b0..cd37416b27f 100644
--- a/apps/settings/src/components/PrefixMixin.vue
+++ b/apps/settings/src/components/PrefixMixin.vue
@@ -26,7 +26,7 @@ export default {
methods: {
prefix(prefix, content) {
return prefix + '_' + content
- }
- }
+ },
+ },
}
</script>
diff --git a/apps/settings/src/components/SvgFilterMixin.vue b/apps/settings/src/components/SvgFilterMixin.vue
index eab5bee973b..228b574f3c4 100644
--- a/apps/settings/src/components/SvgFilterMixin.vue
+++ b/apps/settings/src/components/SvgFilterMixin.vue
@@ -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>
diff --git a/apps/settings/src/components/UserList.vue b/apps/settings/src/components/UserList.vue
index fc3ee47065a..0fb1d09fbf7 100644
--- a/apps/settings/src/components/UserList.vue
+++ b/apps/settings/src/components/UserList.vue
@@ -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>
diff --git a/apps/settings/src/components/UserList/UserRow.vue b/apps/settings/src/components/UserList/UserRow.vue
index c818cc3e733..39d98f46f97 100644
--- a/apps/settings/src/components/UserList/UserRow.vue
+++ b/apps/settings/src/components/UserList/UserRow.vue
@@ -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>
diff --git a/apps/settings/src/components/UserList/UserRowSimple.vue b/apps/settings/src/components/UserList/UserRowSimple.vue
index 247bfb063ce..008fcc557f3 100644
--- a/apps/settings/src/components/UserList/UserRowSimple.vue
+++ b/apps/settings/src/components/UserList/UserRowSimple.vue
@@ -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>
diff --git a/apps/settings/src/main-admin-security.js b/apps/settings/src/main-admin-security.js
index 345d1b3407b..5be21450fd2 100644
--- a/apps/settings/src/main-admin-security.js
+++ b/apps/settings/src/main-admin-security.js
@@ -19,5 +19,5 @@ store.replaceState(
const View = Vue.extend(AdminTwoFactor)
new View({
- store
+ store,
}).$mount('#two-factor-auth-settings')
diff --git a/apps/settings/src/main-apps-users-management.js b/apps/settings/src/main-apps-users-management.js
index e7d5b4e91c3..0847ed87062 100644
--- a/apps/settings/src/main-apps-users-management.js
+++ b/apps/settings/src/main-apps-users-management.js
@@ -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 }
diff --git a/apps/settings/src/main-personal-security.js b/apps/settings/src/main-personal-security.js
index 85a88bf8f1d..958c9da5e39 100644
--- a/apps/settings/src/main-personal-security.js
+++ b/apps/settings/src/main-personal-security.js
@@ -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')
diff --git a/apps/settings/src/mixins/UserRowMixin.js b/apps/settings/src/mixins/UserRowMixin.js
index ff1276fdd15..c997d2ea945 100644
--- a/apps/settings/src/mixins/UserRowMixin.js
+++ b/apps/settings/src/mixins/UserRowMixin.js
@@ -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,
}
)
- }
- }
+ },
+ },
}
diff --git a/apps/settings/src/router.js b/apps/settings/src/router.js
index 7612fdea895..c11c74ac163 100644
--- a/apps/settings/src/router.js
+++ b/apps/settings/src/router.js
@@ -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,
+ },
+ ],
+ },
+ ],
+ },
+ ],
})
diff --git a/apps/settings/src/store/admin-security.js b/apps/settings/src/store/admin-security.js
index e86783557f2..c71f40a1e85 100644
--- a/apps/settings/src/store/admin-security.js
+++ b/apps/settings/src/store/admin-security.js
@@ -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,
})
diff --git a/apps/settings/src/store/api.js b/apps/settings/src/store/api.js
index 313ef7d0d23..ec29c8fa87f 100644
--- a/apps/settings/src/store/api.js
+++ b/apps/settings/src/store/api.js
@@ -77,5 +77,5 @@ export default {
},
delete(url, data) {
return axios.delete(sanitize(url), { data: data })
- }
+ },
}
diff --git a/apps/settings/src/store/apps.js b/apps/settings/src/store/apps.js
index 47698382904..309932ada08 100644
--- a/apps/settings/src/store/apps.js
+++ b/apps/settings/src/store/apps.js
@@ -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))
- }
+ },
}
diff --git a/apps/settings/src/store/index.js b/apps/settings/src/store/index.js
index c640d32cd6a..9f4313413eb 100644
--- a/apps/settings/src/store/index.js
+++ b/apps/settings/src/store/index.js
@@ -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,
})
diff --git a/apps/settings/src/store/oc.js b/apps/settings/src/store/oc.js
index ff14f8ae7e3..b416d684e63 100644
--- a/apps/settings/src/store/oc.js
+++ b/apps/settings/src/store/oc.js
@@ -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 }
diff --git a/apps/settings/src/store/settings.js b/apps/settings/src/store/settings.js
index 88086910c39..cab7a811b33 100644
--- a/apps/settings/src/store/settings.js
+++ b/apps/settings/src/store/settings.js
@@ -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 = {}
diff --git a/apps/settings/src/store/users.js b/apps/settings/src/store/users.js
index 981ac663734..52131fbfd63 100644
--- a/apps/settings/src/store/users.js
+++ b/apps/settings/src/store/users.js
@@ -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 }
diff --git a/apps/settings/src/views/Apps.vue b/apps/settings/src/views/Apps.vue
index 2e0649f7f56..74b5fbde0fa 100644
--- a/apps/settings/src/views/Apps.vue
+++ b/apps/settings/src/views/Apps.vue
@@ -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>
diff --git a/apps/settings/src/views/Users.vue b/apps/settings/src/views/Users.vue
index eb52fa4ba16..7954cf42905 100644
--- a/apps/settings/src/views/Users.vue
+++ b/apps/settings/src/views/Users.vue
@@ -94,7 +94,7 @@ import {
AppNavigationNew,
AppNavigationSettings,
Content,
- Multiselect
+ Multiselect,
} from 'nextcloud-vue'
import UserList from '../components/UserList'
@@ -110,13 +110,13 @@ export default {
AppNavigationSettings,
Content,
UserList,
- Multiselect
+ Multiselect,
},
props: {
selectedGroup: {
type: String,
- default: null
- }
+ default: null,
+ },
},
data() {
return {
@@ -132,8 +132,8 @@ export default {
showUserBackend: false,
showLastLogin: false,
showNewUserForm: false,
- showLanguages: false
- }
+ showLanguages: false,
+ },
}
},
computed: {
@@ -152,25 +152,25 @@ export default {
get: function() { return this.getLocalstorage('showLanguages') },
set: function(status) {
this.setLocalStorage('showLanguages', status)
- }
+ },
},
showLastLogin: {
get: function() { return this.getLocalstorage('showLastLogin') },
set: function(status) {
this.setLocalStorage('showLastLogin', status)
- }
+ },
},
showUserBackend: {
get: function() { return this.getLocalstorage('showUserBackend') },
set: function(status) {
this.setLocalStorage('showUserBackend', status)
- }
+ },
},
showStoragePath: {
get: function() { return this.getLocalstorage('showStoragePath') },
set: function(status) {
this.setLocalStorage('showStoragePath', status)
- }
+ },
},
userCount() {
@@ -183,7 +183,7 @@ export default {
// default quota
quotaOptions() {
// convert the preset array into objects
- let quotaPreset = this.settings.quotaPreset.reduce((acc, cur) => acc.concat({ id: cur, label: cur }), [])
+ const quotaPreset = this.settings.quotaPreset.reduce((acc, cur) => acc.concat({ id: cur, label: cur }), [])
// add default presets
quotaPreset.unshift(this.unlimitedQuota)
return quotaPreset
@@ -202,20 +202,20 @@ export default {
},
set: function(quota) {
this.selectedQuota = quota
- }
+ },
},
// BUILD APP NAVIGATION MENU OBJECT
menu() {
// Data provided php side
- let self = this
+ const self = this
let groups = this.$store.getters.getGroups
groups = Array.isArray(groups) ? groups : []
// Map groups
groups = groups.map(group => {
- let item = {}
+ const item = {}
item.id = group.id.replace(' ', '_')
item.key = item.id
item.utils = {}
@@ -223,7 +223,7 @@ export default {
// router link to
item.router = {
name: 'group',
- params: { selectedGroup: group.id }
+ params: { selectedGroup: group.id },
}
// group name
@@ -242,7 +242,7 @@ export default {
text: t('settings', 'Remove group'),
action: function() {
self.removeGroup(group.id)
- }
+ },
}]
}
return item
@@ -256,16 +256,16 @@ export default {
realGroups = typeof realGroups === 'undefined' ? [] : realGroups
realGroups = Array.isArray(realGroups) ? realGroups : [realGroups]
if (realGroups.length > 0) {
- let separator = {
+ const separator = {
caption: true,
- text: t('settings', 'Groups')
+ text: t('settings', 'Groups'),
}
groups.unshift(separator)
}
// Adjust admin and disabled groups
- let adminGroup = groups.find(group => group.id === 'admin')
- let disabledGroup = groups.find(group => group.id === 'disabled')
+ const adminGroup = groups.find(group => group.id === 'admin')
+ const disabledGroup = groups.find(group => group.id === 'disabled')
// filter out admin and disabled
groups = groups.filter(group => ['admin', 'disabled'].indexOf(group.id) === -1)
@@ -291,27 +291,27 @@ export default {
}
// Add everyone group
- let everyoneGroup = {
+ const everyoneGroup = {
id: 'everyone',
key: 'everyone',
icon: 'icon-contacts-dark',
router: { name: 'users' },
- text: t('settings', 'Everyone')
+ text: t('settings', 'Everyone'),
}
// users count
if (this.userCount > 0) {
Vue.set(everyoneGroup, 'utils', {
- counter: this.userCount
+ counter: this.userCount,
})
}
groups.unshift(everyoneGroup)
- let addGroup = {
+ const addGroup = {
id: 'addgroup',
key: 'addgroup',
icon: 'icon-add',
text: t('settings', 'Add group'),
- classes: this.loadingAddGroup ? 'icon-loading-small' : ''
+ classes: this.loadingAddGroup ? 'icon-loading-small' : '',
}
if (this.showAddGroupEntry) {
Vue.set(addGroup, 'edit', {
@@ -319,7 +319,7 @@ export default {
action: this.createGroup,
reset: function() {
self.showAddGroupEntry = false
- }
+ },
})
addGroup.classes = 'editing'
} else {
@@ -334,13 +334,13 @@ export default {
groups.unshift(addGroup)
return groups
- }
+ },
},
beforeMount() {
this.$store.commit('initGroups', {
groups: this.$store.getters.getServerData.groups,
orderBy: this.$store.getters.getServerData.sortGroups,
- userCount: this.$store.getters.getServerData.userCount
+ userCount: this.$store.getters.getServerData.userCount,
})
this.$store.dispatch('getPasswordPolicyMinLength')
},
@@ -350,9 +350,9 @@ export default {
Object.assign(OCA, {
Settings: {
UserList: {
- registerAction: this.registerAction
- }
- }
+ registerAction: this.registerAction,
+ },
+ },
})
},
methods: {
@@ -366,7 +366,7 @@ export default {
},
getLocalstorage(key) {
// force initialization
- let localConfig = this.$localStorage.get(key)
+ const localConfig = this.$localStorage.get(key)
// if localstorage is null, fallback to original values
this.showConfig[key] = localConfig !== null ? localConfig === 'true' : this.showConfig[key]
return this.showConfig[key]
@@ -377,7 +377,7 @@ export default {
return status
},
removeGroup(groupid) {
- let self = this
+ const self = this
// TODO migrate to a vue js confirm dialog component
OC.dialogs.confirm(
t('settings', 'You are about to remove the group {group}. The users will NOT be deleted.', { group: groupid }),
@@ -400,7 +400,7 @@ export default {
app: 'files',
key: 'default_quota',
// ensure we only send the preset id
- value: quota.id ? quota.id : quota
+ value: quota.id ? quota.id : quota,
}).then(() => {
if (typeof quota !== 'object') {
quota = { id: quota, label: quota }
@@ -417,7 +417,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) {
return this.setDefaultQuota('none')
} else {
@@ -438,7 +438,7 @@ export default {
this.externalActions.push({
icon: icon,
text: text,
- action: action
+ action: action,
})
return this.externalActions
},
@@ -449,7 +449,7 @@ export default {
* @param {Object} event The form submit event
*/
createGroup(event) {
- let gid = event.target[0].value
+ const gid = event.target[0].value
this.loadingAddGroup = true
this.$store.dispatch('addGroup', gid)
.then(() => {
@@ -458,14 +458,14 @@ export default {
this.$router.push({
name: 'group',
params: {
- selectedGroup: gid
- }
+ selectedGroup: gid,
+ },
})
})
.catch(() => {
this.loadingAddGroup = false
})
- }
- }
+ },
+ },
}
</script>