Skip to content

Commit f00ab04

Browse files
committed
Merge branch 'main' into fix_browser_strangeness
2 parents 4c836c5 + 290d310 commit f00ab04

File tree

1 file changed

+46
-11
lines changed

1 file changed

+46
-11
lines changed

README.md

Lines changed: 46 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ There are three main parts of the roundup-classhelper component:
3535
* **Select/Info Table Section**: This section displays the search results or a list of available items. If a search section is present, it will show the items matching the search criteria. If no search section is available, it will display all available items. This section may include pagination controls to navigate through large datasets. Additionally, it may have a checkbox for selecting items if the `<roundup-classhelper>` is associated with a form field. However, if there is no associated form field (i.e., "info mode"), this section will act as an information box without selection capabilities.
3636

3737
<img src="./doc-assets/image-3.png" alt="Image Title" width="60%">
38-
38+
3939
* **Accumulator/Submit Section**: This section shows the items selected by the user from the Select/Info Table Section. It serves as an accumulator, allowing users to review and confirm their selections before submitting or updating the associated form field. If the `<roundup-classhelper>` is in "info mode" (without an associated form field), this section may be absent, as there are no items to accumulate or submit.
4040
<img src="./doc-assets/image-4.png" alt="Image Title" width="60%">
4141

@@ -49,11 +49,16 @@ The `<roundup-classhelper>` is designed to be fully accessible and navigable usi
4949
* **Search Section**: If present, users can type their search query directly into the search input field using the keyboard.
5050

5151
* **Select/Info Table Section**:
52-
* Users can navigate through the list of items using the Up and Down arrow keys.
53-
* To select/deselect an item, users can press the Space key when an item is focused.
54-
* If pagination controls are present, users can navigate to the next or previous page using the appropriate links or buttons, which should be accessible via the Tab key.
55-
52+
* Users can navigate through the list of items using the `Up` and `Down` arrow keys.
53+
* To select/deselect an item, users can press the `Space` key when an item is focused.
54+
* If pagination controls are present, users can navigate to the `next` or `previous` page using the appropriate links or buttons, which should be accessible via the `Tab` key.
55+
* Users can also use the `<` and `>` keys to focus on the `Prev` and `Next` buttons for navigating to the previous and next pages, respectively.
5656

57+
* **Accumulator/Submit Section**:
58+
* Users can navigate to the `Apply` or `Cancel` buttons using the `Tab` key.
59+
* To submit or cancel the selected values, users can press the `Enter` key when the respective button is focused.
60+
* Users can navigate to `Submit` button, by pressing `Shift + Enter` from anywhere.
61+
Enter push makes the thing happen
5762

5863
### Mouse Usage
5964
In addition to keyboard navigation, the `<roundup-classhelper>` component can be used with a mouse or other pointing device:
@@ -142,16 +147,46 @@ In addition to keyboard navigation, the `<roundup-classhelper>` component can be
142147
* In case of errors, the component will display relevant messages to the user.(component will notify the user)
143148
* For further debugging, users can open the browser console and inspect the results.
144149

145-
# Roles - Interfaces.py
150+
146151

147152
#### Refreshing `classhelper.css`
148-
In case of issues with the `<roundup-classhelper>` component, you can try refreshing the classhelper.css file by following these steps:
149-
* Open the `<roundup-classhelper>` popup window.
150-
* Press `Ctrl+Shift+R` (or `Cmd+Shift+R` on Mac) to perform a hard refresh of the page.
153+
In case of issues with the `<roundup-classhelper>` component, you can try refreshing the `classhelper.css` file by following these steps:
154+
* Open your Roundup issue tracker in a web browser.
155+
* In the address bar, append `@@file/classhelper.css` to the end of your Roundup URL. For example, if your Roundup URL is `http://example.com/tracker`, the URL you should visit would be `http://example.com/tracker/@@file/classhelper.css`
156+
* This will open the `classhelper.css` file in your browser.
157+
* To perform a hard refresh of the page, which forces the browser to reload the file and associated resources from the server, press `Ctrl+Shift+R` (on Windows and Linux) or `Cmd+Shift+R` (on macOS).
158+
159+
This will force the browser to reload the classhelper.css file and any other associated resources, potentially resolving any issues caused by cached or outdated files.
160+
161+
## Adding Roles
162+
* If you want to enable the display of roles in the `<roundup-classhelper>` component, you'll need to have an `interfaces.py` file with the following code:
163+
164+
```python
165+
from roundup.rest import Routing, RestfulInstance, _data_decorator
166+
167+
class RestfulInstance:
168+
169+
@Routing.route("/roles", 'GET')
170+
@_data_decorator
171+
def get_roles(self, input):
172+
"""Return all defined roles. The User class property
173+
roles is a string but simulate it as a MultiLink
174+
to an actual Roles class.
175+
"""
176+
return 200, {"collection": [ {"id": rolename, "name": rolename}
177+
for rolename in list(self.db.security.role.keys())]}
178+
```
151179

152-
This will force the browser to reload the classhelper.js file and any other associated resources, potentially resolving any issues caused by cached or outdated files.
180+
By including this code in the `interfaces.py` file, you enable the `<roundup-classhelper>` component to handle roles effectively, allowing users to search, filter, and select roles within the component.
153181

182+
# Installing and Setup
183+
Copy the following files into your Roundup instance `html` directory:
154184

185+
- `classhelper.css` ([[GitHub file link](https://github.com/UMB-CS-682-Team-03/tracker/blob/main/html/classhelper.css)])
186+
- `classhelper.js` ([[GitHub file link](https://github.com/UMB-CS-682-Team-03/tracker/blob/main/html/classhelper.js)])
187+
188+
After copying these files, you can use the `<roundup-classhelper>` component in your Roundup templates.
189+
155190

156191

157192
# Running the Test Suite
@@ -176,6 +211,6 @@ In addition to keyboard navigation, the `<roundup-classhelper>` component can be
176211
Set " HEADLESS = FALSE" in line 12.
177212

178213

179-
### Run the test_suite
214+
### Run the test suite
180215
python test_classhelper.py
181216

0 commit comments

Comments
 (0)