Skip to content

Commit 2b7cf69

Browse files
Merge branch 'main' into PSL-BUG-7014
2 parents 243783d + cb02ff7 commit 2b7cf69

29 files changed

+281
-40
lines changed

.github/workflows/codeql.yml

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL Advanced"
13+
14+
on:
15+
push:
16+
branches: [ "main" ]
17+
pull_request:
18+
branches: [ "main" ]
19+
schedule:
20+
- cron: '22 13 * * 0'
21+
22+
jobs:
23+
analyze:
24+
name: Analyze (${{ matrix.language }})
25+
# Runner size impacts CodeQL analysis time. To learn more, please see:
26+
# - https://gh.io/recommended-hardware-resources-for-running-codeql
27+
# - https://gh.io/supported-runners-and-hardware-resources
28+
# - https://gh.io/using-larger-runners (GitHub.com only)
29+
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
30+
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
31+
permissions:
32+
# required for all workflows
33+
security-events: write
34+
35+
# required to fetch internal or private CodeQL packs
36+
packages: read
37+
38+
# only required for workflows in private repositories
39+
actions: read
40+
contents: read
41+
42+
strategy:
43+
fail-fast: false
44+
matrix:
45+
include:
46+
- language: javascript-typescript
47+
build-mode: none
48+
- language: python
49+
build-mode: none
50+
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
51+
# Use `c-cpp` to analyze code written in C, C++ or both
52+
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
53+
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
54+
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
55+
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
56+
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
57+
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
58+
steps:
59+
- name: Checkout repository
60+
uses: actions/checkout@v4
61+
62+
# Initializes the CodeQL tools for scanning.
63+
- name: Initialize CodeQL
64+
uses: github/codeql-action/init@v3
65+
with:
66+
languages: ${{ matrix.language }}
67+
build-mode: ${{ matrix.build-mode }}
68+
# If you wish to specify custom queries, you can do so here or in a config file.
69+
# By default, queries listed here will override any specified in a config file.
70+
# Prefix the list here with "+" to use these queries and those in the config file.
71+
72+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
73+
# queries: security-extended,security-and-quality
74+
75+
# If the analyze step fails for one of the languages you are analyzing with
76+
# "We were unable to automatically build your code", modify the matrix above
77+
# to set the build mode to "manual" for that language. Then modify this step
78+
# to build your code.
79+
# ℹ️ Command-line programs to run using the OS shell.
80+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
81+
- if: matrix.build-mode == 'manual'
82+
shell: bash
83+
run: |
84+
echo 'If you are using a "manual" build mode for one or more of the' \
85+
'languages you are analyzing, replace this with the commands to build' \
86+
'your code, for example:'
87+
echo ' make bootstrap'
88+
echo ' make release'
89+
exit 1
90+
91+
- name: Perform CodeQL Analysis
92+
uses: github/codeql-action/analyze@v3
93+
with:
94+
category: "/language:${{matrix.language}}"

.github/workflows/eslint.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
# ESLint is a tool for identifying and reporting on patterns
6+
# found in ECMAScript/JavaScript code.
7+
# More details at https://github.com/eslint/eslint
8+
# and https://eslint.org
9+
10+
name: ESLint
11+
12+
on:
13+
push:
14+
branches: [ "main" ]
15+
pull_request:
16+
# The branches below must be a subset of the branches above
17+
branches: [ "main" ]
18+
schedule:
19+
- cron: '43 7 * * 5'
20+
21+
jobs:
22+
eslint:
23+
name: Run eslint scanning
24+
runs-on: ubuntu-latest
25+
permissions:
26+
contents: read
27+
security-events: write
28+
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
29+
steps:
30+
- name: Checkout code
31+
uses: actions/checkout@v4
32+
33+
- name: Install ESLint
34+
run: |
35+
npm install [email protected]
36+
npm install @microsoft/[email protected]
37+
38+
- name: Run ESLint
39+
env:
40+
SARIF_ESLINT_IGNORE_SUPPRESSED: "true"
41+
run: npx eslint .
42+
--config .eslintrc.js
43+
--ext .js,.jsx,.ts,.tsx
44+
--format @microsoft/eslint-formatter-sarif
45+
--output-file eslint-results.sarif
46+
continue-on-error: true
47+
48+
- name: Upload analysis results to GitHub
49+
uses: github/codeql-action/upload-sarif@v3
50+
with:
51+
sarif_file: eslint-results.sarif
52+
wait-for-processing: true

.github/workflows/pylint.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Pylint
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
python-version: ["3.8", "3.9", "3.10"]
11+
steps:
12+
- uses: actions/checkout@v4
13+
- name: Set up Python ${{ matrix.python-version }}
14+
uses: actions/setup-python@v3
15+
with:
16+
python-version: ${{ matrix.python-version }}
17+
- name: Install dependencies
18+
run: |
19+
python -m pip install --upgrade pip
20+
pip install pylint
21+
- name: Analysing the code with pylint
22+
run: |
23+
pylint $(git ls-files '*.py')

