Skip to content

Commit 3accf66

Browse files
authored
Merge pull request #4802 from akolson/merge-into-search-recs
Merge unstable changes into search recommendations
2 parents 8b8a55e + bb4be9d commit 3accf66

75 files changed

Lines changed: 2304 additions & 29486 deletions

File tree

Some content is hidden

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

.github/workflows/containerbuild.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index
5959

6060
- name: Build and push Docker image
61-
uses: docker/build-push-action@v5
61+
uses: docker/build-push-action@v6
6262
with:
6363
context: ./docker
6464
file: ./docker/Dockerfile.postgres.dev
@@ -98,7 +98,7 @@ jobs:
9898
uses: docker/setup-buildx-action@v3
9999

100100
- name: Build Docker image
101-
uses: docker/build-push-action@v5
101+
uses: docker/build-push-action@v6
102102
with:
103103
context: ./
104104
file: ./k8s/images/nginx/Dockerfile

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ webpack-stats\.json
128128
storybook-static/
129129

130130
# i18n
131-
/contentcuration/locale/CSV_FILES/*
131+
/contentcuration/locale/**/LC_MESSAGES/*.csv
132132

133133
# pyenv
134134
.python-version

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ migrate:
3838
# 4) Remove the management command from this `deploy-migrate` recipe
3939
# 5) Repeat!
4040
deploy-migrate:
41-
echo "Nothing to do here!"
41+
python contentcuration/manage.py rectify_incorrect_contentnode_source_fields
4242

4343
contentnodegc:
4444
python contentcuration/manage.py garbage_collect

contentcuration/contentcuration/frontend/channelEdit/components/ContentNodeEditListItem.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@
258258
retryFailedCopy: withChangeTracker(function(changeTracker) {
259259
this.updateContentNode({
260260
id: this.nodeId,
261+
checkComplete: true,
261262
[COPYING_STATUS]: COPYING_STATUS_VALUES.COPYING,
262263
});
263264

contentcuration/contentcuration/frontend/channelEdit/components/ContentNodeListItem/index.spec.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ function mountComponent(opts = {}) {
3636
namespaced: true,
3737
getters: {
3838
isNodeInCopyingState: () => jest.fn(),
39+
getContentNodesCount: () =>
40+
jest.fn().mockReturnValue({
41+
resource_count: TOPIC_NODE.resource_count,
42+
assessment_item_count: EXERCISE_NODE.assessment_item_count,
43+
}),
3944
},
4045
},
4146
},

contentcuration/contentcuration/frontend/channelEdit/components/ContentNodeListItem/index.vue

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,11 @@
258258
};
259259
},
260260
computed: {
261-
...mapGetters('contentNode', ['isNodeInCopyingState', 'hasNodeCopyingErrored']),
261+
...mapGetters('contentNode', [
262+
'isNodeInCopyingState',
263+
'hasNodeCopyingErrored',
264+
'getContentNodesCount',
265+
]),
262266
isCompact() {
263267
return this.compact || !this.$vuetify.breakpoint.mdAndUp;
264268
},
@@ -273,14 +277,15 @@
273277
return { title, kind, src, encoding };
274278
},
275279
subtitle() {
280+
const count = this.getContentNodesCount(this.node.id);
276281
switch (this.node.kind) {
277282
case ContentKindsNames.TOPIC:
278283
return this.$tr('resources', {
279-
value: this.node.resource_count || 0,
284+
value: count?.resource_count || 0,
280285
});
281286
case ContentKindsNames.EXERCISE:
282287
return this.$tr('questions', {
283-
value: this.node.assessment_item_count || 0,
288+
value: count?.assessment_item_count || 0,
284289
});
285290
}
286291

contentcuration/contentcuration/frontend/channelEdit/components/ContentNodeOptions.vue

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
},
125125
{
126126
label: this.$tr('makeACopy'),
127-
onClick: this.duplicateNode,
127+
onClick: () => this.duplicateNode(this.nodeId),
128128
condition: this.canEdit,
129129
},
130130
{
@@ -282,9 +282,11 @@
282282
});
283283
},
284284
moveNode(target) {
285-
return this.moveContentNodes({ id__in: [this.nodeId], parent: target }).then(
286-
this.$refs.moveModal.moveComplete
287-
);
285+
return this.moveContentNodes({
286+
id__in: [this.nodeId],
287+
parent: target,
288+
inherit: this.node.parent !== target,
289+
}).then(this.$refs.moveModal.moveComplete);
288290
},
289291
getRemoveNodeRedirect() {
290292
// Returns a callback to do appropriate post-removal navigation
@@ -322,7 +324,7 @@
322324
removeNode: withChangeTracker(function(id__in, changeTracker) {
323325
this.trackAction('Delete');
324326
const redirect = this.getRemoveNodeRedirect();
325-
return this.moveContentNodes({ id__in, parent: this.trashId }).then(() => {
327+
return this.moveContentNodes({ id__in, parent: this.trashId, inherit: false }).then(() => {
326328
redirect();
327329
this.showSnackbar({
328330
text: this.$tr('removedItems'),
@@ -345,7 +347,7 @@
345347
}
346348
);
347349
}),
348-
duplicateNode: withChangeTracker(async function(changeTracker) {
350+
duplicateNode: withChangeTracker(async function(nodeId, changeTracker) {
349351
this.trackAction('Copy');
350352
this.showSnackbar({
351353
duration: null,
@@ -356,8 +358,8 @@
356358
// actionCallback: () => changeTracker.revert(),
357359
});
358360
const copiedContentNode = await this.copyContentNode({
359-
id: this.nodeId,
360-
target: this.nodeId,
361+
id: nodeId,
362+
target: nodeId,
361363
position: RELATIVE_TREE_POSITIONS.RIGHT,
362364
});
363365

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,9 @@
107107
},
108108
canSave() {
109109
if (this.hasMixedCategories) {
110-
return Object.values(this.selectedValues).some(value => value.length > 0);
110+
return Object.values(this.selectedValues).some(
111+
value => value.length === this.nodes.length
112+
);
111113
}
112114
return !this.error;
113115
},
@@ -174,7 +176,7 @@
174176
Object.assign(fieldValue, currentNode[this.field] || {});
175177
}
176178
Object.entries(this.selectedValues)
177-
.filter(([value]) => value.length === this.nodeIds.length)
179+
.filter(entry => entry[1].length === this.nodeIds.length)
178180
.forEach(([key]) => {
179181
fieldValue[key] = true;
180182
});

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,9 @@
6262
box
6363
:required="isEditable"
6464
:disabled="!isEditable"
65+
:helpText="helpText"
6566
/>
6667
</div>
67-
<p v-if="helpText" class="help" style="margin-bottom: 8px">
68-
{{ helpText }}
69-
</p>
7068
</div>
7169
<div class="form-item">
7270
<div class="input-container">
@@ -293,7 +291,7 @@
293291
aggregatorToolTip:
294292
'Website or org hosting the content collection but not necessarily the creator or copyright holder',
295293
copyrightHolderLabel: 'Copyright holder',
296-
cannotEditPublic: 'Cannot edit for public channel resources',
294+
cannotEditPublic: 'Not editable for resources from public channels',
297295
editOnlyLocal: 'Edits will be reflected only for local resources',
298296
mixed: 'Mixed',
299297
saveAction: 'Save',

0 commit comments

Comments
 (0)