Skip to content

Commit

Permalink
Merge pull request #11651 from nextcloud/build/noid/typescript-support
Browse files Browse the repository at this point in the history
build: provide Typescript support
  • Loading branch information
Antreesy authored Feb 26, 2024
2 parents e02b293 + 1b68fdb commit 7e91398
Show file tree
Hide file tree
Showing 23 changed files with 283 additions and 83 deletions.
2 changes: 2 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module.exports = {
extends: [
'@nextcloud',
'@nextcloud/eslint-config/typescript',
],
globals: {
// @nextcloud/webpack-vue-config globals
Expand All @@ -12,6 +13,7 @@ module.exports = {
rules: {
'comma-dangle': 'off',
'jsdoc/no-defaults': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'import/newline-after-import': 'warn',
'import/no-named-as-default-member': 'off',
'import/order': [
Expand Down
6 changes: 6 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ module.exports = {
},

transform: {
'\\.ts$': ['ts-jest', {
useESM: true,
tsconfig: {
verbatimModuleSyntax: false,
},
}],
'\\.js$': 'babel-jest',
'\\.vue$': '@vue/vue2-jest',
'\\.tflite$': 'jest-transform-stub',
Expand Down
179 changes: 179 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
"jest-mock-console": "^2.0.0",
"jest-transform-stub": "^2.0.0",
"regenerator-runtime": "^0.14.1",
"ts-jest": "^29.1.2",
"vue-template-compiler": "^2.7.16",
"wasm-check": "^2.1.2",
"webpack-bundle-analyzer": "^4.10.1",
Expand Down
20 changes: 10 additions & 10 deletions src/components/AdminSettings/AllowedGroups.vue
Original file line number Diff line number Diff line change
Expand Up @@ -212,14 +212,14 @@ export default {
})

OCP.AppConfig.setValue('spreed', 'allowed_groups', JSON.stringify(groups), {
success: function() {
success: () => {
this.loading = false
this.loadingGroups = false
this.saveLabelAllowedGroups = t('spreed', 'Saved!')
setTimeout(function() {
setTimeout(() => {
this.saveLabelAllowedGroups = t('spreed', 'Save changes')
}.bind(this), 5000)
}.bind(this),
}, 5000)
},
})
},

Expand All @@ -233,24 +233,24 @@ export default {
})

OCP.AppConfig.setValue('spreed', 'start_conversations', JSON.stringify(groups), {
success: function() {
success: () => {
this.loading = false
this.loadingGroups = false
this.saveLabelStartConversations = t('spreed', 'Saved!')
setTimeout(function() {
setTimeout(() => {
this.saveLabelStartConversations = t('spreed', 'Save changes')
}.bind(this), 5000)
}.bind(this),
}, 5000)
},
})
},

saveStartCalls() {
this.loadingStartCalls = true

OCP.AppConfig.setValue('spreed', 'start_calls', this.startCalls.value, {
success: function() {
success: () => {
this.loadingStartCalls = false
}.bind(this),
},
})
},
},
Expand Down
24 changes: 12 additions & 12 deletions src/components/AdminSettings/Federation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -162,43 +162,43 @@ export default {
this.loading = true

OCP.AppConfig.setValue('spreed', 'federation_enabled', value ? 'yes' : 'no', {
success: function() {
success: () => {
this.loading = false
this.isFederationEnabled = value
}.bind(this),
},
})
},

saveFederationIncomingEnabled(value) {
this.loading = true

OCP.AppConfig.setValue('spreed', 'federation_incoming_enabled', value ? '1' : '0', {
success: function() {
success: () => {
this.loading = false
this.isFederationIncomingEnabled = value
}.bind(this),
},
})
},

saveFederationOutgoingEnabled(value) {
this.loading = true

OCP.AppConfig.setValue('spreed', 'federation_outgoing_enabled', value ? '1' : '0', {
success: function() {
success: () => {
this.loading = false
this.isFederationOutgoingEnabled = value
}.bind(this),
},
})
},

saveFederationOnlyTrustedServersEnabled(value) {
this.loading = true

OCP.AppConfig.setValue('spreed', 'federation_only_trusted_servers', value ? '1' : '0', {
success: function() {
success: () => {
this.loading = false
this.isFederationOnlyTrustedServersEnabled = value
}.bind(this),
},
})
},

Expand Down Expand Up @@ -232,14 +232,14 @@ export default {
const groups = this.allowedGroups.map(group => typeof group === 'object' ? group.id : group)

OCP.AppConfig.setValue('spreed', 'federation_allowed_groups', JSON.stringify(groups), {
success: function() {
success: () => {
this.loading = false
this.loadingGroups = false
this.saveLabelAllowedGroups = t('spreed', 'Saved!')
setTimeout(function() {
setTimeout(() => {
this.saveLabelAllowedGroups = t('spreed', 'Save changes')
}.bind(this), 5000)
}.bind(this),
}, 5000)
},
})
},
},
Expand Down
Loading

0 comments on commit 7e91398

Please sign in to comment.