Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
9c644d7
First batch of gherkin scenarios
Feb 5, 2021
6017684
First batch of gherkin scenarios
Feb 5, 2021
351d2d8
Continuous to Present Simple, Asterisks, Examples section
Feb 9, 2021
fa91213
Titles, Unifications, Strings changes
Feb 12, 2021
7d4532e
Allow MPTT updates when uploading tree to ensure proper order.
kollivier Feb 15, 2021
caef2ee
as a non-admin user added in Background section, spellcheck correcton…
Feb 16, 2021
70a2c19
Merge pull request #2954 from kollivier/ricecooker_fix
rtibbles Feb 16, 2021
4020348
Add `randomize` field to `ExtraFieldsSerializer`
jonboiser Feb 16, 2021
27c9625
Fix guard for `extra_fields.randomize` in `generateContentNode`
jonboiser Feb 16, 2021
27afd30
Add test for extra_fields.randomize
jonboiser Feb 17, 2021
10208b5
plain warning, asterisks
Feb 17, 2021
c65e2d0
Merge pull request #2911 from metodimilevqa/gherkins
radinamatic Feb 17, 2021
b533936
Merge pull request #2956 from jonboiser/sync-randomize-field
rtibbles Feb 17, 2021
2fd4cff
Fix channel link in Details.vue
jonboiser Feb 17, 2021
6886592
Use `window.Urls.channel` instead of hard-coded link
jonboiser Feb 17, 2021
21ed5a1
update stopPublish function to work also cancel sync tasks
marcellamaki Feb 17, 2021
126a777
reduce duplicate code in ProgressModal for closing/refreshing
marcellamaki Feb 17, 2021
9530450
Reference window.Urls from within a method, not template
jonboiser Feb 17, 2021
226db27
Add pyenv “.python-version” to gitignore
jonboiser Feb 17, 2021
eccf920
Merge pull request #2963 from jonboiser/fix-channel-link
jonboiser Feb 17, 2021
16c1934
update tests
marcellamaki Feb 17, 2021
7ada880
Fix resource panel header width stretching
sairina Feb 18, 2021
9e8b8eb
Merge pull request #2966 from sairina/resource-panel-width
rtibbles Feb 18, 2021
aa98a80
Merge pull request #2964 from marcellamaki/stop-syncing
MisRob Feb 18, 2021
fa38708
Disable usage of spreadsheet row filling as broken.
rtibbles Feb 19, 2021
c7e1b5a
Merge pull request #2974 from rtibbles/no_sheet
rtibbles Feb 20, 2021
bc69ef6
Fix mismatch between Progress Modal content and current task. Remove …
marcellamaki Feb 22, 2021
bd36fc2
Merge pull request #2982 from marcellamaki/fix-progress-modal-titles
rtibbles Feb 22, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,6 @@ storybook-static/

