Skip to content

Commit af806ee

Browse files
committed
README updates: Testing, Data Migration
1 parent ca7c716 commit af806ee

File tree

1 file changed

+79
-63
lines changed

1 file changed

+79
-63
lines changed

README.md

Lines changed: 79 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[![Build Status](https://travis-ci.org/tdunn891/milestone-4.svg?branch=master)](https://travis-ci.org/tdunn891/milestone-4)
22

3-
# Milestone Profile 4 - [TrackIt](https://django-issue-tracker-1.herokuapp.com/)
3+
# Milestone Project 4 - [TrackIt](https://django-issue-tracker-1.herokuapp.com/)
44

55
# Contents
66

@@ -16,7 +16,10 @@
1616
- [**Existing Features**](#existing-features)
1717
- [**Potential Future Features**](#potential-future-features)
1818

19-
4. [**Database**](#Database)
19+
4. [**Databases**](#databases)
20+
21+
- [**Data Models**](#data-models)
22+
- [**Data Migration**](#data-migration)
2023

2124
5. [**Technologies**](#technologies)
2225

@@ -25,6 +28,7 @@
2528
- [**Unit Testing**](#unit-testing)
2629
- [**Manual Testing**](#manual-testing)
2730
- [**Code Validation**](#code-validation)
31+
- [**Audit**](#audit)
2832

2933
7. [**Deployment**](#deployment)
3034

@@ -193,6 +197,12 @@ The **Change History** tab allows the user to see a timeline of what has changed
193197

194198
The **Comments** section displayed below the ticket allows anyone to leave a comment, which helps to speed up resolution of the ticket.
195199

200+
### Add Ticket
201+
202+
Basic users can upload up to 10 tickets per month, with a message displaying how many remaining:
203+
204+
![Add Ticket Basic User](static/images/add-ticket-basic-user.png)
205+
196206
### Edit Ticket
197207

198208
The Edit ticket form is accessible by the ticket's Submitter and Staff. Possible edits include reassigning the ticket, upgrading/downgrading its Priority, editing Description, Tags, Summary.
@@ -203,7 +213,11 @@ Dashboard page allows visual interaction with the tickets data across 6 intercon
203213

204214
### KANBAN
205215

206-
Tickets are displayed in KANBAN columns by Status: New, In Progress, Resolved, Cancelled. Given that Cancelled tickets may be unimportant to some users, the 'Hide Cancelled' checkbox
216+
Tickets are displayed in KANBAN columns by Status: New, In Progress, Resolved, Cancelled. Given that Cancelled tickets may be unimportant to some users, the 'Hide Cancelled' checkbox.
217+
218+
If Basic users click the KANBAN navigation link, they are redirected to Checkout page.
219+
220+
![KANBAN Basic User](static/images/kanban-go-pro.png)
207221

208222
### Team
209223

@@ -244,7 +258,7 @@ Users can:
244258
- Dark Mode setting toggle in Account page.
245259
- Allow the Assignee to set an Estimated Resolved Date for each ticket.
246260

247-
# Database
261+
# Databases
248262

249263
Sqlite3 was used during development. For deployment, data tables and data was migrated to a PostgreSQL database.
250264

@@ -323,39 +337,65 @@ OrderLineItem Model
323337
| product | CharField |
324338
| quantity | IntegerField |
325339

340+
## Data Migration
341+
342+
To ensure a rich dataset for assessment purposes, testing data (including users, tickets) was migrated from sqlite3 to the PostgreSQL database using the following method:
343+
344+
Dump existing data into json format:
345+
346+
`python3 manage.py dumpdata > datadump.json`
347+
348+
Change DATABASES in settings.py to Postgres, then migrate:
349+
350+
`python3 manage.py migrate --run-syncdb`
351+
352+
Exclude contenttype data:
353+
354+
```
355+
python3 manage.py shell
356+
>>> from django.contrib.contenttypes.models import ContentType
357+
>>> ContentType.objects.all().delete()
358+
>>> quit()
359+
```
360+
361+
Load json data into PostgreSQL:
362+
363+
`python3 manage.py loaddata datadump.json`
364+
326365
# Technologies
327366

328-
- [Autoprefixer CSS Online](https://autoprefixer.github.io/) : to add vendor prefixes.
329-
- [Balsamiq](https://balsamiq.com/) : to create wireframes.
330-
- [Bootstrap](https://bootstrap.com/) : for responsive webpages.
331-
- [Chrome Developer Tools](https://developers.google.com/web/tools/chrome-devtools) : to ensure device responsiveness.
367+
- [Autoprefixer CSS Online](https://autoprefixer.github.io/) : add vendor prefixes.
368+
- [Balsamiq](https://balsamiq.com/) : wireframes development.
369+
- [Bootstrap](https://bootstrap.com/) : responsive webpages on all devices.
370+
- [Chrome Developer Tools](https://developers.google.com/web/tools/chrome-devtools) : device responsiveness and audits.
332371
- [crossfilter](https://github.com/crossfilter/crossfilter) : enables filters to be applied to all graphs.
333372
- [CSS3](https://www.w3.org/Style/CSS/Overview.en.html) : styling language.
334373
- [d3js.org](https://d3.js) : Javascript charting library.
335374
- [DataTables.net](https://datatables.net) : pagination and filtering of tables.
336375
- [DBDiagram](https://dbdiagram.io/) : mapping database relationships.
337376
- [DBeaver](https://dbeaver.io) : database tool to confirm successful data migration from sqlite3.
338377
- [dc.js](https://dc.js) : charting Javascript library built on d3.js.
339-
- [Django](https://django.io/) :
340-
- [Django Crispy Forms](https://django-crispy-forms.readthedocs.io/) : for Django form styling.
378+
- [Django](https://django.io/) : high-level Python Web framework.
379+
- [Django Crispy Forms](https://django-crispy-forms.readthedocs.io/) : Django form styling.
341380
- [Django REST Framework](https://www.django-rest-framework.org/) : API data source for dashboard charts.
342381
- [Django Simple History](https://django-simple-history.readthedocs.io) : tracking changes to model fields.
343382
- [Git](https://git-scm.com/) : version control.
344383
- [GitHub](https://github.com) : code repository and source branch used in deployment.
345384
- [Heroku](https://www.heroku.com) : deployment.
346385
- [jQuery](https://jquery.com/) : manipulate HTML elements.
386+
- [LazyLoad](https://github.com/verlok/lazyload) : lazy loading of images.
347387
- [Material Icons](https://material.io/) : icons and fonts.
348388
- [PEP8 Validator](http://pep8online.com/) : validation of Python code.
349389
- [Pillow](https://pillow.readthedocs.io) : processing images in database.
350-
- [PostgreSQL](https://www.postgresql.org/) : as relational database in production.
351-
- [Stripe](https://stripe.com/) : accept payments.
390+
- [PostgreSQL](https://www.postgresql.org/) : relational production database.
391+
- [Stripe](https://stripe.com/) : accept online payments.
352392
- [Travis](https://travis-ci.org) : continuous integration.
353393
- [VSCode](https://code.visualstudio.com) : preferred code editor.
354394
- [W3C Validator](https://jigsaw.w3.org) : validate HTML & CSS.
355395

356396
# Testing
357397

358-
Extensive automatic and manual testing was conducted to ensure the site functions and looks well on all major browsers (Chrome, Firefox, Safari, Edge) and device sizes.
398+
Extensive unit and manual testing was conducted to ensure the site functions and looks well on all major browsers (Chrome, Firefox, Safari, Edge) and device sizes.
359399

360400
## Unit Testing
361401

@@ -367,44 +407,43 @@ Extensive automatic and manual testing was conducted to ensure the site function
367407

368408
The following manual tests passed:
369409

370-
Home
410+
#### Home
371411

372412
- If no user is logged in, 3 'Create Free Account' buttons are displayed
373413
- If Basic user is logged in, 3 'Go PRO' buttons are displayed.
374414
- If Pro user is logged in, 3 'Go PRO' buttons are hidden.
375415

376-
Tickets
416+
#### Tickets
377417

378418
- Global search input filters in all fields.
379419
- Reset filters button reloads page.
380420
- All field-specific search boxes filter correctly.
381421
- Clicking headings orders by that field. Clicking again changes order direction.
382422
- Pagination and 'Show x tickets' per page functions correctly.
383423
- All columns are visible or accessible via horizontal scroll.
384-
- Tooltips function on hover of Summary, Type, Status.
385424
- Row colours represent status.
386425
- Raise Ticket button takes user to Add Ticket page.
387426

388-
Dashboard
427+
#### Dashboard
389428

390429
- All 6 charts display with adequate padding.
391430
- All 6 charts be filtered on click, or range selection.
392431
- Display updates to show how many tickets are filtered - eg. 12 of 25 Tickets.
393432

394-
KANBAN
433+
#### KANBAN
395434

396435
- If user is not PRO user, redirect to Checkout page.
397436
- 'Hide Cancelled' checkbox toggles Cancelled column.
398437
- Ticket count and counts for each column (ticket status) are correct.
399438
- Quick update dropdown updates status and success message displayed: 'Ticket status updated.'
400439

401-
Add Ticket
440+
#### Add Ticket
402441

403442
- If Basic user, message is displayed shows how many tickets have been submitted out of 10 in the current month. If limit has been reached, message is displayed and user is redirected to checkout page.
404443
- Form is valid and submits even if Tags and Screenshot is blank.
405444
- Success message is displayed: 'Ticket raised.'
406445

407-
View Ticket
446+
#### View Ticket
408447

409448
- Jumbotron colour correctly represents ticket status.
410449
- Submitter and Assignee pill badges show user profile pictures if any, and on click a drop-right menu with 'mailto:' links Zoom links functioning.
@@ -414,51 +453,53 @@ View Ticket
414453
- If screenshot exists, following link shows the screenshot in a modal. Download button downloads image.
415454
- Comments can be submitted and success message is displayed: 'Comment shared.'
416455

417-
Edit Ticket
456+
#### Edit Ticket
418457

419458
- Only submitter or staff can edit a ticket.
420459
- Fields are pre-filled with existing values.
421460
- Submitting form updates all fields.
422461
- On successful edit, success message is displayed: 'Ticket successfully updated'.
423462

424-
Account
463+
#### Account
425464

426465
- User Profile image can be changed via upload. Image is displayed with rounded border.
427466
- First Name, Last Name can be updated via edit button.
428467
- If user not Staff, requesting staff access button is displayed, which on click enables Staff access. Note: In a live environment, these requests would be sent to Admin for review before granting permission. For assessment purposes this permission is granted immediately so assessors can edit all tickets.
429468
- Member Since and PRO Since (if PRO) shows correct dates.
430469
- On click of Zoom Meeting ID, Zoom Personal Meeting Room is launched.
431470

432-
404 Error Page
471+
#### Team
433472

434-
- When an incorrect URL is entered, 404 Page is displayed
435-
- Return home button takes user back to Home Page
436-
- Navigation buttons function
473+
- All email and zoom links function
437474

438475
### Mobile and Tablet Testing
439476

440-
The above Desktop Tests were also conducted on mobile and tablet devices (via Chrome DevTools). In addition, the following mobile and tablet-specific tests were run:
477+
The above Desktop Tests were repeated on mobile and tablet devices via Chrome Dev Tools. In addition, the following mobile and tablet-specific tests were run:
441478

442479
Dashboard (Mobile)
443480

444481
- All graphs on dashboard page are readable.
445482

446483
The following tests failed:
447484

448-
| Issue No. | Test Name | Issue | Resolved? | Action Taken |
449-
| :-------- | :---------------------------------------------- | :-------------------------------------- | :-------- | :---------------------------------------------------------------------- |
450-
| 1 | Content is not squeezed or overlapping (Mobile) | Tickets table overflowing horizontally. | Yes | Added Bootstrap class 'table-responsive' to enable horizontal scrolling |
485+
| Issue No. | Test Name | Issue | Resolved? | Action Taken |
486+
| :-------- | :-------------------------------------------------------------------- | :--------------------------------------------------------------------------- | :-------- | :---------------------------------------------------------------------- |
487+
| 1 | Content is not squeezed or overlapping (Mobile) | Tickets table overflowing horizontally. | Yes | Added Bootstrap class 'table-responsive' to enable horizontal scrolling |
488+
| 2 | Tickets page: All tooltips function on hover of Summary, Type, Status | On Tickets page tooltips on tickets beyond on the first are not initialized. | Yes | Added callback function to reinitialise all toolips on redraw of table |
489+
| 3 | View Ticket page: Image appropriately sized | Screenshot overflows modal | Yes | Set screenshot image max-width: 96% |
451490

452491
## Code Validation
453492

454-
| Code | Result |
455-
| :---------------------------------------------------------- | :----- |
456-
| CSS ([W3C](https://jigsaw.w3.org/css-validator/)) | PASS |
457-
| HTML ([W3C](https://validator.w3.org/)) | PASS |
458-
| Javascript: no major errors ([jshint](https://jshint.com/)) | PASS |
459-
| Python ([PEP8](https://pep8online.com/)) | PASS |
493+
| Code | Files validated | Result |
494+
| :---------------------------------------------------------- | :----------------------------------------------------------------- | :----- |
495+
| CSS ([W3C](https://jigsaw.w3.org/css-validator/)) | style.css | PASS |
496+
| HTML ([W3C](https://validator.w3.org/)) | templates | PASS |
497+
| Javascript: no major errors ([jshint](https://jshint.com/)) | dashboard.js,base.js | PASS |
498+
| Python ([PEP8](https://pep8online.com/)) | views.py, models.py, forms.py, urls.py, settings.py, test\_\*\*.py | PASS |
460499

461-
^ The following classes of errors were deemed not applicable, as the validator did not take into account Flask and Jinja templating:
500+
## Audits
501+
502+
All pages were audited using Chrome Developer Tools' Lighthouse to assess Performance, Accessibility, Best Practices and SEO. Key performance improvements included lazy loading images and optimising the loading of third-party libraries. After making these changes, the vast majority of page scores were Green (ie >90%).
462503

463504
# Deployment
464505

@@ -468,7 +509,7 @@ The application was deployed to Heroku, via the following steps:
468509

469510
1. Ensure `requirements.txt` reflects all dependencies via `pip freeze > requirements.txt`
470511
2. Create `Procfile` via `web: gunicorn issue_tracker.wsgi:application > Procfile`
471-
3. `git add` above files, then commit and push to GitHub
512+
3. `git add` above files, then `git commit` and `git push` to GitHub
472513
4. Heroku.com > Create new app > App name: 'django-issue-tracker-1' (app name must be unique), Region: Europe
473514
5. Deploy > Deployment method > Link GitHub account
474515
6. Select repository 'milestone-4'
@@ -489,31 +530,6 @@ The application was deployed to Heroku, via the following steps:
489530
9. Manual Deploy > Deploy Branch (master)
490531
10. Heroku Website > Open App
491532

492-
### Data Migration
493-
494-
To ensure a rich dataset for assessment purposes, testing data (including users, tickets) was migrated from sqlite3 to the PostgreSQL database using the following method:
495-
496-
Dump existing data into json format:
497-
498-
`python3 manage.py dumpdata > datadump.json`
499-
500-
Change DATABASES in settings.py to Postgres, then migrate:
501-
502-
`python3 manage.py migrate --run-syncdb`
503-
504-
Exclude contenttype data:
505-
506-
```
507-
python3 manage.py shell
508-
>>> from django.contrib.contenttypes.models import ContentType
509-
>>> ContentType.objects.all().delete()
510-
>>> quit()
511-
```
512-
513-
Load json data into PostgreSQL:
514-
515-
`python3 manage.py loaddata datadump.json`
516-
517533
## Local Deployment
518534

519535
1. 'Clone or download' repository from https://github.com/tdunn891/milestone-4, or from command line:

0 commit comments

Comments
 (0)