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

feat: Deprecate and replace legacy jQuery UI dialogs with Vue #44755

Merged
merged 4 commits into from
Apr 10, 2024
Merged
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
2 changes: 1 addition & 1 deletion core/css/server.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion core/css/server.css.map

Large diffs are not rendered by default.

336 changes: 148 additions & 188 deletions core/src/OC/dialogs.js

Large diffs are not rendered by default.

107 changes: 107 additions & 0 deletions core/src/components/LegacyDialogPrompt.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
<template>
<NcDialog dialog-classes="legacy-prompt__dialog"
:buttons="buttons"
:name="name"
@update:open="$emit('close', false, inputValue)">
<p class="legacy-prompt__text" v-text="text" />
<NcPasswordField v-if="isPassword"
ref="input"
autocomplete="new-password"
class="legacy-prompt__input"
:label="name"
:name="inputName"
:value.sync="inputValue" />
<NcTextField v-else
ref="input"
class="legacy-prompt__input"
:label="name"
:name="inputName"
:value.sync="inputValue" />
</NcDialog>
</template>

<script lang="ts">
import { translate as t } from '@nextcloud/l10n'
import { defineComponent } from 'vue'

import NcDialog from '@nextcloud/vue/dist/Components/NcDialog.js'
import NcTextField from '@nextcloud/vue/dist/Components/NcTextField.js'
import NcPasswordField from '@nextcloud/vue/dist/Components/NcPasswordField.js'

export default defineComponent({
name: 'LegacyDialogPrompt',

components: {
NcDialog,
NcTextField,
NcPasswordField,
},

props: {
name: {
type: String,
required: true,
},

text: {
type: String,
required: true,
},

isPassword: {
type: Boolean,
required: true,
},

inputName: {
type: String,
default: 'prompt-input',
},
},

emits: ['close'],

data() {
return {
inputValue: '',
}
},

computed: {
buttons() {
return [
{
label: t('core', 'No'),
callback: () => this.$emit('close', false, this.inputValue),
},
{
label: t('core', 'Yes'),
type: 'primary',
callback: () => this.$emit('close', true, this.inputValue),
},
]
},
},

mounted() {
this.$nextTick(() => this.$refs.input?.focus?.())
},
})
</script>

<style scoped lang="scss">
.legacy-prompt {
&__text {
margin-block: 0 .75em;
}

&__input {
margin-block: 0 1em;
}
}

:deep(.legacy-prompt__dialog .dialog__actions) {
min-width: calc(100% - 12px);
justify-content: space-between;
}
</style>
3 changes: 0 additions & 3 deletions core/templates/message.html

This file was deleted.

2 changes: 1 addition & 1 deletion cypress/e2e/settings/users.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ describe('Settings: Create and delete accounts', function() {
// The "Delete account" action in the actions menu is shown and clicked
cy.get('.action-item__popper .action').contains('Delete account').should('exist').click({ force: true })
// And confirmation dialog accepted
cy.get('.oc-dialog button').contains(`Delete ${testUser.userId}`).click({ force: true })
cy.get('.nc-generic-dialog button').contains(`Delete ${testUser.userId}`).click({ force: true })

// Make sure no confirmation modal is shown
handlePasswordConfirmation(admin.password)
Expand Down
2 changes: 2 additions & 0 deletions dist/1689-1689.js

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

1 change: 1 addition & 0 deletions dist/1689-1689.js.map

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

4 changes: 2 additions & 2 deletions dist/4997-4997.js

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions dist/7185-7185.js

Large diffs are not rendered by default.

43 changes: 43 additions & 0 deletions dist/7560-7560.js.LICENSE.txt → dist/7185-7185.js.LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,28 @@
*
*/

/**
* @copyright Copyright (c) 2023 Ferdinand Thiessen <opensource@fthiessen.de>
*
* @author Ferdinand Thiessen <opensource@fthiessen.de>
*
* @license AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

/**
* @copyright Copyright (c) 2023 Ferdinand Thiessen <opensource@fthiessen.de>
*
Expand Down Expand Up @@ -152,3 +174,24 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

/**
* @copyright Copyright (c) 2024 Ferdinand Thiessen <opensource@fthiessen.de>
*
* @author Ferdinand Thiessen <opensource@fthiessen.de>
*
* @license AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
1 change: 1 addition & 0 deletions dist/7185-7185.js.map

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions dist/7560-7560.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/7560-7560.js.map

This file was deleted.

3 changes: 0 additions & 3 deletions dist/8618-8618.js

This file was deleted.

3 changes: 3 additions & 0 deletions dist/9891-9891.js

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

File renamed without changes.
2 changes: 1 addition & 1 deletion dist/8618-8618.js.map → dist/9891-9891.js.map

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

4 changes: 2 additions & 2 deletions dist/comments-comments-app.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/comments-comments-app.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/comments-comments-tab.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/comments-comments-tab.js.map

Large diffs are not rendered by default.

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/core-legacy-unified-search.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/core-legacy-unified-search.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/core-login.js

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/core-main.js

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/core-profile.js

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/dav-settings-personal-availability.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/dav-settings-personal-availability.js.map

Large diffs are not rendered by default.

Loading
Loading