Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate project activity to LFNext #1416

Merged
merged 113 commits into from
Sep 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
75cfb2c
initial plumbing
Jun 23, 2022
d75709f
not sure how that's helping...
Jun 23, 2022
32c3338
.json naming convention won't work with page endpoints
Jun 23, 2022
73a32fe
possible empty data impl
Jun 23, 2022
da01a6b
refactored route uppon feedback
Jun 23, 2022
49b38b2
provided a means of db dump/restore
Jun 23, 2022
83a415b
created activity data
Jun 23, 2022
f7698e4
Rename README to README.md
Jun 23, 2022
94b47c1
corrected the docs
Jun 23, 2022
ef744a3
added clarification to docs
Jun 23, 2022
eaf01d8
completed TODO's
Jun 23, 2022
70db430
updated paths in proxy
Jun 23, 2022
3c4ffd9
initial data integration with UI
Jun 23, 2022
1c8e7f0
prettied up the UI
Jun 23, 2022
aa7b243
learned more about activity_list_dto's api
Jun 23, 2022
fcfd1b5
pairing for new php api
Jun 23, 2022
775b3fc
delete unused ActivityTypes API
megahirt Jun 23, 2022
0d981a6
refactor activity_list_dto_for_project
megahirt Jun 23, 2022
e8a891f
refactor project activity to use project code
megahirt Jun 23, 2022
e948853
remove unnecessary uasort
megahirt Jun 23, 2022
af0ae2c
configured TS support
Jun 23, 2022
4bdf0da
updated deps
Jun 23, 2022
48365f8
removed unnecessary config
Jun 23, 2022
be3d7dc
old legacy link to activity not needed anymore
Jun 23, 2022
b2619ac
remnant from before last refactor
Jun 23, 2022
424835f
tweaked the activities endpoint call
Jun 23, 2022
fa80f7a
removed accidental whitespace
Jun 23, 2022
beca017
started project landing page for LFNext
Jun 23, 2022
9f64ec0
too many warnings, need to work these in slowly
Jun 23, 2022
f04ee26
expanded API
Jun 23, 2022
3d6c690
refactored activity to comp in a project landing page
Jun 23, 2022
e3fcb31
provide link to a project's editor
Jun 23, 2022
3ad6515
fixed failing build
Jun 23, 2022
06bec54
updated links in "My Projects" dropdown (header)
Jun 23, 2022
cc5a36f
updated project link on "My Projects" page
Jun 23, 2022
0eec733
updated project link in breadcrumbs
Jun 23, 2022
d9051ae
updated project link for invitation link use case
Jun 23, 2022
5f4a07f
limit default activity call to last 30 days only
Jun 23, 2022
499730d
updated deps and fixed breaking changes in latest kit release
Jun 23, 2022
cdb2f0f
corrected route
Jun 23, 2022
8fa4d32
corrected whitespace
Jun 23, 2022
ac829c4
wanted a fallback for unmapped actions
Jun 23, 2022
977b7be
added ability for user to request all activity
Jun 23, 2022
89f2273
reduced prominence of show all
Jun 23, 2022
6f6717e
made whitespace consistent
Jun 23, 2022
5895c77
referenced lookup
Jun 23, 2022
0b003d8
sorted the activity
Jun 23, 2022
9c7c3b5
readability
Jun 23, 2022
5c9c933
readability
Jun 23, 2022
fdad481
accidentally left in troubleshooting code
Jun 23, 2022
6de2e57
horizontal overflow not right on mobile
Jun 23, 2022
38936ca
reconsidered button api so breakpoints can be used in classes
Jun 23, 2022
8f1e69d
show all button was too close to h-scrollbar when shown
Jun 23, 2022
d31720e
corrected mobile layout
Jun 23, 2022
70d7b5e
"show all" was still showing when there was no activity
Jun 23, 2022
55863db
fixed unit test
Jun 23, 2022
51c516e
incorporated PR feedback
Jun 23, 2022
c907aa5
incorporated PR feedback
Jun 23, 2022
dcbce73
incorporated PR feedback
Jun 23, 2022
a3a68d2
same-day activity was not showing up
Jun 23, 2022
1e89bd3
incorporated PR feeedback to remove legacy code related to activity
Jun 23, 2022
957c6a8
updated breadcrumbs in wrong place and broke the settings menu, this …
Jun 23, 2022
16559ce
Remove activity page from site traversal test
rmunn Jun 23, 2022
cbb30ec
fixed ts warning where $app wasn't being found
Jun 27, 2022
4f72fdd
corrected bug when result was a boolean (false)
Jun 30, 2022
4e78bcd
corrected whitespace
Jun 30, 2022
cc9a755
addressed PR feedback
Jul 6, 2022
956f988
mapped more actions (PR feedback)
Jul 8, 2022
0dbf80e
bourght back $$props (PR feedback)
Jul 8, 2022
b196479
limited activity rows to 50 (PR feedback)
Jul 8, 2022
fa37282
had to override the limit to ensure all rows are retrieved
Jul 8, 2022
a6b2990
fixed sorting bug (PR feedback)
Jul 11, 2022
4a2a2ea
oops, brain and fingers were not on same page!
Jul 11, 2022
4fc542d
needed to extract time in ISO before using
Jul 11, 2022
c298d27
Revert "delete unused ActivityTypes API"
Jul 11, 2022
7f0dc52
reverted relevant portions of 8c1ac6d57cde9c81ba79e9100f4fba9454fec8fc
Jul 11, 2022
615f292
Revert "remove unnecessary uasort"
Jul 11, 2022
4256bfa
Revert "incorporated PR feeedback to remove legacy code related to ac…
Jul 11, 2022
8437526
initial ui design for prooject data
Jul 13, 2022
60b4de8
refactored data call in preparation for stats
Jul 13, 2022
3e935a0
derived real num_users
Jul 13, 2022
6eafd3e
added ref doc
Jul 13, 2022
cf2873a
integrated real num_entries data
Jul 13, 2022
17ef552
derived num_entries_with_picture
Jul 13, 2022
3daafcf
integrated Num_unresolved_comments
Jul 13, 2022
8453fce
make multiple calls in parallel
Jul 13, 2022
1e92102
cleaned stat appearance up a bit
Jul 14, 2022
35f527f
added just a little more whitespace
Jul 14, 2022
9c588a2
updated deps
Jul 14, 2022
81b1127
derived num_entries_with_audio
Jul 14, 2022
11afe0e
no need for spacing for now
Jul 14, 2022
cac7475
checked for audio in all entry fields as well as meanings
Jul 15, 2022
1e55f95
refactored the naming to reflect more logical representation of the d…
Jul 17, 2022
9f640e9
also looked in examples for audio
Jul 17, 2022
1893331
upgraded breaking changes in sveltekit
Aug 15, 2022
b17eb55
mirgated breaking SvelteKit changes to new routing system
Aug 22, 2022
9255f8e
accidentally left a console.log
Aug 22, 2022
ffe32b0
incorporated documentation feedback
Aug 22, 2022
f29ba44
grabbed latest SvelteKit build
Aug 22, 2022
661b94c
simplified code with optional chaining
Aug 22, 2022
c65af4c
refactored server-side errorhandling for latest kit changes
Aug 24, 2022
4df9d46
eliminated residual error flash when working in local dev
Aug 24, 2022
1004f59
upgraded next-app deps
Aug 24, 2022
2550b57
fixed typo
Aug 24, 2022
57a8757
convention
Aug 24, 2022
f4cbed5
refactored to singular app API for errors
Aug 24, 2022
05b6e37
unneeded code
Aug 24, 2022
5058a00
convention
Aug 24, 2022
f9449a2
added source of svg's
Aug 25, 2022
120ab87
protected against projects without `senses`
Sep 6, 2022
800174d
got rid of old py refs and made powerwash more powerwashy
Sep 6, 2022
4804863
dep upgrades and breaking change fix
Sep 7, 2022
12914e4
made powerwash a little more surgical
Sep 7, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,5 @@ clean-volumes:

