Skip to content

Commit

Permalink
Merge branch 'main' into feat/forms-1331-event-stream
Browse files Browse the repository at this point in the history
  • Loading branch information
usingtechnology authored Jul 31, 2024
2 parents d2e9367 + 2653749 commit a322955
Show file tree
Hide file tree
Showing 69 changed files with 7,857 additions and 1,281 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG VARIANT="18.20.3-bookworm"
ARG VARIANT="18.20.4-bookworm"
FROM node:${VARIANT}

# not much in here, could acheive this another way for sure...
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"dockerfile": "Dockerfile",
"context": "..",
"args": {
"VARIANT": "18.20.3-bookworm"
"VARIANT": "18.20.4-bookworm"
}
},

Expand Down
8 changes: 4 additions & 4 deletions .github/actions/build-push-container/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,23 +117,23 @@ runs:
echo "HAS_DOCKERHUB=${{ fromJson(inputs.dockerhub_username != '' && inputs.dockerhub_token != '') }}" >> $GITHUB_ENV
- name: Login to Github Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ env.GH_USERNAME }}
password: ${{ inputs.github_token }}

- name: Login to Dockerhub Container Registry
if: env.HAS_DOCKERHUB == 'true'
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: docker.io
username: ${{ inputs.dockerhub_username }}
password: ${{ inputs.dockerhub_token }}

- name: Prepare Container Metadata tags
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ env.GH_USERNAME }}/${{ inputs.image_name }}
Expand All @@ -151,7 +151,7 @@ runs:
- name: Build and Push to Container Registry
id: builder
uses: docker/build-push-action@v3
uses: docker/build-push-action@v6
with:
context: ${{ inputs.context }}
push: true
Expand Down
8 changes: 4 additions & 4 deletions .github/actions/deploy-to-environment/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,22 @@ inputs:
ref:
description: The checkout ref id
required: false
default: ''
default: ""

runs:
using: composite
steps:
- name: Checkout repository from pull request
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
if: ${{ inputs.ref != '' }}
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
if: ${{ inputs.ref == '' }}

- name: Login to OpenShift Cluster
uses: jasonchung1871/oc-login@v1.1.2
uses: redhat-actions/oc-login@v1

