Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>tags/v23.0.0beta1
extends: ['@nextcloud'], | extends: ['@nextcloud'], | ||||
rules: { | rules: { | ||||
'no-tabs': 'warn', | 'no-tabs': 'warn', | ||||
} | |||||
// TODO: make sure we fix this as this is bad vue coding style. | |||||
// Use proper sync modifier | |||||
'vue/no-mutating-props': 'warn', | |||||
}, | |||||
} | } |
</template> | </template> | ||||
<script> | <script> | ||||
import ItemPreview from './components/ItemPreview' | |||||
import axios from '@nextcloud/axios' | |||||
import { generateUrl, generateOcsUrl } from '@nextcloud/router' | import { generateUrl, generateOcsUrl } from '@nextcloud/router' | ||||
import { loadState } from '@nextcloud/initial-state' | |||||
import axios from '@nextcloud/axios' | |||||
import ItemPreview from './components/ItemPreview' | |||||
const availableConfig = loadState('accessibility', 'available-config') | |||||
const userConfig = loadState('accessibility', 'user-config') | |||||
export default { | export default { | ||||
name: 'Accessibility', | name: 'Accessibility', | ||||
components: { ItemPreview }, | |||||
props: { | |||||
availableConfig: { | |||||
type: Object, | |||||
required: true, | |||||
}, | |||||
userConfig: { | |||||
type: Object, | |||||
required: true, | |||||
}, | |||||
components: { | |||||
ItemPreview, | |||||
}, | }, | ||||
data() { | |||||
return { | |||||
availableConfig, | |||||
userConfig, | |||||
} | |||||
}, | |||||
computed: { | computed: { | ||||
themes() { | themes() { | ||||
return this.availableConfig.themes | return this.availableConfig.themes |
*/ | */ | ||||
import Vue from 'vue' | import Vue from 'vue' | ||||
import { loadState } from '@nextcloud/initial-state' | |||||
import App from './Accessibility.vue' | import App from './Accessibility.vue' | ||||
// bind to window | // bind to window | ||||
Vue.prototype.OC = OC | Vue.prototype.OC = OC | ||||
Vue.prototype.t = t | Vue.prototype.t = t | ||||
const availableConfig = loadState('accessibility', 'available-config') | |||||
const userConfig = loadState('accessibility', 'user-config') | |||||
const View = Vue.extend(App) | const View = Vue.extend(App) | ||||
const accessibility = new View({ | |||||
propsData: { | |||||
availableConfig, | |||||
userConfig, | |||||
}, | |||||
}) | |||||
const accessibility = new View() | |||||
accessibility.$mount('#accessibility') | accessibility.$mount('#accessibility') |
!function(e){var n={};function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var o in e)t.d(r,o,function(n){return e[n]}.bind(null,o));return r},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="/js/",t(t.s=709)}({709:function(e,n){function r(e,n,t,r,o,i,u){try{var c=e[i](u),a=c.value}catch(e){return void t(e)}c.done?n(a):Promise.resolve(a).then(r,o)} | |||||
!function(e){var n={};function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var o in e)t.d(r,o,function(n){return e[n]}.bind(null,o));return r},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="/js/",t(t.s=682)}({682:function(e,n){function r(e,n,t,r,o,i,u){try{var c=e[i](u),a=c.value}catch(e){return void t(e)}c.done?n(a):Promise.resolve(a).then(r,o)} | |||||
/** | /** | ||||
* @copyright Copyright (c) 2020 John Molakvoæ <skjnldsv@protonmail.com> | * @copyright Copyright (c) 2020 John Molakvoæ <skjnldsv@protonmail.com> | ||||
* | * |
!function(e){var n={};function t(o){if(n[o])return n[o].exports;var i=n[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,t),i.l=!0,i.exports}t.m=e,t.c=n,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:o})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(t.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var i in e)t.d(o,i,function(n){return e[n]}.bind(null,i));return o},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="/js/",t(t.s=430)}({430:function(e,n,t){"use strict";t.r(n);t(431),t(432),t(433),t(434); | |||||
!function(e){var n={};function t(o){if(n[o])return n[o].exports;var i=n[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,t),i.l=!0,i.exports}t.m=e,t.c=n,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:o})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(t.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var i in e)t.d(o,i,function(n){return e[n]}.bind(null,i));return o},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="/js/",t(t.s=422)}({422:function(e,n,t){"use strict";t.r(n);t(423),t(424),t(425),t(426); | |||||
/** | /** | ||||
* @copyright Copyright (c) 2016 Roeland Jago Douma <roeland@famdouma.nl> | * @copyright Copyright (c) 2016 Roeland Jago Douma <roeland@famdouma.nl> | ||||
* | * | ||||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||||
* | * | ||||
*/ | */ | ||||
window.OCA.Comments=OCA.Comments},431:function(e,n){ | |||||
window.OCA.Comments=OCA.Comments},423:function(e,n){ | |||||
/** | /** | ||||
* Copyright (c) 2016 Vincent Petry <pvince81@owncloud.com> | * Copyright (c) 2016 Vincent Petry <pvince81@owncloud.com> | ||||
* | * | ||||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||||
* | * | ||||
*/ | */ | ||||
OCA.Comments||(OCA.Comments={})},432:function(e,n){function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var o;o=Handlebars.template,(OCA.Comments.Templates=OCA.Comments.Templates||{}).filesplugin=o({compiler:[8,">= 4.3.0"],main:function(e,n,o,i,r){var s,a=null!=n?n:e.nullContext||{},l=e.hooks.helperMissing,m=e.escapeExpression,c=e.lookupProperty||function(e,n){if(Object.prototype.hasOwnProperty.call(e,n))return e[n]};return'<a class="action action-comment permanent" title="'+m("function"===t(s=null!=(s=c(o,"countMessage")||(null!=n?c(n,"countMessage"):n))?s:l)?s.call(a,{name:"countMessage",hash:{},data:r,loc:{start:{line:1,column:50},end:{line:1,column:66}}}):s)+'" href="#">\n\t<img class="svg" src="'+m("function"===t(s=null!=(s=c(o,"iconUrl")||(null!=n?c(n,"iconUrl"):n))?s:l)?s.call(a,{name:"iconUrl",hash:{},data:r,loc:{start:{line:2,column:23},end:{line:2,column:34}}}):s)+'"/>\n</a>\n'},useData:!0})},433:function(e,o){_.extend(OC.Files.Client,{PROPERTY_COMMENTS_UNREAD:"{"+OC.Files.Client.NS_OWNCLOUD+"}comments-unread"}),OCA.Comments=_.extend({},OCA.Comments),OCA.Comments||(OCA.Comments={}),OCA.Comments.FilesPlugin={ignoreLists:["trashbin","files.public"],_formatCommentCount:function(e){return OCA.Comments.Templates.filesplugin({count:e,countMessage:n("comments","%n unread comment","%n unread comments",e),iconUrl:OC.imagePath("core","actions/comment")})},attach:function(e){var o=this;if(!(this.ignoreLists.indexOf(e.id)>=0)){var i=e._getWebdavProperties;e._getWebdavProperties=function(){var e=i.apply(this,arguments);return e.push(OC.Files.Client.PROPERTY_COMMENTS_UNREAD),e},e.filesClient.addFileInfoParser((function(e){var n={},t=e.propStat[0].properties[OC.Files.Client.PROPERTY_COMMENTS_UNREAD];return _.isUndefined(t)||""===t||(n.commentsUnread=parseInt(t,10)),n})),e.$el.addClass("has-comments");var r=e._createRow;e._createRow=function(e){var n=r.apply(this,arguments);return e.commentsUnread&&n.attr("data-comments-unread",e.commentsUnread),n},e.fileActions.registerAction({name:"Comment",displayName:function(e){if(e&&e.$file){var o=parseInt(e.$file.data("comments-unread"),10);if(o>=0)return n("comments","1 new comment","{unread} new comments",o,{unread:o})}return t("comments","Comment")},mime:"all",order:-140,iconClass:"icon-comment",permissions:OC.PERMISSION_READ,type:OCA.Files.FileActions.TYPE_INLINE,render:function(e,n,t){var i=t.$file.data("comments-unread");if(i){var r=$(o._formatCommentCount(i));return t.$file.find("a.name>span.fileactions").append(r),r}return""},actionHandler:function(e,n){n.$file.find(".action-comment").tooltip("hide"),OCA.Files.Sidebar.setActiveTab("comments"),OCA.Files.Sidebar.open("/"+e)}});var s=e.elementToFile;e.elementToFile=function(e){var n=s.apply(this,arguments),t=e.data("comments-unread");return t&&(n.commentsUnread=t),n}}}},OC.Plugins.register("OCA.Files.FileList",OCA.Comments.FilesPlugin)},434:function(e,n){OCA.Comments.ActivityTabViewPlugin={prepareModelForDisplay:function(e,n,t){if("comments"===e.get("app")&&"comments"===e.get("type")&&"ActivityTabView"===t&&(n.addClass("comment"),e.get("message")&&this._isLong(e.get("message")))){n.addClass("collapsed");var o=$("<div>").addClass("message-overlay");n.find(".activitymessage").after(o),n.on("click",this._onClickCollapsedComment)}},_onClickCollapsedComment:function(e){var n=$(e.target);n.is(".comment")||(n=n.closest(".comment")),n.removeClass("collapsed")},_isLong:function(e){return e.length>250||(e.match(/\n/g)||[]).length>1}},OC.Plugins.register("OCA.Activity.RenderingPlugins",OCA.Comments.ActivityTabViewPlugin)}}); | |||||
OCA.Comments||(OCA.Comments={})},424:function(e,n){function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var o;o=Handlebars.template,(OCA.Comments.Templates=OCA.Comments.Templates||{}).filesplugin=o({compiler:[8,">= 4.3.0"],main:function(e,n,o,i,r){var s,a=null!=n?n:e.nullContext||{},l=e.hooks.helperMissing,m=e.escapeExpression,c=e.lookupProperty||function(e,n){if(Object.prototype.hasOwnProperty.call(e,n))return e[n]};return'<a class="action action-comment permanent" title="'+m("function"===t(s=null!=(s=c(o,"countMessage")||(null!=n?c(n,"countMessage"):n))?s:l)?s.call(a,{name:"countMessage",hash:{},data:r,loc:{start:{line:1,column:50},end:{line:1,column:66}}}):s)+'" href="#">\n\t<img class="svg" src="'+m("function"===t(s=null!=(s=c(o,"iconUrl")||(null!=n?c(n,"iconUrl"):n))?s:l)?s.call(a,{name:"iconUrl",hash:{},data:r,loc:{start:{line:2,column:23},end:{line:2,column:34}}}):s)+'"/>\n</a>\n'},useData:!0})},425:function(e,o){_.extend(OC.Files.Client,{PROPERTY_COMMENTS_UNREAD:"{"+OC.Files.Client.NS_OWNCLOUD+"}comments-unread"}),OCA.Comments=_.extend({},OCA.Comments),OCA.Comments||(OCA.Comments={}),OCA.Comments.FilesPlugin={ignoreLists:["trashbin","files.public"],_formatCommentCount:function(e){return OCA.Comments.Templates.filesplugin({count:e,countMessage:n("comments","%n unread comment","%n unread comments",e),iconUrl:OC.imagePath("core","actions/comment")})},attach:function(e){var o=this;if(!(this.ignoreLists.indexOf(e.id)>=0)){var i=e._getWebdavProperties;e._getWebdavProperties=function(){var e=i.apply(this,arguments);return e.push(OC.Files.Client.PROPERTY_COMMENTS_UNREAD),e},e.filesClient.addFileInfoParser((function(e){var n={},t=e.propStat[0].properties[OC.Files.Client.PROPERTY_COMMENTS_UNREAD];return _.isUndefined(t)||""===t||(n.commentsUnread=parseInt(t,10)),n})),e.$el.addClass("has-comments");var r=e._createRow;e._createRow=function(e){var n=r.apply(this,arguments);return e.commentsUnread&&n.attr("data-comments-unread",e.commentsUnread),n},e.fileActions.registerAction({name:"Comment",displayName:function(e){if(e&&e.$file){var o=parseInt(e.$file.data("comments-unread"),10);if(o>=0)return n("comments","1 new comment","{unread} new comments",o,{unread:o})}return t("comments","Comment")},mime:"all",order:-140,iconClass:"icon-comment",permissions:OC.PERMISSION_READ,type:OCA.Files.FileActions.TYPE_INLINE,render:function(e,n,t){var i=t.$file.data("comments-unread");if(i){var r=$(o._formatCommentCount(i));return t.$file.find("a.name>span.fileactions").append(r),r}return""},actionHandler:function(e,n){n.$file.find(".action-comment").tooltip("hide"),OCA.Files.Sidebar.setActiveTab("comments"),OCA.Files.Sidebar.open("/"+e)}});var s=e.elementToFile;e.elementToFile=function(e){var n=s.apply(this,arguments),t=e.data("comments-unread");return t&&(n.commentsUnread=t),n}}}},OC.Plugins.register("OCA.Files.FileList",OCA.Comments.FilesPlugin)},426:function(e,n){OCA.Comments.ActivityTabViewPlugin={prepareModelForDisplay:function(e,n,t){if("comments"===e.get("app")&&"comments"===e.get("type")&&"ActivityTabView"===t&&(n.addClass("comment"),e.get("message")&&this._isLong(e.get("message")))){n.addClass("collapsed");var o=$("<div>").addClass("message-overlay");n.find(".activitymessage").after(o),n.on("click",this._onClickCollapsedComment)}},_onClickCollapsedComment:function(e){var n=$(e.target);n.is(".comment")||(n=n.closest(".comment")),n.removeClass("collapsed")},_isLong:function(e){return e.length>250||(e.match(/\n/g)||[]).length>1}},OC.Plugins.register("OCA.Activity.RenderingPlugins",OCA.Comments.ActivityTabViewPlugin)}}); | |||||
//# sourceMappingURL=comments.js.map | //# sourceMappingURL=comments.js.map |
* @param {Function} resolve a function to run after the share is added and its component initialized | * @param {Function} resolve a function to run after the share is added and its component initialized | ||||
*/ | */ | ||||
addShare(share, resolve) { | addShare(share, resolve) { | ||||
// eslint-disable-next-line vue/no-mutating-props | |||||
this.shares.unshift(share) | this.shares.unshift(share) | ||||
this.awaitForShare(share, resolve) | this.awaitForShare(share, resolve) | ||||
}, | }, | ||||
*/ | */ | ||||
removeShare(share) { | removeShare(share) { | ||||
const index = this.shares.findIndex(item => item === share) | const index = this.shares.findIndex(item => item === share) | ||||
// eslint-disable-next-line vue/no-mutating-props | |||||
this.shares.splice(index, 1) | this.shares.splice(index, 1) | ||||
}, | }, | ||||
}, | }, |
*/ | */ | ||||
removeShare(share) { | removeShare(share) { | ||||
const index = this.shares.findIndex(item => item === share) | const index = this.shares.findIndex(item => item === share) | ||||
// eslint-disable-next-line vue/no-mutating-props | |||||
this.shares.splice(index, 1) | this.shares.splice(index, 1) | ||||
}, | }, | ||||
}, | }, |
deleteClient(id) { | deleteClient(id) { | ||||
axios.delete(generateUrl('apps/oauth2/clients/{id}', { id })) | axios.delete(generateUrl('apps/oauth2/clients/{id}', { id })) | ||||
.then((response) => { | .then((response) => { | ||||
// eslint-disable-next-line vue/no-mutating-props | |||||
this.clients = this.clients.filter(client => client.id !== id) | this.clients = this.clients.filter(client => client.id !== id) | ||||
}) | }) | ||||
}, | }, | ||||
redirectUri: this.newClient.redirectUri, | redirectUri: this.newClient.redirectUri, | ||||
} | } | ||||
).then(response => { | ).then(response => { | ||||
// eslint-disable-next-line vue/no-mutating-props | |||||
this.clients.push(response.data) | this.clients.push(response.data) | ||||
this.newClient.name = '' | this.newClient.name = '' |
* | * | ||||
*/ | */ | ||||
r.nc=btoa(OC.requestToken),i.default.prototype.t=t,window.OC=window.OC||{},window.OC.Settings=window.OC.Settings||{},w.replaceState(Object(o.loadState)("settings","mandatory2FAState")),new(i.default.extend(y))({store:w}).$mount("#two-factor-auth-settings")}]); | r.nc=btoa(OC.requestToken),i.default.prototype.t=t,window.OC=window.OC||{},window.OC.Settings=window.OC.Settings||{},w.replaceState(Object(o.loadState)("settings","mandatory2FAState")),new(i.default.extend(y))({store:w}).$mount("#two-factor-auth-settings")}]); | ||||
//# sourceMappingURL=vue-settings-admin-security.js.map?v=be49a2ac44968c2ddba1 | |||||
//# sourceMappingURL=vue-settings-admin-security.js.map?v=1fc687d39cc4634bd5d6 |
* | * | ||||
*/ | */ | ||||
r.nc=btoa(OC.requestToken),o.default.prototype.t=t,o.default.prototype.logger=i.a;var ht=o.default.extend(mt);n.default=new ht({el:"#vue-emailsection"})}]); | r.nc=btoa(OC.requestToken),o.default.prototype.t=t,o.default.prototype.logger=i.a;var ht=o.default.extend(mt);n.default=new ht({el:"#vue-emailsection"})}]); | ||||
//# sourceMappingURL=vue-settings-personal-info.js.map?v=15eed81bbfb09f00e9d7 | |||||
//# sourceMappingURL=vue-settings-personal-info.js.map?v=7d443aca148d4b82b7d1 |
* | * | ||||
*/ | */ | ||||
r.nc=btoa(OC.requestToken),o.default.prototype.t=t,new(o.default.extend(Q))({propsData:{initialDevices:Object(i.loadState)("settings","webauthn-devices"),isHttps:"https:"===window.location.protocol,isLocalhost:"localhost"===window.location.hostname,hasPublicKeyCredential:void 0!==window.PublicKeyCredential}}).$mount("#security-webauthn")}]); | r.nc=btoa(OC.requestToken),o.default.prototype.t=t,new(o.default.extend(Q))({propsData:{initialDevices:Object(i.loadState)("settings","webauthn-devices"),isHttps:"https:"===window.location.protocol,isLocalhost:"localhost"===window.location.hostname,hasPublicKeyCredential:void 0!==window.PublicKeyCredential}}).$mount("#security-webauthn")}]); | ||||
//# sourceMappingURL=vue-settings-personal-webauthn.js.map?v=06e8b9df4aca46e8c31c | |||||
//# sourceMappingURL=vue-settings-personal-webauthn.js.map?v=46b2deb69660b2ed86b2 |
return axios.post(this.baseUrl, data) | return axios.post(this.baseUrl, data) | ||||
.then(resp => resp.data) | .then(resp => resp.data) | ||||
.then(tap(() => console.debug('app token created'))) | .then(tap(() => console.debug('app token created'))) | ||||
// eslint-disable-next-line vue/no-mutating-props | |||||
.then(tap(data => this.tokens.push(data.deviceToken))) | .then(tap(data => this.tokens.push(data.deviceToken))) | ||||
.catch(err => { | .catch(err => { | ||||
console.error.bind('could not create app password', err) | console.error.bind('could not create app password', err) | ||||
deleteToken(token) { | deleteToken(token) { | ||||
console.debug('deleting app token', token) | console.debug('deleting app token', token) | ||||
// eslint-disable-next-line vue/no-mutating-props | |||||
this.tokens = this.tokens.filter(t => t !== token) | this.tokens = this.tokens.filter(t => t !== token) | ||||
return axios.delete(this.baseUrl + '/' + token.id) | return axios.delete(this.baseUrl + '/' + token.id) | ||||
OC.Notification.showTemporary(t('core', 'Error while deleting the token')) | OC.Notification.showTemporary(t('core', 'Error while deleting the token')) | ||||
// Restore | // Restore | ||||
// eslint-disable-next-line vue/no-mutating-props | |||||
this.tokens.push(token) | this.tokens.push(token) | ||||
}) | }) | ||||
}, | }, |
} | } | ||||
}, | }, | ||||
closeModal() { | closeModal() { | ||||
// eslint-disable-next-line vue/no-mutating-props | |||||
this.showConfig.showNewUserForm = false | this.showConfig.showNewUserForm = false | ||||
}, | }, | ||||
}, | }, |
</template> | </template> | ||||
</AppNavigation> | </AppNavigation> | ||||
<AppContent> | <AppContent> | ||||
<UserList #content | |||||
:users="users" | |||||
:show-config="showConfig" | |||||
:selected-group="selectedGroupDecoded" | |||||
:external-actions="externalActions" /> | |||||
<template #content> | |||||
<UserList | |||||
:users="users" | |||||
:show-config="showConfig" | |||||
:selected-group="selectedGroupDecoded" | |||||
:external-actions="externalActions" /> | |||||
</template> | |||||
</AppContent> | </AppContent> | ||||
</Content> | </Content> | ||||
</template> | </template> |
}, | }, | ||||
}) | }) | ||||
} else { | } else { | ||||
// eslint-disable-next-line standard/no-callback-literal | |||||
// eslint-disable-next-line node/no-callback-literal | |||||
callback([]) | callback([]) | ||||
} | } | ||||
}, | }, |
id="user-status_panel" | id="user-status_panel" | ||||
:items="items" | :items="items" | ||||
:loading="loading"> | :loading="loading"> | ||||
<template v-slot:default="{ item }"> | |||||
<template #default="{ item }"> | |||||
<DashboardWidgetItem | <DashboardWidgetItem | ||||
:main-text="item.mainText" | :main-text="item.mainText" | ||||
:sub-text="item.subText"> | :sub-text="item.subText"> | ||||
<template v-slot:avatar> | |||||
<template #avatar> | |||||
<Avatar | <Avatar | ||||
class="item-avatar" | class="item-avatar" | ||||
:size="44" | :size="44" | ||||
</template> | </template> | ||||
</DashboardWidgetItem> | </DashboardWidgetItem> | ||||
</template> | </template> | ||||
<template v-slot:empty-content> | |||||
<template #empty-content> | |||||
<EmptyContent | <EmptyContent | ||||
id="user_status-widget-empty-content" | id="user_status-widget-empty-content" | ||||
icon="icon-user-status"> | icon="icon-user-status"> |
if (this.currentOption && this.currentOption.validate) { | if (this.currentOption && this.currentOption.validate) { | ||||
this.valid = !!this.currentOption.validate(this.check) | this.valid = !!this.currentOption.validate(this.check) | ||||
} | } | ||||
// eslint-disable-next-line vue/no-mutating-props | |||||
this.check.invalid = !this.valid | this.check.invalid = !this.valid | ||||
this.$emit('validate', this.valid) | this.$emit('validate', this.valid) | ||||
}, | }, | ||||
if (this.check.class !== this.currentOption.class || matchingOperator === -1) { | if (this.check.class !== this.currentOption.class || matchingOperator === -1) { | ||||
this.currentOperator = this.operators[0] | this.currentOperator = this.operators[0] | ||||
} | } | ||||
// eslint-disable-next-line vue/no-mutating-props | |||||
this.check.class = this.currentOption.class | this.check.class = this.currentOption.class | ||||
// eslint-disable-next-line vue/no-mutating-props | |||||
this.check.operator = this.currentOperator.operator | this.check.operator = this.currentOperator.operator | ||||
this.validate() | this.validate() |
:auto-limit="false" | :auto-limit="false" | ||||
:disabled="allEvents.length <= 1" | :disabled="allEvents.length <= 1" | ||||
@input="updateEvent"> | @input="updateEvent"> | ||||
<template slot="selection" slot-scope="{ values, search, isOpen }"> | |||||
<template slot="selection" slot-scope="{ values, isOpen }"> | |||||
<div v-if="values.length && !isOpen" class="eventlist"> | <div v-if="values.length && !isOpen" class="eventlist"> | ||||
<img class="option__icon" :src="values[0].entity.icon"> | <img class="option__icon" :src="values[0].entity.icon"> | ||||
<span v-for="(value, index) in values" :key="value.id" class="text option__title option__title_single">{{ value.displayName }} <span v-if="index+1 < values.length">, </span></span> | <span v-for="(value, index) in values" :key="value.id" class="text option__title option__title_single">{{ value.displayName }} <span v-if="index+1 < values.length">, </span></span> |
type="button" | type="button" | ||||
class="check--add" | class="check--add" | ||||
value="Add a new filter" | value="Add a new filter" | ||||
@click="rule.checks.push({class: null, operator: null, value: ''})"> | |||||
@click="onAddFilter"> | |||||
</p> | </p> | ||||
</div> | </div> | ||||
<div class="flow-icon icon-confirm" /> | <div class="flow-icon icon-confirm" /> | ||||
this.dirty = false | this.dirty = false | ||||
} | } | ||||
}, | }, | ||||
async removeCheck(check) { | async removeCheck(check) { | ||||
const index = this.rule.checks.findIndex(item => item === check) | const index = this.rule.checks.findIndex(item => item === check) | ||||
if (index > -1) { | if (index > -1) { | ||||
} | } | ||||
this.$store.dispatch('updateRule', this.rule) | this.$store.dispatch('updateRule', this.rule) | ||||
}, | }, | ||||
onAddFilter() { | |||||
// eslint-disable-next-line vue/no-mutating-props | |||||
this.rule.checks.push({ class: null, operator: null, value: '' }) | |||||
}, | |||||
}, | }, | ||||
} | } | ||||
</script> | </script> |
} | } | ||||
const setDeprecatedProp = (global, cb, msg) => { | const setDeprecatedProp = (global, cb, msg) => { | ||||
(Array.isArray(global) ? global : [global]).map(global => { | |||||
(Array.isArray(global) ? global : [global]).forEach(global => { | |||||
if (window[global] !== undefined) { | if (window[global] !== undefined) { | ||||
delete window[global] | delete window[global] | ||||
} | } |
* | * | ||||
*/ | */ | ||||
import { loadState } from '@nextcloud/initial-state' | |||||
import queryString from 'query-string' | |||||
import Vue from 'vue' | import Vue from 'vue' | ||||
// eslint-disable-next-line no-unused-vars | // eslint-disable-next-line no-unused-vars | ||||
import LoginView from './views/Login.vue' | import LoginView from './views/Login.vue' | ||||
import Nextcloud from './mixins/Nextcloud' | import Nextcloud from './mixins/Nextcloud' | ||||
const query = queryString.parse(location.search) | |||||
if (query.clear === '1') { | |||||
try { | |||||
window.localStorage.clear() | |||||
window.sessionStorage.clear() | |||||
console.debug('Browser storage cleared') | |||||
} catch (e) { | |||||
console.error('Could not clear browser storage', e) | |||||
} | |||||
} | |||||
Vue.mixin(Nextcloud) | Vue.mixin(Nextcloud) | ||||
const fromStateOr = (key, orValue) => { | |||||
try { | |||||
return loadState('core', key) | |||||
} catch (e) { | |||||
return orValue | |||||
} | |||||
} | |||||
const View = Vue.extend(LoginView) | const View = Vue.extend(LoginView) | ||||
new View({ | |||||
propsData: { | |||||
errors: fromStateOr('loginErrors', []), | |||||
messages: fromStateOr('loginMessages', []), | |||||
redirectUrl: fromStateOr('loginRedirectUrl', undefined), | |||||
username: fromStateOr('loginUsername', ''), | |||||
throttleDelay: fromStateOr('loginThrottleDelay', 0), | |||||
invertedColors: OCA.Theming && OCA.Theming.inverted, | |||||
canResetPassword: fromStateOr('loginCanResetPassword', false), | |||||
resetPasswordLink: fromStateOr('loginResetPasswordLink', ''), | |||||
autoCompleteAllowed: fromStateOr('loginAutocomplete', true), | |||||
resetPasswordTarget: fromStateOr('resetPasswordTarget', ''), | |||||
resetPasswordUser: fromStateOr('resetPasswordUser', ''), | |||||
directLogin: query.direct === '1', | |||||
hasPasswordless: fromStateOr('webauthn-available', false), | |||||
countAlternativeLogins: fromStateOr('countAlternativeLogins', false), | |||||
isHttps: window.location.protocol === 'https:', | |||||
isLocalhost: window.location.hostname === 'localhost', | |||||
hasPublicKeyCredential: typeof (window.PublicKeyCredential) !== 'undefined', | |||||
hideLoginForm: fromStateOr('hideLoginForm', false), | |||||
}, | |||||
}).$mount('#login') | |||||
new View().$mount('#login') |
sinon: true, | sinon: true, | ||||
}, | }, | ||||
rules: { | rules: { | ||||
"node/no-unpublished-import": 'off' | |||||
} | |||||
'node/no-unpublished-import': 'off', | |||||
}, | |||||
} | } |
</template> | </template> | ||||
<script> | <script> | ||||
import { loadState } from '@nextcloud/initial-state' | |||||
import queryString from 'query-string' | |||||
import LoginForm from '../components/login/LoginForm.vue' | import LoginForm from '../components/login/LoginForm.vue' | ||||
import PasswordLessLoginForm from '../components/login/PasswordLessLoginForm.vue' | import PasswordLessLoginForm from '../components/login/PasswordLessLoginForm.vue' | ||||
import ResetPassword from '../components/login/ResetPassword.vue' | import ResetPassword from '../components/login/ResetPassword.vue' | ||||
import UpdatePassword from '../components/login/UpdatePassword.vue' | import UpdatePassword from '../components/login/UpdatePassword.vue' | ||||
const query = queryString.parse(location.search) | |||||
if (query.clear === '1') { | |||||
try { | |||||
window.localStorage.clear() | |||||
window.sessionStorage.clear() | |||||
console.debug('Browser storage cleared') | |||||
} catch (e) { | |||||
console.error('Could not clear browser storage', e) | |||||
} | |||||
} | |||||
export default { | export default { | ||||
name: 'Login', | name: 'Login', | ||||
components: { | components: { | ||||
LoginForm, | LoginForm, | ||||
PasswordLessLoginForm, | PasswordLessLoginForm, | ||||
ResetPassword, | ResetPassword, | ||||
UpdatePassword, | UpdatePassword, | ||||
}, | }, | ||||
props: { | |||||
username: { | |||||
type: String, | |||||
default: '', | |||||
}, | |||||
redirectUrl: { | |||||
type: String, | |||||
}, | |||||
errors: { | |||||
type: Array, | |||||
default: () => [], | |||||
}, | |||||
messages: { | |||||
type: Array, | |||||
default: () => [], | |||||
}, | |||||
throttleDelay: { | |||||
type: Number, | |||||
}, | |||||
canResetPassword: { | |||||
type: Boolean, | |||||
default: false, | |||||
}, | |||||
resetPasswordLink: { | |||||
type: String, | |||||
}, | |||||
resetPasswordTarget: { | |||||
type: String, | |||||
}, | |||||
invertedColors: { | |||||
type: Boolean, | |||||
default: false, | |||||
}, | |||||
autoCompleteAllowed: { | |||||
type: Boolean, | |||||
default: true, | |||||
}, | |||||
directLogin: { | |||||
type: Boolean, | |||||
default: false, | |||||
}, | |||||
hasPasswordless: { | |||||
type: Boolean, | |||||
default: false, | |||||
}, | |||||
countAlternativeLogins: { | |||||
type: Number, | |||||
default: 0, | |||||
}, | |||||
isHttps: { | |||||
type: Boolean, | |||||
default: false, | |||||
}, | |||||
isLocalhost: { | |||||
type: Boolean, | |||||
default: false, | |||||
}, | |||||
hasPublicKeyCredential: { | |||||
type: Boolean, | |||||
default: false, | |||||
}, | |||||
hideLoginForm: { | |||||
type: Boolean, | |||||
default: false, | |||||
}, | |||||
}, | |||||
data() { | data() { | ||||
return { | return { | ||||
loading: false, | loading: false, | ||||
user: this.username, | user: this.username, | ||||
passwordlessLogin: false, | passwordlessLogin: false, | ||||
resetPassword: false, | resetPassword: false, | ||||
// Initial data | |||||
errors: loadState('core', 'loginErrors', []), | |||||
messages: loadState('core', 'loginMessages', []), | |||||
redirectUrl: loadState('core', 'loginRedirectUrl', undefined), | |||||
username: loadState('core', 'loginUsername', ''), | |||||
throttleDelay: loadState('core', 'loginThrottleDelay', 0), | |||||
invertedColors: OCA.Theming && OCA.Theming.inverted, | |||||
canResetPassword: loadState('core', 'loginCanResetPassword', false), | |||||
resetPasswordLink: loadState('core', 'loginResetPasswordLink', ''), | |||||
autoCompleteAllowed: loadState('core', 'loginAutocomplete', true), | |||||
resetPasswordTarget: loadState('core', 'resetPasswordTarget', ''), | |||||
resetPasswordUser: loadState('core', 'resetPasswordUser', ''), | |||||
directLogin: query.direct === '1', | |||||
hasPasswordless: loadState('core', 'webauthn-available', false), | |||||
countAlternativeLogins: loadState('core', 'countAlternativeLogins', false), | |||||
isHttps: window.location.protocol === 'https:', | |||||
isLocalhost: window.location.hostname === 'localhost', | |||||
hasPublicKeyCredential: typeof (window.PublicKeyCredential) !== 'undefined', | |||||
hideLoginForm: loadState('core', 'hideLoginForm', false), | |||||
} | } | ||||
}, | }, | ||||
methods: { | methods: { |