# i18n
/contentcuration/locale/CSV_FILES/*

# pyenv
.python-version
7 changes: 0 additions & 7 deletions contentcuration/contentcuration/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,13 +203,6 @@ class Meta:
fields = ("operating_system", "browser", "channel", "description")


class SubmitFeedbackForm(forms.Form, ExtraFormMixin):
feedback = forms.CharField(required=True)

class Meta:
fields = ("feedback",)


class DeleteAccountForm(forms.Form, ExtraFormMixin):
email = forms.CharField(required=True)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
<div v-for="channel in details.edit_channels" :key="channel.id" class="mb-2">
<ActionLink
:text="channel.name"
:href="`/channels/${channel.id}`"
:href="channelUrl(channel)"
target="_blank"
/>
</div>
Expand All @@ -115,7 +115,7 @@
<div v-for="channel in details.viewonly_channels" :key="channel.id" class="mb-2">
<ActionLink
:text="channel.name"
:href="`/channels/${channel.id}`"
:href="channelUrl(channel)"
target="_blank"
/>
</div>
Expand Down Expand Up @@ -282,6 +282,9 @@
},
methods: {
...mapActions('userAdmin', ['loadUser', 'loadUserDetails']),
channelUrl(channel) {
return window.Urls.channel(channel.id);
},
updateTitleForPage() {
this.updateTabTitle(`${this.userFullName} - Users - Administration`);
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
</VFlex>
<VSpacer />
<!-- Slot for elements like edit button -->
<VFlex grow>
<VFlex shrink>
<slot name="actions"></slot>
</VFlex>
</VLayout>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
v-if="progressPercent === 100 || currentTaskError"
color="primary"
data-test="refresh"
@click="closeOverlay"
@click="cancelTaskAndClose(currentTask)"
>
{{ doneButtonText || $tr('refreshButton') }}
</VBtn>
Expand All @@ -68,7 +68,11 @@
<VBtn flat data-test="cancelstop" @click="step--">
{{ $tr('cancel') }}
</VBtn>
<VBtn color="primary" data-test="confirmstop" @click="cancelTask">
<VBtn
color="primary"
data-test="confirmstop"
@click="cancelTaskAndClose(currentTask)"
>
{{ stopButtonText || $tr('confirmStopButton') }}
</VBtn>
</VCardActions>
Expand Down Expand Up @@ -164,63 +168,44 @@
);
},
headerText() {
if (this.currentTask) {
if (this.currentTask.task_type === 'duplicate-nodes') {
return this.$tr('copyHeader');
} else if (this.isPublishing) {
return this.$tr('publishHeader');
} else if (this.currentTask.task_type === 'move-nodes') {
return this.$tr('moveHeader');
} else if (this.isSyncing || this.nothingToSync) {
return this.$tr('syncHeader');
}
} else if (this.nothingToSync) {
if ((this.currentTask && this.isPublishing) || this.currentChannel.publishing) {
return this.$tr('publishHeader');
} else if (this.syncing || (this.currentTask && this.isSyncing)) {
return this.$tr('syncHeader');
}
return this.$tr('publishHeader');
return '';
},
descriptionText() {
if (this.currentTask) {
if (this.progressPercent >= 100) {
return this.$tr('finishedMessage');
} else if (this.currentTask.task_type === 'duplicate-nodes') {
return this.$tr('copyDescription');
} else if (this.isPublishing) {
return this.$tr('publishDescription');
} else if (this.currentTask.task_type === 'move-nodes') {
return this.$tr('moveDescription');
} else if (this.isSyncing) {
return this.$tr('syncDescription');
}
} else if (this.nothingToSync) {
if (this.progressPercent >= 100 || this.nothingToSync) {
return this.$tr('finishedMessage');
} else if ((this.currentTask && this.isPublishing) || this.currentChannel.publishing) {
return this.$tr('publishDescription');
} else if (this.syncing || (this.currentTask && this.isSyncing)) {
return this.$tr('syncDescription');
}
return this.$tr('publishDescription');
return '';
},
},
methods: {
...mapActions('currentChannel', ['stopPublishing']),
closeOverlay() {
this.stopPublishing().then(() => {
...mapActions('currentChannel', ['stopTask']),
cancelTaskAndClose(task) {
this.stopTask(task).then(() => {
window.location.reload();
});
},
cancelTask() {
this.stopPublishing();
},
},
$trs: {
copyHeader: 'Importing resources',
copyDescription: 'Import is in progress, please wait...',
// copyHeader: 'Importing resources',
// copyDescription: 'Import is in progress, please wait...',
/* eslint-disable kolibri/vue-no-unused-translations */
defaultHeader: 'Updating channel',
defaultDescription: 'Update is in progress, please wait...',
/* eslint-enable */
defaultErrorText:
'An unexpected error has occurred. Please try again, and if you continue to see this message, please contact support via the Help menu.',
finishedMessage: 'Operation complete! Click "Refresh" to update the page.',
moveHeader: 'Moving Content',
moveDescription: 'Move operation is in progress, please wait...',
// moveHeader: 'Moving Content',
// moveDescription: 'Move operation is in progress, please wait...',
publishHeader: 'Publishing channel',
publishDescription:
'Once publishing is complete, you will receive an email notification and will be able to make further edits to your channel.',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@ describe('progressModal', () => {
expect(wrapper.find('[data-test="refresh"]').exists()).toBe(true);
});
it('refresh button should reload the page', () => {
const closeOverlay = jest.fn();
const cancelTaskAndClose = jest.fn();
let wrapper = makeWrapper({
progressPercent() {
return 100;
},
});
wrapper.setMethods({ closeOverlay });
wrapper.setMethods({ cancelTaskAndClose });
wrapper.find('[data-test="refresh"]').trigger('click');
expect(closeOverlay).toHaveBeenCalled();
expect(cancelTaskAndClose).toHaveBeenCalled();
});

