Skip to content

Commit

Permalink
Merge pull request #1342 from Crown-Commercial-Service/p3sprint8
Browse files Browse the repository at this point in the history
P3sprint8 Release to Pre-Production on 11-05-2023
  • Loading branch information
boobalanmurugan-bc authored May 11, 2023
2 parents bd93e24 + 39bf6e5 commit addb485
Show file tree
Hide file tree
Showing 40 changed files with 667 additions and 149 deletions.
24 changes: 24 additions & 0 deletions .github/codeclimate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
version: "2"
checks:
argument-count:
enabled: true
complex-logic:
enabled: true
file-lines:
enabled: false
method-complexity:
enabled: true
config:
threshold: 20
method-count:
enabled: false
method-lines:
enabled: false
nested-control-flow:
enabled: true
return-statements:
enabled: true
similar-code:
enabled: false
identical-code:
enabled: true
64 changes: 64 additions & 0 deletions .github/workflows/secrets-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Git Secrets Scan

on:
schedule:
- cron: "0 0 * * *"
push:
branches: [main, feature/*, p3sprint/*]

jobs:
git-secrets-scan:
name: Git Secrets Scan
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install git secrets
run: sudo apt-get update && sudo apt-get install git-secrets -y

- name: Add custom secrets patterns
run: git secrets --add '(\bBEGIN\b).*(PRIVATE KEY\b)'
&& git secrets --add 'AKIA[0-9A-Z]{16}'
&& git secrets --add '^([A-Za-z0-9/+=]{40,})$'
&& git secrets --add '^ghp_[a-zA-Z0-9]{36}'
&& git secrets --add '^github_pat_[a-zA-Z0-9]{22}_[a-zA-Z0-9]{59}'
&& git secrets --add '^v[0-9]\\.[0-9a-f]{40}'
&& git secrets --add '[A-Za-z0-9+/]{88}=='
&& git secrets --add '[A-Za-z0-9_-]{32}$'
&& git secrets --add 'conclavesso[0-9a-z-]{84}'
&& git secrets --add '\\b[a-z0-9]{80}\\b'
&& git secrets --add '\\b[A-Z0-9]{50}\\b'
&& git secrets --add '\\b[A-Z0-9]{58}\\b'
&& git secrets --add '^[a-zA-Z0-9_-]{32,64}$'

- name: Run git secrets scan
run: |
git secrets --scan
- name: Send email notification
uses:
dawidd6/action-send-mail@v3.1.0
if: always()

with:
server_address: ${{ secrets.SERVER_ADDRESS }}
server_port: ${{ secrets.SERVER_PORT }}
username: ${{ secrets.USER_NAME }}
password: ${{ secrets.PASSWORD }}
subject: Git Secrets Scan Results
to: "ponselvam.sakthivel@brickendon.com"
from: "secops@brickendon.com"
body: |
Hi,
The Git Secrets scan has completed for "${{ github.repository }}". Please review the results below:
Scan Job URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
Scan Status: **${{ job.status }}**
Thank You.
Brickendon SecOps
5 changes: 1 addition & 4 deletions nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ http {
limit_req zone=dm_post_limit burst=5;








Expand Down Expand Up @@ -84,4 +81,4 @@ http {
}

}
}
}
4 changes: 2 additions & 2 deletions src/app/components/govuk-table/govuk-table.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@
</div>
</fieldset>
</td>
<td class="tablular govuk-table__cell" *ngIf="!isHyperLinkVisible">
<a class="tablular" tabindex="0">.</a>
<td class="tablular" *ngIf="!isHyperLinkVisible">
<a class="tablular govuk-table__cell" tabindex="0">.</a>
</td>
</tr>
</tbody>
Expand Down
1 change: 0 additions & 1 deletion src/app/components/govuk-table/govuk-table.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ a {
.role_group_table {
padding: 0px 0px 0px 0 !important;
}

.hide_dots{
display: none;
}
106 changes: 59 additions & 47 deletions src/app/models/organisationGroup.ts
Original file line number Diff line number Diff line change
@@ -1,86 +1,98 @@
export interface Group {
groupId: number;
mfaEnabled: boolean;
groupName: string;
createdDate?: string;
groupId: number;
mfaEnabled: boolean;
groupName: string;
createdDate?: string;
}

export interface GroupList {
organisationId: string;
groupList: Group[]
organisationId: string;
groupList: Group[];
}

export interface OrganisationGroupNameInfo {
groupName?: string;
groupName?: string;
}

export interface OrganisationGroupRequestInfo extends OrganisationGroupNameInfo {
roleInfo?: OrganisationGroupRolePatchInfo,
serviceRoleGroupInfo?: OrganisationGroupRolePatchInfo,
userInfo?: OrganisationGroupUserPatchInfo
export interface OrganisationGroupRequestInfo
extends OrganisationGroupNameInfo {
roleInfo?: OrganisationGroupRolePatchInfo;
serviceRoleGroupInfo?: OrganisationGroupRolePatchInfo;
userInfo?: OrganisationGroupUserPatchInfo;
}


export interface OrganisationGroupRolePatchInfo {
addedRoleIds?: number[],
removedRoleIds?: number[]
addedServiceRoleGroupIds?: number[],
removedServiceRoleGroupIds?: number[]
addedRoleIds?: number[];
removedRoleIds?: number[];
addedServiceRoleGroupIds?: number[];
removedServiceRoleGroupIds?: number[];
}

export interface OrganisationGroupServicePatchInfo {
addedRoleIds: number[],
removedRoleIds: number[]
addedRoleIds: number[];
removedRoleIds: number[];
}

export interface OrganisationGroupUserPatchInfo {
addedUserIds: string[],
removedUserIds: string[]
addedUserIds: string[];
removedUserIds: string[];
}

export interface RoleDetail {
orgTypeEligibility?: number;
description?: string | undefined;
subscriptionTypeEligibility?: number;
tradeEligibility?: number;
enabled?: boolean;
serviceName?: string | null;
isDeleted?: boolean;
orgTypeEligibility?: number;
description?: string | undefined;
subscriptionTypeEligibility?: number;
tradeEligibility?: number;
enabled?: boolean;
serviceName?: string | null;
isDeleted?: boolean;
}

export interface Role extends RoleDetail {
pendingStatus?: boolean;
roleId: number;
roleKey: string;
roleName: string;
pendingStatus?: boolean;
roleId: number;
roleKey: string;
roleName: string;
}

export interface ServiceRoleGroup extends RoleDetail {
id: number;
key: string;
name: string;
id: number;
key: string;
name: string;
}


export interface CheckBoxRoleListGridSource extends Role {
isChecked?: boolean
isDisable?: any

isChecked?: boolean;
isDisable?: any;
}

export interface OrganisationGroupResponseInfo extends Group {
roles: GroupRole[],
users: GroupUser[]
serviceRoleGroups: GroupRole[],
roles: GroupRole[];
users: GroupUser[];
serviceRoleGroups: GroupRole[];
}

export interface GroupRole {
id: number;
name: string;
id: number;
name: string;
}

export interface GroupUser {
userId: string;
name: string;
isAdmin: boolean;
}
userId: string;
name: string;
isAdmin: boolean;
}

export interface pendingApprovalResponce {
currentPage: number;
groupUser: pendingApprovalGroupRole[];
pageCount: number;
rowCount: number;
}

export interface pendingApprovalGroupRole {
isAdmin: boolean;
userPendingRoleStatus: number;
name: string;
userId: string;
}
4 changes: 2 additions & 2 deletions src/app/pages/buyer/details/details.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ <h2 class="govuk-heading-s">Registries</h2>
</tr>
<tr class="govuk-table__row" *ngFor="let row of additionalIdentifiers">
<th scope="row" class="govuk-table__header">{{ getSchemaName(row.scheme) }}</th>
<td class="govuk-table__cell">{{ row.id }}</td>
<td class="govuk-table__cell">{{ getId(row.id, row.scheme) }}</td>
<td class="govuk-table__cell"></td>
</tr>
</tbody>
Expand All @@ -54,4 +54,4 @@ <h2 class="govuk-heading-s">Registries</h2>
<button type="button" class="govuk-button govuk-button--secondary" data-module="govuk-button"
(click)="onCancelClick()">Cancel</button>
</div>
</div>
</div>
26 changes: 21 additions & 5 deletions src/app/pages/buyer/details/details.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,34 @@ export class BuyerDetailsComponent extends BaseComponent implements OnInit {
}

public getSchemaName(schema: string): string {
let selecedScheme = this.schemeData.find(s => s.scheme === schema);
if(selecedScheme?.schemeName) {
return selecedScheme?.schemeName;
}
else if (schema === 'GB-CCS') {
let selecedScheme = this.schemeData.find(s => s.scheme === schema);
if (schema === 'GB-CCS') {
return 'Internal Identifier';
}
else if(selecedScheme?.schemeName) {
return selecedScheme?.schemeName;
}
else {
return '';
}
}

public getId(id:string, schema: string): string {
if (schema === 'GB-PPG') {
return this.convertIdToHyphenId(id);
}
else {
return id;
}
}

public convertIdToHyphenId(id:string): string {
if (id != null) {
return [id.slice(0, 3), '-', id.slice(3,6), '-', id.slice(6,9)].join('')
}
return id;
}

public onContinueClick() {
if(environment.appSetting.hideAutoValidation){
this.router.navigateByUrl(`buyer/confirm/${this.selectedOrgId}`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ <h2 class="govuk-heading-m">Organisation registries</h2>
</tr>
<tr class="govuk-table__row" *ngFor="let row of additionalIdentifiers">
<th scope="row" class="govuk-table__header">{{ getSchemaName(row.scheme) }}</th>
<td class="govuk-table__cell">{{ row.id }}</td>
<td class="govuk-table__cell">{{ getId(row.id, row.scheme) }}</td>
<td class="govuk-table__cell"></td>
</tr>
</tbody>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,16 +236,34 @@ export class ViewPendingVerificationComponent implements OnInit {
}

public getSchemaName(schema: string): string {
let selecedScheme = this.schemeData.find((s) => s.scheme === schema);
if (selecedScheme?.schemeName) {
return selecedScheme?.schemeName;
} else if (schema === 'GB-CCS') {
let selecedScheme = this.schemeData.find(s => s.scheme === schema);
if (schema === 'GB-CCS') {
return 'Internal Identifier';
} else {
}
else if(selecedScheme?.schemeName) {
return selecedScheme?.schemeName;
}
else {
return '';
}
}

public getId(id:string, schema: string): string {
if (schema === 'GB-PPG') {
return this.convertIdToHyphenId(id);
}
else {
return id;
}
}

public convertIdToHyphenId(id:string): string {
if (id != null) {
return [id.slice(0, 3), '-', id.slice(3,6), '-', id.slice(6,9)].join('')
}
return id;
}

getPendingVerificationOrg() {
this.wrapperBuyerAndBothService.getpendingVerificationOrg(
this.organisationId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ <h2 class="govuk-heading-m">Organisation registries</h2>
<tr class="govuk-table__row" *ngFor="let row of additionalIdentifiers">
<th scope="row" class="govuk-table__header">{{ getSchemaName(row.scheme) }}
</th>
<td class="govuk-table__cell">{{ row.id }}</td>
<td class="govuk-table__cell">{{ getId(row.id, row.scheme) }}</td>
<td class="govuk-table__cell"></td>
</tr>
</tbody>
Expand Down Expand Up @@ -125,4 +125,4 @@ <h2 class="govuk-heading-m">Event log</h2>
(click)="nevigateViewEdit()">View / edit organisations’ right to buy status</a></p>
</div>
</div>
</div>
</div>
Loading

0 comments on commit addb485

Please sign in to comment.