Skip to content

Commit c81afc3

Browse files
authored
Merge branch 'unstable' into button-in-edit-channel-details
2 parents e707acd + 261cc59 commit c81afc3

File tree

104 files changed

+5777
-2727
lines changed

Some content is hidden

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

104 files changed

+5777
-2727
lines changed

.github/workflows/deploytest.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- name: Use pnpm
3232
uses: pnpm/action-setup@v4
3333
- name: Use Node.js
34-
uses: actions/setup-node@v5
34+
uses: actions/setup-node@v6
3535
with:
3636
node-version: '20.x'
3737
cache: 'pnpm'
@@ -61,13 +61,15 @@ jobs:
6161
${{ runner.os }}-pyprod-
6262
- name: Install pip-tools and python dependencies
6363
run: |
64-
python -m pip install --upgrade pip
64+
# Pin pip to 25.2 to avoid incompatibility with pip-tools and 25.3
65+
# see https://github.com/jazzband/pip-tools/issues/2252
66+
python -m pip install pip==25.2
6567
pip install pip-tools
6668
pip-sync requirements.txt
6769
- name: Use pnpm
6870
uses: pnpm/action-setup@v4
6971
- name: Use Node.js
70-
uses: actions/setup-node@v5
72+
uses: actions/setup-node@v6
7173
with:
7274
node-version: '20.x'
7375
cache: 'pnpm'

.github/workflows/frontendtest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- name: Use pnpm
3232
uses: pnpm/action-setup@v4
3333
- name: Use Node.js
34-
uses: actions/setup-node@v5
34+
uses: actions/setup-node@v6
3535
with:
3636
node-version: '20.x'
3737
cache: 'pnpm'

.github/workflows/pre-commit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
- name: Use pnpm
3939
uses: pnpm/action-setup@v4
4040
- name: Use Node.js
41-
uses: actions/setup-node@v5
41+
uses: actions/setup-node@v6
4242
with:
4343
node-version: '20.x'
4444
cache: 'pnpm'

.github/workflows/pythontest.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ jobs:
6868
-e "MINIO_ROOT_USER=development" \
6969
-e "MINIO_ROOT_PASSWORD=development" \
7070
-e "MINIO_DEFAULT_BUCKETS=content:public" \
71-
bitnami/minio:2024.5.28
71+
bitnamilegacy/minio:2024.5.28
7272
- name: Set up Python 3.10
7373
uses: actions/setup-python@v6
7474
with:
@@ -82,7 +82,9 @@ jobs:
8282
${{ runner.os }}-pytest-
8383
- name: Install pip-tools and python dependencies
8484
run: |
85-
python -m pip install --upgrade pip
85+
# Pin pip to 25.2 to avoid incompatibility with pip-tools and 25.3
86+
# see https://github.com/jazzband/pip-tools/issues/2252
87+
python -m pip install pip==25.2
8688
pip install pip-tools
8789
pip-sync requirements.txt requirements-dev.txt
8890
- name: Test pytest