.PHONY: clean-powerwash
clean-powerwash: clean-volumes
docker compose down --rmi all
docker rmi -f `docker images -q "lf-*"`
docker builder prune -f
1 change: 1 addition & 0 deletions docker/db/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dump
14 changes: 14 additions & 0 deletions docker/db/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
clean:
docker compose down

db:
docker compose up -d db

dump: db
docker compose exec db mongodump
docker compose cp db:/dump ./dump

restore: db
docker compose cp ./dump db:/dump
docker compose exec db mongorestore

43 changes: 43 additions & 0 deletions docker/db/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Creating and utilizing any test data

## Create a dump

1. start the app
1. create all the data you want through the app
1. `make dump clean` to create a `dump` folder in this directory
1. `tar -cf <name-representative-of-data>.tar dump`, e.g., `tar -cf activity.tar dump`, and decide whether to commit this or not for others to use.

## Load a dump

1. `tar -xf <name-representative-of-data>.tar` and rename to `dump`
1. `make restore clean` to load the `dump` directory

# Common mongo commands

> https://www.mongodb.com/docs/v4.4/mongo

`mongo` within `db` container

> https://www.mongodb.com/docs/manual/reference/mongo-shell/#command-helpers

`show dbs`

`use scriptureforge`

`show collections`

`exit`

> https://www.mongodb.com/docs/manual/reference/mongo-shell/#queries

`db.users.find()`

# Test data

## Activity

