Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
101 changes: 55 additions & 46 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,19 @@ frontend-plugin-notifications
Purpose
=======

This is the repository for storing Notification Tray frontend plugin. Intended to be used with
the `frontend-plugin-framework`_.
This is a collection of components meant to integrate Notifications into the platform UI. They are presently used in the `HeaderNotificationsSlot`_.

.. _frontend-plugin-framework: https://github.com/openedx/frontend-plugin-framework
.. _HeaderNotificationsSlot: https://github.com/openedx/frontend-component-header/tree/master/src/plugin-slots/HeaderNotificationsSlot

Getting Started
===============

Devstack Installation
Configuration
---------------------

This plugin is intended to be used with Header component. Make sure to follow the instructions on the MFE's
repository README for getting set up in a devstack.
The components are added to logged-in MFEs when `tutor-contrib-platform-notifications`_ is used in a Tutor deployment.

Header in MFE should contain a plugin slot component to render the notifications tray.
.. _tutor-contrib-platform-notifications: https://github.com/openedx/tutor-contrib-platform-notifications

Local Development
-----------------
Expand All @@ -44,47 +42,47 @@ Clone this repository into your main workspace folder.
Insert the following into the ``env.config.js`` file of MFE. If it doesn't exist, create one
in the root and add the following configuration::

```
// Imports from frontend-plugin-framework
import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';

// Import plugin components from the npm package
import NotificationsTray from '@edx/frontend-plugin-notifications';

const config = {
pluginSlots: {
// Add configuration for each notifications_slot. This is the ID for the <PluginSlot> component
notifications_tray: {
plugins: [
{
op: PLUGIN_OPERATIONS.Insert,
widget: {
id: 'notifications_tray',
type: DIRECT_PLUGIN,
RenderWidget: NotificationsTray,

// Imports from frontend-plugin-framework
import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';

// Import plugin components from the npm package
import NotificationsTray from '@edx/frontend-plugin-notifications';

const config = {
pluginSlots: {
// Add configuration for each notifications_slot. This is the ID for the <PluginSlot> component
notifications_tray: {
plugins: [
{
op: PLUGIN_OPERATIONS.Insert,
widget: {
id: 'notifications_tray',
type: DIRECT_PLUGIN,
RenderWidget: NotificationsTray,
},
},
},
],
],
},
},
},
};
export default config;
};
export default config;


```

To develop while using this plugin library, modify the ``module.config.js`` file in the root of the MFE you are
developing in to reference the local version of the plugin.::

module.exports = {
localModules: [
// Add the below object to the localModules array
{
moduleName: '@edx/frontend-plugin-notifications',
dir: '../src/frontend-plugin-notifications',
dist: 'dist'
},
],
}
module.exports = {
localModules: [
// Add the below object to the localModules array
{
moduleName: '@edx/frontend-plugin-notifications',
dir: '../src/frontend-plugin-notifications',
dist: 'dist'
},
],
}


License
Expand All @@ -98,17 +96,28 @@ Please see `LICENSE <LICENSE>`_ for details.
Contributing
============

Before considering whether or not something belongs in this repository, use the `plugins decision tree`_ to see ensure
it is the correct place.
Contributions are very welcome. Please read `How To Contribute`_ for details.

.. _How To Contribute: https://openedx.org/r/how-to-contribute

.. _plugins decision tree: https://2u-internal.atlassian.net/wiki/spaces/microb/pages/597590081/Frontend+Plugin+Framework#Implementation
This project is currently accepting all types of contributions, bug fixes,
security fixes, maintenance work, or new features. However, please make sure
to have a discussion about your new feature idea with the maintainers prior to
beginning development to maximize the chances of your change being accepted.
You can start a conversation by creating a new issue on this repo summarizing
your idea.

People
======

Contact @edx/edx-infinity if you are having any trouble developing in this repository.
The assigned maintainers for this component and other project details may be
found in `Backstage`_. Backstage pulls this data from the ``catalog-info.yaml``
file in this repo.

.. _Backstage: https://open-edx-backstage.herokuapp.com/catalog/default/component/frontend-plugin-notifications


Reporting Security Issues
=========================

Please do not report security issues in public. Email security@edx.org instead.
Please do not report security issues in public. Email security@openedx.org instead.
18 changes: 15 additions & 3 deletions catalog-info.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,19 @@ metadata:
- url: "https://github.com/edx/frontend-plugin-notifications/blob/master/README.rst"
title: "README"
icon: "Article"
annotations:
# The openedx.org/release key is described in OEP-10:
# https://open-edx-proposals.readthedocs.io/en/latest/oep-0010-proc-openedx-releases.html
# The FAQ might also be helpful: https://openedx.atlassian.net/wiki/spaces/COMM/pages/1331268879/Open+edX+Release+FAQ
# Note: This will only work if the repo is in the `openedx` org in github. Repos in other orgs that have this
# setting will still be treated as if they don't want to be part of the Open edX releases.
openedx.org/release: null
# (Optional) Annotation keys and values can be whatever you want.
# We use it in Open edX repos to have a comma-separated list of GitHub user
# names that might be interested in changes to the architecture of this
# component.
openedx.org/arch-interest-groups: ""
spec:
owner: group:edx-infinity
type: "plugin"
lifecycle: "experimental"
owner: group:openedx-unmaintained
type: "library"
lifecycle: "production"