1.0.65 • Published 1 month ago

@cpelements/cp-comments v1.0.65

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
1 month ago

CP-Comments

This web component is intended to be used with the red_hat_comments Drupal module.

This component had a rocky development process and is a bit different from working on most components. It's recommended to develop on this with a local Drupal environment, possibly many Drupal development environments.

Getting Started

See CP Elements Docs for general instructions getting setup, there's helpful info about getting your environment setup and other helpful information.

To get a proper dev setup get CP-comments setup in a Drupal environment:

Also see the architecture documentation.

Compiling

From inside this folder run:

npm run dev

From CP Elements git root run:

# Only watches and compiles CP-Comments and it's dependencies
npm run dev cp-comments

# Or this command that launches a web server and watches/compiles all components:
npm start

The web server is not helpful for CP Elements at time of writing, it only works well in a Drupal context.

Dependencies

  • PFelement base class
  • pfe-avatar
  • pfe-button

CSS Variables

CSS Property NameDefaultDescription
--cp-comments__loader__color#cccColor of the loading spinner

Events

cp-comments:comments-loaded

Fires when the first/another batch of comments have been loaded

  • event.detail.commentCount: Total comments (from all pages)
  • event.detail.cpComments: A reference to the cp-comments element

cp-comments:comment-added

Fires when a comment has been successfully added. Includes:

  • event.detail.commentCount: Total comments (from all pages)
  • event.detail.cpComments: A reference to the cp-comments element

cp-comments:comment-deleted

Fires when a comment is successfully deleted. Includes:

  • event.detail.commentCount: Total comments (from all pages)
  • event.detail.cpComments: A reference to the cp-comments element

pfeconfig-query

Fires when component loads and is ready for config from the host site. See docroot/modules/contrib/red_hat_comments/templates/comments-block.html.twig on the Commenting Platform, which captures the event and sets the config on cp-comments.

Development Process

At time of writing, we're in the middle of heavy development, and need to coordinate multiple folks working on the code, pushing code to QA, and code review.

The process (for now) is: 1. For new work create a feature branch from epic/cp-comments-1x/integration, it's recommended to use DAT branch naming for consistency:

```
feature/USERNAME/TICKET--SHORT-DESCRIPTION

For example:
feature/wruvalca/CPCORE-9212--fixing-authentication`
```
  1. You can run npm run dev cp-comments from CP Elements git root, or npm run dev from the CP Comments folder to watch and build code.
  2. Work on your feature in your branch until it's ready for review.
  3. Create an MR in Gitlab against main.
  4. Coordinate with Wes and other devs to create a new version on NPM, so we can push the code to QA.

Releasing to Preprod

Check with devs working on cp-comments to see if they're close to needing a release to combine efforts.

  1. Make sure all code for the release is merged to epic/cp-comments-1x/integration
  2. Push the updated epic/cp-comments-1x/integration to GitLab
  3. Make sure you're on the right version of node (nvm use or similar for CP Elements gitroot)
  4. Go to elements/cp-comments
  5. Run npm version patch (assuming you want a patch and not )
  6. Run npm run build (this ensures the component will report the right version from it's API)
  7. npm publish --access=public
  8. Go to CP Chrome and checkout epic/cp-comments-1x/integration
  9. Update the cp-comments version in j/public_modules/package.json
  10. Commit
  11. Follow the instructions from here starting at step 4: https://docs.engineering.redhat.com/pages/viewpage.action?pageId=310386287
  12. Do a CP Chrome release to Dev and QA, and optionally stage. If you aren't familiar with the process, it is highly recommended to find someone who is, as it's a tedious and confusing release process. Documentation is available though.
1.0.65

1 month ago

1.0.64

7 months ago

1.0.63

10 months ago

1.0.62

10 months ago

1.0.19

1 year ago

1.0.61

1 year ago

1.0.60

1 year ago

1.0.22

1 year ago

1.0.21

1 year ago

1.0.20

1 year ago

1.0.26

1 year ago

1.0.25

1 year ago

1.0.24

1 year ago

1.0.23

1 year ago

1.0.29

1 year ago

1.0.28

1 year ago

1.0.27

1 year ago

1.0.33

1 year ago

1.0.32

1 year ago

1.0.31

1 year ago

1.0.30

1 year ago

1.0.37

1 year ago

1.0.36

1 year ago

1.0.35

1 year ago

1.0.34

1 year ago

1.0.39

1 year ago

1.0.38

1 year ago

1.0.40

1 year ago

1.0.44

1 year ago

1.0.43

1 year ago

1.0.42

1 year ago

1.0.41

1 year ago

1.0.48

1 year ago

1.0.47

1 year ago

1.0.46

1 year ago

1.0.45

1 year ago

1.0.49

1 year ago

1.0.51

1 year ago

1.0.50

1 year ago

1.0.55

1 year ago

1.0.54

1 year ago

1.0.53

1 year ago

1.0.52

1 year ago

1.0.59

1 year ago

1.0.58

1 year ago

1.0.57

1 year ago

1.0.56

1 year ago

1.0.18

1 year ago

1.0.17

1 year ago

1.0.16

1 year ago

1.0.15

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

0.0.15

2 years ago

1.1.10

1 year ago

0.0.12

2 years ago

0.0.13

2 years ago

0.0.14

2 years ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

0.0.11

2 years ago

0.0.10

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago