mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-12 15:44:06 -08:00
fix(editor): Fix success status for plus stalk on new canvas (no-changelog) (#11140)
Some checks failed
Test Master / install-and-build (push) Waiting to run
Test Master / Unit tests (18.x) (push) Blocked by required conditions
Test Master / Unit tests (20.x) (push) Blocked by required conditions
Test Master / Unit tests (22.4) (push) Blocked by required conditions
Test Master / Lint (push) Blocked by required conditions
Test Master / Notify Slack on failure (push) Blocked by required conditions
Benchmark Docker Image CI / build (push) Has been cancelled
Some checks failed
Test Master / install-and-build (push) Waiting to run
Test Master / Unit tests (18.x) (push) Blocked by required conditions
Test Master / Unit tests (20.x) (push) Blocked by required conditions
Test Master / Unit tests (22.4) (push) Blocked by required conditions
Test Master / Lint (push) Blocked by required conditions
Test Master / Notify Slack on failure (push) Blocked by required conditions
Benchmark Docker Image CI / build (push) Has been cancelled
This commit is contained in:
parent
41228b472d
commit
6522b1cc44
|
@ -32,6 +32,23 @@ describe('CanvasHandleMainOutput', () => {
|
|||
expect(queryByTestId('canvas-handle-plus')).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('should render CanvasHandlePlus with success state when runData.total > 1', () => {
|
||||
const { queryByTestId } = renderComponent({
|
||||
global: {
|
||||
provide: {
|
||||
...createCanvasHandleProvide({
|
||||
runData: {
|
||||
total: 2,
|
||||
iterations: 1,
|
||||
},
|
||||
}),
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
expect(queryByTestId('canvas-handle-plus')).toHaveClass('success');
|
||||
});
|
||||
|
||||
it('should render run data label', async () => {
|
||||
const runData = {
|
||||
total: 1,
|
||||
|
|
|
@ -38,7 +38,7 @@ const runDataLabel = computed(() =>
|
|||
|
||||
const isHandlePlusVisible = computed(() => !isConnecting.value || isHovered.value);
|
||||
|
||||
const plusType = computed(() => (runData.value ? 'success' : 'default'));
|
||||
const plusType = computed(() => ((runData.value?.total ?? 0) > 0 ? 'success' : 'default'));
|
||||
|
||||
const plusLineSize = computed(
|
||||
() =>
|
||||
|
|
|
@ -10,7 +10,7 @@ const emit = defineEmits<{
|
|||
|
||||
const $style = useCssModule();
|
||||
|
||||
const { label, isConnected, isConnecting, isRequired, type, runData } = useCanvasNodeHandle();
|
||||
const { label, isConnected, isConnecting, isRequired, type } = useCanvasNodeHandle();
|
||||
|
||||
const handleClasses = 'target';
|
||||
|
||||
|
@ -30,8 +30,6 @@ const isHandlePlusVisible = computed(
|
|||
() => !isConnecting.value || isHovered.value || supportsMultipleConnections.value,
|
||||
);
|
||||
|
||||
const plusType = computed(() => (runData.value ? 'success' : 'ai'));
|
||||
|
||||
const isHovered = ref(false);
|
||||
|
||||
function onMouseEnter() {
|
||||
|
@ -55,7 +53,7 @@ function onClickAdd() {
|
|||
v-if="isHandlePlusAvailable"
|
||||
v-show="isHandlePlusVisible"
|
||||
:handle-classes="handleClasses"
|
||||
:type="plusType"
|
||||
type="secondary"
|
||||
position="bottom"
|
||||
@mouseenter="onMouseEnter"
|
||||
@mouseleave="onMouseLeave"
|
||||
|
|
|
@ -7,7 +7,7 @@ const props = withDefaults(
|
|||
handleClasses?: string;
|
||||
plusSize?: number;
|
||||
lineSize?: number;
|
||||
type?: 'success' | 'ai' | 'default';
|
||||
type?: 'success' | 'secondary' | 'default';
|
||||
}>(),
|
||||
{
|
||||
position: 'right',
|
||||
|
@ -135,7 +135,7 @@ function onClick(event: MouseEvent) {
|
|||
.wrapper {
|
||||
position: relative;
|
||||
|
||||
&.ai {
|
||||
&.secondary {
|
||||
.line {
|
||||
stroke: var(--node-type-supplemental-color);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue