Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/unstable' into merge-into-sear…
Browse files Browse the repository at this point in the history
…ch-recs
  • Loading branch information
akolson committed Oct 31, 2024
2 parents 2df4aae + 8799b85 commit 078638c
Show file tree
Hide file tree
Showing 72 changed files with 2,241 additions and 29,461 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/containerbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index

- name: Build and push Docker image
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: ./docker
file: ./docker/Dockerfile.postgres.dev
Expand Down Expand Up @@ -98,7 +98,7 @@ jobs:
uses: docker/setup-buildx-action@v3

- name: Build Docker image
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: ./
file: ./k8s/images/nginx/Dockerfile
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ webpack-stats\.json
storybook-static/

# i18n
/contentcuration/locale/CSV_FILES/*
/contentcuration/locale/**/LC_MESSAGES/*.csv

# pyenv
.python-version
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ migrate:
# 4) Remove the management command from this `deploy-migrate` recipe
# 5) Repeat!
deploy-migrate:
echo "Nothing to do here!"
python contentcuration/manage.py rectify_incorrect_contentnode_source_fields

contentnodegc:
python contentcuration/manage.py garbage_collect
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@
retryFailedCopy: withChangeTracker(function(changeTracker) {
this.updateContentNode({
id: this.nodeId,
checkComplete: true,
[COPYING_STATUS]: COPYING_STATUS_VALUES.COPYING,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ function mountComponent(opts = {}) {
namespaced: true,
getters: {
isNodeInCopyingState: () => jest.fn(),
getContentNodesCount: () =>
jest.fn().mockReturnValue({
resource_count: TOPIC_NODE.resource_count,
assessment_item_count: EXERCISE_NODE.assessment_item_count,
}),
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,11 @@
};
},
computed: {
...mapGetters('contentNode', ['isNodeInCopyingState', 'hasNodeCopyingErrored']),
...mapGetters('contentNode', [
'isNodeInCopyingState',
'hasNodeCopyingErrored',
'getContentNodesCount',
]),
isCompact() {
return this.compact || !this.$vuetify.breakpoint.mdAndUp;
},
Expand All @@ -273,14 +277,15 @@
return { title, kind, src, encoding };
},
subtitle() {
const count = this.getContentNodesCount(this.node.id);
switch (this.node.kind) {
case ContentKindsNames.TOPIC:
return this.$tr('resources', {
value: this.node.resource_count || 0,
value: count?.resource_count || 0,
});
case ContentKindsNames.EXERCISE:
return this.$tr('questions', {
value: this.node.assessment_item_count || 0,
value: count?.assessment_item_count || 0,
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
},
{
label: this.$tr('makeACopy'),
onClick: this.duplicateNode,
onClick: () => this.duplicateNode(this.nodeId),
condition: this.canEdit,
},
{
Expand Down Expand Up @@ -282,9 +282,11 @@
});
},
moveNode(target) {
return this.moveContentNodes({ id__in: [this.nodeId], parent: target }).then(
this.$refs.moveModal.moveComplete
);
return this.moveContentNodes({
id__in: [this.nodeId],
parent: target,
inherit: this.node.parent !== target,
}).then(this.$refs.moveModal.moveComplete);
},
getRemoveNodeRedirect() {
// Returns a callback to do appropriate post-removal navigation
Expand Down Expand Up @@ -322,7 +324,7 @@
removeNode: withChangeTracker(function(id__in, changeTracker) {
this.trackAction('Delete');
const redirect = this.getRemoveNodeRedirect();
return this.moveContentNodes({ id__in, parent: this.trashId }).then(() => {
return this.moveContentNodes({ id__in, parent: this.trashId, inherit: false }).then(() => {
redirect();
this.showSnackbar({
text: this.$tr('removedItems'),
Expand All @@ -345,7 +347,7 @@
}
);
}),
duplicateNode: withChangeTracker(async function(changeTracker) {
duplicateNode: withChangeTracker(async function(nodeId, changeTracker) {
this.trackAction('Copy');
this.showSnackbar({
duration: null,
Expand All @@ -356,8 +358,8 @@
// actionCallback: () => changeTracker.revert(),
});
const copiedContentNode = await this.copyContentNode({
id: this.nodeId,
target: this.nodeId,
id: nodeId,
target: nodeId,
position: RELATIVE_TREE_POSITIONS.RIGHT,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@
},
canSave() {
if (this.hasMixedCategories) {
return Object.values(this.selectedValues).some(value => value.length > 0);
return Object.values(this.selectedValues).some(
value => value.length === this.nodes.length
);
}
return !this.error;
},
Expand Down Expand Up @@ -174,7 +176,7 @@
Object.assign(fieldValue, currentNode[this.field] || {});
}
Object.entries(this.selectedValues)
.filter(([value]) => value.length === this.nodeIds.length)
.filter(entry => entry[1].length === this.nodeIds.length)
.forEach(([key]) => {
fieldValue[key] = true;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,9 @@
box
:required="isEditable"
:disabled="!isEditable"
:helpText="helpText"
/>
</div>
<p v-if="helpText" class="help" style="margin-bottom: 8px">
{{ helpText }}
</p>
</div>
<div class="form-item">
<div class="input-container">
Expand Down Expand Up @@ -293,7 +291,7 @@
aggregatorToolTip:
'Website or org hosting the content collection but not necessarily the creator or copyright holder',
copyrightHolderLabel: 'Copyright holder',
cannotEditPublic: 'Cannot edit for public channel resources',
cannotEditPublic: 'Not editable for resources from public channels',
editOnlyLocal: 'Edits will be reflected only for local resources',
mixed: 'Mixed',
saveAction: 'Save',
Expand Down
Loading

0 comments on commit 078638c

Please sign in to comment.