Skip to content

Commit

Permalink
feat: comments custom field [CU-2tn2923] (#157)
Browse files Browse the repository at this point in the history
* feat: comments custom field

* chore: code coverage

* fix: pr feedback and tests

* chore: tests rename

* fix: failing test

* chore: version update

* feat: custom field icon

* fix: failing tests

* fix: typescript build failing

* fix: add env and change path (#158)

Co-authored-by: Mateusz Ziarko <[email protected]>
Co-authored-by: Maksymilian Pamuła <[email protected]>
  • Loading branch information
3 people authored Sep 27, 2022
1 parent 3b9eee2 commit aaac8a0
Show file tree
Hide file tree
Showing 39 changed files with 2,157 additions and 73 deletions.
5 changes: 4 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ jobs:
docker:
- image: cimg/node:14.19.3
working_directory: ~/repo
resource_class: large
steps:
- checkout
- run:
Expand All @@ -34,7 +35,9 @@ jobs:
- run:
name: Test
command: |
yarn test:unit
yarn test:unit:ci
- store_test_results:
path: ./coverage/clover.xml
- codecov/upload:
flags: unittest
file:
Expand Down
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ A plugin for [Strapi Headless CMS](https://github.com/strapi/strapi) that provid
- [Plugin file](#in-v202-and-older--default-configuration-state-for-v203-and-newer)
5. [🕸️ Public API - REST](#%EF%B8%8F-public-rest-api-specification)
6. [🕸️ Public API - GraphQL](#%EF%B8%8F-public-graphql-specification)
7. [🤝 Contributing](#-contributing)
8. [👨‍💻 Community support](#-community-support)
7. [⚗️ Custom fields](#-custom-fields)
8. [🤝 Contributing](#-contributing)
9. [👨‍💻 Community support](#-community-support)

## ✨ Features

Expand Down Expand Up @@ -828,6 +829,14 @@ _Available reason enums:_ `BAD_WORDS`, `OTHER`, `DISCRIMINATION` (want more? See

Live example of plugin usage can be found in the [VirtusLab Strapi Examples](https://github.com/VirtusLab/strapi-examples/tree/master/strapi-v4-plugin-comments) repository.

## ⚗️ Custom fields

**THIS IS AN UNSTABLE FEATURE**

For developers who upgrades their Strapi instance custom field from Comments plugin is available. Custom field can be picked from content types' edit page or added in definition file.

Read more about this feature in [Strapi's docs](https://docs-next.strapi.io/user-docs/latest/plugins/introduction-to-plugins.html#custom-fields).

## 🤝 Contributing

<div>
Expand Down
29 changes: 29 additions & 0 deletions admin/src/custom-fields/comments/components/icon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import React from "react";

export const CustomFieldIcon = () => (
<svg
width="2em"
height="1.5em"
viewBox="0 0 50 36"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<rect
x="0.75"
y="0.75"
width="48.5"
height="34.5"
rx="2.25"
fill="#FDF4DC"
stroke="#FAE7B9"
stroke-width="1.5"
/>
<path
d="M34 10H16V23.6098H21.7073L25.2195 28L28.2927 23.6098H34V10Z"
stroke="#D9822F"
stroke-width="1.5"
/>
<path d="M21.2686 15.2676H28.2929" stroke="#D9822F" stroke-width="1.5" />
<path d="M21.2686 18.3418H28.2929" stroke="#D9822F" stroke-width="1.5" />
</svg>
);
2 changes: 2 additions & 0 deletions admin/src/custom-fields/comments/components/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from "./icon";
export * from "./input";
Loading

0 comments on commit aaac8a0

Please sign in to comment.