Skip to content

Commit

Permalink
add birthday columns in attendee list view and add address validation…
Browse files Browse the repository at this point in the history
… on attendee update view
  • Loading branch information
xjlin0 committed Dec 28, 2024
1 parent 2b0f187 commit b60c134
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 8 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,12 @@ EMAIL_HOST=sendgrid
```
* Install and start [docker desktop](https://www.docker.com/products/docker-desktop) (including docker compose), and [add local repo directory to file sharing in docker desktop preference](https://docs.docker.com/desktop/settings/mac/#file-sharing).
* In Docker Desktop Settings, please ensure both "Use Virtualization framework" and "Use Rosetta for x86_64/amd64 emulation on Apple Silicon" options in enabled.
* build and start the Debian based local machine by `docker compose -f local.yml build && docker compose -f local.yml up -d`, your site will be at http://0.0.0.0:8008/
* build the Debian based local machine by `docker compose -f local.yml build`
* migrate db by `docker compose -f local.yml run --rm django python manage.py migrate`
* upadte content types after migration by `docker compose -f local.yml run django python manage.py update_content_types`
* create 2 superusers by `docker compose -f local.yml run --rm django python manage.py createsuperuser`
* import the seed data by `docker compose -f local.yml run django python manage.py loaddata fixtures/db_seed`, data were created by:
* start the Debian based local machine by `docker compose -f local.yml up -d`, your site will be at http://localhost:8008/
* to see django log: `docker compose -f local.yml logs django`
* enter the Bash shell of running container `docker compose -f local.yml run django bash`
* enter Redis-CLI by `docker exec -it redis redis-cli`
Expand Down
44 changes: 43 additions & 1 deletion attendees/static/js/persons/attendee_update_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -2039,6 +2039,13 @@ Attendees.datagridUpdate = {
editorOptions: {
placeholder: 'Main/parent/past, etc',
},
validationRules: [
{
type: 'stringLength',
max: 50,
message: "display name can't be more than 50 characters"
},
],
},
{
colSpan: 3,
Expand Down Expand Up @@ -2158,6 +2165,13 @@ Attendees.datagridUpdate = {
editorOptions: {
placeholder: "example: '22416'",
},
validationRules: [
{
type: 'stringLength',
max: 20,
message: "Door number can't be more than 20 characters"
},
],
},
{
colSpan: 4,
Expand All @@ -2169,6 +2183,13 @@ Attendees.datagridUpdate = {
editorOptions: {
placeholder: "example: 'A street'",
},
validationRules: [
{
type: 'stringLength',
max: 100,
message: "route can't be more than 100 characters"
},
],
},
{
colSpan: 4,
Expand All @@ -2180,6 +2201,13 @@ Attendees.datagridUpdate = {
editorOptions: {
placeholder: 'example: Apt 2G',
},
validationRules: [
{
type: 'stringLength',
max: 20,
message: "extra can't be more than 20 characters"
},
],
},
{
colSpan: 4,
Expand All @@ -2192,6 +2220,13 @@ Attendees.datagridUpdate = {
editorOptions: {
placeholder: "example: 'San Francisco'",
},
validationRules: [
{
type: 'stringLength',
max: 165,
message: "City can't be more than 165 characters"
},
],
},
{
colSpan: 4,
Expand All @@ -2200,6 +2235,13 @@ Attendees.datagridUpdate = {
editorOptions: {
placeholder: "example: '94106'",
},
validationRules: [
{
type: 'stringLength',
max: 10,
message: "postal code can't be more than 10 characters"
},
],
},
{
colSpan: 4,
Expand Down Expand Up @@ -2252,7 +2294,7 @@ Attendees.datagridUpdate = {
type: 'default',
useSubmitBehavior: true,
onClick: (clickEvent) => {
if (confirm('Are you sure to submit the popup Place Form?')) {
if (clickEvent.validationGroup.validate().isValid && confirm('Are you sure to submit the popup Place Form?')) {
const userData = Attendees.datagridUpdate.placePopupDxForm.option('formData');
const addressMaybeEdited = Attendees.datagridUpdate.placePopupDxForm.itemOption('NewAddressItems').visible;

Expand Down
13 changes: 13 additions & 0 deletions attendees/static/js/persons/attendees_list_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,19 @@ Attendees.dataAttendees = {
dataField: "first_name2",
visible: false,
},
{
dataField: "actual_birthday",
caption: "birthday YMD",
dataHtmlTitle: "YYYY-MM-DD",
visible: false,
},
{
dataField: "estimated_birthday",
caption: "birthday maybe",
dataHtmlTitle: "guessed birthday MM-DD",
calculateCellValue: (rowData) => rowData && rowData.estimated_birthday ? rowData.estimated_birthday.replace('1800-', '????-') : null,
visible: false,
},
{
dataHtmlTitle: "click to sort, or click the funnel to select",
caption: "division & attendance",
Expand Down
4 changes: 2 additions & 2 deletions compose/local/django/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG PYTHON_VERSION=3.10-slim-bookworm
ARG PYTHON_VERSION=3.10.12-slim-bookworm

# define an alias for the specfic python version used in this file.
# define an alias for the specific python version used in this file.
FROM python:${PYTHON_VERSION} AS python

# Python build stage
Expand Down
4 changes: 2 additions & 2 deletions compose/local/docs/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG PYTHON_VERSION=3.10-slim-bookworm
ARG PYTHON_VERSION=3.10.12-slim-bookworm

# define an alias for the specfic python version used in this file.
# define an alias for the specific python version used in this file.
FROM python:${PYTHON_VERSION} AS python


Expand Down
4 changes: 2 additions & 2 deletions fixtures/db_seed.json
Original file line number Diff line number Diff line change
Expand Up @@ -9796,7 +9796,7 @@
"last_name2": "",
"gender": "MALE",
"actual_birthday": null,
"estimated_birthday": null,
"estimated_birthday": "2011-12-13",
"deathday": null,
"photo": "",
"infos": {
Expand Down Expand Up @@ -9831,7 +9831,7 @@
"last_name2": "",
"gender": "FEMALE",
"actual_birthday": null,
"estimated_birthday": null,
"estimated_birthday": "1800-12",
"deathday": null,
"photo": "",
"infos": {
Expand Down

0 comments on commit b60c134

Please sign in to comment.