with:
openshift_server_url: ${{ inputs.openshift_server }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/codeql-analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -57,7 +57,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -71,4 +71,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
32 changes: 10 additions & 22 deletions .github/workflows/.deploy.yaml → .github/workflows/pr_deploy.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy PR
name: PR Deploy
run-name: Deploy PR-${{ github.event.inputs.pr-number }}

env:
Expand All @@ -9,7 +9,7 @@ on:
inputs:
pr-number:
description: Pull request number
required: false
required: true
type: string

concurrency:
Expand Down Expand Up @@ -37,6 +37,7 @@ jobs:
echo "JOB_NAME=master" >> "$GITHUB_OUTPUT"
echo "ROUTE_PATH=/app" >> "$GITHUB_OUTPUT"
echo "URL=https://$ACRONYM-dev.apps.silver.devops.gov.bc.ca" >> "$GITHUB_OUTPUT"
- name: Final variables
id: vars
env:
Expand All @@ -45,17 +46,10 @@ jobs:
REF=refs/pull/$PR_NUMBER/head
echo REF:$REF
echo "ref=$REF" >> $GITHUB_OUTPUT
if [[ "$PR_NUMBER" != '' ]]; then
echo "APP_TITLE=${{ steps.default-vars.outputs.APP_TITLE }} - PR-$PR_NUMBER" >> "$GITHUB_OUTPUT"
echo "JOB_NAME=pr-$PR_NUMBER" >> "$GITHUB_OUTPUT"
echo "ROUTE_PATH=/pr-$PR_NUMBER" >> "$GITHUB_OUTPUT"
echo "URL=${{ steps.default-vars.outputs.URL }}/pr-$PR_NUMBER" >> "$GITHUB_OUTPUT"
else
echo "APP_TITLE=${{ steps.default-vars.outputs.APP_TITLE }}" >> "$GITHUB_OUTPUT"
echo "JOB_NAME=${{ steps.default-vars.outputs.JOB_NAME }}" >> "$GITHUB_OUTPUT"
echo "ROUTE_PATH=${{ steps.default-vars.outputs.ROUTE_PATH }}" >> "$GITHUB_OUTPUT"
echo "URL=${{ steps.default-vars.outputs.URL }}/app" >> "$GITHUB_OUTPUT"
fi
echo "APP_TITLE=${{ steps.default-vars.outputs.APP_TITLE }} - PR-$PR_NUMBER" >> "$GITHUB_OUTPUT"
echo "JOB_NAME=pr-$PR_NUMBER" >> "$GITHUB_OUTPUT"
echo "ROUTE_PATH=/pr-$PR_NUMBER" >> "$GITHUB_OUTPUT"
echo "URL=${{ steps.default-vars.outputs.URL }}/pr-$PR_NUMBER" >> "$GITHUB_OUTPUT"
build:
name: Build & Push
Expand All @@ -67,10 +61,6 @@ jobs:
uses: actions/checkout@v4
with:
ref: ${{ needs.set-vars.outputs.ref }}
if: ${{ needs.set-vars.outputs.ref != '' }}
- name: Checkout repository
uses: actions/checkout@v4
if: ${{ needs.set-vars.outputs.ref == '' }}
- name: Build & Push
uses: ./.github/actions/build-push-container
with:
Expand All @@ -97,10 +87,6 @@ jobs:
uses: actions/checkout@v4
with:
ref: ${{ needs.set-vars.outputs.ref }}
if: ${{ needs.set-vars.outputs.ref != '' }}
- name: Checkout repository
uses: actions/checkout@v4
if: ${{ needs.set-vars.outputs.ref == '' }}
- name: Deploy to environment
uses: ./.github/actions/deploy-to-environment
with:
Expand All @@ -118,9 +104,11 @@ jobs:
ref: ${{ needs.set-vars.outputs.ref }}
- name: Release Comment on PR
uses: marocchino/sticky-pull-request-comment@v2
if: ${{ github.event.inputs.pr-number }} != '' && success()
if: success()
with:
header: release
hide_and_recreate: true
hide_classify: "OUTDATED"
message: |
Release ${{ github.sha }} deployed at <https://${{ env.ACRONYM }}-dev.apps.silver.devops.gov.bc.ca/pr-${{ github.event.inputs.pr-number }}>
number: ${{ github.event.inputs.pr-number }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Close pull request deployment
name: PR Undeploy
run-name: Undeploy PR-${{ github.event.inputs.pr-number }}

env:
ACRONYM: chefs
Expand All @@ -7,19 +8,9 @@ on:
workflow_dispatch:
inputs:
pr-number:
description: Pull request number, leave blank for dev/test/prod deployment
required: false
type: string
environment:
description: Environment name; choose dev for PR
description: Pull request number
required: true
type: choice
options:
- dev
- test
- prod
default: dev

type: string

jobs:
remove-pr-dev:
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ jobs:
version: [18]
steps:
- name: Checkout Repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Check CodeClimate Secrets
id: check-secrets
run: echo "HAS_CC_SECRETS=${{ secrets.CC_TEST_REPORTER_ID != '' }}" >> $GITHUB_OUTPUT
- name: Use Node.js ${{ matrix.version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.version }}
- name: Cache node modules
uses: actions/cache@v3
uses: actions/cache@v4
id: cache-app
env:
cache-name: cache-node-modules
Expand All @@ -50,7 +50,7 @@ jobs:
CI: true
- name: Save Coverage Results
if: matrix.version == 18
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: coverage-app
path: ${{ github.workspace }}/app/coverage
Expand Down Expand Up @@ -81,13 +81,13 @@ jobs:
version: [18]
steps:
- name: Checkout Repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.version }}
- name: Cache node modules
uses: actions/cache@v3
uses: actions/cache@v4
id: cache-frontend
env:
cache-name: cache-node-modules
Expand All @@ -107,7 +107,7 @@ jobs:
CI: true
- name: Save Coverage Results
if: matrix.version == 18
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: coverage-frontend
path: ${{ github.workspace }}/app/frontend/coverage
Expand All @@ -133,11 +133,11 @@ jobs:
timeout-minutes: 10
steps:
- name: Checkout Repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Restore Coverage Results
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
- name: Publish code coverage
uses: paambaati/codeclimate-action@v3.2.0
uses: paambaati/codeclimate-action@v8
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
Expand Down
1 change: 0 additions & 1 deletion .tool-versions

This file was deleted.

