|
1 | | -# Clone mercurial repository. |
| 1 | +# Development Setup |
| 2 | + |
| 3 | +### Clone mercurial repository. |
| 4 | +```shell |
2 | 5 | hg clone http://hg.code.sf.net/p/roundup/code roundup |
| 6 | +``` |
3 | 7 |
|
4 | | -# Navigate to roundup, then git clone tracker only repo. |
| 8 | +### Make python virtual env and activate it |
| 9 | +```shell |
5 | 10 | cd roundup |
| 11 | +python -m venv . |
| 12 | +``` |
| 13 | +#### For linux and mac |
| 14 | +```shell |
| 15 | +source bin/activate |
| 16 | +``` |
| 17 | +#### For windows powershell |
| 18 | +```shell |
| 19 | +.\scripts\Activate.ps1 |
| 20 | +``` |
| 21 | + |
| 22 | +### Install roundup |
| 23 | +```shell |
| 24 | +python -m pip install . |
| 25 | +``` |
| 26 | + |
| 27 | +### Clone tracker only repo. |
| 28 | +```shell |
6 | 29 | git clone https://github.com/UMB-CS-682-Team-03/tracker.git |
| 30 | +``` |
7 | 31 |
|
8 | | -# Init the demo tracker |
9 | | -python3 demo.py -b sqlite |
| 32 | +### Init the demo tracker with default ./demo |
| 33 | +```shell |
| 34 | +roundup-demo -b sqlite |
| 35 | +``` |
10 | 36 |
|
11 | | -# Move the files from tracker dir to demo dir |
| 37 | +### Move the files from tracker dir to demo dir |
| 38 | +#### For linux and mac |
| 39 | +```shell |
12 | 40 | cp -r ./tracker/**/* ./demo |
13 | 41 | cp -r ./tracker/.git ./tracker/.gitignore ./demo |
| 42 | +``` |
| 43 | +#### For windows powershell |
| 44 | +```shell |
| 45 | +xcopy .\tracker .\demo /s #say yes to all |
| 46 | +``` |
14 | 47 |
|
15 | | -# Delete the tracker dir |
16 | | -rm -rf ./tracker |
17 | | - |
18 | | -# Now you are setup open the roundup folder in VScode. |
19 | | -# Any new changes are only to be done in demo dir |
20 | | -# git is initialised to track origin in demo dir |
| 48 | +1. Now you are done setting up developing environment. |
| 49 | +2. Open the roundup folder in VScode. |
| 50 | +3. Any new changes are only to be done in demo directory. |
| 51 | +4. git is initialized to track origin in demo directory (for windows check if .git folder is copied to the demo) |
21 | 52 |
|
22 | 53 | # Roundup - Classhelper |
23 | 54 | ## `<roundup-classhelper>` |
@@ -75,81 +106,87 @@ In addition to keyboard navigation, the `<roundup-classhelper>` component can be |
75 | 106 |
|
76 | 107 | * If present, users can click on the submit button or any other controls in this section to trigger the submission or update action. |
77 | 108 |
|
78 | | -### Admin guide for deploying roundup-classhelper to an existing tracker |
| 109 | +## Guide for using/deploying roundup-classhelper in a tracker |
79 | 110 | #### Which tag to use and where to place it. |
80 | 111 | * To customise your own classhelper you can introduce of the `<roundup-classhelper>` web component. |
81 | 112 |
|
82 | | - * Locate the appropriate template files (e.g., issue.html) where you want to use the <roundup-classhelper>. |
| 113 | + * Locate the appropriate template files (e.g., issue.html) where you want to use the `<roundup-classhelper>`. |
83 | 114 |
|
84 | | - * Wrap the existing ClassHelper link with the <roundup-classhelper> tag. |
| 115 | + * Wrap the existing ClassHelper link with the `<roundup-classhelper>` tag. |
85 | 116 | ##### Before the code would look like this. |
86 | 117 | ```html |
87 | 118 | <th i18n:translate="">Nosy List</th> |
88 | | - <td> |
89 | | - <span tal:replace="structure context/nosy/field" /> |
90 | | - <span tal:condition="context/is_edit_ok" tal:replace="structure |
91 | | - python:db.user.classhelp('username,realname,address', property='nosy', width='600')" /> |
92 | | -<br> |
93 | | - </td> |
| 119 | +<td> |
| 120 | +<span tal:replace="structure context/nosy/field" /> |
| 121 | +<span tal:condition="context/is_edit_ok" tal:replace="structure |
| 122 | + python:db.user.classhelp('username,realname,address', property='nosy', width='600'" /> |
| 123 | +</td> |
94 | 124 | ``` |
95 | 125 |
|
96 | 126 | ##### After adding the `<roundup-classhelper>`, it should look like this. |
97 | 127 | ```html |
98 | 128 | <th i18n:translate="">Nosy List</th> |
99 | | - <td> |
100 | | - <span tal:replace="structure context/nosy/field" /> |
101 | | - <roundup-classhelper data-search-with="username,phone,roles[]"> |
102 | | - <span tal:condition="context/is_edit_ok" tal:replace="structure |
103 | | - python:db.user.classhelp('username,realname,address', property='nosy', width='600')" /> |
104 | | - </roundup-classhelper> |
105 | | -<br> |
106 | | - </td> |
| 129 | +<td> |
| 130 | +<span tal:replace="structure context/nosy/field" /> |
| 131 | +<roundup-classhelper data-popup-title="Nosy List Classhelper - {itemDesignator}" data-search-with="username,phone,roles[]"> |
| 132 | + <span tal:condition="context/is_edit_ok" tal:replace="structure python:db.user.classhelp('username,realname,address', property='nosy', width='600')" /> |
| 133 | +</roundup-classhelper> |
| 134 | +</td> |
107 | 135 | ``` |
108 | 136 |
|
109 | | - #### Setting Attributes |
110 | | - * Set the `data-search-with` attribute to specify the fields that can be used for searching (e.g., `data-search-with="title,status,keyword"`). |
| 137 | +### Setting Attributes on `</roundup-classhelper>` |
| 138 | + |
| 139 | +#### Setting the `data-popup-title` attribute is optional. |
| 140 | + |
| 141 | +* Adding `data-popup-title` changes the title of the popup window with the value of the attribute. |
| 142 | +* `{itemDesignator}` can be used inside the attribute value to replace it with the current classhelper usage context. |
| 143 | +* eg. `data-popup-title="Nosy List Classhelper - {itemDesginator}"` will have the popup window title `Nosy List Classhelper - users` |
| 144 | + |
| 145 | +#### Setting the `data-search-with` attribute is optional. |
| 146 | + |
| 147 | +* Adding `data-search-with` specifies the fields that can be used for searching (e.g., `data-search-with="title,status,keyword"`). |
111 | 148 |
|
112 | | - * Optionally, customize the search parameters using the following syntax: |
113 | | - * `"status[]"`: Displays a dropdown for the "status" field, showing all possible values. |
| 149 | +* Optionally, customize the search parameters using the following syntax: |
| 150 | + * `"status[]"`: Displays a dropdown for the "status" field, showing all possible values. |
114 | 151 | ```html |
115 | 152 | <roundup-classhelper data-search-with="title,status[], keyword[]"> |
116 | 153 | <span tal:condition="context/is_edit_ok" tal:replace="structure python:db.issue.classhelp('id,title', property='superseder', pagesize=100)" /> |
117 | 154 | </roundup-classhelper> |
118 | 155 | ``` |
119 | | - * `"keyword[]+name"`: Sorts the "keyword" dropdown in ascending order by name. |
| 156 | + * `"keyword[]+name"`: Sorts the "keyword" dropdown in ascending order by name. |
120 | 157 | ```html |
121 | 158 | <roundup-classhelper data-search-with="title,status[],keyword[]+name"> |
122 | 159 | <span tal:condition="context/is_edit_ok" tal:replace="structure python:db.issue.classhelp('id,title', property='superseder', pagesize=100)" /> |
123 | 160 | </roundup-classhelper> |
124 | 161 | ``` |
125 | | - * `"keyword[]-name"`: Sorts the "keyword" dropdown in descending order by name. |
| 162 | + * `"keyword[]-name"`: Sorts the "keyword" dropdown in descending order by name. |
126 | 163 | ```html |
127 | 164 | <roundup-classhelper data-search-with="title,status[],keyword[]-name"> |
128 | 165 | <span tal:condition="context/is_edit_ok" tal:replace="structure python:db.issue.classhelp('id,title', property='superseder', pagesize=100)" /> |
129 | 166 | </roundup-classhelper> |
130 | 167 | ``` |
131 | 168 | * If the `roles` field cannot be displayed as a dropdown, it will be treated as a text-only match. |
132 | 169 |
|
133 | | - #### User ClassHelper |
| 170 | +### User ClassHelper |
134 | 171 | * To emulate the normal user ClassHelper behavior (e.g., for username and roles), use the following attribute values: |
135 | 172 | ``` html |
136 | 173 | <roundup-classhelper data-search-with="username,roles[]"> |
137 | 174 | <!-- ClassHelper content --> |
138 | 175 | </roundup-classhelper> |
139 | 176 | ``` |
140 | 177 |
|
141 | | - #### Fallback Mechanism |
142 | | - If the user's browser doesn't support web components, the `<roundup-classhelper>` will automatically fall back to the existing ClassHelper link. |
| 178 | +### Fallback Mechanism |
| 179 | + If the user's browser doesn't support web components, the `<roundup-classhelper>` will automatically fall back to use ClassHelper link. |
143 | 180 |
|
144 | 181 | <img src="./doc-assets/image-5.png" alt="Image Title" width="40%"> |
145 | 182 |
|
146 | | - #### Error Handling |
147 | | - * In case of errors, the component will display relevant messages to the user.(component will notify the user) |
| 183 | +### Error Handling |
| 184 | + * In case of errors, the component will use the fallback to use ClassHelper link while alerting the user. |
148 | 185 | * For further debugging, users can open the browser console and inspect the results. |
149 | 186 |
|
150 | 187 |
|
151 | 188 |
|
152 | | - #### Refreshing `classhelper.css` |
| 189 | +### Refreshing `classhelper.css` |
153 | 190 | In case of issues with the `<roundup-classhelper>` component, you can try refreshing the `classhelper.css` file by following these steps: |
154 | 191 | * Open your Roundup issue tracker in a web browser. |
155 | 192 | * 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` |
|
0 commit comments