Skip to content

Commit f0b45b6

Browse files
feat: init commit
0 parents  commit f0b45b6

File tree

42 files changed

+2456
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+2456
-0
lines changed

.editorconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
insert_final_newline = false
6+
indent_style = tab
7+
indent_size = 2

.eslintrc.backend.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = {
2+
$schema: 'https://json.schemastore.org/eslintrc',
3+
env: {
4+
es6: true,
5+
node: true,
6+
},
7+
extends: ['eslint:recommended', 'plugin:node/recommended', 'prettier'],
8+
};

.eslintrc.frontend.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
module.exports = {
2+
$schema: 'https://json.schemastore.org/eslintrc',
3+
parser: '@babel/eslint-parser',
4+
env: {
5+
browser: true,
6+
es6: true,
7+
},
8+
plugins: ['react'],
9+
extends: ['eslint:recommended', 'plugin:react/recommended', 'prettier'],
10+
parserOptions: {
11+
requireConfigFile: false,
12+
ecmaVersion: 2018,
13+
ecmaFeatures: {
14+
jsx: true,
15+
},
16+
sourceType: 'module',
17+
babelOptions: {
18+
presets: ['@babel/preset-react'],
19+
},
20+
},
21+
settings: {
22+
react: {
23+
version: 'detect',
24+
},
25+
},
26+
};

.eslintrc.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
const frontendESLint = require('./.eslintrc.frontend.js');
2+
const backendESLint = require('./.eslintrc.backend.js');
3+
4+
module.exports = {
5+
$schema: 'https://json.schemastore.org/eslintrc',
6+
parserOptions: {
7+
ecmaVersion: 2018,
8+
},
9+
rules: {
10+
indent: ['error', 'tab'],
11+
'linebreak-style': ['error', 'unix'],
12+
quotes: ['error', 'single'],
13+
semi: ['error', 'always'],
14+
},
15+
globals: {
16+
strapi: 'readonly',
17+
},
18+
overrides: [
19+
{
20+
files: ['server/**/*'],
21+
...backendESLint,
22+
},
23+
{
24+
files: ['admin/**/*'],
25+
...frontendESLint,
26+
},
27+
],
28+
};

.gitattributes

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# From https://github.com/Danimoth/gitattributes/blob/master/Web.gitattributes
2+
3+
# Handle line endings automatically for files detected as text
4+
# and leave all files detected as binary untouched.
5+
* text=auto
6+
7+
#
8+
# The above will handle all files NOT found below
9+
#
10+
11+
#
12+
## These files are text and should be normalized (Convert crlf => lf)
13+
#
14+
15+
# source code
16+
*.php text
17+
*.css text
18+
*.sass text
19+
*.scss text
20+
*.less text
21+
*.styl text
22+
*.js text eol=lf
23+
*.coffee text
24+
*.json text
25+
*.htm text
26+
*.html text
27+
*.xml text
28+
*.svg text
29+
*.txt text
30+
*.ini text
31+
*.inc text
32+
*.pl text
33+
*.rb text
34+
*.py text
35+
*.scm text
36+
*.sql text
37+
*.sh text
38+
*.bat text
39+
40+
# templates
41+
*.ejs text
42+
*.hbt text
43+
*.jade text
44+
*.haml text
45+
*.hbs text
46+
*.dot text
47+
*.tmpl text
48+
*.phtml text
49+
50+
# git config
51+
.gitattributes text
52+
.gitignore text
53+
.gitconfig text
54+
55+
# code analysis config
56+
.jshintrc text
57+
.jscsrc text
58+
.jshintignore text
59+
.csslintrc text
60+
61+
# misc config
62+
*.yaml text
63+
*.yml text
64+
.editorconfig text
65+
66+
# build config
67+
*.npmignore text
68+
*.bowerrc text
69+
70+
# Documentation
71+
*.md text
72+
LICENSE text
73+
AUTHORS text
74+
75+
76+
#
77+
## These files are binary and should be left untouched
78+
#
79+
80+
# (binary is a macro for -text -diff)
81+
*.png binary
82+
*.jpg binary
83+
*.jpeg binary
84+
*.gif binary
85+
*.ico binary
86+
*.mov binary
87+
*.mp4 binary
88+
*.mp3 binary
89+
*.flv binary
90+
*.fla binary
91+
*.swf binary
92+
*.gz binary
93+
*.zip binary
94+
*.7z binary
95+
*.ttf binary
96+
*.eot binary
97+
*.woff binary
98+
*.pyc binary
99+
*.pdf binary

.github/workflows/npm-publish.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# This workflow will publish a package to NPM when a release is created
2+
3+
name: Publish to NPM
4+
5+
on:
6+
release:
7+
types: [published]
8+
9+
jobs:
10+
publish-npm:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout branch
14+
uses: actions/checkout@v2
15+
16+
- name: Install Node v14
17+
uses: actions/setup-node@v2
18+
with:
19+
node-version: '14.x'
20+
registry-url: 'https://registry.npmjs.org'
21+
22+
- name: Install Yarn
23+
run: npm install -g yarn
24+
25+
- name: Clean install deps
26+
run: yarn install --frozen-lockfile
27+
28+
- name: Publish to NPM
29+
run: npm publish
30+
env:
31+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Don't check auto-generated stuff into git
2+
coverage
3+
node_modules
4+
stats.json
5+
6+
# Cruft
7+
.DS_Store
8+
npm-debug.log
9+
.idea

.npmignore

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# npm
2+
npm-debug.log
3+
4+
# git
5+
.git
6+
.gitattributes
7+
.gitignore
8+
9+
# vscode
10+
.vscode
11+
12+
# RC files
13+
.eslintrc.js
14+
.eslintrc.backend.js
15+
.eslintrc.frontend.js
16+
.prettierrc.json
17+
18+
# config files
19+
.editorconfig
20+
21+
# github
22+
.github

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package-lock.json

.prettierrc.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "http://json.schemastore.org/prettierrc",
3+
"trailingComma": "es5",
4+
"tabWidth": 2,
5+
"semi": true,
6+
"singleQuote": true,
7+
"useTabs": true,
8+
"arrowParens": "always",
9+
"endOfLine": "lf",
10+
"printWidth": 100
11+
}

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 @ComfortablyCoding
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# strapi-plugin-notes
2+
3+
A plugin for [Strapi](https://github.com/strapi/strapi) that provides the ability to add notes to entity records.
4+
5+
## Requirements
6+
7+
The installation requirements are the same as Strapi itself and can be found in the documentation on the [Quick Start](https://strapi.io/documentation/developer-docs/latest/getting-started/quick-start.html) page in the Prerequisites info card.
8+
9+
### Supported Strapi versions
10+
11+
- v4.x.x
12+
13+
**NOTE**: While this plugin may work with the older Strapi versions, they are not supported, it is always recommended to use the latest version of Strapi.
14+
15+
## Installation
16+
17+
```sh
18+
npm install strapi-plugin-notes
19+
```
20+
21+
**or**
22+
23+
```sh
24+
yarn add strapi-plugin-notes
25+
```
26+
27+
## Configuration
28+
29+
The plugin configuration is stored in a config file located at `./config/plugins.js`.
30+
31+
```javascript
32+
module.exports = ({ env }) => ({
33+
'entity-notes': {
34+
enabled: true,
35+
},
36+
});
37+
```
38+
39+
**IMPORTANT NOTE**: Make sure any sensitive data is stored in env files.
40+
41+
## Usage
42+
43+
Once the plugin has been installed, configured a notes section will be added to the `informations` sections of the edit view for all content types.
44+
45+
### Adding a note
46+
47+
Navigate to the entity record that a note needs to be added to and click the `Add new note` text button. A modal will appear with input areas to add the note information. Once completed select save to create the note. Clicking the `x` icon on the top right or cancel on the bottom left will abort the note creation.
48+
49+
### Editing a note
50+
51+
Navigate to the entity record that the note belongs to, and find the note in the notes list. Click on the pen can icon and a modal will appear with input areas to add the note information. Once completed select save to permanently save any changes that have been made. Clicking the `x` icon on the top right or cancel on the bottom left will abort all edits.
52+
53+
### Deleting a note
54+
55+
Navigate to the entity record that the note belongs to, and find the note in the notes list. Click on the trash can icon and the record will be deleted.
56+
57+
## Bugs
58+
59+
If any bugs are found please report them as a [Github Issue](https://github.com/ComfortablyCoding/strapi-plugin-notes/issues)
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/**
2+
*
3+
* Initializer
4+
*
5+
*/
6+
7+
import { useEffect, useRef } from 'react';
8+
import PropTypes from 'prop-types';
9+
import { pluginId } from '../../pluginId';
10+
11+
const Initializer = ({ setPlugin }) => {
12+
const ref = useRef();
13+
ref.current = setPlugin;
14+
15+
useEffect(() => {
16+
ref.current(pluginId);
17+
}, []);
18+
19+
return null;
20+
};
21+
22+
Initializer.propTypes = {
23+
setPlugin: PropTypes.func.isRequired,
24+
};
25+
26+
export default Initializer;

0 commit comments

Comments
 (0)