Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat send team emails #8

Open
wants to merge 6 commits into
base: jv/feat-send-indivudial-email-pluggable
Choose a base branch
from

Conversation

johnvente
Copy link

@johnvente johnvente commented Jan 4, 2024

Description

This allows you to send emails to specific teams in a course. The teams will be displayed as checkboxes, and the user will be able to select the teams as they wish.

Demo

demo.mp4

When teams are being fetched

Screen Shot 2024-01-05 at 1 03 35 PM
Screen Shot 2024-01-05 at 12 33 53 PM

Plugin loaded

Screen Shot 2024-01-03 at 8 15 40 PM

How to test it

Setting up

You will need to install these following plugins:

If you are using devstack

  1. Go to workspace and clone this branch
cd ~/workspace && git remote add fork [email protected]:eduNEXT/frontend-app-communications.git
git fetch fork jv/feat-send-team-emails-pluggable && git checkout jv/feat-send-team-emails-pluggable
  1. Go to the mfe repository, use node version in the repo and install dependencies
cd ~/workspace/frontend-app-communications && nvm use && npm install

  1. inside frontend-app-communications run
npm run start
  1. Go to http://localhost:1984/courses/course-v1:edX+DemoX+Demo_Course/bulk_email Or
    http://localhost:1984/courses/{{id_course}}/bulk_email

  2. Select any team or some teams in the field called "teams"

  3. Fill out the fields Subject and Body

@johnvente johnvente force-pushed the jv/feat-send-team-emails-pluggable branch from 0a0b15d to bcd7e63 Compare January 4, 2024 14:01
@codecov-commenter
Copy link

codecov-commenter commented Jan 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (a6dfabb) 83.31% compared to head (9752165) 83.31%.

Additional details and impacted files
@@                           Coverage Diff                            @@
##           jv/feat-send-indivudial-email-pluggable       #8   +/-   ##
========================================================================
  Coverage                                    83.31%   83.31%           
========================================================================
  Files                                           53       53           
  Lines                                          773      773           
  Branches                                       147      147           
========================================================================
  Hits                                           644      644           
  Misses                                         129      129           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@johnvente johnvente force-pushed the jv/feat-send-team-emails-pluggable branch from bcd7e63 to 01f8c9f Compare January 4, 2024 14:15
@johnvente johnvente changed the title feat send team emails pluggable feat send team emails Jan 4, 2024
import ListTeams from './ListTeams';

describe('ListTeams component', () => {
// eslint-disable-next-line no-unused-vars, react/prop-types
Copy link
Member

Choose a reason for hiding this comment

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

Is this still necessary?

Copy link
Author

Choose a reason for hiding this comment

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

'no-unused-vars' isn't necessary, I will remove it. Thanks!


const formStatusToast = ['error', 'complete', 'completeSchedule'];
const formStatusToast = ['error', 'complete', 'completeSchedule', 'loadingTeams'];
Copy link
Member

Choose a reason for hiding this comment

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

I've seen this status in many different places, I would suggest to move into a variables, in order to avoid typos in the future.

Ej:

Suggested change
const formStatusToast = ['error', 'complete', 'completeSchedule', 'loadingTeams'];
const ERROR = 'error'
const COMPLETE = 'complete'
const COMPLETE_SCHEDULE = 'completeSchedule'
const LOADING_TEAMS = 'loadingTeams'
const formStatusToast = [ERROR, COMPLETE, COMPLETE_SCHEDULE, LOADING_TEAMS];

}), [intl]);

const statefulButtonDisableStates = useMemo(() => [
'pending',
'complete',
'completeSchedule',
], []);
isLoadingTeams ? 'loadingTeams' : '',
Copy link
Member

Choose a reason for hiding this comment

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

Same about this states:

Suggested change
isLoadingTeams ? 'loadingTeams' : '',
COMPLETE_SCHEDULE,
isLoadingTeams ? LOADING_TEAMS : '',

data-testid="send-email-btn"
variant="primary"
onClick={handleClickStatefulButton}
state={isLoadingTeams ? 'loadingTeams' : formStatus}
Copy link
Member

Choose a reason for hiding this comment

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

Same here:

Suggested change
state={isLoadingTeams ? 'loadingTeams' : formStatus}
state={isLoadingTeams ? LOADING_TEAMS : formStatus}

@BryanttV
Copy link

BryanttV commented Jan 5, 2024

Works as expected! 🚀

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.

6 participants