| username | email | password | project |
| -------- | ------------------- | ------------- | ----------- |
| admin | admin@example.com | password | all |
| johndoe | jd@example.org | languageforge | project-1 |
| janedoe | janedoe@example.org | languageforge | project-2 |
Binary file added docker/db/activity.tar
Binary file not shown.
2 changes: 2 additions & 0 deletions docker/next-app/Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
:80 {
@next_app_paths {
path /_app/*
# ref for existing: /src/index.php
path /app/changepassword
path /password*
path /projects*
}
route @next_app_paths {
rewrite /app/changepassword /password/change
Expand Down
2 changes: 1 addition & 1 deletion docker/next-app/Dockerfile.next-app
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM node:alpine AS builder

WORKDIR /app

COPY jsconfig.json package-lock.json package.json postcss.config.cjs svelte.config.js tailwind.config.cjs /app/
COPY tsconfig.json package-lock.json package.json postcss.config.cjs svelte.config.js vite.config.js tailwind.config.cjs /app/
COPY src /app/src
COPY static /app/static

Expand Down
13 changes: 8 additions & 5 deletions docker/next-app/dev/Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@

:80 {
@next_app_paths {
path *svelte* # when running next-app in dev mode, this is needed.
path *node_modules* # when running next-app in dev mode, this is needed.
path *vite* # when running next-app in dev mode, this is needed.
path /src/lib* # when running next-app in dev mode, this is needed.
path /_app/*
# when running next-app in dev mode, these are needed.
path /.svelte-kit/*
path *node_modules*
path /@vite/*
path /src/*

# ref for existing: /src/index.php
path /app/changepassword
path /password*
path /projects*
}
route @next_app_paths {
rewrite /app/changepassword /password/change
Expand Down
2 changes: 1 addition & 1 deletion docker/next-app/dev/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM node:alpine

WORKDIR /app

COPY jsconfig.json package-lock.json package.json postcss.config.cjs svelte.config.js tailwind.config.cjs /app
longrunningprocess marked this conversation as resolved.
Show resolved Hide resolved
COPY tsconfig.json package-lock.json package.json postcss.config.cjs svelte.config.js vite.config.js tailwind.config.cjs /app/
COPY src /app/src
COPY static /app/static

Expand Down
2 changes: 1 addition & 1 deletion docs/DEVELOPER.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ After a minute or two, your source or test changes should be applied and you sho
### Running dev

1. `make dev` will start the legacy app in development mode, i.e. changes to source code will immediately be reflected in the locally running app.
1. `make next-dev` will start the next app in development mode, i.e. changes to source code will immediately be reflected in the locally running app.
1. `make next-dev` will start the next app in development mode, i.e. changes to source code will immediately be reflected in the locally running app. Access non-ssl: http://localhost
> TODO: There is a desire to consolidate these into a single use case, `make dev`.

### Visual Studio Code ###
Expand Down
7 changes: 6 additions & 1 deletion next-app/README-Tech.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ A backend layer is being utilized to insulate the UI from implemenation details

### Common error handling

In an effort to provide a common error experience for users and eliminate much of the biolerplate on devs, a central error handling implementation is provided in `$lib/error`. It has both a shared API as well as a component for use in the app. Central, generic hooks for client-side errors of all kinds have been implemented in the `$lib/error/index.js` but there are not similar hooks for _all_ error scenarios on the server-side which may result in more biolerplate for devs when it comes to error handling there.
In an effort to provide a common error experience for users and eliminate much of the boilerplate on devs, a central error handling implementation is provided in `$lib/error`. It has both a shared API as well as a component for use in the app. Central, generic hooks for client-side errors of all kinds have been implemented in the `$lib/error/index.js` but there are not similar hooks for _all_ error scenarios on the server-side which may result in more boilerplate for devs when it comes to error handling there.

### Common fetch

Expand All @@ -104,3 +104,8 @@ Found in `$lib/fetch/client.js`. This wrapper exports some of the most common t

Found in `$lib/fetch/server.js`. This wrapper exports some of the most common types of fetches, handles errors consistently and abides by the legacy app's `/api/sf` contract.

### FAQ's

#### Why are we using `$$props.class` when Svelte docs suggest against it?

This a very well-known and conventional way of getting all you need from the element without the extra boilerplate code required to expose an explicit API for each [Attribute](https://developer.mozilla.org/en-US/docs/Web/API/Element/attributes) or "properties" as referred to by Svelte (https://svelte.dev/docs#template-syntax-attributes-and-props). See https://github.com/sillsdev/web-languageforge/pull/1416/files#r894114808 for further rationale and comparison of alternative which is considered unnecessarily verbose and not as maintainable.
11 changes: 0 additions & 11 deletions next-app/jsconfig.json

This file was deleted.

Loading