ClientAdvisor/App/app.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -970,7 +970,8 @@ async def stream_chat_request(request_body, request_headers):
970970
if client_id is None:
971971
return jsonify({"error": "No client ID provided"}), 400
972972
query = request_body.get("messages")[-1].get("content")
973-
973+
query = query.strip()
974+
974975
async def generate():
975976
deltaText = ''
976977
#async for completionChunk in response:
@@ -1549,12 +1550,12 @@ def get_users():
15491550
ClientSummary,
15501551
CAST(LastMeeting AS DATE) AS LastMeetingDate,
15511552
FORMAT(CAST(LastMeeting AS DATE), 'dddd MMMM d, yyyy') AS LastMeetingDateFormatted,
1552-
      FORMAT(LastMeeting, 'hh:mm tt') AS LastMeetingStartTime,
1553-
FORMAT(LastMeetingEnd, 'hh:mm tt') AS LastMeetingEndTime,
1553+
       FORMAT(LastMeeting, 'HH:mm ') AS LastMeetingStartTime,
1554+
FORMAT(LastMeetingEnd, 'HH:mm') AS LastMeetingEndTime,
15541555
CAST(NextMeeting AS DATE) AS NextMeetingDate,
15551556
FORMAT(CAST(NextMeeting AS DATE), 'dddd MMMM d, yyyy') AS NextMeetingFormatted,
1556-
FORMAT(NextMeeting, 'hh:mm tt') AS NextMeetingStartTime,
1557-
FORMAT(NextMeetingEnd, 'hh:mm tt') AS NextMeetingEndTime
1557+
FORMAT(NextMeeting, 'HH:mm') AS NextMeetingStartTime,
1558+
FORMAT(NextMeetingEnd, 'HH:mm') AS NextMeetingEndTime
15581559
FROM (
15591560
SELECT ca.ClientId, Client, Email, AssetValue, ClientSummary, LastMeeting, LastMeetingEnd, NextMeeting, NextMeetingEnd
15601561
FROM (
@@ -1641,4 +1642,4 @@ def get_users():
16411642
if conn:
16421643
conn.close()
16431644

1644-
app = create_app()
1645+
app = create_app()

ClientAdvisor/App/frontend/src/components/Cards/Cards.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
}
4040

4141
.userCardContainer.selected {
42-
background-color: #0078D7;
42+
background-color: #0F6CBD;
4343
color: white;
4444
box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.14), 0px 0px 2px 0px rgba(0, 0, 0, 0.12);
4545
}

ClientAdvisor/App/frontend/src/components/Cards/Cards.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@ const Cards: React.FC<CardsProps> = ({ onCardClick }) => {
1717
const [selectedClientId, setSelectedClientId] = useState<string | null>(null);
1818
const [loadingUsers, setLoadingUsers] = useState<boolean>(true);
1919

20+
21+
useEffect(() => {
22+
if(selectedClientId != null && appStateContext?.state.clientId == ''){
23+
setSelectedClientId('')
24+
}
25+
},[appStateContext?.state.clientId]);
26+
2027
useEffect(() => {
2128
const fetchUsers = async () => {
2229
try {

ClientAdvisor/App/frontend/src/components/ChatHistory/ChatHistoryPanel.module.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,11 @@
7777
width: 100%;
7878
}
7979
}
80+
81+
@media screen and (-ms-high-contrast: active), (forced-colors: active) {
82+
.container{
83+
border: 2px solid WindowText;
84+
background-color: Window;
85+
color: WindowText;
86+
}
87+
}

ClientAdvisor/App/frontend/src/components/ChatHistory/ChatHistoryPanel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ export function ChatHistoryPanel(_props: ChatHistoryPanelProps) {
111111
<StackItem>
112112
<Text
113113
role="heading"
114-
aria-level={2}
114+
aria-level={3}
115115
style={{
116116
alignSelf: 'center',
117117
fontWeight: '600',

ClientAdvisor/App/frontend/src/components/QuestionInput/QuestionInput.module.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,12 @@
6262
left: 16.5%;
6363
}
6464
}
65+
66+
@media screen and (-ms-high-contrast: active), (forced-colors: active) {
67+
68+
.questionInputContainer{
69+
border: 2px solid WindowText;
70+
background-color: Window;
71+
color: WindowText;
72+
}
73+
}

ClientAdvisor/App/frontend/src/components/UserCard/UserCard.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
}
3030

3131
.selected {
32-
background-color: #0078D7;
32+
background-color: #0F6CBD;
3333
color: white !important;
3434
box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.14), 0px 0px 2px 0px rgba(0, 0, 0, 0.12);
3535
}

0 commit comments

Comments
 (0)