Commit 8e80c580 authored by Denys Mishunov's avatar Denys Mishunov

Merge branch '239341-fix-snippets-create-without-file-path' into 'master'

Fix create snippet disabled on empty file path

Closes #239341

See merge request gitlab-org/gitlab!40412
parents 9022a33d c19c1ad6
...@@ -63,7 +63,7 @@ export default { ...@@ -63,7 +63,7 @@ export default {
return this.actions.length > 0; return this.actions.length > 0;
}, },
hasValidBlobs() { hasValidBlobs() {
return this.actions.every(x => x.filePath && x.content); return this.actions.every(x => x.content);
}, },
updatePrevented() { updatePrevented() {
return this.snippet.title === '' || !this.hasValidBlobs || this.isUpdating; return this.snippet.title === '' || !this.hasValidBlobs || this.isUpdating;
......
---
title: Fix snippet save button disabled with empty file path
merge_request: 40412
author:
type: fixed
...@@ -183,7 +183,7 @@ describe('Snippet Edit app', () => { ...@@ -183,7 +183,7 @@ describe('Snippet Edit app', () => {
${'foo'} | ${[]} | ${false} ${'foo'} | ${[]} | ${false}
${'foo'} | ${[TEST_ACTIONS.VALID]} | ${false} ${'foo'} | ${[TEST_ACTIONS.VALID]} | ${false}
${'foo'} | ${[TEST_ACTIONS.VALID, TEST_ACTIONS.NO_CONTENT]} | ${true} ${'foo'} | ${[TEST_ACTIONS.VALID, TEST_ACTIONS.NO_CONTENT]} | ${true}
${'foo'} | ${[TEST_ACTIONS.VALID, TEST_ACTIONS.NO_PATH]} | ${true} ${'foo'} | ${[TEST_ACTIONS.VALID, TEST_ACTIONS.NO_PATH]} | ${false}
`( `(
'should handle submit disable (title=$title, actions=$actions, shouldDisable=$shouldDisable)', 'should handle submit disable (title=$title, actions=$actions, shouldDisable=$shouldDisable)',
async ({ title, actions, shouldDisable }) => { async ({ title, actions, shouldDisable }) => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment