diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 000000000000..fa116eb028a0 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,38 @@ +--- +name: Bug Report +about: Create a report to help us fix a bug.w +title: 'BUG: ' +labels: '' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Desktop (please complete the following information):** + - OS: [e.g. iOS] + - Browser [e.g. chrome, safari] + - Version [e.g. 22] + +**Smartphone (please complete the following information):** + - Device: [e.g. iPhone6] + - OS: [e.g. iOS8.1] + - Browser [e.g. stock browser, safari] + - Version [e.g. 22] + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 000000000000..d5bbb538052a --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature Request +about: Suggest a new feature for CIPP. +title: 'FEATURE REQUEST: ' +labels: '' +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/workflows/Assign_Issue_Volunteer.yml b/.github/workflows/Assign_Issue_Volunteer.yml new file mode 100644 index 000000000000..659a510e507c --- /dev/null +++ b/.github/workflows/Assign_Issue_Volunteer.yml @@ -0,0 +1,11 @@ +name: "Assign Issue to Volunteer" + +on: [issue_comment] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: bhermann/issue-volunteer@v0.1.12 + with: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/Check_for_Version_Update.yml b/.github/workflows/Check_for_Version_Update.yml new file mode 100644 index 000000000000..7bfa37e80bf7 --- /dev/null +++ b/.github/workflows/Check_for_Version_Update.yml @@ -0,0 +1,27 @@ +name: Check for Version Update + +on: + pull_request: + branches: [ master ] + + workflow_dispatch: + +jobs: + build: + name: "Check for Version Update" + runs-on: ubuntu-latest + + steps: + + - name: Check for Changed Files + uses: brettcannon/check-for-changed-files@v1.1.0 + with: + file-pattern: version_latest.txt + failure-message: "You have not updated version_latest.txt. This is a required file to update at each PR. Please sync your latest changes and update the version number." + + - name: Prevent changes to workflow files + uses: DovnarAlexander/github-action-file-detection@v0.3.0 + with: + wildcard: ".github/workflows/*.yml" + exit_code_found: 1 + exit_code_not_found: 0 diff --git a/.github/workflows/Close_Stale_Issues_and_PRs.yml b/.github/workflows/Close_Stale_Issues_and_PRs.yml new file mode 100644 index 000000000000..82aae4ace1e8 --- /dev/null +++ b/.github/workflows/Close_Stale_Issues_and_PRs.yml @@ -0,0 +1,17 @@ +name: 'Close stale issues and PRs' +on: + schedule: + - cron: '30 1 * * *' + +jobs: + stale: + runs-on: ubuntu-latest + steps: + - uses: actions/stale@v4 + with: + stale-issue-message: 'This issue is stale because it has been open 10 days with no activity. We will close this issue soon. If you want this feature implemented you can contribute it. See: https://cipp.app/GettingStarted/Contributions/ . Please notify the team if you are working on this yourself.' + close-issue-message: 'This issue was closed because it has been stalled for 14 days with no activity.' + stale-issue-label: 'no-activity' + exempt-issue-labels: 'planned' + days-before-stale: 9 + days-before-close: 14 diff --git a/.github/workflows/CodeQL_Analyser.yml b/.github/workflows/CodeQL_Analyser.yml new file mode 100644 index 000000000000..78ce211ad282 --- /dev/null +++ b/.github/workflows/CodeQL_Analyser.yml @@ -0,0 +1,38 @@ +name: "CodeQL" + +on: + push: + branches: [ master, dev, react ] + pull_request: + branches: [ master, dev, react ] + schedule: + - cron: '26 17 * * 0' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'javascript' ] + + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + with: + languages: ${{ matrix.language }} + + - name: Autobuild + uses: github/codeql-action/autobuild@v1 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 diff --git a/.github/workflows/Comment_on_Issues.yml b/.github/workflows/Comment_on_Issues.yml new file mode 100644 index 000000000000..74e2c6227ed2 --- /dev/null +++ b/.github/workflows/Comment_on_Issues.yml @@ -0,0 +1,38 @@ +name: Add Comment +on: + issues: + types: + - labeled +jobs: + add-comment_bug: + if: github.event.label.name == 'unconfirmed-by-user' + runs-on: ubuntu-latest + permissions: + issues: write + steps: + - name: Add Comment + uses: peter-evans/create-or-update-comment@a35cf36e5301d70b76f316e867e7788a55a31dae + with: + issue-number: ${{ github.event.issue.number }} + body: | + Thank you for creating a bug. Please make sure your bug is indeed a unique case by checking current and past issues, and reading the complete documentation at https://kelvintegelaar.github.io/CIPP + If your bug is a known documentation issue, it will be closed without notice by a contributor. To confirm that this is not a bug found in the documentation, please copy and paste the following comment: "I confirm that I have checked the documentation thoroughly and believe this to be an actual bug.". + + Without confirming, your report will be closed in 24 hours. If you'd like this bug to be assigned to you, please comment "I would like to work on this please!". + + add-comment_fr: + if: github.event.label.name == 'enhancement' + runs-on: ubuntu-latest + permissions: + issues: write + steps: + - name: Add Comment + uses: peter-evans/create-or-update-comment@a35cf36e5301d70b76f316e867e7788a55a31dae + with: + issue-number: ${{ github.event.issue.number }} + body: | + Thank you for creating a feature request! feature requests are prioritized by our direct contributors. Your current priority is set to "No Priority". If you are a sponsor you can request an upgrade of priority, If you want this feature to be integrated you can always do this yourself by checking out our contributions guide at https://kelvintegelaar.github.io/CIPP/GettingStarted/Contributions.html. Contributors to the CIPP project reserve the right to close feature requests at will. + + If your feature request is not picked up in 2 week by a contributor it will be closed. + + If you'd like this feature request to be assigned to you, please comment "I would like to work on this please!". diff --git a/.github/workflows/Label_Issues.yml b/.github/workflows/Label_Issues.yml new file mode 100644 index 000000000000..f0c1c5a8818e --- /dev/null +++ b/.github/workflows/Label_Issues.yml @@ -0,0 +1,28 @@ +name: Label Issues +on: + issues: + types: + - opened +jobs: + label_issues_bugs: + if: contains(github.event.issue.title,'Bug') + runs-on: ubuntu-latest + permissions: + issues: write + steps: + - name: Label Issues + uses: andymckay/labeler@5c59dabdfd4dd5bd9c6e6d255b01b9d764af4414 + with: + add-labels: "unconfirmed-by-user" + repo-token: ${{ secrets.GITHUB_TOKEN }} + label_issues_frs: + if: contains(github.event.issue.title,'Feature') + runs-on: ubuntu-latest + permissions: + issues: write + steps: + - name: Label Issues + uses: andymckay/labeler@5c59dabdfd4dd5bd9c6e6d255b01b9d764af4414 + with: + add-labels: "enhancement, no-priority" + repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/Node_Project_Check.yml b/.github/workflows/Node_Project_Check.yml new file mode 100644 index 000000000000..5893ff36c44d --- /dev/null +++ b/.github/workflows/Node_Project_Check.yml @@ -0,0 +1,40 @@ +name: NodeJS Project Check + +on: + push: + branches: + - master + - react + pull_request: + branches: + - master + - react + +concurrency: + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.ref }} + cancel-in-progress: true + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [16.x, 17.x] + os: [ubuntu-latest, windows-latest, macOS-latest] + + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node-version }} + - name: Install Test + run: npm i --legacy-peer-deps + env: + CI: true + - name: Build Test + run: npm run build + env: + CI: true \ No newline at end of file diff --git a/.github/workflows/Run_Linters.yml b/.github/workflows/Run_Linters.yml new file mode 100644 index 000000000000..9b3a649c0398 --- /dev/null +++ b/.github/workflows/Run_Linters.yml @@ -0,0 +1,32 @@ +name: Run Linters +on: + push: + branches: + - master + - react + pull_request: + branches: + - master + - react + +concurrency: + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.ref }} + cancel-in-progress: true + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v2 + with: + node-version: 16.x + - name: Install Linters + run: npm i --legacy-peer-deps -D eslint prettier + - uses: wearerequired/lint-action@v1 + name: Lint + with: + eslint: true + eslint_args: "--max-warnings 0" + prettier: true \ No newline at end of file diff --git a/package.json b/package.json index 1c7f891d6b9e..6141e1560397 100644 --- a/package.json +++ b/package.json @@ -82,5 +82,8 @@ "engines": { "node": "16", "npm": ">=7" - } + }, + "eslintIgnore": [ + "node_modules/" + ] } diff --git a/src/components/Wizard.js b/src/components/Wizard.js index f3ab885ae26c..a01722964ae6 100644 --- a/src/components/Wizard.js +++ b/src/components/Wizard.js @@ -2,8 +2,6 @@ import React from 'react' import PropTypes from 'prop-types' import { Form } from 'react-final-form' import { CButton, CCardHeader, CNav, CNavItem, CNavLink, CRow, CCol } from '@coreui/react' -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' -import { faCircleNotch } from '@fortawesome/free-solid-svg-icons' import { CippPage } from 'src/components' export default class Wizard extends React.Component { diff --git a/src/components/cipp/CippOffcanvasListGroup.js b/src/components/cipp/CippOffcanvasListGroup.js deleted file mode 100644 index ad1f33a9a7c2..000000000000 --- a/src/components/cipp/CippOffcanvasListGroup.js +++ /dev/null @@ -1,12 +0,0 @@ -import React from 'react' -import { useListDatatableQuery } from 'src/store/api/datatable' -import PropTypes from 'prop-types' -import { CListGroup, CListGroupItem } from '@coreui/react' - -export default function CippDatatable({ path, params, ...rest }) {} - -CippDatatable.propTypes = { - path: PropTypes.string.isRequired, - params: PropTypes.object, - ...CippTablePropTypes, -} diff --git a/src/index.js b/src/index.js index 69919252a03f..a14a1f9b2f41 100644 --- a/src/index.js +++ b/src/index.js @@ -10,11 +10,13 @@ import { PersistGate } from 'redux-persist/integration/react' import { FullScreenLoading } from './components' ReactDOM.render( - - } persistor={persistor}> - - - , + + + } persistor={persistor}> + + + + , document.getElementById('root'), ) diff --git a/src/views/email-exchange/administration/ContactsList.js b/src/views/email-exchange/administration/ContactsList.js index ca6f64bd5a78..e2716b5a1967 100644 --- a/src/views/email-exchange/administration/ContactsList.js +++ b/src/views/email-exchange/administration/ContactsList.js @@ -5,7 +5,6 @@ import { CippPageList } from 'src/components' import { cellBooleanFormatter } from 'src/components/cipp' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { faEdit } from '@fortawesome/free-solid-svg-icons' -import { Link } from 'react-router-dom' const Dropdown = (row, rowIndex, formatExtraData) => { const tenant = useSelector((state) => state.app.currentTenant) diff --git a/src/views/identity/administration/Users.js b/src/views/identity/administration/Users.js index 2ac42c0bf6fc..9cc6d9cc744f 100644 --- a/src/views/identity/administration/Users.js +++ b/src/views/identity/administration/Users.js @@ -2,7 +2,7 @@ import React, { useState } from 'react' import { CButton } from '@coreui/react' import { Link } from 'react-router-dom' import { useSelector } from 'react-redux' -import { faPlus, faEdit, faTrash, faEllipsisV, faEye } from '@fortawesome/free-solid-svg-icons' +import { faEdit, faTrash, faEllipsisV, faEye } from '@fortawesome/free-solid-svg-icons' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { cellBooleanFormatter } from 'src/components/cipp' import { CippPageList } from 'src/components' diff --git a/src/views/tenant/standards/ListAppliedStandards.js b/src/views/tenant/standards/ListAppliedStandards.js index 3a3c8881e2ee..f0469ef46a1f 100644 --- a/src/views/tenant/standards/ListAppliedStandards.js +++ b/src/views/tenant/standards/ListAppliedStandards.js @@ -1,15 +1,6 @@ import React from 'react' import { useSelector } from 'react-redux' -import { CippDatatable } from '../../../components/cipp' -import { - CCard, - CCardBody, - CCardTitle, - CCardHeader, - CSpinner, - CButton, - CCallout, -} from '@coreui/react' +import { CSpinner, CButton, CCallout } from '@coreui/react' import { faTrash } from '@fortawesome/free-solid-svg-icons' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { CippPageList, ModalService } from '../../../components'