Selaa lähdekoodia

Replace proposal-class-private-properties by regular properties

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Signed-off-by: npmbuildbot-nextcloud[bot] <npmbuildbot-nextcloud[bot]@users.noreply.github.com>
tags/v22.0.0beta4
John Molakvoæ (skjnldsv) 3 vuotta sitten
vanhempi
commit
aef00ddeaf

+ 4
- 4
apps/files/js/dist/files-app-settings.js
File diff suppressed because it is too large
Näytä tiedosto


+ 1
- 1
apps/files/js/dist/files-app-settings.js.map
File diff suppressed because it is too large
Näytä tiedosto


+ 7
- 8
apps/files/js/dist/sidebar.js
File diff suppressed because it is too large
Näytä tiedosto


+ 1
- 1
apps/files/js/dist/sidebar.js.map
File diff suppressed because it is too large
Näytä tiedosto


+ 18
- 16
apps/files/src/models/Setting.js Näytä tiedosto

@@ -23,10 +23,10 @@

export default class Setting {

#close
#el
#name
#open
_close
_el
_name
_open

/**
* Create a new files app setting
@@ -38,32 +38,34 @@ export default class Setting {
* @param {Function} [component.close] callback for when setting is closed
*/
constructor(name, { el, open, close }) {
this.#name = name
this.#el = el
this.#open = open
this.#close = close
if (typeof this.#open !== 'function') {
this.#open = () => {}
this._name = name
this._el = el
this._open = open
this._close = close

if (typeof this._open !== 'function') {
this._open = () => {}
}
if (typeof this.#close !== 'function') {
this.#close = () => {}

if (typeof this._close !== 'function') {
this._close = () => {}
}
}

get name() {
return this.#name
return this._name
}

get el() {
return this.#el
return this._el
}

get open() {
return this.#open
return this._open
}

get close() {
return this.#close
return this._close
}

}

+ 24
- 24
apps/files/src/models/Tab.js Näytä tiedosto

@@ -22,14 +22,14 @@

export default class Tab {

#id
#name
#icon
#mount
#update
#destroy
#enabled
#scrollBottomReached
_id
_name
_icon
_mount
_update
_destroy
_enabled
_scrollBottomReached

/**
* Create a new tab instance
@@ -78,47 +78,47 @@ export default class Tab {
throw new Error('The scrollBottomReached argument should be a function')
}

this.#id = id
this.#name = name
this.#icon = icon
this.#mount = mount
this.#update = update
this.#destroy = destroy
this.#enabled = enabled
this.#scrollBottomReached = scrollBottomReached
this._id = id
this._name = name
this._icon = icon
this._mount = mount
this._update = update
this._destroy = destroy
this._enabled = enabled
this._scrollBottomReached = scrollBottomReached

}

get id() {
return this.#id
return this._id
}

get name() {
return this.#name
return this._name
}

get icon() {
return this.#icon
return this._icon
}

get mount() {
return this.#mount
return this._mount
}

get update() {
return this.#update
return this._update
}

get destroy() {
return this.#destroy
return this._destroy
}

get enabled() {
return this.#enabled
return this._enabled
}

get scrollBottomReached() {
return this.#scrollBottomReached
return this._scrollBottomReached
}

}

+ 5
- 5
apps/files/src/services/Settings.js Näytä tiedosto

@@ -22,10 +22,10 @@

export default class Settings {

#settings
_settings

constructor() {
this.#settings = []
this._settings = []
console.debug('OCA.Files.Settings initialized')
}

@@ -37,11 +37,11 @@ export default class Settings {
* @returns {boolean} whether registering was successful
*/
register(view) {
if (this.#settings.filter(e => e.name === view.name).length > 0) {
if (this._settings.filter(e => e.name === view.name).length > 0) {
console.error('A setting with the same name is already registered')
return false
}
this.#settings.push(view)
this._settings.push(view)
return true
}

@@ -50,7 +50,7 @@ export default class Settings {
* @returns {OCA.Files.Settings.Setting[]} All currently registered settings
*/
get settings() {
return this.#settings
return this._settings
}

}

+ 13
- 14
apps/files/src/services/Sidebar.js Näytä tiedosto

@@ -22,18 +22,17 @@

export default class Sidebar {

#state;
#view;
_state;

constructor() {
// init empty state
this.#state = {}
this._state = {}

// init default values
this.#state.tabs = []
this.#state.views = []
this.#state.file = ''
this.#state.activeTab = ''
this._state.tabs = []
this._state.views = []
this._state.file = ''
this._state.activeTab = ''
console.debug('OCA.Files.Sidebar initialized')
}

@@ -45,7 +44,7 @@ export default class Sidebar {
* @returns {Object} the data state
*/
get state() {
return this.#state
return this._state
}

/**
@@ -56,9 +55,9 @@ export default class Sidebar {
* @returns {Boolean}
*/
registerTab(tab) {
const hasDuplicate = this.#state.tabs.findIndex(check => check.id === tab.id) > -1
const hasDuplicate = this._state.tabs.findIndex(check => check.id === tab.id) > -1
if (!hasDuplicate) {
this.#state.tabs.push(tab)
this._state.tabs.push(tab)
return true
}
console.error(`An tab with the same id ${tab.id} already exists`, tab)
@@ -66,9 +65,9 @@ export default class Sidebar {
}

registerSecondaryView(view) {
const hasDuplicate = this.#state.views.findIndex(check => check.id === view.id) > -1
const hasDuplicate = this._state.views.findIndex(check => check.id === view.id) > -1
if (!hasDuplicate) {
this.#state.views.push(view)
this._state.views.push(view)
return true
}
console.error('A similar view already exists', view)
@@ -82,7 +81,7 @@ export default class Sidebar {
* @returns {String} the current opened file
*/
get file() {
return this.#state.file
return this._state.file
}

/**
@@ -92,7 +91,7 @@ export default class Sidebar {
* @param {string} id the tab unique id
*/
setActiveTab(id) {
this.#state.activeTab = id
this._state.activeTab = id
}

}

+ 16
- 14
apps/files_sharing/js/dist/files_sharing_tab.js
File diff suppressed because it is too large
Näytä tiedosto


+ 1
- 1
apps/files_sharing/js/dist/files_sharing_tab.js.map
File diff suppressed because it is too large
Näytä tiedosto


+ 49
- 49
apps/files_sharing/src/models/Share.js Näytä tiedosto

@@ -27,7 +27,7 @@

export default class Share {

#share;
_share;

/**
* Create the share object
@@ -44,7 +44,7 @@ export default class Share {
ocsData.mail_send = !!ocsData.mail_send

// store state
this.#share = ocsData
this._share = ocsData
}

/**
@@ -59,7 +59,7 @@ export default class Share {
* @memberof Sidebar
*/
get state() {
return this.#share
return this._share
}

/**
@@ -70,7 +70,7 @@ export default class Share {
* @memberof Share
*/
get id() {
return this.#share.id
return this._share.id
}

/**
@@ -81,7 +81,7 @@ export default class Share {
* @memberof Share
*/
get type() {
return this.#share.share_type
return this._share.share_type
}

/**
@@ -93,7 +93,7 @@ export default class Share {
* @memberof Share
*/
get permissions() {
return this.#share.permissions
return this._share.permissions
}

/**
@@ -104,7 +104,7 @@ export default class Share {
* @memberof Share
*/
set permissions(permissions) {
this.#share.permissions = permissions
this._share.permissions = permissions
}

// SHARE OWNER --------------------------------------------------
@@ -116,7 +116,7 @@ export default class Share {
* @memberof Share
*/
get owner() {
return this.#share.uid_owner
return this._share.uid_owner
}

/**
@@ -127,7 +127,7 @@ export default class Share {
* @memberof Share
*/
get ownerDisplayName() {
return this.#share.displayname_owner
return this._share.displayname_owner
}

// SHARED WITH --------------------------------------------------
@@ -139,7 +139,7 @@ export default class Share {
* @memberof Share
*/
get shareWith() {
return this.#share.share_with
return this._share.share_with
}

/**
@@ -151,8 +151,8 @@ export default class Share {
* @memberof Share
*/
get shareWithDisplayName() {
return this.#share.share_with_displayname
|| this.#share.share_with
return this._share.share_with_displayname
|| this._share.share_with
}

/**
@@ -164,8 +164,8 @@ export default class Share {
* @memberof Share
*/
get shareWithDisplayNameUnique() {
return this.#share.share_with_displayname_unique
|| this.#share.share_with
return this._share.share_with_displayname_unique
|| this._share.share_with
}

/**
@@ -176,7 +176,7 @@ export default class Share {
* @memberof Share
*/
get shareWithLink() {
return this.#share.share_with_link
return this._share.share_with_link
}

/**
@@ -187,7 +187,7 @@ export default class Share {
* @memberof Share
*/
get shareWithAvatar() {
return this.#share.share_with_avatar
return this._share.share_with_avatar
}

// SHARED FILE OR FOLDER OWNER ----------------------------------
@@ -199,7 +199,7 @@ export default class Share {
* @memberof Share
*/
get uidFileOwner() {
return this.#share.uid_file_owner
return this._share.uid_file_owner
}

/**
@@ -211,8 +211,8 @@ export default class Share {
* @memberof Share
*/
get displaynameFileOwner() {
return this.#share.displayname_file_owner
|| this.#share.uid_file_owner
return this._share.displayname_file_owner
|| this._share.uid_file_owner
}

// TIME DATA ----------------------------------------------------
@@ -224,7 +224,7 @@ export default class Share {
* @memberof Share
*/
get createdTime() {
return this.#share.stime
return this._share.stime
}

/**
@@ -235,7 +235,7 @@ export default class Share {
* @memberof Share
*/
get expireDate() {
return this.#share.expiration
return this._share.expiration
}

/**
@@ -246,7 +246,7 @@ export default class Share {
* @memberof Share
*/
set expireDate(date) {
this.#share.expiration = date
this._share.expiration = date
}

// EXTRA DATA ---------------------------------------------------
@@ -258,7 +258,7 @@ export default class Share {
* @memberof Share
*/
get token() {
return this.#share.token
return this._share.token
}

/**
@@ -269,7 +269,7 @@ export default class Share {
* @memberof Share
*/
get note() {
return this.#share.note
return this._share.note
}

/**
@@ -279,7 +279,7 @@ export default class Share {
* @memberof Share
*/
set note(note) {
this.#share.note = note
this._share.note = note
}

/**
@@ -291,7 +291,7 @@ export default class Share {
* @memberof Share
*/
get label() {
return this.#share.label
return this._share.label
}

/**
@@ -302,7 +302,7 @@ export default class Share {
* @memberof Share
*/
set label(label) {
this.#share.label = label
this._share.label = label
}

/**
@@ -313,7 +313,7 @@ export default class Share {
* @memberof Share
*/
get mailSend() {
return this.#share.mail_send === true
return this._share.mail_send === true
}

/**
@@ -324,7 +324,7 @@ export default class Share {
* @memberof Share
*/
get hideDownload() {
return this.#share.hide_download === true
return this._share.hide_download === true
}

/**
@@ -334,7 +334,7 @@ export default class Share {
* @memberof Share
*/
set hideDownload(state) {
this.#share.hide_download = state === true
this._share.hide_download = state === true
}

/**
@@ -345,7 +345,7 @@ export default class Share {
* @memberof Share
*/
get password() {
return this.#share.password
return this._share.password
}

/**
@@ -355,7 +355,7 @@ export default class Share {
* @memberof Share
*/
set password(password) {
this.#share.password = password
this._share.password = password
}

/**
@@ -366,7 +366,7 @@ export default class Share {
* @memberof Share
*/
get sendPasswordByTalk() {
return this.#share.send_password_by_talk
return this._share.send_password_by_talk
}

/**
@@ -377,7 +377,7 @@ export default class Share {
* @memberof Share
*/
set sendPasswordByTalk(sendPasswordByTalk) {
this.#share.send_password_by_talk = sendPasswordByTalk
this._share.send_password_by_talk = sendPasswordByTalk
}

// SHARED ITEM DATA ---------------------------------------------
@@ -389,7 +389,7 @@ export default class Share {
* @memberof Share
*/
get path() {
return this.#share.path
return this._share.path
}

/**
@@ -400,7 +400,7 @@ export default class Share {
* @memberof Share
*/
get itemType() {
return this.#share.item_type
return this._share.item_type
}

/**
@@ -411,7 +411,7 @@ export default class Share {
* @memberof Share
*/
get mimetype() {
return this.#share.mimetype
return this._share.mimetype
}

/**
@@ -422,7 +422,7 @@ export default class Share {
* @memberof Share
*/
get fileSource() {
return this.#share.file_source
return this._share.file_source
}

/**
@@ -435,7 +435,7 @@ export default class Share {
* @memberof Share
*/
get fileTarget() {
return this.#share.file_target
return this._share.file_target
}

/**
@@ -446,7 +446,7 @@ export default class Share {
* @memberof Share
*/
get fileParent() {
return this.#share.file_parent
return this._share.file_parent
}

// PERMISSIONS Shortcuts
@@ -517,7 +517,7 @@ export default class Share {
* @memberof Share
*/
get canEdit() {
return this.#share.can_edit === true
return this._share.can_edit === true
}

/**
@@ -528,7 +528,7 @@ export default class Share {
* @memberof Share
*/
get canDelete() {
return this.#share.can_delete === true
return this._share.can_delete === true
}

/**
@@ -538,7 +538,7 @@ export default class Share {
* @memberof Share
*/
get viaFileid() {
return this.#share.via_fileid
return this._share.via_fileid
}

/**
@@ -548,29 +548,29 @@ export default class Share {
* @memberof Share
*/
get viaPath() {
return this.#share.via_path
return this._share.via_path
}

// TODO: SORT THOSE PROPERTIES

get parent() {
return this.#share.parent
return this._share.parent
}

get storageId() {
return this.#share.storage_id
return this._share.storage_id
}

get storage() {
return this.#share.storage
return this._share.storage
}

get itemSource() {
return this.#share.item_source
return this._share.item_source
}

get status() {
return this.#share.status
return this._share.status
}

}

+ 5
- 5
apps/files_sharing/src/services/ExternalLinkActions.js Näytä tiedosto

@@ -22,14 +22,14 @@

export default class ExternalLinkActions {

#state;
_state;

constructor() {
// init empty state
this.#state = {}
this._state = {}

// init default values
this.#state.actions = []
this._state.actions = []
console.debug('OCA.Sharing.ExternalLinkActions initialized')
}

@@ -41,7 +41,7 @@ export default class ExternalLinkActions {
* @returns {Object} the data state
*/
get state() {
return this.#state
return this._state
}

/**
@@ -53,7 +53,7 @@ export default class ExternalLinkActions {
*/
registerAction(action) {
if (typeof action === 'object' && action.icon && action.name && action.url) {
this.#state.actions.push(action)
this._state.actions.push(action)
return true
}
console.error('Invalid action provided', action)

+ 5
- 5
apps/files_sharing/src/services/ShareSearch.js Näytä tiedosto

@@ -22,14 +22,14 @@

export default class ShareSearch {

#state;
_state;

constructor() {
// init empty state
this.#state = {}
this._state = {}

// init default values
this.#state.results = []
this._state.results = []
console.debug('OCA.Sharing.ShareSearch initialized')
}

@@ -41,7 +41,7 @@ export default class ShareSearch {
* @returns {Object} the data state
*/
get state() {
return this.#state
return this._state
}

/**
@@ -61,7 +61,7 @@ export default class ShareSearch {
addNewResult(result) {
if (result.displayName.trim() !== ''
&& typeof result.handler === 'function') {
this.#state.results.push(result)
this._state.results.push(result)
return true
}
console.error('Invalid search result provided', result)

+ 4
- 4
apps/files_sharing/src/services/TabSections.js Näytä tiedosto

@@ -22,21 +22,21 @@

export default class TabSections {

#sections;
_sections;

constructor() {
this.#sections = []
this._sections = []
}

/**
* @param {registerSectionCallback} section To be called to mount the section to the sharing sidebar
*/
registerSection(section) {
this.#sections.push(section)
this._sections.push(section)
}

getSections() {
return this.#sections
return this._sections
}

}

Loading…
Peruuta
Tallenna