describe('on cancel task', () => {
Expand All @@ -96,19 +96,19 @@ describe('progressModal', () => {
expect(wrapper.vm.step).toBe(2);
});
it('clicking stop button on confirmation window should cancel the task', () => {
const cancelTask = jest.fn();
wrapper.setMethods({ cancelTask });
const cancelTaskAndClose = jest.fn();
wrapper.setMethods({ cancelTaskAndClose });
wrapper.setData({ step: 2 });
wrapper.find('[data-test="confirmstop"]').trigger('click');
expect(cancelTask).toHaveBeenCalled();
expect(cancelTaskAndClose).toHaveBeenCalled();
});
it('clicking cancel button on confirmation window should go back to progress window', () => {
const cancelTask = jest.fn();
wrapper.setMethods({ cancelTask });
const cancelTaskAndClose = jest.fn();
wrapper.setMethods({ cancelTaskAndClose });
wrapper.setData({ step: 2 });
wrapper.find('[data-test="cancelstop"]').trigger('click');
expect(wrapper.vm.step).toBe(1);
expect(cancelTask).not.toHaveBeenCalled();
expect(cancelTaskAndClose).not.toHaveBeenCalled();
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ function generateContentNodeData({
if (extra_fields.n) {
contentNodeData.extra_fields.n = extra_fields.n;
}
if (extra_fields.randomize) {
if (extra_fields.randomize !== undefined) {
contentNodeData.extra_fields.randomize = extra_fields.randomize;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,14 @@ export function publishChannel(context, version_notes) {
return Channel.publish(context.state.currentChannelId, version_notes);
}

export function stopPublishing(context) {
return Channel.clearPublish(context.state.currentChannelId).then(() => {
const publishTask = context.rootGetters['task/currentTasksForChannel'](
context.state.currentChannelId
).find(task => task.task_type === 'export-channel');
return publishTask
? context.dispatch('task/deleteTask', publishTask, { root: true })
: Promise.resolve();
});
export function stopTask(context, task) {
if (task && task.task_type === 'export-channel') {
return Channel.clearPublish(context.state.currentChannelId).then(() => {
return context.dispatch('task/deleteTask', task, { root: true });
});
} else if (task) {
return context.dispatch('task/deleteTask', task, { root: true });
} else {
Promise.resolve();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,13 @@
/>
<p class="mt-4">
<ActionLink
href="https://community.learningequality.org/c/support/studio"
target="_blank"
:text="$tr('giveFeedback')"
@click="showFeedbackForm"
/>
</p>
</VContainer>
</VNavigationDrawer>
<!-- Overwrite dark mode -->
<span style="color: var(--v-grey-darken4);">
<FeedbackForm v-model="showFeedbackDialog" />
</span>

</div>

Expand All @@ -87,25 +84,18 @@

import { mapActions, mapState } from 'vuex';
import KolibriLogo from './KolibriLogo';
import FeedbackForm from 'shared/views/errors/FeedbackForm';

export default {
name: 'MainNavigationDrawer',
components: {
KolibriLogo,
FeedbackForm,
},
props: {
value: {
type: Boolean,
default: false,
},
},
data() {
return {
showFeedbackDialog: false,
};
},
computed: {
...mapState({
user: state => state.session.currentUser,
Expand Down Expand Up @@ -133,10 +123,6 @@
},
methods: {
...mapActions(['logout']),
showFeedbackForm() {
this.showFeedbackDialog = true;
this.drawer = false;
},
trackClick(label) {
this.$analytics.trackClick('general', `User dropdown - ${label}`);
},
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@
</VFlex>
<a
v-else
:href="`/channels/${channel.id}/view`"
:href="channelUrl(channel)"
target="_blank"
class="notranslate primary--text"
>
Expand Down Expand Up @@ -382,6 +382,11 @@
return this.sortedTags.map(tag => tag.tag_name).join(', ');
},
},
methods: {
channelUrl(channel) {
return window.Urls.channel(channel.id);
},
},
$trs: {
/* eslint-disable kolibri/vue-no-unused-translations */
sizeHeading: 'Channel size',
Expand Down
Loading