Skip to content

Commit

Permalink
Replace proposal-class-private-properties by regular properties
Browse files Browse the repository at this point in the history
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Signed-off-by: npmbuildbot-nextcloud[bot] <npmbuildbot-nextcloud[bot]@users.noreply.github.com>
  • Loading branch information
skjnldsv authored and npmbuildbot-nextcloud[bot] committed Jun 2, 2021
1 parent d9a9714 commit aef00dd
Show file tree
Hide file tree
Showing 14 changed files with 153 additions and 151 deletions.
8 changes: 4 additions & 4 deletions apps/files/js/dist/files-app-settings.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/files/js/dist/files-app-settings.js.map

Large diffs are not rendered by default.

15 changes: 7 additions & 8 deletions apps/files/js/dist/sidebar.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/files/js/dist/sidebar.js.map

Large diffs are not rendered by default.

34 changes: 18 additions & 16 deletions apps/files/src/models/Setting.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@

export default class Setting {

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

/**
* Create a new files app setting
Expand All @@ -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
}

}
48 changes: 24 additions & 24 deletions apps/files/src/models/Tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}

}
10 changes: 5 additions & 5 deletions apps/files/src/services/Settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@

export default class Settings {

#settings
_settings

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

Expand All @@ -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
}

Expand All @@ -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
}

}
27 changes: 13 additions & 14 deletions apps/files/src/services/Sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}

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

/**
Expand All @@ -56,19 +55,19 @@ 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)
return false
}

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)
Expand All @@ -82,7 +81,7 @@ export default class Sidebar {
* @returns {String} the current opened file
*/
get file() {
return this.#state.file
return this._state.file
}

/**
Expand All @@ -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
}

}
30 changes: 16 additions & 14 deletions apps/files_sharing/js/dist/files_sharing_tab.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/files_sharing/js/dist/files_sharing_tab.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit aef00dd

Please sign in to comment.