Skip to content

Commit 43e9c7c

Browse files
committed
docs: Updated the documentation with Admin guide for deploying roundup-classhelper for Issue #25
1 parent 1c82e12 commit 43e9c7c

File tree

7 files changed

+137
-2
lines changed

7 files changed

+137
-2
lines changed

README.md

Lines changed: 137 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,141 @@ rm -rf ./tracker
1919
# Any new changes are only to be done in demo dir
2020
# git is initialised to track origin in demo dir
2121

22+
# Roundup - Classhelper
23+
## `<roundup-classhelper>`
24+
## Why there is need of `<roundup-classhelper>` in the issue tracker?
25+
* The existing ClassHelper implementation in Roundup Issue Tracker uses outdated HTML framesets, which have accessibility limitations, lack advanced features like search and sorting, are difficult to customize, and harder to maintain with modern web development practices.
26+
* The `<roundup-classhelper>`, which is a web component, addresses these shortcomings by providing a modern, accessible, and flexible solution implemented as a web component. It offers improved accessibility, an enhanced user experience with advanced features, easy customization, better maintainability, and a fallback mechanism for browsers that don't support web components.
27+
* Overall, the `<roundup-classhelper>` modernizes and enhances the ClassHelper feature, making it more accessible, user-friendly, and maintainable, while laying the foundation for further improvements and integration with other Roundup features.
28+
29+
## What is classhelper comprised of?
30+
There are three main parts of the roundup-classhelper component:
31+
32+
* **Search Section (optional)**: This section allows users to search for items based on specified fields. For example, users can search for issues by title, status, or keywords. The search section is optional and may not be present in some configurations.
33+
<img src="/roundup/demo/doc-assets/image-1.png" alt="Image Title" width="60%">
34+
35+
* **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.
36+
37+
<img src="/roundup/demo/doc-assets/image-3.png" alt="Image Title" width="60%">
38+
39+
* **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.
40+
<img src="/roundup/demo/doc-assets/image-4.png" alt="Image Title" width="60%">
41+
42+
The presence and behavior of these sections can vary depending on the configuration and intended use case of the `<roundup-classhelper>` component. For example, in some scenarios, the Search Section may not be necessary.
43+
44+
## How can you use it?
45+
### Keyboard Usage
46+
The `<roundup-classhelper>` is designed to be fully accessible and navigable using only the keyboard. The tab order and key bindings are as follows:
47+
* **Tab Order**: Users can navigate between the different sections (Search, Select/Info Table, Accumulator/Submit) using the Tab key. The order of focus will be determined by the DOM structure of the component.
48+
49+
* **Search Section**: If present, users can type their search query directly into the search input field using the keyboard.
50+
51+
* **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+
56+
57+
58+
### Mouse Usage
59+
In addition to keyboard navigation, the `<roundup-classhelper>` component can be used with a mouse or other pointing device:
60+
61+
* **Search Section**: Users can click inside the search input field and type their query.
62+
63+
64+
* **Select/Info Table Section**:
65+
66+
* Users can click on a table row to select/deselect an item.
67+
* If pagination controls are present, users can click on the appropriate links or buttons to navigate to the next or previous page.
68+
69+
* **Accumulator/Submit Section**:
70+
71+
* If present, users can click on the submit button or any other controls in this section to trigger the submission or update action.
72+
73+
### Admin guide for deploying roundup-classhelper to an existing tracker
74+
#### Which tag to use and where to place it.
75+
* To customise your own classhelper you can introduce of the `<roundup-classhelper>` web component.
76+
77+
* Locate the appropriate template files (e.g., issue.html) where you want to use the <roundup-classhelper>.
78+
79+
* Wrap the existing ClassHelper link with the <roundup-classhelper> tag.
80+
##### Before the code would look like this.
81+
```html
82+
<th i18n:translate="">Nosy List</th>
83+
<td>
84+
<span tal:replace="structure context/nosy/field" />
85+
<span tal:condition="context/is_edit_ok" tal:replace="structure
86+
python:db.user.classhelp('username,realname,address', property='nosy', width='600')" />
87+
<br>
88+
</td>
89+
```
90+
91+
##### After adding the `<roundup-classhelper>`, it should look like this.
92+
```html
93+
<th i18n:translate="">Nosy List</th>
94+
<td>
95+
<span tal:replace="structure context/nosy/field" />
96+
<roundup-classhelper searchWith="username,phone,roles[]">
97+
<span tal:condition="context/is_edit_ok" tal:replace="structure
98+
python:db.user.classhelp('username,realname,address', property='nosy', width='600')" />
99+
</roundup-classhelper>
100+
<br>
101+
</td>
102+
```
103+
104+
#### Setting Attributes
105+
* Set the `searchWith` attribute to specify the fields that can be used for searching (e.g., `searchWith="title,status,keyword"`).
106+
107+
* Optionally, customize the search parameters using the following syntax:
108+
* `"status[]"`: Displays a dropdown for the "status" field, showing all possible values.
109+
```html
110+
<roundup-classhelper searchWith="title,status[], keyword[]">
111+
<span tal:condition="context/is_edit_ok" tal:replace="structure python:db.issue.classhelp('id,title', property='superseder', pagesize=100)" />
112+
</roundup-classhelper>
113+
```
114+
* `"keyword[]+name"`: Sorts the "keyword" dropdown in ascending order by name.
115+
```html
116+
<roundup-classhelper searchWith="title,status[],keyword[]+name">
117+
<span tal:condition="context/is_edit_ok" tal:replace="structure python:db.issue.classhelp('id,title', property='superseder', pagesize=100)" />
118+
</roundup-classhelper>
119+
```
120+
* `"keyword[]-name"`: Sorts the "keyword" dropdown in descending order by name.
121+
```html
122+
<roundup-classhelper searchWith="title,status[],keyword[]-name">
123+
<span tal:condition="context/is_edit_ok" tal:replace="structure python:db.issue.classhelp('id,title', property='superseder', pagesize=100)" />
124+
</roundup-classhelper>
125+
```
126+
* If the `roles` field cannot be displayed as a dropdown, it will be treated as a text-only match.
127+
128+
#### User ClassHelper
129+
* To emulate the normal user ClassHelper behavior (e.g., for username and roles), use the following attribute values:
130+
``` html
131+
<roundup-classhelper searchWith="username,roles[]">
132+
<!-- ClassHelper content -->
133+
</roundup-classhelper>
134+
```
135+
136+
#### Fallback Mechanism
137+
If the user's browser doesn't support web components, the `<roundup-classhelper>` will automatically fall back to the existing ClassHelper link.
138+
139+
<img src="/roundup/demo/doc-assets/image-5.png" alt="Image Title" width="40%">
140+
141+
#### Error Handling
142+
* In case of errors, the component will display relevant messages to the user.(component will notify the user)
143+
* For further debugging, users can open the browser console and inspect the results.
144+
145+
# Roles - Interfaces.py
146+
147+
#### 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.
151+
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.
153+
154+
155+
156+
22157
# Running the Test Suite
23158
```
24159
# Requirements
@@ -28,7 +163,7 @@ rm -rf ./tracker
28163

29164
# Installation Instructions
30165
1. **Selenium and Splinter Installation**: Open your terminal or command prompt and run:
31-
python -m pip install splinter==0.21.0
166+
python -m pip install splinter==0.eeeeeeeeeeeeeeee21.0
32167
python -m pip install selenium==4.18.1
33168

34169
2. ** GeckoDriver Installation**:
@@ -37,4 +172,4 @@ rm -rf ./tracker
37172
# Run the test_suite
38173

39174
python test_classhelper.py
40-
```
175+
```

doc-assets/image-1.png

6.55 KB
Loading

doc-assets/image-2.png

45.4 KB
Loading

doc-assets/image-3.png

45.7 KB
Loading

doc-assets/image-4.png

3.64 KB
Loading

doc-assets/image-5.png

42.8 KB
Loading

doc-assets/image.png

6.44 KB
Loading

0 commit comments

Comments
 (0)