mirror of
https://github.com/n8n-io/n8n.git
synced 2025-02-02 07:01:30 -08:00
fix(editor): Vue3 - Fix modal positioning and multi-select tag sizing (#6783)
* ✨ Updating modals positioning within the overlay * 💄 Implemented multi-select variant with small tabs * ✔️ Removing password link clicks while modal is open in e2e tests * Set generous timeout for $paramter resolve Signed-off-by: Oleg Ivaniv <me@olegivaniv.com> --------- Signed-off-by: Oleg Ivaniv <me@olegivaniv.com> Co-authored-by: Oleg Ivaniv <me@olegivaniv.com>
This commit is contained in:
parent
30484a0615
commit
4e491b754f
|
@ -51,7 +51,7 @@ describe('Inline expression editor', () => {
|
||||||
it('should resolve array resolvables', () => {
|
it('should resolve array resolvables', () => {
|
||||||
WorkflowPage.getters.inlineExpressionEditorInput().clear();
|
WorkflowPage.getters.inlineExpressionEditorInput().clear();
|
||||||
WorkflowPage.getters.inlineExpressionEditorInput().type('{{');
|
WorkflowPage.getters.inlineExpressionEditorInput().type('{{');
|
||||||
WorkflowPage.getters.inlineExpressionEditorInput().type('[1, 2, 3]');
|
WorkflowPage.getters.inlineExpressionEditorInput().type('[1, 2, 3]', { timeout: 20000 });
|
||||||
WorkflowPage.getters.inlineExpressionEditorOutput().contains(/^\[Array: \[1,2,3\]\]$/);
|
WorkflowPage.getters.inlineExpressionEditorOutput().contains(/^\[Array: \[1,2,3\]\]$/);
|
||||||
|
|
||||||
WorkflowPage.getters.inlineExpressionEditorInput().clear();
|
WorkflowPage.getters.inlineExpressionEditorInput().clear();
|
||||||
|
@ -65,7 +65,8 @@ describe('Inline expression editor', () => {
|
||||||
it('should resolve $parameter[]', () => {
|
it('should resolve $parameter[]', () => {
|
||||||
WorkflowPage.getters.inlineExpressionEditorInput().clear();
|
WorkflowPage.getters.inlineExpressionEditorInput().clear();
|
||||||
WorkflowPage.getters.inlineExpressionEditorInput().type('{{');
|
WorkflowPage.getters.inlineExpressionEditorInput().type('{{');
|
||||||
WorkflowPage.getters.inlineExpressionEditorInput().type('$parameter["operation"]');
|
// Resolving $parameter is slow, especially on CI runner
|
||||||
|
WorkflowPage.getters.inlineExpressionEditorInput().type('$parameter["operation"]', { timeout: 35000 });
|
||||||
WorkflowPage.getters.inlineExpressionEditorOutput().contains(/^get$/);
|
WorkflowPage.getters.inlineExpressionEditorOutput().contains(/^get$/);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -88,6 +88,7 @@ describe('User Management', { disableAutoLogin: true }, () => {
|
||||||
|
|
||||||
it(`shouldn't allow user to set weak password`, () => {
|
it(`shouldn't allow user to set weak password`, () => {
|
||||||
personalSettingsPage.actions.loginAndVisit(INSTANCE_OWNER.email, INSTANCE_OWNER.password);
|
personalSettingsPage.actions.loginAndVisit(INSTANCE_OWNER.email, INSTANCE_OWNER.password);
|
||||||
|
personalSettingsPage.getters.changePasswordLink().click();
|
||||||
for (let weakPass of updatedPersonalData.invalidPasswords) {
|
for (let weakPass of updatedPersonalData.invalidPasswords) {
|
||||||
personalSettingsPage.actions.tryToSetWeakPassword(INSTANCE_OWNER.password, weakPass);
|
personalSettingsPage.actions.tryToSetWeakPassword(INSTANCE_OWNER.password, weakPass);
|
||||||
}
|
}
|
||||||
|
@ -95,6 +96,7 @@ describe('User Management', { disableAutoLogin: true }, () => {
|
||||||
|
|
||||||
it(`shouldn't allow user to change password if old password is wrong`, () => {
|
it(`shouldn't allow user to change password if old password is wrong`, () => {
|
||||||
personalSettingsPage.actions.loginAndVisit(INSTANCE_OWNER.email, INSTANCE_OWNER.password);
|
personalSettingsPage.actions.loginAndVisit(INSTANCE_OWNER.email, INSTANCE_OWNER.password);
|
||||||
|
personalSettingsPage.getters.changePasswordLink().click();
|
||||||
personalSettingsPage.actions.updatePassword('iCannotRemember', updatedPersonalData.newPassword);
|
personalSettingsPage.actions.updatePassword('iCannotRemember', updatedPersonalData.newPassword);
|
||||||
workflowPage.getters
|
workflowPage.getters
|
||||||
.errorToast()
|
.errorToast()
|
||||||
|
@ -104,6 +106,7 @@ describe('User Management', { disableAutoLogin: true }, () => {
|
||||||
|
|
||||||
it(`should change current user password`, () => {
|
it(`should change current user password`, () => {
|
||||||
personalSettingsPage.actions.loginAndVisit(INSTANCE_OWNER.email, INSTANCE_OWNER.password);
|
personalSettingsPage.actions.loginAndVisit(INSTANCE_OWNER.email, INSTANCE_OWNER.password);
|
||||||
|
personalSettingsPage.getters.changePasswordLink().click();
|
||||||
personalSettingsPage.actions.updatePassword(
|
personalSettingsPage.actions.updatePassword(
|
||||||
INSTANCE_OWNER.password,
|
INSTANCE_OWNER.password,
|
||||||
updatedPersonalData.newPassword,
|
updatedPersonalData.newPassword,
|
||||||
|
|
|
@ -25,7 +25,6 @@ export class PersonalSettingsPage extends BasePage {
|
||||||
this.getters.saveSettingsButton().realClick();
|
this.getters.saveSettingsButton().realClick();
|
||||||
},
|
},
|
||||||
updatePassword: (oldPassword: string, newPassword: string) => {
|
updatePassword: (oldPassword: string, newPassword: string) => {
|
||||||
this.getters.changePasswordLink().realClick();
|
|
||||||
changePasswordModal.getters.modalContainer().should('be.visible');
|
changePasswordModal.getters.modalContainer().should('be.visible');
|
||||||
changePasswordModal.getters.currentPasswordInput().type('{selectall}').type(oldPassword);
|
changePasswordModal.getters.currentPasswordInput().type('{selectall}').type(oldPassword);
|
||||||
changePasswordModal.getters.newPasswordInput().type('{selectall}').type(newPassword);
|
changePasswordModal.getters.newPasswordInput().type('{selectall}').type(newPassword);
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
<div :class="showErrors ? $style.errorInput : ''" @keydown.stop @keydown.enter="onEnter">
|
<div :class="showErrors ? $style.errorInput : ''" @keydown.stop @keydown.enter="onEnter">
|
||||||
<slot v-if="hasDefaultSlot" />
|
<slot v-if="hasDefaultSlot" />
|
||||||
<n8n-select
|
<n8n-select
|
||||||
|
:class="{ [$style.multiSelectSmallTags]: tagSize === 'small' }"
|
||||||
v-else-if="type === 'select' || type === 'multi-select'"
|
v-else-if="type === 'select' || type === 'multi-select'"
|
||||||
:modelValue="modelValue"
|
:modelValue="modelValue"
|
||||||
:placeholder="placeholder"
|
:placeholder="placeholder"
|
||||||
|
@ -50,6 +51,7 @@
|
||||||
:key="option.value"
|
:key="option.value"
|
||||||
:value="option.value"
|
:value="option.value"
|
||||||
:label="option.label"
|
:label="option.label"
|
||||||
|
size="small"
|
||||||
/>
|
/>
|
||||||
</n8n-select>
|
</n8n-select>
|
||||||
<n8n-input
|
<n8n-input
|
||||||
|
@ -127,6 +129,7 @@ export interface Props {
|
||||||
inactiveLabel?: string;
|
inactiveLabel?: string;
|
||||||
inactiveColor?: string;
|
inactiveColor?: string;
|
||||||
teleported?: boolean;
|
teleported?: boolean;
|
||||||
|
tagSize?: 'small' | 'medium';
|
||||||
}
|
}
|
||||||
|
|
||||||
const props = withDefaults(defineProps<Props>(), {
|
const props = withDefaults(defineProps<Props>(), {
|
||||||
|
@ -136,6 +139,7 @@ const props = withDefaults(defineProps<Props>(), {
|
||||||
showRequiredAsterisk: true,
|
showRequiredAsterisk: true,
|
||||||
validateOnBlur: true,
|
validateOnBlur: true,
|
||||||
teleported: true,
|
teleported: true,
|
||||||
|
tagSize: 'small',
|
||||||
});
|
});
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
|
@ -268,4 +272,12 @@ defineExpose({ inputRef });
|
||||||
.errorInput {
|
.errorInput {
|
||||||
--input-border-color: var(--color-danger);
|
--input-border-color: var(--color-danger);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.multiSelectSmallTags {
|
||||||
|
:global(.el-tag) {
|
||||||
|
height: 24px;
|
||||||
|
padding: 0 8px;
|
||||||
|
line-height: 22px;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
:data-test-id="input.name"
|
:data-test-id="input.name"
|
||||||
:showValidationWarnings="showValidationWarnings"
|
:showValidationWarnings="showValidationWarnings"
|
||||||
:teleported="teleported"
|
:teleported="teleported"
|
||||||
|
:tagSize="tagSize"
|
||||||
@update:modelValue="(value) => onUpdateModelValue(input.name, value)"
|
@update:modelValue="(value) => onUpdateModelValue(input.name, value)"
|
||||||
@validate="(value) => onValidate(input.name, value)"
|
@validate="(value) => onValidate(input.name, value)"
|
||||||
@enter="onSubmit"
|
@enter="onSubmit"
|
||||||
|
@ -73,6 +74,11 @@ export default defineComponent({
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true,
|
default: true,
|
||||||
},
|
},
|
||||||
|
tagSize: {
|
||||||
|
type: String,
|
||||||
|
default: 'small',
|
||||||
|
validator: (value: string): boolean => ['small', 'medium'].includes(value),
|
||||||
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -694,12 +694,10 @@ export default defineComponent({
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.el-overlay-dialog {
|
|
||||||
padding-top: var(--spacing-2xs);
|
|
||||||
}
|
|
||||||
|
|
||||||
.ndv-wrapper {
|
.ndv-wrapper {
|
||||||
overflow: visible;
|
overflow: visible;
|
||||||
|
padding-top: var(--spacing-2xs);
|
||||||
|
margin-top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.data-display-wrapper {
|
.data-display-wrapper {
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
:columnView="true"
|
:columnView="true"
|
||||||
:eventBus="formBus"
|
:eventBus="formBus"
|
||||||
:teleported="teleported"
|
:teleported="teleported"
|
||||||
|
tagSize="small"
|
||||||
@submit="onSubmit"
|
@submit="onSubmit"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -9,10 +9,15 @@
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.el-overlay-dialog {
|
||||||
|
justify-content: unset;
|
||||||
|
}
|
||||||
|
|
||||||
.el-dialog {
|
.el-dialog {
|
||||||
border: var(--border-base);
|
border: var(--border-base);
|
||||||
box-shadow: 0px 6px 16px rgb(68 28 23 / 6%);
|
box-shadow: 0px 6px 16px rgb(68 28 23 / 6%);
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
|
margin-top: 15vh;
|
||||||
|
|
||||||
@media (max-height: 1050px) {
|
@media (max-height: 1050px) {
|
||||||
margin: 4em auto !important;
|
margin: 4em auto !important;
|
||||||
|
|
Loading…
Reference in a new issue