Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
36241a4
Bump path-parse from 1.0.6 to 1.0.7 in /vue/sbc-common-components (#238)
dependabot[bot] Mar 16, 2023
a8a2074
Update nodejs.yml (#321)
seeker25 Mar 17, 2023
4797a3d
Update common-util.ts
severinbeauvais Apr 27, 2023
b93585e
Update config-helper.ts
severinbeauvais Apr 27, 2023
9a91dad
Update vue-ci.yml (#331)
seeker25 Jul 28, 2023
594804a
Fix default for getFlag. (#334)
seeker25 Sep 27, 2023
1aa7dc8
Fix serialize array (#335)
seeker25 Oct 3, 2023
d5053bd
Add in http_logger, we can use this in DEV/TEST, but not PROD. (#342)
seeker25 Dec 5, 2023
87a5ee9
Allow signout (#345)
seeker25 Jan 4, 2024
2258ec6
Minor changes (#346)
seeker25 Jan 4, 2024
5807c20
no message (#349)
kris-daxiom Mar 5, 2024
5f99e13
Fix sbc-auth unit tests (#350)
seeker25 Mar 11, 2024
8871ffc
add release notes (#351)
eve-git Apr 22, 2024
05cec58
include queue message types (#352)
seeker25 May 3, 2024
1524803
Update enums.py (#353)
seeker25 May 3, 2024
6880382
Update enums.py
seeker25 May 6, 2024
71912ef
Add in common PaymentToken dataclass. (#354)
seeker25 May 6, 2024
9c39308
Update enums.py
seeker25 May 6, 2024
15a43af
names message type (#355)
bolyachevets May 7, 2024
f4dae84
Update enums.py
seeker25 May 7, 2024
5a8d762
Update enums.py
seeker25 May 7, 2024
6cbacdd
Update enums.py
seeker25 May 16, 2024
5d114de
Added environment alert to the header. Header needs to be passed an e…
EPortman May 17, 2024
374c4fe
Made banner nonexistant when environment passed in is not one of thes…
EPortman May 17, 2024
de5f7d8
Merge pull request #357 from EPortman/master
ozamani9gh May 22, 2024
9498611
Bumped up version numbers in package.json and package-lock.json for t…
EPortman May 27, 2024
e92f7c0
Bump follow-redirects in /vue/sbc-common-components (#347)
dependabot[bot] May 31, 2024
a37663f
Bump browserify-sign from 4.2.1 to 4.2.2 in /vue/sbc-common-component…
dependabot[bot] May 31, 2024
a74816b
Bump chromedriver from 103.0.0 to 119.0.1 in /vue/sbc-common-componen…
dependabot[bot] May 31, 2024
e770b4a
Revert "Bump chromedriver from 103.0.0 to 119.0.1 in /vue/sbc-common-…
seeker25 May 31, 2024
22978d8
Update enums.py
seeker25 May 31, 2024
8307880
signout on whitelist (#373)
seeker25 Sep 11, 2024
43c90c0
Small flex fix (#374)
seeker25 Sep 11, 2024
d640dc7
handle empty dict (#375)
bolyachevets Oct 21, 2024
7a57e1e
Replace BC Registries and Online Services to Service BC Connect (#377)
sameer0422 Feb 4, 2025
d3b4492
Fix linting issue
seeker25 Feb 4, 2025
0c501fb
fix lint
seeker25 Feb 4, 2025
b2b7abb
Bump elliptic from 6.5.4 to 6.6.1 in /vue/sbc-common-components (#378)
dependabot[bot] Feb 15, 2025
c3da5ee
SBC-Common-Components V3 - Upgrade keycloak library (#381)
seeker25 Feb 26, 2025
edc8e7e
26031 - Remove Vuex/Vuex-module-decorator and Add Pinia (#380)
Jxio Mar 11, 2025
5570da9
26030 Bug fix - Login error (#385)
Jxio Mar 11, 2025
703460c
26845 - Convert SbcAuthMenu.vue, SbcSignin.vue to composition-api (#386)
Jxio Mar 27, 2025
1ef6451
Add in account-data-loaded event in sbc-header
seeker25 Apr 9, 2025
dd34fe9
27075-account-queue-messages
ochiu May 6, 2025
11c0799
Merge pull request #389 from bcgov/27075
ochiu May 6, 2025
7846a52
update the footer and package version (#390)
phungchithanh May 8, 2025
2889cc4
Conditionally show pricelist (#392)
seeker25 May 12, 2025
d280cd1
Add interceptor for gateway (optional) (#393)
seeker25 May 12, 2025
468e50b
31568 - remove release notes link from footer (#394)
hfekete Dec 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches: master
paths:
- '**package.json'
workflow_dispatch:

jobs:
build:
Expand All @@ -13,10 +14,10 @@ jobs:

strategy:
matrix:
node-version: [16.14.2]
node-version: [20.5.1]

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
Expand Down
29 changes: 12 additions & 17 deletions .github/workflows/vue-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
pull_request:
branches:
- master
- 4.0.0-vue3
paths:
- "vue/sbc-common-components/**"

Expand All @@ -14,24 +15,24 @@

jobs:
setup-job:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04

if: github.repository == 'bcgov/sbc-common-components'

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: "true"

linting:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
needs: setup-job
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04

strategy:
matrix:
node-version: [16.14.2]
node-version: [20.5.1]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
Expand All @@ -45,14 +46,14 @@

testing-coverage:
needs: setup-job
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04

strategy:
matrix:
node-version: [16.14.2]
node-version: [20.5.1]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
Expand All @@ -64,23 +65,17 @@
id: test
run: |
make test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
flags: sbccommoncomponentsweb
name: codecov-vue
fail_ci_if_error: true

build-check:
needs: setup-job
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04

strategy:
matrix:
node-version: [16.14.2]
node-version: [20.5.1]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion python/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Flask-OpenTracing
Flask-OpenTracing==1.1.0
Flask-SQLAlchemy
Flask
Jinja2
Expand Down
4 changes: 2 additions & 2 deletions python/requirements/prod.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
flask
Flask-SQLAlchemy
flask-jwt-oidc>=0.1.5
Flask-OpenTracing
jaeger-client
Flask-OpenTracing==1.1.0
jaeger-client
14 changes: 14 additions & 0 deletions python/src/sbc_common_components/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright © 2019 Province of British Columbia
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# 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.
"""This module holds general utility functions and helpers for the main package."""
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from werkzeug.exceptions import HTTPException, default_exceptions
import logging
logger = logging.getLogger('api-exceptions')
http_logger = logging.getLogger('api-exceptions-http')

RESPONSE_HEADERS = {'Content-Type': 'application/json', 'Access-Control-Allow-Origin': '*'}

Expand All @@ -31,7 +32,7 @@ def __init__(self, app=None):

def auth_handler(self, error): # pylint: disable=no-self-use
"""Handle AuthError."""
logger.error(error.error)
http_logger.error(error.error)
return error.error, error.status_code, RESPONSE_HEADERS

def db_handler(self, error): # pylint: disable=no-self-use
Expand All @@ -46,7 +47,7 @@ def db_handler(self, error): # pylint: disable=no-self-use
def std_handler(self, error): # pylint: disable=no-self-use
"""Handle standard exception."""
if isinstance(error, HTTPException):
logger.error(error)
http_logger.error(error)
message = dict(message=error.message if hasattr(error, 'message') else error.description)
else:
logger.exception(error)
Expand Down
13 changes: 11 additions & 2 deletions python/src/sbc_common_components/utils/camel_case_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,18 @@ def camelcase(string):
])


def camelcase_dict(data: Dict[str, any], camel_dict: Dict[str, any]):
def camelcase_dict(data, camel_dict: Dict[str, any]):
"""Iterate through the dict and convert to camel case."""
if data:

if isinstance(data, list):
if not data: # empty array is falsy
return []
return [camelcase_dict(item, {}) for item in data]

if isinstance(data, dict):
if not data: # empty dict is falsy
return {}

for key, value in data.items():
key = camelcase(key)
if isinstance(value, dict):
Expand Down
12 changes: 12 additions & 0 deletions python/src/sbc_common_components/utils/dataclasses.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from dataclasses import asdict, dataclass
from typing import Optional


@dataclass
class PaymentToken:
"""Payment Token payload common interface for LEAR and Names."""

id: Optional[str] = None
status_code: Optional[str] = None
filing_identifier: Optional[str] = None
corp_type_code: Optional[str] = None
67 changes: 67 additions & 0 deletions python/src/sbc_common_components/utils/enums.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
from enum import Enum

class QueueMessageTypes(Enum):
"""Queue MessageTypes."""

# Note some of these need to match inside of SubjectType in account_mailer.enums.

ACTIVITY_LOG = 'bc.registry.auth.activity'
ADMIN_NOTIFICATION = 'bc.registry.auth.adminNotification'
ADMIN_REMOVED = 'bc.registry.auth.adminRemoved'
AFFILIATION_INVITATION = 'bc.registry.auth.affiliationInvitation'
AFFILIATION_INVITATION_REQUEST = 'bc.registry.auth.affiliationInvitationRequest'
AFFILIATION_INVITATION_REQUEST_AUTHORIZATION = 'bc.registry.auth.affiliationInvitationRequestAuthorization'
BUSINESS_AFFILIATED = 'bc.registry.auth.businessAffiliated'
BUSINESS_UNAFFILIATED = 'bc.registry.auth.businessUnaffiliated'
BUSINESS_INVITATION = 'bc.registry.auth.businessInvitation'
BUSINESS_INVITATION_FOR_BCEID = 'bc.registry.auth.businessInvitationForBceid'
CAS_MESSAGE_TYPE = 'bc.registry.payment.casSettlementUploaded'
CGI_ACK_MESSAGE_TYPE = 'bc.registry.payment.cgi.ACKReceived'
CGI_FEEDBACK_MESSAGE_TYPE = 'bc.registry.payment.cgi.FEEDBACKReceived'
CONFIRMATION_PERIOD_OVER = 'bc.registry.payment.confirmationPeriodOver'
DIRSEARCH_BUSINESS_INVITATION = 'bc.registry.auth.dirsearchBusinessInvitation'
EFT_AVAILABLE_NOTIFICATION = 'bc.registry.payment.eftAvailableNotification'
EFT_FILE_UPLOADED = 'bc.registry.payment.eft.fileUploaded'
EFT_INVOICE_CREATED = 'bc.registry.payment.eft.invoiceCreated'
EJV_FAILED = 'bc.registry.payment.ejvFailed'
GOVM_APPROVED_NOTIFICATION = 'bc.registry.auth.govmApprovedNotification'
GOVM_BUSINESS_INVITATION = 'bc.registry.auth.govmBusinessInvitation'
GOVM_MEMBER_INVITATION = 'bc.registry.auth.govmMemberInvitation'
GOVM_REJECTED_NOTIFICATION = 'bc.registry.auth.govmRejectedNotification'
INCORPORATION = 'bc.registry.business.incorporationApplication'
MEMBERSHIP_APPROVED_NOTIFICATION = 'bc.registry.auth.membershipApprovedNotification'
MEMBERSHIP_APPROVED_NOTIFICATION_FOR_BCEID = 'bc.registry.auth.membershipApprovedNotificationForBceid'
NAMES_EVENT = 'bc.registry.names.events'
NAMES_MESSAGE_TYPE = 'bc.registry.names.request'
NON_BCSC_ORG_APPROVED_NOTIFICATION = 'bc.registry.auth.nonbcscOrgApprovedNotification'
NON_BCSC_ORG_REJECTED_NOTIFICATION = 'bc.registry.auth.nonbcscOrgRejectedNotification'
NSF_LOCK_ACCOUNT = 'bc.registry.payment.lockAccount'
NSF_UNLOCK_ACCOUNT = 'bc.registry.payment.unlockAccount'
ONLINE_BANKING_OVER_PAYMENT = 'bc.registry.payment.OverPaid'
ONLINE_BANKING_PAYMENT = 'bc.registry.payment.Payment'
ONLINE_BANKING_UNDER_PAYMENT = 'bc.registry.payment.UnderPaid'
OTP_AUTHENTICATOR_RESET_NOTIFICATION = 'bc.registry.auth.otpAuthenticatorResetNotification'
PAD_ACCOUNT_CREATE = 'bc.registry.payment.padAccountCreate'
PAD_INVOICE_CREATED = 'bc.registry.payment.pad.invoiceCreated'
PAD_PAYMENT_SUCCESS = 'bc.registry.payment.PAD.PaymentSuccess'
PAD_SETUP_FAILED = 'bc.registry.payment.PadSetupFailed'
PAYMENT = 'bc.registry.payment'
PAYMENT_DUE_NOTIFICATION = 'bc.registry.payment.statementDueNotification'
PAYMENT_PENDING = 'bc.registry.payment.ob.outstandingInvoice'
PAYMENT_REMINDER_NOTIFICATION = 'bc.registry.payment.statementReminderNotification'
PROD_PACKAGE_APPROVED_NOTIFICATION = 'bc.registry.auth.prodPackageApprovedNotification'
PROD_PACKAGE_REJECTED_NOTIFICATION = 'bc.registry.auth.prodPackageRejectedNotification'
PRODUCT_APPROVED_NOTIFICATION_DETAILED = 'bc.registry.auth.productApprovedNotificationDetailed'
PRODUCT_CONFIRMATION_NOTIFICATION = 'bc.registry.auth.productConfirmationNotification'
PRODUCT_REJECTED_NOTIFICATION_DETAILED = 'bc.registry.auth.productRejectedNotificationDetailed'
REFUND_DRAWDOWN_REQUEST = 'bc.registry.payment.drawdown.refundRequest'
REGISTRATION = 'bc.registry.business.registration'
RESET_PASSCODE = 'bc.registry.auth.resetPasscode'
RESUBMIT_BCEID_ADMIN_NOTIFICATION = 'bc.registry.auth.resubmitBceidAdmin'
RESUBMIT_BCEID_ORG_NOTIFICATION = 'bc.registry.auth.resubmitBceidOrg'
ROLE_CHANGED_NOTIFICATION = 'bc.registry.auth.roleChangedNotification'
STAFF_REVIEW_ACCOUNT = 'bc.registry.auth.staffReviewAccount'
STATEMENT_NOTIFICATION = 'bc.registry.payment.statementNotification'
TEAM_MEMBER_INVITED = 'bc.registry.auth.teamMemberInvited'
TEAM_MEMBER_REMOVED = 'bc.registry.auth.teamMemberRemoved'
TEAM_MODIFIED = 'bc.registry.auth.teamModified'
1 change: 0 additions & 1 deletion vue/sbc-common-components/docs/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ module.exports = {
'/Layout/',
'/FeeCalculator/',
'/AuthenticationOptions/',
'/BaseAddress/',
'/KeycloakService/',
'/TokenService(Deprecated)/',
'/Signin/',
Expand Down
21 changes: 0 additions & 21 deletions vue/sbc-common-components/docs/BaseAddress/README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,3 @@
# Base Address

This is a stand alone address display / entry component.

The `BaseAddress` component has these properties:

- `address`: a JavaScript `object` that contains the existing address information. Can be undefined.
- `editing`: a `boolean` that is true if the component is to display the address in editing mode, or false if the
address is displayed as static text.
- `schema`: a JavaScript `object` that contains Vuelidate rules (ie, schema).

The `BaseAddress` component emits these events:

- `valid`: a `boolean` that is true if the address passes the validation tests, or false otherwise. This event will be
emitted when the component is first created, and every time the address is changed.
- `modified`: a `boolean` that is true if the address has been modified from its original value, or false otherwise.
In the case where the address is changed from its original value and then changed back to its original value, the final
event will be false.
- `update:address`: a JavaScript `object` containing the address. This will be emitted every time the address is
changed. The parent can use the `.sync` modifier to update its version of the `address` property.


### Prerequisites

Expand Down
11 changes: 6 additions & 5 deletions vue/sbc-common-components/docs/KeycloakService/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ It has two optional arguments:

| Argument | Type | Description |
| --- | --- | --- |
| **store** | vuex store | optional argument to pass the store of the app (default: null)
| **store** | pinia store | optional argument to pass the store of the app (default: null)
| **isScheduleRefresh** | boolean | optional argument to disable/enable scheduled refresh (default: true)


Expand All @@ -37,8 +37,9 @@ It supports two modes for **refreshing the token**
4. Start the timer

```js
if (this.$store.getters['auth/isAuthenticated']) {
await KeyCloakService.initializeToken(this.$store)
const authStore = useAuthStore()
if (authStore.isAuthenticated) {
await KeyCloakService.initializeToken()
}

```
Expand All @@ -53,7 +54,7 @@ It supports two modes for **refreshing the token**
`import KeyCloakService from 'sbc-common-components/src/services/keycloak.services'`

```js
KeyCloakService.initializeToken(this.$store, false).then(function (token) {
KeyCloakService.initializeToken(false).then(function (token) {
originalRequest.headers['Authorization'] = `Bearer ${token}`
return axios(originalRequest)
}).catch(error => {
Expand Down Expand Up @@ -89,4 +90,4 @@ This function will verify whether the current logged in keycloak token has the a
KeyCloakService.verifyRoles(['admin', 'coordinator'], ['basic_user'])
```

here, the function will return true if the logged in KC token has roles `admin` or `cooordinator` and return false if it has `basic_user`
here, the function will return true if the logged in KC token has roles `admin` or `cooordinator` and return false if it has `basic_user`
19 changes: 19 additions & 0 deletions vue/sbc-common-components/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>sbc-common-components</title>
</head>
<body>
<noscript>
<strong>
We're sorry but sbc-common-components doesn't work properly
without JavaScript enabled. Please enable it to continue.
</strong>
</noscript>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
37 changes: 0 additions & 37 deletions vue/sbc-common-components/jest.config.js

This file was deleted.

Loading
Loading