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J}mxP9ywq8O8m0=b=N=mN&mGxEW)Ya^6Nx%%4D~f65A(N
zPk#S+{)6p5#C`Z@XFUs^R(3k`bheNFleXOln6omSqyI>^J+rh)_P@#5cK7Cer$DE)
zZ~cDZZoAdR`sPPPL|Yow|2_1Ud*;ijOP_AF&Hj8mye~m6XWirb>wZ0cv;A$TU0%<}
zA0Jn|Vw|gzfY(~y`D!(6W6fKggcTf=U{Jx*@MdJx}Q1=(LcWeaeE`Yia
z#s(&qAZZZW2(+FD#6ay3Ve1{6qOGIC(L1&@gDhEsuA?$Bu!Q%HEfp+HQP)ugggW{}
zIAZG^Ll#h>E~L^mgm!?#6hK{dpH%2lDhp88sRF#J2egz5+LiWDKBQ!2NdO}lqRPZDQNg6CM);{D?}(5
z8t9qonJ5I7CKi=cDFnELv8kicHn3zWy
z7^oWZ*u85n>vEJz_jow21EhF%i`3o~@RrUszghpN}y($pMHouRq8
zi2=Hpv6&^N9YzM0XzC114M2+tQSC4_G{tm_kpYI7xrsT39p)yM7-3*;Zfc5duZ5ur
zx_O4iSjEgR{A+9iO4lfEHZ-;{$53Z(V2ELdIcAs|nj0G+`J<#LF*7H%2z;JVaAsAi
z0%(P6P=0=if+46L3R2Mb%uCBx0F6z8*e(ju3N|LGmL`^_hNg*$X@u`6Q!Yrp|KH{s;aBM8y5gYl%U)I
literal 420
zcmY!laBV4#qnl*MIZqoD7TnwMUZp@0OWUl3Jvo
z@0OETlIoJ0oS%}aU}wiwTvC*pn9Ehcmh(bvA
z_xtw-tLlip-@i97_Wl07))CI{_wTg?32O&dLe#w9zc<@1(a6r&(8=We{=Kr+aN!h9
zMPHB`eCyxu->dt6|6V7E6v!T^gZ$p_-y2;f!wQk8gHRH#@AvODg|Of6-y6rq%JF{x
y-l%wHh!FR=Me^_W@6CU|e{YT+$g`<=DbUbK%}W6VDkvmDw4tdf7gWdy8r}ehxa64t
diff --git a/spec/frontend/repository/components/blob_button_group_spec.js b/spec/frontend/repository/components/blob_button_group_spec.js
index 89f764372cb717..5fc87312871b61 100644
--- a/spec/frontend/repository/components/blob_button_group_spec.js
+++ b/spec/frontend/repository/components/blob_button_group_spec.js
@@ -132,14 +132,12 @@ describe('BlobButtonGroup component', () => {
const title = `Replace ${name}`;
expect(findUploadBlobModal().props()).toMatchObject({
- modalTitle: title,
commitMessage: title,
targetBranch,
originalBranch,
canPushCode,
path,
replacePath,
- primaryBtnText: 'Replace file',
});
});
diff --git a/spec/frontend/repository/components/header_area/breadcrumbs_spec.js b/spec/frontend/repository/components/header_area/breadcrumbs_spec.js
index f9653521b50895..0e62cfcdd62f55 100644
--- a/spec/frontend/repository/components/header_area/breadcrumbs_spec.js
+++ b/spec/frontend/repository/components/header_area/breadcrumbs_spec.js
@@ -196,7 +196,7 @@ describe('Repository breadcrumbs component', () => {
});
it('renders the modal once loaded', async () => {
- await nextTick();
+ await waitForPromises();
expect(findUploadBlobModal().exists()).toBe(true);
});
@@ -211,7 +211,7 @@ describe('Repository breadcrumbs component', () => {
});
it('renders the modal once loaded', async () => {
- await nextTick();
+ await waitForPromises();
expect(findNewDirectoryModal().exists()).toBe(true);
expect(findNewDirectoryModal().props('path')).toBe('root/master/some_dir');
diff --git a/spec/frontend/repository/components/upload_blob_modal_spec.js b/spec/frontend/repository/components/upload_blob_modal_spec.js
index c43afaac1acaff..d9b0029b983cc7 100644
--- a/spec/frontend/repository/components/upload_blob_modal_spec.js
+++ b/spec/frontend/repository/components/upload_blob_modal_spec.js
@@ -1,4 +1,3 @@
-import { GlModal, GlFormInput, GlFormTextarea, GlFormCheckbox, GlAlert } from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils';
import axios from 'axios';
import MockAdapter from 'axios-mock-adapter';
@@ -10,11 +9,14 @@ import { HTTP_STATUS_OK } from '~/lib/utils/http_status';
import { visitUrl } from '~/lib/utils/url_utility';
import UploadBlobModal from '~/repository/components/upload_blob_modal.vue';
import UploadDropzone from '~/vue_shared/components/upload_dropzone/upload_dropzone.vue';
+import CommitChangesModal from '~/repository/components/commit_changes_modal.vue';
jest.mock('~/alert');
+
jest.mock('~/lib/utils/url_utility', () => ({
visitUrl: jest.fn(),
joinPaths: () => '/new_upload',
+ setUrlFragment: jest.fn(),
}));
const initialProps = {
@@ -23,6 +25,7 @@ const initialProps = {
targetBranch: 'main',
originalBranch: 'main',
canPushCode: true,
+ canPushToBranch: true,
path: 'new_upload',
};
@@ -30,14 +33,15 @@ describe('UploadBlobModal', () => {
let wrapper;
let mock;
- const mockEvent = { preventDefault: jest.fn() };
-
const createComponent = (props) => {
wrapper = shallowMount(UploadBlobModal, {
propsData: {
...initialProps,
...props,
},
+ stubs: {
+ CommitChangesModal,
+ },
mocks: {
$route: {
params: {
@@ -48,74 +52,32 @@ describe('UploadBlobModal', () => {
});
};
- const findModal = () => wrapper.findComponent(GlModal);
- const findAlert = () => wrapper.findComponent(GlAlert);
- const findCommitMessage = () => wrapper.findComponent(GlFormTextarea);
- const findBranchName = () => wrapper.findComponent(GlFormInput);
- const findMrCheckbox = () => wrapper.findComponent(GlFormCheckbox);
+ const findCommitChangesModal = () => wrapper.findComponent(CommitChangesModal);
const findUploadDropzone = () => wrapper.findComponent(UploadDropzone);
- const actionButtonDisabledState = () => findModal().props('actionPrimary').attributes.disabled;
- const cancelButtonDisabledState = () => findModal().props('actionCancel').attributes.disabled;
- const actionButtonLoadingState = () => findModal().props('actionPrimary').attributes.loading;
+ const primaryButtonDisabledProp = () => findCommitChangesModal().props('isPrimaryButtonDisabled');
const findFileIcon = () => wrapper.findComponent(FileIcon);
describe.each`
- canPushCode | displayBranchName | displayForkedBranchMessage
- ${true} | ${true} | ${false}
- ${false} | ${false} | ${true}
+ canPushCode | canPushToBranch
+ ${true} | ${true}
+ ${true} | ${false}
+ ${false} | ${true}
`(
- 'canPushCode = $canPushCode',
- ({ canPushCode, displayBranchName, displayForkedBranchMessage }) => {
- beforeEach(() => {
- createComponent({ canPushCode });
- });
-
- it('displays the modal', () => {
- expect(findModal().exists()).toBe(true);
+ 'canPushCode = $canPushCode, canPushToBranch = $canPushToBranch',
+ ({ canPushCode, canPushToBranch }) => {
+ beforeEach(async () => {
+ createComponent({ canPushCode, canPushToBranch });
+ await nextTick();
});
it('includes the upload dropzone', () => {
expect(findUploadDropzone().exists()).toBe(true);
});
- it('includes the commit message', () => {
- expect(findCommitMessage().exists()).toBe(true);
- });
-
it('displays the disabled upload button', () => {
- expect(actionButtonDisabledState()).toBe(true);
- });
-
- it('displays the enabled cancel button', () => {
- expect(cancelButtonDisabledState()).toBe(false);
- });
-
- it('does not display the MR checkbox', () => {
- expect(findMrCheckbox().exists()).toBe(false);
+ expect(primaryButtonDisabledProp()).toBe(true);
});
- it(`${
- displayForkedBranchMessage ? 'displays' : 'does not display'
- } the forked branch message`, () => {
- expect(findAlert().exists()).toBe(displayForkedBranchMessage);
- });
-
- it(`${displayBranchName ? 'displays' : 'does not display'} the branch name`, () => {
- expect(findBranchName().exists()).toBe(displayBranchName);
- });
-
- if (canPushCode) {
- describe('when changing the branch name', () => {
- it('displays the MR checkbox', async () => {
- createComponent({ targetBranch: 'Not main' });
-
- await nextTick();
-
- expect(findMrCheckbox().exists()).toBe(true);
- });
- });
- }
-
describe('completed form', () => {
beforeEach(() => {
findUploadDropzone().vm.$emit(
@@ -125,36 +87,16 @@ describe('UploadBlobModal', () => {
});
it('enables the upload button when the form is completed', () => {
- expect(actionButtonDisabledState()).toBe(false);
- });
-
- describe('form submission', () => {
- beforeEach(() => {
- mock = new MockAdapter(axios);
-
- findModal().vm.$emit('primary', mockEvent);
- });
-
- afterEach(() => {
- mock.restore();
- });
-
- it('disables the upload button', () => {
- expect(actionButtonDisabledState()).toBe(true);
- });
-
- it('sets the upload button to loading', () => {
- expect(actionButtonLoadingState()).toBe(true);
- });
+ expect(primaryButtonDisabledProp()).toBe(false);
});
describe('successful response', () => {
beforeEach(async () => {
+ const mockFormData = new FormData();
mock = new MockAdapter(axios);
mock.onPost(initialProps.path).reply(HTTP_STATUS_OK, { filePath: 'blah' });
- findModal().vm.$emit('primary', mockEvent);
-
+ await wrapper.vm.submitForm(mockFormData);
await waitForPromises();
});
@@ -163,7 +105,7 @@ describe('UploadBlobModal', () => {
});
it('redirects to the uploaded file', () => {
- expect(visitUrl).toHaveBeenCalled();
+ expect(visitUrl).toHaveBeenCalledWith('blah');
});
afterEach(() => {
@@ -173,12 +115,11 @@ describe('UploadBlobModal', () => {
describe('error response', () => {
beforeEach(async () => {
+ const mockFormData = new FormData();
mock = new MockAdapter(axios);
mock.onPost(initialProps.path).timeout();
- findModal().vm.$emit('primary', mockEvent);
-
- await waitForPromises();
+ await wrapper.vm.submitForm(mockFormData);
});
it('creates an alert error', () => {
@@ -197,8 +138,10 @@ describe('UploadBlobModal', () => {
describe('blob file submission type', () => {
const submitRequest = async () => {
+ const mockFormData = new FormData();
mock = new MockAdapter(axios);
- findModal().vm.$emit('primary', mockEvent);
+
+ await wrapper.vm.submitForm(mockFormData);
await waitForPromises();
};
@@ -207,14 +150,6 @@ describe('UploadBlobModal', () => {
createComponent();
});
- it('displays the default "Upload new file" modal title', () => {
- expect(findModal().props('title')).toBe('Upload new file');
- });
-
- it('display the defaul primary button text', () => {
- expect(findModal().props('actionPrimary').text).toBe('Upload file');
- });
-
it('makes a POST request', async () => {
await submitRequest();
@@ -224,26 +159,14 @@ describe('UploadBlobModal', () => {
});
describe('replace blob file', () => {
- const modalTitle = 'Replace foo.js';
const replacePath = 'replace-path';
- const primaryBtnText = 'Replace file';
beforeEach(() => {
createComponent({
- modalTitle,
replacePath,
- primaryBtnText,
});
});
- it('displays the passed modal title', () => {
- expect(findModal().props('title')).toBe(modalTitle);
- });
-
- it('display the passed primary button text', () => {
- expect(findModal().props('actionPrimary').text).toBe(primaryBtnText);
- });
-
it('makes a PUT request', async () => {
await submitRequest();
diff --git a/spec/helpers/tree_helper_spec.rb b/spec/helpers/tree_helper_spec.rb
index 61d1c8039ff157..0acf6a88198a30 100644
--- a/spec/helpers/tree_helper_spec.rb
+++ b/spec/helpers/tree_helper_spec.rb
@@ -19,6 +19,39 @@
end
end
+ describe '#breadcrumb_data_attributes' do
+ let(:ref) { 'main' }
+ let(:base_attributes) do
+ {
+ selected_branch: ref,
+ can_push_code: 'false',
+ can_push_to_branch: 'false',
+ can_collaborate: 'false',
+ new_blob_path: project_new_blob_path(project, ref),
+ upload_path: project_create_blob_path(project, ref),
+ new_dir_path: project_create_dir_path(project, ref),
+ new_branch_path: new_project_branch_path(project),
+ new_tag_path: new_project_tag_path(project),
+ can_edit_tree: 'false'
+ }
+ end
+
+ before do
+ helper.instance_variable_set(:@project, project)
+ helper.instance_variable_set(:@ref, ref)
+ allow(helper).to receive(:selected_branch).and_return(ref)
+ allow(helper).to receive(:current_user).and_return(user)
+ allow(helper).to receive(:can?).and_return(false)
+ allow(helper).to receive(:user_access).and_return(instance_double(Gitlab::UserAccess, can_push_to_branch?: false))
+ allow(helper).to receive(:can_collaborate_with_project?).and_return(false)
+ allow(helper).to receive(:can_edit_tree?).and_return(false)
+ end
+
+ it 'returns a list of breadcrumb attributes' do
+ expect(helper.breadcrumb_data_attributes).to eq(base_attributes)
+ end
+ end
+
describe '#vue_file_list_data' do
it 'returns a list of attributes related to the project' do
helper.instance_variable_set(:@ref_type, 'heads')
diff --git a/spec/presenters/project_presenter_spec.rb b/spec/presenters/project_presenter_spec.rb
index 652509f62dd013..9ce360fdc8000b 100644
--- a/spec/presenters/project_presenter_spec.rb
+++ b/spec/presenters/project_presenter_spec.rb
@@ -674,6 +674,7 @@
label: a_string_including('Upload file'),
data: {
"can_push_code" => "true",
+ "can_push_to_branch" => "true",
"original_branch" => "master",
"path" => "/#{project.full_path}/-/create/master",
"project_path" => project.full_path,
diff --git a/spec/support/shared_examples/features/project_upload_files_shared_examples.rb b/spec/support/shared_examples/features/project_upload_files_shared_examples.rb
index 806ffdad2f14ce..63d77e9e0a0286 100644
--- a/spec/support/shared_examples/features/project_upload_files_shared_examples.rb
+++ b/spec/support/shared_examples/features/project_upload_files_shared_examples.rb
@@ -18,11 +18,11 @@
page.within('#modal-upload-blob') do
fill_in(:commit_message, with: 'New commit message')
+ choose(option: true)
+ fill_in(:branch_name, with: 'upload_text', visible: true)
+ click_button('Commit changes')
end
- fill_in(:branch_name, with: 'upload_text', visible: true)
- click_button('Upload file')
-
expect(page).to have_content('New commit message')
expect(page).to have_current_path(project_new_merge_request_path(project), ignore_query: true)
@@ -54,8 +54,9 @@
page.within('#modal-upload-blob') do
fill_in(:commit_message, with: 'New commit message')
+ choose(option: true)
fill_in(:branch_name, with: 'upload_image', visible: true)
- click_button('Upload file')
+ click_button('Commit changes')
end
wait_for_all_requests
@@ -84,15 +85,19 @@
page.within('#modal-upload-blob') do
fill_in(:commit_message, with: 'New commit message')
+ choose(option: true)
fill_in(:branch_name, with: 'upload_image', visible: true)
- click_button('Upload file')
+ click_button('Commit changes')
end
wait_for_all_requests
visit(project_blob_path(project, 'upload_image/sample.pdf'))
+ wait_for_all_requests
+
expect(page).to have_css('.js-pdf-viewer')
+ expect(page).not_to have_content('An error occurred while loading the file. Please try again later.')
end
end
@@ -121,10 +126,9 @@
page.within('#modal-upload-blob') do
fill_in(:commit_message, with: 'New commit message')
+ click_button('Commit changes')
end
- click_button('Upload file')
-
expect(page).to have_content('New commit message')
fork = user.fork_of(project2.reload)
@@ -159,10 +163,9 @@
page.within('#modal-upload-blob') do
fill_in(:commit_message, with: 'New commit message')
+ click_button('Commit changes')
end
- click_button('Upload file')
-
expect(page).to have_content('New commit message')
page.within('.repo-breadcrumb') do
@@ -184,10 +187,9 @@
page.within('#details-modal-upload-blob') do
fill_in(:commit_message, with: 'New commit message')
+ click_button('Commit changes')
end
- click_button('Upload file')
-
expect(page).to have_content('New commit message')
expect(page).to have_content('Lorem ipsum dolor sit amet')
expect(page).to have_content('Sed ut perspiciatis unde omnis')
--
GitLab
From 73e8f492d0e6c342fd339a0a99eef914b047a8ac Mon Sep 17 00:00:00 2001
From: Chaoyue Zhao
Date: Wed, 4 Dec 2024 18:18:09 -0500
Subject: [PATCH 03/18] Update `can_push_to_branch` to always `true` in
`project_presenter.rb`
---
app/presenters/project_presenter.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/presenters/project_presenter.rb b/app/presenters/project_presenter.rb
index 52a70c1184e2b7..a89cb2e1071e4c 100644
--- a/app/presenters/project_presenter.rb
+++ b/app/presenters/project_presenter.rb
@@ -266,7 +266,7 @@ def upload_anchor_data
'target_branch' => default_branch_or_main,
'original_branch' => default_branch_or_main,
'can_push_code' => 'true',
- 'can_push_to_branch' => can_current_user_push_to_branch?(current_ref).to_s,
+ 'can_push_to_branch' => 'true',
'path' => project_create_blob_path(project, default_branch_or_main),
'project_path' => project.full_path
}
--
GitLab
From 20836411a155406920218444869629cea641a904 Mon Sep 17 00:00:00 2001
From: Chaoyue Zhao
Date: Fri, 6 Dec 2024 10:26:40 -0500
Subject: [PATCH 04/18] Add new state for empty repo
---
.../projects/details/upload_button.vue | 4 ++
.../javascripts/projects/upload_file.js | 1 +
.../components/commit_changes_modal.vue | 53 +++++++++++--------
.../components/upload_blob_modal.vue | 6 +++
.../components/commit_changes_modal_spec.js | 17 +++---
5 files changed, 53 insertions(+), 28 deletions(-)
diff --git a/app/assets/javascripts/projects/details/upload_button.vue b/app/assets/javascripts/projects/details/upload_button.vue
index 8baa64547a361d..9b0eddea2157be 100644
--- a/app/assets/javascripts/projects/details/upload_button.vue
+++ b/app/assets/javascripts/projects/details/upload_button.vue
@@ -31,6 +31,9 @@ export default {
projectPath: {
default: '',
},
+ emptyRepo: {
+ default: false,
+ },
},
uploadBlobModalId: UPLOAD_BLOB_MODAL_ID,
};
@@ -55,6 +58,7 @@ export default {
:can-push-code="canPushCode"
:can-push-to-branch="canPushToBranch"
:path="path"
+ :empty-repo="emptyRepo"
/>
diff --git a/app/assets/javascripts/projects/upload_file.js b/app/assets/javascripts/projects/upload_file.js
index e25c30de3a23a0..794bf1dfd653be 100644
--- a/app/assets/javascripts/projects/upload_file.js
+++ b/app/assets/javascripts/projects/upload_file.js
@@ -21,6 +21,7 @@ export const initUploadFileTrigger = () => {
canPushToBranch: parseBoolean(canPushToBranch),
path,
projectPath,
+ emptyRepo: true,
},
render(h) {
return h(UploadButton);
diff --git a/app/assets/javascripts/repository/components/commit_changes_modal.vue b/app/assets/javascripts/repository/components/commit_changes_modal.vue
index 8a09ad21d9452f..094491faf60cd3 100644
--- a/app/assets/javascripts/repository/components/commit_changes_modal.vue
+++ b/app/assets/javascripts/repository/components/commit_changes_modal.vue
@@ -48,6 +48,9 @@ export default {
COMMIT_IN_BRANCH_MESSAGE: __(
'Your changes can be committed to %{branchName} because a merge request is open.',
),
+ COMMIT_IN_DEFAULT_BRANCH: __(
+ 'GitLab will create %{branchName} branch and commit your changes to it.',
+ ),
COMMIT_LABEL,
COMMIT_MESSAGE_HINT: __(
'Try to keep the first line under 52 characters and the others under 72.',
@@ -291,33 +294,40 @@ export default {
+
+
+
+ {{ $options.i18n.COMMIT_MESSAGE_HINT }}
+
+
+
+
+ {{ originalBranch }}
+
+
+
-
-
-
- {{ $options.i18n.COMMIT_MESSAGE_HINT }}
-
-
-