Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable30] fix(settings): Fix mail server settings form #50184

Open
wants to merge 2 commits into
base: stable30
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 20 additions & 29 deletions apps/settings/src/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
* SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

import { generateUrl } from '@nextcloud/router'
import $ from 'jquery'
import axios from '@nextcloud/axios'

window.addEventListener('DOMContentLoaded', () => {
$('#loglevel').change(function() {
$.post(OC.generateUrl('/settings/admin/log/level'), { level: $(this).val() }, () => {
Expand Down Expand Up @@ -44,17 +49,12 @@ window.addEventListener('DOMContentLoaded', () => {
}

OC.msg.startSaving('#mail_settings_msg')
$.ajax({
url: OC.generateUrl('/settings/admin/mailsettings'),
type: 'POST',
data: $('#mail_general_settings_form').serialize(),
success: () => {
axios.post(generateUrl('/settings/admin/mailsettings'), $('#mail_general_settings_form').serialize())
.then(() => {
OC.msg.finishedSuccess('#mail_settings_msg', t('settings', 'Saved'))
},
error: (xhr) => {
OC.msg.finishedError('#mail_settings_msg', xhr.responseJSON)
},
})
}).catch((error) => {
OC.msg.finishedError('#mail_settings_msg', error)
})
}

const toggleEmailCredentials = function() {
Expand All @@ -64,17 +64,12 @@ window.addEventListener('DOMContentLoaded', () => {
}

OC.msg.startSaving('#mail_settings_msg')
$.ajax({
url: OC.generateUrl('/settings/admin/mailsettings/credentials'),
type: 'POST',
data: $('#mail_credentials_settings').serialize(),
success: () => {
axios.post(generateUrl('/settings/admin/mailsettings/credentials'), $('#mail_credentials_settings').serialize())
.then(() => {
OC.msg.finishedSuccess('#mail_settings_msg', t('settings', 'Saved'))
},
error: (xhr) => {
OC.msg.finishedError('#mail_settings_msg', xhr.responseJSON)
},
})
}).catch((error) => {
OC.msg.finishedError('#mail_settings_msg', error)
})
}

$('#mail_general_settings_form').change(changeEmailSettings)
Expand All @@ -90,16 +85,12 @@ window.addEventListener('DOMContentLoaded', () => {
event.preventDefault()
OC.msg.startAction('#sendtestmail_msg', t('settings', 'Sending…'))

$.ajax({
url: OC.generateUrl('/settings/admin/mailtest'),
type: 'POST',
success: () => {
axios.post(generateUrl('/settings/admin/mailtest'))
.then(() => {
OC.msg.finishedSuccess('#sendtestmail_msg', t('settings', 'Email sent'))
},
error: (xhr) => {
OC.msg.finishedError('#sendtestmail_msg', xhr.responseJSON)
},
})
}).catch((error) => {
OC.msg.finishedError('#sendtestmail_msg', error)
})
})

const setupChecks = () => {
Expand Down
4 changes: 2 additions & 2 deletions dist/core-common.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/core-common.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/settings-legacy-admin.js

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

147 changes: 147 additions & 0 deletions dist/settings-legacy-admin.js.license
Original file line number Diff line number Diff line change
@@ -1,8 +1,155 @@
SPDX-License-Identifier: MIT
SPDX-License-Identifier: ISC
SPDX-License-Identifier: GPL-3.0-or-later
SPDX-License-Identifier: BSD-3-Clause
SPDX-License-Identifier: AGPL-3.0-or-later
SPDX-FileCopyrightText: inherits developers
SPDX-FileCopyrightText: assert developers
SPDX-FileCopyrightText: Tobias Koppers @sokra
SPDX-FileCopyrightText: T. Jameson Little <[email protected]>
SPDX-FileCopyrightText: Roman Shtylman <[email protected]>
SPDX-FileCopyrightText: Raynos <[email protected]>
SPDX-FileCopyrightText: OpenJS Foundation and other contributors
SPDX-FileCopyrightText: Nextcloud GmbH and Nextcloud contributors
SPDX-FileCopyrightText: Matt Zabriskie
SPDX-FileCopyrightText: Joyent
SPDX-FileCopyrightText: Jordan Harband <[email protected]>
SPDX-FileCopyrightText: Jordan Harband
SPDX-FileCopyrightText: GitHub Inc.
SPDX-FileCopyrightText: Feross Aboukhadijeh
SPDX-FileCopyrightText: Christoph Wurst


This file is generated from multiple sources. Included packages:
- @nextcloud/auth
- version: 2.4.0
- license: GPL-3.0-or-later
- @nextcloud/axios
- version: 2.5.1
- license: GPL-3.0-or-later
- @nextcloud/browser-storage
- version: 0.4.0
- license: GPL-3.0-or-later
- semver
- version: 7.6.3
- license: ISC
- @nextcloud/event-bus
- version: 3.3.1
- license: GPL-3.0-or-later
- @nextcloud/router
- version: 3.0.1
- license: GPL-3.0-or-later
- assert
- version: 2.1.0
- license: MIT
- available-typed-arrays
- version: 1.0.7
- license: MIT
- axios
- version: 1.7.9
- license: MIT
- base64-js
- version: 1.5.1
- license: MIT
- call-bind
- version: 1.0.7
- license: MIT
- console-browserify
- version: 1.2.0
- license: MIT
- define-data-property
- version: 1.1.4
- license: MIT
- define-properties
- version: 1.2.1
- license: MIT
- es-define-property
- version: 1.0.0
- license: MIT
- es-errors
- version: 1.3.0
- license: MIT
- for-each
- version: 0.3.3
- license: MIT
- function-bind
- version: 1.1.2
- license: MIT
- get-intrinsic
- version: 1.2.4
- license: MIT
- gopd
- version: 1.0.1
- license: MIT
- has-property-descriptors
- version: 1.0.2
- license: MIT
- has-proto
- version: 1.0.3
- license: MIT
- has-symbols
- version: 1.0.3
- license: MIT
- has-tostringtag
- version: 1.0.2
- license: MIT
- hasown
- version: 2.0.2
- license: MIT
- ieee754
- version: 1.2.1
- license: BSD-3-Clause
- inherits
- version: 2.0.4
- license: ISC
- is-arguments
- version: 1.1.1
- license: MIT
- is-callable
- version: 1.2.7
- license: MIT
- is-generator-function
- version: 1.0.10
- license: MIT
- is-nan
- version: 1.3.2
- license: MIT
- is-typed-array
- version: 1.1.13
- license: MIT
- jquery
- version: 3.7.1
- license: MIT
- buffer
- version: 6.0.3
- license: MIT
- object-is
- version: 1.1.6
- license: MIT
- object-keys
- version: 1.1.1
- license: MIT
- object.assign
- version: 4.1.5
- license: MIT
- possible-typed-array-names
- version: 1.0.0
- license: MIT
- process
- version: 0.11.10
- license: MIT
- set-function-length
- version: 1.2.2
- license: MIT
- util
- version: 0.12.5
- license: MIT
- webpack
- version: 5.94.0
- license: MIT
- which-typed-array
- version: 1.1.15
- license: MIT
- nextcloud
- version: 1.0.0
- license: AGPL-3.0-or-later
Loading
Loading