Skip to content

Conversation

@pregnantboy
Copy link
Contributor

@pregnantboy pregnantboy commented Dec 4, 2024

Features

  1. Allow CC recipients in postman action

UI changes

  1. Show connected pipes in Tiles list
  2. Allow users to upload secret key in FormSG connection step
  3. Show confirmation when deleting tile
  4. UI improvements for tiles (auto focus inputs, button size, etc)

Others

  1. Add tracking of users' last logged in

Fix

  1. Postman re-test step not working if partial failure occured previously

kevinkim-ogp and others added 7 commits November 28, 2024 11:49
## Problem
Pipes are failing when users accidentally delete Tiles that are
connected to existing Pipes.

Closes [PLU-310: show connected pipes to
tiles](https://linear.app/ogp/issue/PLU-310/show-connected-pipes-to-tiles)

## Solution
Display the number of Pipes using the Tile, including Pipes of current
user and collaborators of the Tile.

**Improvements**:
- Removed unnecessary menu button (current menu only shows "View" /
"Delete")
  - User can view the Tile by clicking on the row
- Delete button will be made visible to Tile owners when they hover a
Tile

## Before & After Screenshots

**BEFORE**:
<img width="1512" alt="Screenshot 2024-11-15 at 3 05 26 PM"
src="https://github.com/user-attachments/assets/235e190d-fdd5-47a4-b0d7-23c7a2b13ca5">


**AFTER**:
- Show number of Pipes and remove menu
<img width="1512" alt="Screenshot 2024-11-15 at 3 06 03 PM"
src="https://github.com/user-attachments/assets/817af8d3-725d-47fc-a044-e2a096603a64">

- Show delete icon on hover
<img width="1512" alt="Screenshot 2024-11-15 at 3 06 46 PM"
src="https://github.com/user-attachments/assets/b087596b-1fac-4c5e-ac06-83a4c7e37cc6">


## Tests
- [x] Number of Pipes displayed is correct, including pipes of Tile
collaborators
- [x] Able to view Tiles for all roles (Owner / Editor / Viewer)
- [x] Able to delete Tiles


**New scripts**:
-
`packages/backend/src/graphql/__tests__/queries/tiles/get-table-connections.itest.ts`
: tests for retrieving table connections
- `packages/backend/src/graphql/queries/tiles/get-table-connections.ts`
: query for retrieving table connections
- `packages/frontend/src/graphql/queries/tiles/get-table-connections.ts`
: query for retrieving table connections
## Problem
There is no last login tracking for users.

Closes https://linear.app/ogp/issue/PLU-341/user-last-logged-in-tracking

## Solution
- Create a new `last_login_at` column in the `users` table
- Update this column when user logs in successfully via OTP or sgID

**Improvements**:
- Added test cases for `getOrCreateUser` function

## Before & After Screenshots

**BEFORE**:
![Screenshot 2024-11-20 at 3 45
29 PM](https://github.com/user-attachments/assets/5a84c7b0-ae99-4485-877f-7cad43f77a71)


**AFTER**:
![Screenshot 2024-11-20 at 3 45
52 PM](https://github.com/user-attachments/assets/34510761-a22e-4d8c-884b-4ad9beb8092b)
* OTP Login
  * Before login
![Screenshot 2024-11-20 at 3 46
28 PM](https://github.com/user-attachments/assets/ba8bdb7f-c668-4751-92b7-50295cbfd02a)

  * After login


https://github.com/user-attachments/assets/c78bd337-3b03-4295-a0ea-687aaa9723c2

![Screenshot 2024-11-20 at 3 54
50 PM](https://github.com/user-attachments/assets/feccac00-ea1d-43cf-b450-ed5d96008964)

* Singpass Login
  * Before login
![Screenshot 2024-11-20 at 3 55
29 PM](https://github.com/user-attachments/assets/8dee96ff-13fa-44cc-b583-9b17efe028e0)
  * After login


https://github.com/user-attachments/assets/dc7dfe5a-8298-4484-a39a-cbcc44f0ae6d

(Singpass was slow in sending the profile details)
![Screenshot 2024-11-20 at 4 01
30 PM](https://github.com/user-attachments/assets/ca8d7d70-16b0-47c0-b29f-75c4271da125)


## Tests
- [x] Login via OTP and check that `last_login_at` is updated correctly
- [x] Login via Singpass / sgID and check that `last_login_at` is
updated correctly
- [x] Key in wrong OTP multiple times and check that `last_login_at` is
not updated

## Deploy Notes
Note, need to run DB migration to add `last_login_at` column before
deploying.

**New scripts**:

-
`packages/backend/src/db/migrations/20241119090013_add_user_last_login_at.ts`
: DB migration script to create `last_login_at` column in `users` table
## Problem
- Users need to manually copy / paste the form secret key when adding
the form connection
- Secret key is exposed

Closes
https://linear.app/ogp/issue/PLU-367/formsg-drag-and-drop-secret-key

## Solution
- Adopt similar drag and drop input from Forms
([frontend/src/features/admin-form/settings/components/SecretKeyFormModal.tsx](https://github.com/opengovsg/FormSG/blob/develop/frontend/src/features/admin-form/settings/components/SecretKeyFormModal.tsx)y)
<img width="817" alt="Screenshot 2024-11-22 at 1 51 45 PM"
src="https://github.com/user-attachments/assets/8e75473b-73be-4114-8301-8b6d43f1f11b">

**Improvements**:
- Drag and drop from folder into the input field 
- Open window to select file from folder

## Before & After Screenshots

**BEFORE**:
<img width="644" alt="Screenshot 2024-11-22 at 1 55 37 PM"
src="https://github.com/user-attachments/assets/b5395167-93af-4525-bc9b-a74bdee204e0">

**AFTER**:

- Drag / drop secret key file


https://github.com/user-attachments/assets/81d8ff9d-26c3-4594-9073-9001d2f8ac38

- Upload secret key file


https://github.com/user-attachments/assets/3a4a66df-e405-4d99-96bc-830c5f3e3ef8

- Copy / paste secret key (existing method) 


https://github.com/user-attachments/assets/77223397-969b-4808-965a-5cee78011557


## Tests
- [x] Able to add connection with drag / drop secret key
- [x] Able to add connection with uploaded secret key
- [x] Able to add connection with copy / paste secret key
- [x] Able to reconnect existing form with drag / drop secret key
- [x] Able to reconnect existing form with uploaded secret key
- [x] Able to reconnect existing form with copy / paste secret key

## Deploy Notes
**New scripts**:
- `packages/frontend/src/components/DragDropInput/index.tsx` : component
to incorporate both the drag and drop, and the file upload button input
- `packages/frontend/src/components/FileUpload/index.tsx` : component
for the file upload button input, this is separated out as it will be
used in upcoming feature development for uploading attachments

---------

Co-authored-by: Ian Chen <[email protected]>
## Problem
Email by Postman does not support CC.

## Solution
Add CC recipients field.

## Before & After Screenshots
**BEFORE**:
<img width="860" alt="Screenshot 2024-11-26 at 11 58 52 AM"
src="https://github.com/user-attachments/assets/7e181fef-6e6d-444a-8fe5-4a8e100f5c7f">

**AFTER**:
<img width="855" alt="Screenshot 2024-11-26 at 12 01 38 PM"
src="https://github.com/user-attachments/assets/46cfa69f-a643-4dd9-8ef1-b117bc33f04f">


## Tests
- [x] Existing email functionality works
- [x] Emails can be sent without CC recipients
- [x] Emails can be sent to 1 or many CC recipients
## Problem
Error message is unclear when Tile has been deleted.

## Solution
Add specific error message for when Tile has been deleted.

**Improvements**:
- Detailed error message for to inform user that Tile has been deleted
and to check on Tile
- Soft delete table collaborators when Tile is deleted

## Before & After Screenshots

**BEFORE**:

![image](https://github.com/user-attachments/assets/b9ed8966-db1d-4775-a7a7-46e2f75546ac)
<img width="1512" alt="Screenshot 2024-11-27 at 11 59 52 AM"
src="https://github.com/user-attachments/assets/e99a3dff-93b6-430e-8ba6-cbc6080383cc">
<img width="1512" alt="Screenshot 2024-11-27 at 12 02 27 PM"
src="https://github.com/user-attachments/assets/c4fb46eb-4378-49b4-85fa-c6a2f5d849ba">

**AFTER**:

![image](https://github.com/user-attachments/assets/01f15ab5-0662-4c42-9e13-55f4e15093ca)
<img width="1512" alt="Screenshot 2024-11-27 at 1 57 55 PM"
src="https://github.com/user-attachments/assets/d5c04c53-faaa-4fc1-8720-a53de1e44c0d">


## Tests
- [x] Existing pipes run without issues
- [x] Error is shown during pipe creation
- [x] Error is shown for failed pipe execution
# Problem
<img width="648" alt="image"
src="https://github.com/user-attachments/assets/9ff7ce7c-c331-4580-a07c-4c0ef6307a83">

# Solution
Autofocus input when creating new columns
<img width="457" alt="image"
src="https://github.com/user-attachments/assets/70f11364-e11a-4fcb-8e87-b4722d821f28">

Autofocus input when editing column names, reduce delete button size
<img width="327" alt="image"
src="https://github.com/user-attachments/assets/53649134-23a8-4201-b915-f3da3758f0c2">
@pregnantboy pregnantboy requested a review from a team as a code owner December 4, 2024 09:39
@datadog-opengovsg
Copy link

datadog-opengovsg bot commented Dec 4, 2024

Datadog Report

Branch report: develop-v2
Commit report: db01e24
Test service: plumber

✅ 0 Failed, 717 Passed, 0 Skipped, 2m 10.85s Total Time
➡️ Test Sessions change in coverage: 1 no change

## Problem
 
Postman actions cannot be re-tested when a partial success happened in
the last test step.


## Solution

Prevent partial retries in test runs.
@pregnantboy pregnantboy merged commit 16551e1 into production Dec 5, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants