Skip to content

Commit f7a4070

Browse files
authored
Merge branch 'unstable' into fix/content-vue-testing-library
2 parents 2f40c2c + c553c57 commit f7a4070

File tree

102 files changed

+2292
-2535
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+2292
-2535
lines changed

.github/workflows/call-holiday-message.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

.github/workflows/containerbuild.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ jobs:
7979
with:
8080
skip_after_successful_duplicate: false
8181
github_token: ${{ github.token }}
82-
paths: '["k8s/images/nginx/*", ".github/workflows/containerbuild.yml"]'
82+
paths: '["docker/Dockerfile.nginx.prod", "docker/nginx/*", ".github/workflows/containerbuild.yml"]'
8383

8484
build_nginx:
8585
name: nginx - test build of nginx Docker image
@@ -100,6 +100,6 @@ jobs:
100100
uses: docker/build-push-action@v6
101101
with:
102102
context: ./
103-
file: ./k8s/images/nginx/Dockerfile
103+
file: ./docker/Dockerfile.nginx.prod
104104
platforms: linux/amd64
105105
push: false

.gitmodules

Lines changed: 0 additions & 6 deletions
This file was deleted.

Makefile

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,11 +171,7 @@ dcbuild:
171171
$(DOCKER_COMPOSE) build
172172

173173
dcup: .docker/minio .docker/postgres
174-
# run all services except for cloudprober
175-
$(DOCKER_COMPOSE) up studio-app celery-worker
176-
177-
dcup-cloudprober: .docker/minio .docker/postgres
178-
# run all services including cloudprober
174+
# run all services
179175
$(DOCKER_COMPOSE) up
180176

181177
dcdown:

cloudbuild-pr.yaml

Lines changed: 0 additions & 102 deletions
This file was deleted.

cloudbuild-production.yaml

Lines changed: 0 additions & 99 deletions
This file was deleted.

contentcuration/contentcuration/frontend/accounts/pages/Create.vue

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,10 @@
213213
<KButton
214214
primary
215215
class="mt-5"
216-
:disabled="offline"
216+
:disabled="offline || submitting"
217217
:text="$tr('finishButton')"
218218
type="submit"
219+
data-test="submit-button"
219220
/>
220221
</VForm>
221222
</VLayout>
@@ -260,6 +261,7 @@
260261
return {
261262
valid: true,
262263
registrationFailed: false,
264+
submitting: false,
263265
form: {
264266
first_name: '',
265267
last_name: '',
@@ -482,6 +484,12 @@
482484
// We need to check the "acceptedAgreement" here explicitly because it is not a
483485
// Vuetify form field and does not trigger the form validation.
484486
if (this.$refs.form.validate() && this.acceptedAgreement) {
487+
// Prevent double submission
488+
if (this.submitting) {
489+
return Promise.resolve();
490+
}
491+
492+
this.submitting = true;
485493
const cleanedData = this.clean(this.form);
486494
return this.register(cleanedData)
487495
.then(() => {
@@ -517,6 +525,9 @@
517525
this.registrationFailed = true;
518526
this.valid = false;
519527
}
528+
})
529+
.finally(() => {
530+
this.submitting = false;
520531
});
521532
} else if (this.$refs.top.scrollIntoView) {
522533
this.$refs.top.scrollIntoView({ behavior: 'smooth' });

contentcuration/contentcuration/frontend/accounts/pages/__tests__/create.spec.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,4 +179,19 @@ describe('create', () => {
179179
expect(wrapper.vm.registrationFailed).toBe(true);
180180
});
181181
});
182+
describe('double-submit prevention', () => {
183+
it('should prevent multiple API calls on rapid clicks', async () => {
184+
const [wrapper, mocks] = await makeWrapper();
185+
186+
// Click submit multiple times
187+
const p1 = wrapper.vm.submit();
188+
const p2 = wrapper.vm.submit();
189+
const p3 = wrapper.vm.submit();
190+
191+
await Promise.all([p1, p2, p3]);
192+
193+
// Only 1 API call should be made
194+
expect(mocks.register).toHaveBeenCalledTimes(1);
195+
});
196+
});
182197
});

contentcuration/contentcuration/frontend/administration/composables/useKeywordSearch.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { debounce } from 'lodash';
1+
import debounce from 'lodash/debounce';
22
import { ref, computed, onBeforeMount, watch } from 'vue';
33
import { useRoute } from 'vue-router/composables';
44
import { useQueryParams } from './useQueryParams';

contentcuration/contentcuration/frontend/administration/composables/useQueryParams.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { pickBy } from 'lodash';
1+
import pickBy from 'lodash/pickBy';
22
import { useRouter } from 'vue-router/composables';
33

44
/**

0 commit comments

Comments
 (0)