contentcuration/contentcuration/frontend/administration/components/ConfirmationDialog.vue

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
:header="title"
66
:text="text"
77
>
8+
<div
9+
v-if="errorText"
10+
class="error-text lighten-4 ma-3 pa-2 red red--text"
11+
>
12+
{{ errorText }}
13+
</div>
814
<template #buttons="{ close }">
915
<VBtn
1016
flat
@@ -17,6 +23,7 @@
1723
color="primary"
1824
dark
1925
data-test="confirm"
26+
:disabled="disableSubmit"
2027
@click="$emit('confirm')"
2128
>
2229
{{ confirmButtonText }}
@@ -55,6 +62,14 @@
5562
type: String,
5663
default: 'Cancel',
5764
},
65+
errorText: {
66+
type: String,
67+
default: '',
68+
},
69+
disableSubmit: {
70+
type: Boolean,
71+
default: false,
72+
},
5873
},
5974
computed: {
6075
show: {

contentcuration/contentcuration/frontend/administration/pages/Channels/ChannelActionsDropdown.vue

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
v-model="makePublicDialog"
1515
title="Make channel public"
1616
:text="`All users will be able to view and import content from ${name}.`"
17+
:error-text="communityChannelErrorMessage"
18+
:disable-submit="isCommunityChannel"
1719
data-test="confirm-public"
1820
confirmButtonText="Make public"
1921
@confirm="makePublicHandler"
@@ -124,6 +126,7 @@
124126
import ConfirmationDialog from '../../components/ConfirmationDialog';
125127
import { RouteNames } from '../../constants';
126128
import { channelExportMixin } from 'shared/views/channel/mixins';
129+
import { CommunityLibraryStatus } from 'shared/constants';
127130
128131
export default {
129132
name: 'ChannelActionsDropdown',
@@ -160,6 +163,16 @@
160163
},
161164
};
162165
},
166+
isCommunityChannel() {
167+
const status = this.channel.latest_community_library_submission_status;
168+
return status === CommunityLibraryStatus.APPROVED || status === CommunityLibraryStatus.LIVE;
169+
},
170+
communityChannelErrorMessage() {
171+
if (this.isCommunityChannel) {
172+
return 'This channel has been added to the Community Library and cannot be marked public.';
173+
}
174+
return '';
175+
},
163176
},
164177
methods: {
165178
...mapActions('channelAdmin', [

contentcuration/contentcuration/frontend/administration/pages/Users/UserActionsDropdown.vue

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,32 @@
11
<template>
22

33
<div>
4-
<ConfirmationDialog
5-
v-model="deleteDialog"
4+
<KModal
5+
v-if="deleteDialog"
66
title="Delete user"
7-
:text="`Are you sure you want to permanently delete ${user.name}'s account?`"
8-
confirmButtonText="Delete"
7+
submitText="Delete"
8+
cancelText="Cancel"
99
data-test="confirm-delete"
10-
@confirm="deleteHandler"
11-
/>
12-
<ConfirmationDialog
13-
v-model="deactivateDialog"
10+
@submit="deleteHandler"
11+
@cancel="deleteDialog = false"
12+
>
13+
<p>Are you sure you want to permanently delete {{ user.name }}'s account?</p>
14+
</KModal>
15+
16+
<KModal
17+
v-if="deactivateDialog"
1418
title="Deactivate user"
15-
:text="
16-
`Deactivating ${user.name}'s account will block them from ` +
17-
`accessing their account. Are you sure you want to continue?`
18-
"
19-
confirmButtonText="Deactivate"
19+
submitText="Deactivate"
20+
cancelText="Cancel"
2021
data-test="confirm-deactivate"
21-
@confirm="deactivateHandler"
22-
/>
22+
@submit="deactivateHandler"
23+
@cancel="deactivateDialog = false"
24+
>
25+
<p>
26+
Deactivating {{ user.name }}'s account will block them from accessing their account. Are you
27+
sure you want to continue?
28+
</p>
29+
</KModal>
2330
<UserPrivilegeModal
2431
v-model="addAdminPrivilegeDialog"
2532
header="Add admin privileges"
@@ -106,14 +113,13 @@
106113
<script>
107114
108115
import { mapActions, mapGetters, mapState } from 'vuex';
109-
import ConfirmationDialog from '../../components/ConfirmationDialog';
116+
110117
import EmailUsersDialog from './EmailUsersDialog';
111118
import UserPrivilegeModal from './UserPrivilegeModal';
112119
113120
export default {
114121
name: 'UserActionsDropdown',
115122
components: {
116-
ConfirmationDialog,
117123
EmailUsersDialog,
118124
UserPrivilegeModal,
119125
},

contentcuration/contentcuration/frontend/administration/pages/Users/UserStorage.vue

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -41,23 +41,21 @@
4141
</template>
4242
</DropdownWrapper>
4343
</VLayout>
44-
<VBtn
45-
v-if="showCancel"
46-
flat
47-
class="ma-0 mr-4"
48-
data-test="cancel"
49-
@click="cancel"
50-
>
51-
Cancel
52-
</VBtn>
53-
<VBtn
54-
class="ma-0"
55-
color="primary"
56-
type="submit"
57-
data-test="submit"
58-
>
59-
Save changes
60-
</VBtn>
44+
<KButtonGroup>
45+
<KButton
46+
v-if="showCancel"
47+
appearance="flat-button"
48+
text="Cancel"
49+
data-test="cancel"
50+
@click="cancel"
51+
/>
52+
<KButton
53+
:primary="true"
54+
text="Save changes"
55+
type="submit"
56+
data-test="submit"
57+
/>
58+
</KButtonGroup>
6159
</VForm>
6260

6361
</template>

contentcuration/contentcuration/frontend/administration/pages/Users/__tests__/userActionsDropdown.spec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ describe('userActionsDropdown', () => {
7171
});
7272

7373
it('confirm delete user should call deleteUser', async () => {
74-
wrapper.find('[data-test="confirm-delete"]').vm.$emit('confirm');
75-
await wrapper.vm.$nextTick();
74+
await wrapper.findComponent('[data-test="delete"]').trigger('click');
75+
wrapper.findComponent('[data-test="confirm-delete"]').vm.$emit('submit');
7676
expect(mocks.deleteUser).toHaveBeenCalledWith(userId);
7777
});
7878

@@ -93,8 +93,8 @@ describe('userActionsDropdown', () => {
9393
});
9494

9595
it('confirm deactivate should call updateUser with is_active = false', async () => {
96-
wrapper.findComponent('[data-test="confirm-deactivate"]').vm.$emit('confirm');
97-
await wrapper.vm.$nextTick();
96+
await wrapper.findComponent('[data-test="deactivate"]').trigger('click');
97+
wrapper.findComponent('[data-test="confirm-deactivate"]').vm.$emit('submit');
9898
expect(mocks.updateUser).toHaveBeenCalledWith({ id: userId, is_active: false });
9999
});
100100

contentcuration/contentcuration/frontend/channelEdit/components/QuickEditModal/EditLanguageModal.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@
178178
}),
179179
);
180180
/* eslint-disable-next-line kolibri/vue-no-undefined-string-uses */
181-
await this.showSnackbarSimple(commonStrings.$tr('changesSaved'));
181+
this.showSnackbarSimple(commonStrings.$tr('changesSaved'));
182182
this.close(this.changed);
183183
},
184184
showSnackbarSimple(message) {

0 commit comments

Comments
 (0)