Skip to content

Commit e032fc8

Browse files
authored
Merge pull request #40 from icefoganalytics/issue-39/add-ability-for-current-user-viewing-a-place-to-see-their-current-proposed-edits-to-said-place
Issue 39: Add Ability For Current User Viewing a Place to See Their Current Proposed Edits To Said Place
2 parents 6824730 + d105b00 commit e032fc8

36 files changed

+81373
-138
lines changed

.eslintrc.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
env:
2+
browser: true
3+
es2021: true
4+
node: true
5+
extends:
6+
- prettier
7+
overrides: []
8+
parserOptions:
9+
ecmaVersion: latest
10+
sourceType: module
11+
rules: {}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
# Context
11+
12+
**Describe the bug**
13+
A clear and concise description of what the bug is.
14+
15+
**To Reproduce**
16+
Steps to reproduce the behavior:
17+
1. Go to '...'
18+
2. Click on '....'
19+
3. Scroll down to '....'
20+
4. See error
21+
22+
**Expected behavior**
23+
A clear and concise description of what you expected to happen.
24+
25+
**Screenshots**
26+
If applicable, add screenshots to help explain your problem.
27+
28+
**Desktop (please complete the following information):**
29+
- OS: [e.g. iOS]
30+
- Browser [e.g. chrome, safari]
31+
- Version [e.g. 22]
32+
33+
**Smartphone (please complete the following information):**
34+
- Device: [e.g. iPhone6]
35+
- OS: [e.g. iOS8.1]
36+
- Browser [e.g. stock browser, safari]
37+
- Version [e.g. 22]
38+
39+
**Additional context**
40+
Add any other context about the problem here.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
Relates to:
11+
- TODO
12+
13+
# Context
14+
15+
**Is your feature request related to a problem? Please describe.**
16+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
17+
18+
**Describe the solution you'd like**
19+
A clear and concise description of what you want to happen.
20+
21+
**Describe alternatives you've considered**
22+
A clear and concise description of any alternative solutions or features you've considered.
23+
24+
**Additional context**
25+
Add any other context or screenshots about the feature request here.

.github/issue_template.md

Lines changed: 0 additions & 29 deletions
This file was deleted.

.github/pull_request_template.md

Lines changed: 12 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,24 @@
1-
Please replace the following example with your own content.
1+
Fixes TODO
22

3-
Fixes [#25](https://github.com/icefoganalytics/yhsi/issues/25)
3+
Relates to:
44

5-
# User Story
5+
- TODO
66

7-
See https://github.com/icefoganalytics/yhsi/issues/3
8-
As an edit level user I can edit the /sites Themes & Function form and it will create a site change request for admin approval.
7+
# Context
98

10-
# Details
9+
TODO
1110

12-
Now that I have a working example in the form of the Summary, Location, and Dates & Conditions sections, this task is simply a port of the existing patterns to include an additional sub-form.
11+
# Implementation
1312

14-
# Implementation Details
15-
16-
- Tweaked PlaceEdit saving and serialization to hopefully reduce developer errors.
17-
- Dockerize the test suite and update the README.
18-
- add a `dev ts-node` to get access to a local node repl that runs typescript.
13+
TODO
1914

2015
# Screenshots
2116

22-
![image](https://user-images.githubusercontent.com/23045206/163441939-d889fb77-1b78-40e6-b59d-c3a386cc3a5d.png)
17+
TODO
2318

2419
# Testing Instructions
2520

26-
1. Update your user roles to include `Site Admin` via the database console.
27-
2. Go to the /sites table and select a site.
28-
3. In the Themes & Function form, make an edit and press save.
29-
4. The site will refresh and your edits will be saved.
30-
5. Update your user roles so that they _do not include_ `Site Admin` or `Administrator` via the database console. Something like `Site Viewer` would probably be best.
31-
6. Go to the /sites table and select a site.
32-
7. In the summary form, make and edit (or two) and press save.
33-
8. The page will refresh and all Themes & Function fields will become readonly. The save button on the Themes & Function form will be disabled with an appropriate tooltip.
34-
9. Make yourself an `Site Admin` again and go to the /sites-change-requests table.
35-
10. The new change request will be at the top of the list. Click on it to review.
36-
11. Note the various features:
37-
38-
- "accept/reject" toggle buttons
39-
- accept/reject all
40-
- save button is locked until all changes are approved/rejected
41-
42-
12. Reject and accept some changes and press Save.
43-
13. Go back to the /sites table and check that you can now edit the site and that the changes have been applied or rejected correctly.
21+
1. Run the test suite via `dev test` (or `dev test_api`)
22+
2. Boot the app via `dev up`
23+
3. Log in to the app at http://localhost:8080
24+
4.

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,5 +114,4 @@ db/photo_data.sql
114114
db/place_data.sql
115115

116116
# Other
117-
package-lock.json
118117
.DS_Store

.prettierrc.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# .prettierrc or .prettierrc.yaml
2-
embeddedLanguageFormatting: "auto"
2+
$schema: 'https://json.schemastore.org/prettierrc'
3+
embeddedLanguageFormatting: 'auto'
34
jsxSingleQuote: true
45
pugAttributeSeparator: 'as-needed'
56
pugSingleQuote: false
@@ -8,5 +9,11 @@ semi: true
89
singleAttributePerLine: true
910
singleQuote: true
1011
tabWidth: 2
11-
trailingComma: "es5"
12+
trailingComma: 'es5'
1213
useTabs: true
14+
printWidth: 100
15+
plugins:
16+
- prettier-plugin-embed
17+
- prettier-plugin-sql
18+
language: 'tsql'
19+
paramTypes: "{ named: [':'] }"

README.md

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,33 @@ Writing code and developing in this application requires running three services:
1010

1111
---
1212

13-
Boot the three app services:
13+
1. Create a the `yhsi_sqlvolume` volume in docker to hold the app database.
1414

15-
```bash
16-
docker-compose -f docker-compose.development.yml up
17-
```
15+
```bash
16+
docker volume create yhsi_sqlvolume
17+
```
1818

19-
Or if you have `ruby` installed
19+
2. Boot the three app services:
2020

21-
```bash
22-
bin/dev up
23-
```
21+
```bash
22+
dev build
23+
dev up
24+
25+
# Or
26+
docker compose -f docker-compose.development.yml build
27+
docker compose -f docker-compose.development.yml up
28+
```
29+
30+
3. Run the database migrations by going to http://localhost:3000/migrate/latest
31+
32+
4. Create a new user account and log in to http://localhost:8080.
33+
34+
5. Once you are logged in, open a database console with `dev sqlcmd` and run the following command to give your user admin permissions:
35+
36+
```sql
37+
UPDATE [Security].[User] SET [roles] = 'Administrator', [status] = 'Active' WHERE [email] = 'some-user@some-host.com';
38+
GO
39+
```
2440

2541
### Legacy Development Setup
2642

@@ -33,7 +49,10 @@ docker-compose -f docker-compose.dev.yml up -d
3349
This command will start SQL Server and bind it to your local machine's port 1433. When it starts the first time, the database will be empty. To load it with data, you must obtain a database backup and put it into `/db/backups/yhsi.bak` then run the follow commands:
3450

3551
```
36-
docker exec -it yhsi_sql_1 bash
52+
dev exec db bash
53+
54+
# or
55+
docker compose -f docker-compose.development.yml exec db bash
3756
```
3857

3958
This connects you to the running SQL Server container. Once in, run the following commands to create and restore the database from the backup:

0 commit comments

Comments
 (0)