Skip to content

Commit 74c227f

Browse files
authored
Refactor form submit JS (hestiacp#3502)
* Improve notification copy * Refactor form submit JS * Refactor "enable disabled inputs on form submit"
1 parent 74e147f commit 74c227f

22 files changed

+97
-131
lines changed

func/upgrade.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,13 +183,13 @@ upgrade_send_notification_to_panel() {
183183
# Add notification to panel if variable is set to true or is not set
184184
if [[ "$new_version" =~ "alpha" ]]; then
185185
# Send notifications for development releases
186-
$BIN/v-add-user-notification admin 'Development snapshot installed' '<b>Version:</b> '$new_version'<br><b>Code Branch:</b> '$RELEASE_BRANCH'<br><br>Please tell us about any bugs or issues by opening an issue report on <a href="https://github.com/hestiacp/hestiacp/issues" target="_blank"><i class="fab fa-github"></i> GitHub</a> and feel free to share your feedback on our <a href="https://forum.hestiacp.com" target="_blank">discussion forum</a>.<br><br><i class="fas fa-heart icon-red"></i> The Hestia Control Panel development team'
186+
$BIN/v-add-user-notification admin 'Development snapshot installed' '<b>Version:</b> '$new_version'<br><b>Code Branch:</b> '$RELEASE_BRANCH'<br><br>Please report any bugs by <a href="https://github.com/hestiacp/hestiacp/issues" target="_blank">opening an issue on GitHub</a>, and feel free to share your feedback on our <a href="https://forum.hestiacp.com" target="_blank">discussion forum</a>.<br><br><i class="fas fa-heart icon-red"></i> The Hestia Control Panel development team'
187187
elif [[ "$new_version" =~ "beta" ]]; then
188188
# Send feedback notification for beta releases
189-
$BIN/v-add-user-notification admin 'Thank you for testing Hestia Control Panel '$new_version'.' '<b>Please share your feedback with our development team through our <a href="https://forum.hestiacp.com" target="_blank">discussion forum</a>.<br><br>Found a bug? Report it on <a href="https://github.com/hestiacp/hestiacp/issues" target="_blank"><i class="fab fa-github"></i> GitHub</a>!</b><br><br><i class="fas fa-heart icon-red"></i> The Hestia Control Panel development team'
189+
$BIN/v-add-user-notification admin 'Thank you for testing Hestia Control Panel '$new_version'.' '<b>Please share your feedback with our development team through our <a href="https://forum.hestiacp.com" target="_blank">discussion forum</a>.<br><br>Found a bug? <a href="https://github.com/hestiacp/hestiacp/issues" target="_blank">Open an issue on GitHub</a>!</b><br><br><i class="fas fa-heart icon-red"></i> The Hestia Control Panel development team'
190190
else
191191
# Send normal upgrade complete notification for stable releases
192-
$BIN/v-add-user-notification admin 'Upgrade complete' 'Hestia Control Panel has been updated to <b>v'$new_version'</b>.<br><a href="https://github.com/hestiacp/hestiacp/blob/release/CHANGELOG.md" target="_blank">View release notes</a><br><br>Please tell us about any bugs or issues by opening a new issue report on <a href="https://github.com/hestiacp/hestiacp/issues" target="_blank"><i class="fab fa-github"></i> GitHub</a>.<br><br><b>Have a wonderful day!</b><br><br><i class="fas fa-heart icon-red"></i> The Hestia Control Panel development team'
192+
$BIN/v-add-user-notification admin 'Upgrade complete' 'Hestia Control Panel has been updated to <b>v'$new_version'</b>.<br><a href="https://github.com/hestiacp/hestiacp/blob/release/CHANGELOG.md" target="_blank">View release notes</a><br><br>Please report any bugs or issues by <a href="https://github.com/hestiacp/hestiacp/issues" target="_blank">opening an issue on GitHub</a>.<br><br><b>Have a wonderful day!</b><br><br><i class="fas fa-heart icon-red"></i> The Hestia Control Panel development team'
193193
fi
194194
}
195195

web/js/dist/main.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/js/dist/main.min.js.map

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/js/pages/add_web.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,3 @@ $(function () {
9292
}
9393
});
9494
});
95-
96-
document.querySelector('#vstobjects').addEventListener('submit', () => {
97-
$('input[disabled]').each(function (i, elm) {
98-
$(elm).removeAttr('disabled');
99-
});
100-
});

web/js/pages/edit_mail.js

Lines changed: 0 additions & 8 deletions
This file was deleted.

web/js/pages/edit_server_mysql.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

web/js/pages/edit_server_nginx.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

web/js/pages/edit_server_php.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

web/js/pages/edit_web.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -260,15 +260,6 @@ $(function () {
260260
$('#v-clear-cache').show();
261261
}
262262
});
263-
264-
document.querySelector('#vstobjects').addEventListener('submit', () => {
265-
$('input[disabled]').each(function (i, elm) {
266-
var copy_elm = $(elm).clone(true);
267-
$(copy_elm).attr('type', 'hidden');
268-
$(copy_elm).removeAttr('disabled');
269-
$(elm).after(copy_elm);
270-
});
271-
});
272263
});
273264

274265
// eslint-disable-next-line @typescript-eslint/no-unused-vars

web/js/src/confirmationDialog.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { createConfirmationDialog } from './helpers.js';
1+
import { createConfirmationDialog } from './helpers';
22

33
// Adds listeners to .js-confirm-action links and intercepts them with a confirmation dialog
44
export default function handleConfirmationDialogs() {

0 commit comments

Comments
 (0)