The GitHub Actions job "Build" on texera.git/main has failed.
Run started by GitHub user aicam (triggered by aicam).

Head commit for run:
179f177d7299a823b4f75e1221ee7a10eb26a230 / Jaeyun Kim 
<[email protected]>
feat: add user registration form (#4185)

<!--
Thanks for sending a pull request (PR)! Here are some tips for you:
1. If this is your first time, please read our contributor guidelines:
[Contributing to
Texera](https://github.com/apache/texera/blob/main/CONTRIBUTING.md)
  2. Ensure you have added or run the appropriate tests for your PR
  3. If the PR is work in progress, mark it a draft on GitHub.
  4. Please write your PR title to summarize what this PR proposes, we 
    are following Conventional Commits style for PR titles as well.
  5. Be sure to keep the PR description updated to reflect all changes.
-->

## What changes were proposed in this PR?
### Summary
To gather more user information for a better overview of users, this PR
introduces a new column 'joining_reason' to the user table. Now when a
user logins to the Texera for the first time, they will be prompted to
enter their affiliation(optional) and reason of joining Texera. The
answer will be recorded to the database and retrieved when admins enter
the admin dashboard. The prior affiliation modal implemented in #4113
has been removed. In accordance to the change, new APIs and files have
been introduced to the system.

### For Developers
Please do the following steps to incorporate with new changes:
- Apply sql/updates/20.sql to your local postgres instance
- Run
common/dao/src/main/scala/org/apache/texera/dao/JooqCodeGenerator.scala
to generate jooq tables

### Screenshots of the modal
<img width="300" height="300" alt="image"
src="https://github.com/user-attachments/assets/9edace89-2a6b-4f32-8521-714f0cf28258";
/>
<img width="400" height="200" alt="image"
src="https://github.com/user-attachments/assets/b1e19a07-2e57-4023-bb07-9ac6df50342c";
/>

### Sample Video


https://github.com/user-attachments/assets/6d4af0f8-be99-4c74-91f7-b59b800c77d9




### Design of the Feature
When a user logins to Texera for the first time, they will be prompted
to enter their affiliation (optional) and reason of joining Texera
(required) to send request to admin users. Once they finish filling out
the form, until they get approved (role gets changed from INACTIVE to
REGULAR), they will keep seeing a message informing them to wait until
an admin user grants them access.

The new `joining_reason` column in `user` table will be used to
determine if the system needs to prompt the user or not.
1. If the `joining_reason` is null, then the modal will prompt user to
enter affiliation and joining reason (first time logging in).
2. If `joining_reason` is not null, then the user has answered the form
before. The system will not prompt, but will inform user to wait until
an admin user grants access to the user.

Current version of Texera has two forms related to user registration: 
1. Request Access modal that only prompts user to send request or not,
3. Affiliation modal that prompts user to enter their affiliation after
an admin user grants access to them.
As we see redundance on these modals, we decided to combine these modals
into one modal, therefore we are removing the two modals mentioned
above.

### Current `user` schema
<img width="200" height="400" alt="image"
src="https://github.com/user-attachments/assets/b801924d-daab-4c2a-8528-6d377af55033";
/>

### Proposed `user` schema
<img width="200" height="400" alt="image"
src="https://github.com/user-attachments/assets/f015dbd2-d682-4adc-82a7-3309e7e4e752";
/>

### Backend Changes
Added two new API calls: 
- GET /user/joining-reason/required -- Returns if the registration form
is needed or not
- PUT /user/joining-reason -- Updates the user's joining reason and
affiliation
* As the jwtToken carries joiningReason, some codes related to jwtToken
has been configured accordingly.

### Frontend Changes
- Added new `registration-request-modal` component for the registration
form.
- Added new column to admin dashboard
- Changed User interface, leading to multiple file changes

### Any related issues, documentation, discussions?
Closes #4188.

### How was this PR tested?
Manually tested.


### Was this PR authored or co-authored using generative AI tooling?
Generated-by: ChatGPT 5.2

---------

Co-authored-by: ali risheh <[email protected]>

Report URL: https://github.com/apache/texera/actions/runs/22073401898

With regards,
GitHub Actions via GitBox

Reply via email to