Skip to content

Commit e08bbd6

Browse files
Fixing trailing white spaces and english issues
1 parent 60468a7 commit e08bbd6

File tree

2 files changed

+29
-27
lines changed

2 files changed

+29
-27
lines changed

docs/SubjectCriteriaBuilderApllication.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ This application is a Streamlit-based tool for interactively building subject se
3434

3535
### Pre-requisites
3636

37-
Before running the application, you must create a `local.env` file containing your Oracle database credentials.
37+
Before running the application, you must create a `local.env` file containing your Oracle database credentials.<br>
3838
You can generate a template for this file by running:
3939

4040
```bash
@@ -83,14 +83,14 @@ These credentials are required for the application to connect to the Oracle data
8383

8484
### User and Subject Dependencies
8585

86-
Some criteria require additional context, such as a User or Subject object.
86+
Some criteria require additional context, such as a User or Subject object.<br>
8787
If you select a criterion that has a dependency on "User" or "Subject" (as defined in `criteria.json`):
8888

89-
- **User Dependency:**
89+
- **User Dependency:**
9090
- A section will appear allowing you to select a user from the list defined in `users.json`.
9191
- Once selected, the user's name and username are displayed, and a populated user object is created for use in the SQL query.
9292

93-
- **Subject Dependency:**
93+
- **Subject Dependency:**
9494
- A section will appear allowing you to enter a subject's NHS number.
9595
- Once entered, the application will attempt to populate a subject object using this NHS number for use in the SQL query.
9696

@@ -145,16 +145,16 @@ Or, with allowed values and dependencies:
145145
}
146146
```
147147

148-
- **key:** The unique identifier for the criterion (must match the code).
149-
- **value_source:** (Optional) The source of the value, can be left blank. This refers to the class + method used in the subject selection query builder. This is not used by the code but is there to allow easier tracking/mapping.
150-
- **notes:** A clear, user-focused description of what the key is and what the user should input.
151-
- **allowed_values:** (Optional) An array of allowed values for the dropdown selection.
152-
- **dependencies:** (Optional) An array that can include `"User"` and/or `"Subject"`. If present, the app will prompt for a user selection or subject NHS number as needed.
148+
- **`key`:** The unique identifier for the criterion (must match the code).
149+
- **`value_source`:** (Optional) The source of the value, can be left blank. This refers to the class + method used in the subject selection query builder. This is not used by the code but is there to allow easier tracking/mapping.
150+
- **`notes`:** A clear, user-focused description of what the key is and what the user should input.
151+
- **`allowed_values`:** (Optional) An array of allowed values for the dropdown selection.
152+
- **`dependencies`:** (Optional) An array that can include `"User"` and/or `"Subject"`. If present, the app will prompt for a user selection or subject NHS number as needed.
153153

154154
#### To add a new criterion
155155

156156
1. Add a new object to the JSON array with the following fields:
157-
- `"key"`: The Enum member name (must match the code).
157+
- `"key"`: The `Enum` member name (must match the code).
158158
- `"value_source"`: (Optional) The value source, can be left blank.
159159
- `"notes"`: A clear, user-focused description of what the key is and what the user should input.
160160
- `"allowed_values"`: (Optional) An array of allowed values for the dropdown selection.
@@ -175,19 +175,19 @@ Or, with allowed values and dependencies:
175175
#### About the `dependencies` field
176176

177177
- If a criterion requires a User or Subject context, add a `"dependencies"` array to its entry, e.g.:
178-
178+
179179
```json
180180
"dependencies": ["User"]
181181
```
182182

183183
or
184-
184+
185185
```json
186186
"dependencies": ["Subject"]
187187
```
188188

189189
or both:
190-
190+
191191
```json
192192
"dependencies": ["User", "Subject"]
193193
```
@@ -198,7 +198,7 @@ Or, with allowed values and dependencies:
198198

199199
### Adding New Criteria Keys
200200

201-
If you add new keys to the `SubjectSelectionCriteriaKey` Enum in your code, you should also add a corresponding entry in `criteria.json` with a description (`notes`), and (optionally) allowed values and dependencies.
201+
If you add new keys to the `SubjectSelectionCriteriaKey` `Enum` in your code, you should also add a corresponding entry in `criteria.json` with a description (`notes`), and (optionally) allowed values and dependencies.
202202

203203
---
204204

@@ -212,22 +212,22 @@ If you add new keys to the `SubjectSelectionCriteriaKey` Enum in your code, you
212212

213213
### Troubleshooting
214214

215-
- **A key does not appear in the UI:**
216-
Ensure it exists in both the `SubjectSelectionCriteriaKey` Enum and in `criteria.json`.
215+
- **A key does not appear in the UI:**
216+
Ensure it exists in both the `SubjectSelectionCriteriaKey` `Enum` and in `criteria.json`.
217217

218-
- **Dropdown is missing for a key:**
218+
- **Dropdown is missing for a key:**
219219
Add or update the `"allowed_values"` array for that key in `criteria.json`.
220220

221-
- **Descriptions are unclear or missing:**
221+
- **Descriptions are unclear or missing:**
222222
Update the `"notes"` field for the relevant key in `criteria.json`.
223223

224-
- **App does not reload changes:**
225-
Save your changes and refresh the Streamlit app in your browser.
224+
- **App does not reload changes:**
225+
Save your changes and refresh the `Streamlit` app in your browser.
226226

227-
- **Copy to clipboard does not work:**
227+
- **Copy to clipboard does not work:**
228228
Some browsers may not support auto-copy. Manually select and copy the JSON from the code block.
229229

230-
- **Oracle DB errors:**
230+
- **Oracle DB errors:**
231231
Ensure your `local.env` file is present and contains valid values for `ORACLE_USERNAME`, `ORACLE_DB`, and `ORACLE_PASS`.
232232

233233
---
@@ -259,5 +259,5 @@ If you add new keys to the `SubjectSelectionCriteriaKey` Enum in your code, you
259259
- **All configuration is driven by `criteria.json`.**
260260
- **Descriptions, allowed values, and dependencies are fully customizable.**
261261
- **No code changes are needed for most updates—just edit the JSON file.**
262-
- **For new Enum keys, add them to both the `SubjectSelectionCriteriaKey` Enum and the JSON.**
262+
- **For new `Enum` keys, add them to both the `SubjectSelectionCriteriaKey` `Enum` and the JSON.**
263263
- **For criteria that require user or subject context, use the `dependencies` field.**

subject_criteria_builder.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,15 @@ def show_dependency_warnings(dependencies: Optional[list]) -> None:
7575
for dep in dependencies:
7676
if dep == "User":
7777
st.warning(
78-
"""This key may require a populated User object to work in playwright.
79-
If using only the UI, please select a user from the dropdown below."""
78+
"""This key may require a populated User object to work in playwright.
79+
80+
If using only the UI, please select a user from the dropdown below."""
8081
)
8182
elif dep == "Subject":
8283
st.warning(
83-
"""This key may require a populated Subject object to work in playwright.
84-
If using only the UI, please enter an NHS number in the section below."""
84+
"""This key may require a populated Subject object to work in playwright.
85+
86+
If using only the UI, please enter an NHS number in the section below."""
8587
)
8688

8789

0 commit comments

Comments
 (0)