3 changes: 2 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ The stability of the CHEFS application is of highest importance.
- Please bring your change ideas to the team before starting work
- Contributors must follow the [Code of Conduct](CODE-OF-CONDUCT.md)
- Changes must include test coverage, documentation, and comments
- If changes to the code alter the functionality of CHEFS, please update the [documentation](https://developer.gov.bc.ca/docs/default/component/chefs-techdocs) by raising a pull request in the CHEFS tech docs [repository](https://github.com/bcgov/common-hosted-form-service-techdocs).
- The repository guardians review all changes and may ask for revisions

## Contributing code
Expand All @@ -20,4 +21,4 @@ Government employees, public and members of the private sector are encouraged to

All contributors retain the original copyright to their stuff, but by contributing to this project, you grant a world-wide, royalty-free, perpetual, irrevocable, non-exclusive, transferable license to all users **under the terms of the [license](./LICENSE) under which this project is distributed**.

To set up CHEFS on your workstation, visit the [Developer](https://github.com/bcgov/common-hosted-form-service/wiki/Developer) Wiki page.
To set up CHEFS on your workstation, visit the [developer documentation](https://developer.gov.bc.ca/docs/default/component/chefs-techdocs/Developer/).
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM docker.io/node:18.20.3-alpine3.20
FROM docker.io/node:18.20.4-alpine3.20

ENV NO_UPDATE_NOTIFIER=true
WORKDIR /opt/app-root/src/app
Expand Down
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
# Common Hosted Form Service [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE) [![img](https://img.shields.io/badge/Lifecycle-Stable-97ca00)](https://github.com/bcgov/repomountie/blob/master/doc/lifecycle-badges.md)

[Common Hosted Form Service](https://submit.digital.gov.bc.ca/app) is a web-based application designed for creating web forms and managing collected data. It is a free service available to all B.C. government employees and contractors with an IDIR account. For more information, visit the [CHEFS documentation](https://developer.gov.bc.ca/docs/default/component/chefs-techdocs).

[Watch a series of short videos](https://www.youtube.com/playlist?list=PL9CV_8JBQHirsQAShw45PZeU1CkU88Q53) to learn how to build your first form.


![Tests](https://github.com/bcgov/common-hosted-form-service/workflows/Tests/badge.svg)
[![Maintainability](https://api.codeclimate.com/v1/badges/950b1d6c61567a1da227/maintainability)](https://codeclimate.com/github/bcgov/common-hosted-form-service/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/950b1d6c61567a1da227/test_coverage)](https://codeclimate.com/github/bcgov/common-hosted-form-service/test_coverage)

Create, edit and publish forms.

## Directory Structure

.devcontainer - Visual Studio Code devcontainer and local environment config
Expand Down Expand Up @@ -42,12 +45,10 @@ Create, edit and publish forms.
- [CHEFS Load Test Readme](tests/load/load-test/README.md)
- [Devops Tools Setup](https://github.com/bcgov/nr-showcase-devops-tools)
- [Security Reporting](SECURITY.md)
- [Product Roadmap](https://github.com/bcgov/common-hosted-form-service/wiki/Product-Roadmap)
- [Product Roadmap](https://developer.gov.bc.ca/docs/default/component/chefs-techdocs/Product-Roadmap/)

## Help, Problems, and Feature Requests

Visit the [CHEFS Wiki](https://github.com/bcgov/common-hosted-form-service/wiki/) for help on using CHEFS.

To report a problem with CHEFS please create a [GitHub Issue](https://github.com/bcgov/common-hosted-form-service/issues).

Feature requests can be found in the [CHEFS Feedback](https://chefs-fider.apps.silver.devops.gov.bc.ca/) - vote for a feature you want in CHEFS, or add a new feature that hasn't been requested.
Expand All @@ -72,4 +73,4 @@ Please note that this project is released with a [Contributor Code of Conduct](C
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
2 changes: 1 addition & 1 deletion app/frontend/src/components/bcgov/BCGovNavBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const hasPrivileges = computed(() => {
<li v-if="hasPrivileges">
<a
data-cy="help"
href="https://github.com/bcgov/common-hosted-form-service/wiki"
href="https://developer.gov.bc.ca/docs/default/component/chefs-techdocs"
target="_blank"
:lang="locale"
>{{ $t('trans.bCGovNavBar.help') }}</a
Expand Down
7 changes: 6 additions & 1 deletion app/frontend/src/components/designer/FormViewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1089,7 +1089,12 @@ export default {
}
},
async deleteFile(file) {
return fileService.deleteFile(file.id);
const fileId = file?.data?.id
? file.data.id
: file?.id
? file.id
: undefined;
return fileService.deleteFile(fileId);
},
async getFile(fileId, options = {}) {
await this.downloadFile(fileId, options);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ defineExpose({ idpType, userTypeChanged, updateLoginType });
<p class="mt-2 mb-0" :lang="locale">
{{ $t('trans.formSettings.referenceGuideA') }}
<a
href="https://github.com/bcgov/common-hosted-form-service/wiki/Accessing-forms#Notify-the-idim-team-if-you-are-using-bceid"
href="https://developer.gov.bc.ca/docs/default/component/chefs-techdocs/Capabilities/Form-Management/Accessing-forms/#to-use-log-in-required-with-bceid"
:lang="locale"
>{{ $t('trans.formSettings.referenceGuideB') }}</a
>
Expand Down
Loading

0 comments on commit a322955

Please sign in to comment.