Skip to content

Commit

Permalink
merge in main
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanBirtch-aot committed Oct 25, 2024
2 parents c34ba12 + 5f754dc commit 124cd6f
Show file tree
Hide file tree
Showing 184 changed files with 27,435 additions and 13,509 deletions.
11 changes: 6 additions & 5 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
version: "2"
exclude_patterns:
- components/
- config/
- "**/db/"
- dist/
- features/
- "**/node_modules/"
- script/
- Tests/
- "**/*.d.ts"
- "**/*_test.go"
- "**/db/"
- "**/node_modules/"
- "**/spec/"
- "**/test/"
- "**/tests/"
- Tests/
- "**/vendor/"
- "**/*_test.go"
- "**/*.d.ts"
plugins:
csslint:
enabled: true
Expand Down
5 changes: 3 additions & 2 deletions .devcontainer/chefs_local/local.json.sample
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@
"port": "8080",
"rateLimit" : {
"public": {
"windowMs": "900000",
"max": "100"
"limitApiKey": "120",
"limitFrontend": "500",
"windowMs": "60000",
}
},
"encryption": {
Expand Down
4 changes: 4 additions & 0 deletions .github/actions/deploy-to-environment/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ inputs:
runs:
using: composite
steps:
- name: Install OpenShift CLI tools
uses: redhat-actions/openshift-tools-installer@v1
with:
oc: "4.14"
- name: Checkout repository from pull request
uses: actions/checkout@v4
with:
Expand Down
36 changes: 27 additions & 9 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
<!-- Provide a general summary of your changes in the Title above -->
<!--
The above Title for the Pull Request should use the format:
type: FORMS-ABCD your change description
For example:
feat: FORMS-1234 add Assigned To column to submission table
-->

# Description

<!-- Describe your changes in detail -->
<!-- Why is this change required? What problem does it solve? -->
<!-- If it fixes an open issue, please link to the issue here. -->
<!--
Describe your changes in detail.
- Why is this change required?
- What problem does it solve?
-->

## Types of changes
## Type of Change

<!-- Uncomment the main reason for the change (for example, all feat PRs should include docs and test, but only uncomment feat): -->
<!--
Uncomment the main reason for the change. For example: all "feat" PRs should
include documentation ("docs") and tests ("test"), but only uncomment "feat".
-->

<!-- feat (a new feature) -->
<!-- fix (a bug fix) -->
Expand All @@ -18,6 +29,7 @@
<!-- docs (change to documentation) -->
<!-- perf (change to improve performance) -->
<!-- refactor (change to improve code quality) -->
<!-- revert (reverts changes in a previous commit) -->
<!-- style (change to code style/formatting) -->
<!-- test (add missing tests or correct existing tests) -->

Expand All @@ -27,8 +39,10 @@ This is a breaking change because ...

## Checklist

<!-- Go over all the following points, and put an `x` in all the boxes that apply. -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
<!--
Go over all the following points, and put an `x` in all the boxes that apply. If
you're unsure about any of these, don't hesitate to ask. We're here to help!
-->

- [ ] I have read the [CONTRIBUTING](/bcgov/common-hosted-form-service/blob/main/CONTRIBUTING.md) doc
- [ ] I have checked that unit tests pass locally with my changes
Expand All @@ -39,4 +53,8 @@ This is a breaking change because ...

## Further comments

<!-- If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc... -->
<!--
If this is a relatively large or complex change, kick off the discussion by
explaining why you chose the solution you did and what alternatives you
considered, etc...
-->
2 changes: 1 addition & 1 deletion .github/workflows/unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,5 +142,5 @@ jobs:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
coverageLocations: |
${{ github.workspace }}/**/lcov.info:lcov
${{ github.workspace }}/**/clover.xml:clover
prefix: ${{ github.workplace }}
3 changes: 3 additions & 0 deletions app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const querystring = require('querystring');
const log = require('./src/components/log')(module.filename);
const httpLogger = require('./src/components/log').httpLogger;
const middleware = require('./src/forms/common/middleware');
const rateLimiter = require('./src/forms/common/middleware').apiKeyRateLimiter;
const v1Router = require('./src/routes/v1');

const DataConnection = require('./src/db/dataConnection');
Expand Down Expand Up @@ -52,6 +53,8 @@ app.use((_req, res, next) => {
}
});

app.use(config.get('server.basePath') + config.get('server.apiPath'), rateLimiter);

// Frontend configuration endpoint
apiRouter.use('/config', (_req, res, next) => {
try {
Expand Down
5 changes: 3 additions & 2 deletions app/config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@
"port": "8080",
"rateLimit": {
"public": {
"windowMs": "60000",
"max": "120"
"limitApiKey": "120",
"limitFrontend": "500",
"windowMs": "60000"
}
},
"encryption": {
Expand Down
103 changes: 99 additions & 4 deletions app/frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions app/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"@fortawesome/fontawesome-svg-core": "^6.4.2",
"@fortawesome/free-solid-svg-icons": "^6.4.2",
"@fortawesome/vue-fontawesome": "^3.0.3",
"@vueuse/core": "^11.1.0",
"axios": "^1.4.0",
"bootstrap-scss": "^5.3.1",
"crypto-js": "^4.1.1",
Expand Down
66 changes: 29 additions & 37 deletions app/frontend/src/components/admin/AddOwner.vue
Original file line number Diff line number Diff line change
@@ -1,48 +1,40 @@
<script>
import { mapActions } from 'pinia';
<script setup>
import { version as uuidVersion, validate as uuidValidate } from 'uuid';
import { useI18n } from 'vue-i18n';
import { ref } from 'vue';
import { useAdminStore } from '~/store/admin';
import { FormRoleCodes } from '~/utils/constants';
export default {
props: {
formId: {
type: String,
required: true,
},
},
setup() {
const { locale } = useI18n({ useScope: 'global' });
const { locale } = useI18n({ useScope: 'global' });
return { locale };
},
data() {
return {
userGuid: '',
valid: false,
userGuidRules: [
(v) => !!v || 'User ID required',
(v) =>
(uuidValidate(v) && uuidVersion(v) === 4) ||
'Enter a valid User ID GUID',
],
};
},
methods: {
...mapActions(useAdminStore, ['addFormUser', 'readRoles']),
async addOwner() {
if (this.$refs.addUserForm.validate()) {
await this.addFormUser({
userId: this.userGuid,
formId: this.formId,
roles: [FormRoleCodes.OWNER],
});
}
},
const properties = defineProps({
formId: {
type: String,
required: true,
},
};
});
const addUserForm = ref(null);
const userGuid = ref('');
const valid = ref(false);
const userGuidRules = ref([
(v) => !!v || 'User ID required',
(v) =>
(uuidValidate(v) && uuidVersion(v) === 4) || 'Enter a valid User ID GUID',
]);
const adminStore = useAdminStore();
async function addOwner() {
if (addUserForm.value.validate()) {
await adminStore.addFormUser({
userId: userGuid.value,
formId: properties.formId,
roles: [FormRoleCodes.OWNER],
});
}
}
</script>

<template>
Expand Down
Loading

0 comments on commit 124cd6f

Please sign in to comment.