Skip to content

Delete channels from the channel edit view#2988

Merged
sairina merged 1 commit intolearningequality:hotfixesfrom
micahscopes:delete-channels-in-edit-page
Feb 24, 2021
Merged

Delete channels from the channel edit view#2988
sairina merged 1 commit intolearningequality:hotfixesfrom
micahscopes:delete-channels-in-edit-page

Conversation

@micahscopes
Copy link
Copy Markdown
Contributor

@micahscopes micahscopes commented Feb 24, 2021

Description

Fixes deletion of channels from the channel edit page.

Issue Addressed (if applicable)

Fixes #2894

Steps to Test

  • Edit channel that you want to delete
  • Delete the channel using the "..." menu in the upper right corner of the channel edit page
  • Ensure that the channel was deleted, you were redirected to the channel list page and that the snackbar message appears.

Implementation Notes (optional)

At a high level, how did you implement this?

There were two small bugs:

  • Two functions shared the same name
  • A promise was being returned from inside of a Dexie transaction

this.showProgressModal = true;
},
deleteChannel() {
deleteChannelModal() {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deleteChannel also happened to be the name of a vuex action that was mapped into this component, so these were conflicting.

@rtibbles rtibbles added this to the Post Release Stabilization milestone Feb 24, 2021
@rtibbles rtibbles requested a review from sairina February 24, 2021 14:58
// Call endpoint directly in case we need to navigate to new page
return this.transaction({ mode: 'rw', source: IGNORED_SOURCE }, () => {
return this.table.update(id, { deleted: true }).then(() => {
return client.patch(this.modelUrl(id), { deleted: true });
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dexie doesn't support using these kinds of promises inside of transactions, see here.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be a useful code comment?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add it!

@micahscopes micahscopes force-pushed the delete-channels-in-edit-page branch 2 times, most recently from fa7095f to f9e1040 Compare February 24, 2021 15:04
@micahscopes micahscopes force-pushed the delete-channels-in-edit-page branch from f9e1040 to 295bf95 Compare February 24, 2021 15:07
Copy link
Copy Markdown
Contributor

@sairina sairina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@sairina sairina merged commit 4182f86 into learningequality:hotfixes Feb 24, 2021
@metodimilevqa
Copy link
Copy Markdown

I confirm the fix is successful with #3000

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot Delete Channels from Channel Edit Page

4 participants