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

Feat/link audit to include tags #1950

Merged
merged 75 commits into from
Sep 16, 2022
Merged

Conversation

thanhdatle
Copy link
Contributor

Deploy Notes

New scripts:

20220905_add_stringTags_column_to_url_and_url_history_tables.sql

-- This adds columns to both urls and url_histories
-- tables, which are backwards-compatible with the current
-- codebase as they default to empty strings.

@gweiying
Copy link
Contributor

Btw @thanhdatle just wanted to make sure that you saw @halfwhole's comments here too #1917

src/server/repositories/TagRepository.ts Show resolved Hide resolved
src/server/repositories/UrlRepository.ts Outdated Show resolved Hide resolved
src/server/repositories/UrlRepository.ts Show resolved Hide resolved
Copy link
Contributor

@gweiying gweiying left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks for working on this feature was a pretty heavyweight task!

Just wanted to tag @halfwhole for a final review since you left comments on the earlier PR #1917 too

Copy link
Collaborator

@halfwhole halfwhole left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

am only partially done with reviewing rn sorry :( but have some comments below for now. have checked in with the earlier PR #1917 and all comments from there have been resolved!

also I'd like to ask sometime (perhaps offline) to understand the role of the tagStrings column on the url table, and why denormalisation is preferred there

src/shared/util/validation.ts Outdated Show resolved Hide resolved
changes.tags &&
!_.isEqual(_.sortBy(urlDto.tags), _.sortBy(changes.tags))
) {
const newTags = await this.tagRepository.upsertTags(changes.tags, t)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we also delete the tags that are no longer present? worried about leaving behind orphaned tags

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the reason why we don't delete is that, user might want to see tags created before.
Making this optional for now, we can discuss with PM further.

Copy link
Collaborator

@halfwhole halfwhole Sep 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it possible to retrieve the list of previous tags from the user's link history? that could remove the need from storing them directly in the tags table

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be expensive to query from that table actually, since tags are stored as joined string there.

src/server/repositories/UrlRepository.ts Outdated Show resolved Hide resolved
src/server/models/tag.ts Show resolved Hide resolved
test/end-to-end/DrawerLogin.test.ts Show resolved Hide resolved
@thanhdatle
Copy link
Contributor Author

am only partially done with reviewing rn sorry :( but have some comments below for now. have checked in with the earlier PR #1917 and all comments from there have been resolved!

also I'd like to ask sometime (perhaps offline) to understand the role of the tagStrings column on the url table, and why denormalisation is preferred there

The TagStrings is in the url table so that the tag changes can be reflected in url_history table

@halfwhole
Copy link
Collaborator

The TagStrings is in the url table so that the tag changes can be reflected in url_history table

would it be possible to still get tagStrings for url_histories without mirroring it under urls (e.g. by modifying the create/update hooks to pull it from another source)? though understand that it can have downsides too - it could make the implementation more complicated, possibly incur extra reads, or make the columns in url_histories different from the columns in urls, which might not be great

also wondering what you think about representing tagStrings as a Postgres array, rather than serializing it with ; - seems more semantically correct but it's not standard SQL sadly!

Copy link
Collaborator

@halfwhole halfwhole left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

basically looks good to me! just a few more comments, but i'm no good at tests so forgive me if I leave weird/mistaken test-related comments ><

} = req.query
const tagList = tags ? tags.toString().toLowerCase().split(';') : []
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we use , to separate tags in queries? after a chat with Hena, we'll be using commas to delimit tags on the frontend in the search dropdown bar, and for consistency we might want that on the backend too

also where should we document that with multiple tags we have an OR condition rather than an AND condition 😅 I got confused at this bit

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pending for a discussion with PM on searching link by tags

test/server/repositories/UserRepository.test.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

@halfwhole halfwhole left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! 🎉

we're still pending input for some of the things above (e.g. how exactly searching for links by multiple tags works), but these can be addressed later on edit: resolved

also: is it safe to merge into develop directly? i created a separate feature branch feat/tags, but don't have to use it if we don't need to

Copy link
Contributor

@gweiying gweiying left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@thanhdatle thanhdatle merged commit 58a5429 into develop Sep 16, 2022
@halfwhole halfwhole deleted the feat/link-audit-to-include-tags branch September 16, 2022 06:10
gweiying pushed a commit that referenced this pull request Oct 6, 2022
* feat: added tags table and many to many rel to urls

* feat: create tag API to include tags

* feat: create tag API to include tags

* feat: create tag API to include tags

* feat: create tag API to include tags

* feat: create tag API to include tags

* feat: create tag API to include tags

* feat: create tag API to include tags

* feat: create tag API to include tags

* feat: create tag API to include tags

* feat: create tag API to include tags

* feat: create tag API to include tags

* feat: create tag API to include tags

* feat: create tag API to include tags

* feat: create tag API to include tags

* feat: create url API to include tags

* feat: create url API to include tags

* feat: create url API to include tags

* feat: create url API to include tags

* feat: create url API to include tags

* feat: create url API to include tags

* feat: create url API to include tags

* feat: create url API to include tags

* feat: update url API to include tags

* feat: update url API to include tags

* feat: update url API to include tags

* feat: update url API to include tags

* feat: update url API to include tags

* feat: update url API to include tags

* feat: update url API to include tags

* feat: update url API to include tags

* feat: update url API to include tags

* feat: update url API to include tags

* feat: update url API to include tags

* feat: update url API to include tags

* feat: update url API to include tags

* feat: search-link-with-tags

* feat: search-link-with-tags

* feat: search-link-with-tags

* feat: search-link-with-tags

* feat: search-link-with-tags

* feat: search-link-with-tags

* feat: search-link-with-tags

* feat: search-link-with-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: merge link-audit-to-include-tags with develop

* feat: link-audit-to-include-tags
jimvae added a commit that referenced this pull request Oct 16, 2022
…2007)

* Feat/link audit to include tags (#1950)

* feat: added tags table and many to many rel to urls

* feat: create tag API to include tags

* feat: create tag API to include tags

* feat: create tag API to include tags

* feat: create tag API to include tags

* feat: create tag API to include tags

* feat: create tag API to include tags

* feat: create tag API to include tags

* feat: create tag API to include tags

* feat: create tag API to include tags

* feat: create tag API to include tags

* feat: create tag API to include tags

* feat: create tag API to include tags

* feat: create tag API to include tags

* feat: create tag API to include tags

* feat: create url API to include tags

* feat: create url API to include tags

* feat: create url API to include tags

* feat: create url API to include tags

* feat: create url API to include tags

* feat: create url API to include tags

* feat: create url API to include tags

* feat: create url API to include tags

* feat: update url API to include tags

* feat: update url API to include tags

* feat: update url API to include tags

* feat: update url API to include tags

* feat: update url API to include tags

* feat: update url API to include tags

* feat: update url API to include tags

* feat: update url API to include tags

* feat: update url API to include tags

* feat: update url API to include tags

* feat: update url API to include tags

* feat: update url API to include tags

* feat: update url API to include tags

* feat: search-link-with-tags

* feat: search-link-with-tags

* feat: search-link-with-tags

* feat: search-link-with-tags

* feat: search-link-with-tags

* feat: search-link-with-tags

* feat: search-link-with-tags

* feat: search-link-with-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: merge link-audit-to-include-tags with develop

* feat: link-audit-to-include-tags

* feat: search for tags in lower cap (#1973)

* feat: search for tags in lower cap

* feat: search for tags in lower cap

* feat(tagging): add tags to link audit history (#1974)

* chore(datadog): refactor custom metric names (#1965)

* feat(tagging): add frontend tagging on create new link form (#1919)

* feat(tagging): add frontend tagging on create new link form

* chore: refactor autocomplete and address comments

* chore: refactor text field height and add disable submit checks

* chore: refactor max tag length in helper error message

* chore(tagging): refactor max number of tags per link

* chore(tagging): update tag validation tests for underscores

* feat(tagging): add dropdown for tags on user page search bar (#1934)

* feat(tagging): add dropdown for tags on user page search bar

* feat(tagging): add link icon on search dropdown

* feat(tagging): refactor link icon and add tag icon on search dropdown

* feat(tagging): revert link icon to original size

* build(deps): bump winston from 3.3.3 to 3.8.1 (#1889)

* build(deps): bump express-fileupload from 1.2.1 to 1.4.0 (#1890)

* feat(tagging): add frontend API integrations on create new link form (#1971)

* feat(tagging): add frontend tagging on create new link form

* chore: refactor autocomplete and address comments

* chore: refactor text field height and add disable submit checks

* chore: refactor max tag length in helper error message

* chore(tagging): refactor max number of tags per link

* chore(tagging): update tag validation tests for underscores

* feat(tagging): add frontend API integrations for create new link form

* chore(tagging): update tag validation tests for underscores

* chore(tagging): refactor tags to use redux instead of useState

* Feat/add tag to link audit frontend (#1975)

* feat: added TagList component by using mui/Chip to show tags in Link Audit

* feat: added TagList component by using mui/Chip to show tags in Link Audit

* feat: added TagList component by using mui/Chip to show tags in Link Audit

* feat(tagging): add editing of link tags (#1976)

* feat(tagging): add frontend tagging on create new link form

* chore: refactor autocomplete and address comments

* chore: refactor text field height and add disable submit checks

* chore: refactor max tag length in helper error message

* chore(tagging): refactor max number of tags per link

* chore(tagging): update tag validation tests for underscores

* feat(tagging): add frontend API integrations for create new link form

* chore(tagging): update tag validation tests for underscores

* chore(tagging): refactor tags to use redux instead of useState

* feat(tagging): add editing of link tags

* feat(tagging): use manual save button for editing link tags

* fix: return successful response when no URLs are found (#1979)

* fix(tagging): reset tags state after link creation (#1982)

* feat(tagging): add tags to links on user page (#1972)

* feat(tagging): add tags to links on user page

* feat(tagging): apply search when clicking on tags

* chore(tagging): remove duplicate identifier for tags

* fix: revise findUrlsForUser to return urls in correct order (#1981)

* fix: revise findUrlsForUser to return urls in correct order

* fix: revise findUrlsForUser to return urls in correct order

* fix: revise findUrlsForUser to return urls in correct order

* fix: revise findUrlsForUser to return urls in correct order

* fix: revise findUrlsForUser to return urls in correct order

* fix: revise findUrlsForUser to return urls in correct order

* fix: revise findUrlsForUser to return urls in correct order

* fix: revise findUrlsForUser to return urls in correct order

* fix: revise findUrlsForUser to return urls in correct order

* fix: fix urlMapper to correctly check for empty tagStrings before parsing (#1989)

* chore: remove disallowed file extensions (#1985)

* Fix/link tagging for file upload (#1986)

* fix: add tags when creating new link from file

* chore: update sentry message

* fix: wrap backend errors in json messages (#1991)

* fix(tagging): serialize single tags for file uploads (#1990)

* fix(tagging): serialize single tags for file uploads

* chore(tagging): add comment for preprocessing file tags

* feat: add job and job item models

* feat: add jobmanagementservice

* chore: fix conflicts

* chore: rename JobStatusEnum to JobItemStatusEnum

* chore: remove JobItemStatusEnum - Ready

* chore: replaced isSuccess to getJobStatus in JobManagementService

Co-authored-by: thanhdatle <thanhdat.toby@gmail.com>
Co-authored-by: halfwhole <41856541+halfwhole@users.noreply.github.com>
gweiying added a commit that referenced this pull request Dec 5, 2022
* feat: bulk frontend modal (#1958)

* chore: create new CreateTypeButton for CreateLinkForm

* chore: swap isFile state boolean to createType enum

* chore: add CreateType BULK button

* feat: add BulkUpload form

* chore: fix button disabling check

* chore: add download sample csv functionality

* fix: bugs

* chore: add user actions for bulk create

* fix: misspelling and children nesting

* chore: remove isFile from LinkFormStyles

* chore: try to fix the css

* chore: refactor FileInputField component (#1960)

* chore: refactor FileInputField component

* fix: remove unused styles

* feat: connect bulk csv upload to backend

* fix: tag serialization and deserialization on FormData

* fix: renamed button

* chore: add e2e tests for bulk creation (#2022)

* chore: add e2e tests for bulk creation

* chore: clean up unused code

Co-authored-by: halfwhole <41856541+halfwhole@users.noreply.github.com>

* chore: add small wait time to stop test flakiness

Co-authored-by: halfwhole <41856541+halfwhole@users.noreply.github.com>

* feat(bulk-backend): Job and JobItem DB model, repository and service (#2007)

* Feat/link audit to include tags (#1950)

* feat: added tags table and many to many rel to urls

* feat: create tag API to include tags

* feat: create tag API to include tags

* feat: create tag API to include tags

* feat: create tag API to include tags

* feat: create tag API to include tags

* feat: create tag API to include tags

* feat: create tag API to include tags

* feat: create tag API to include tags

* feat: create tag API to include tags

* feat: create tag API to include tags

* feat: create tag API to include tags

* feat: create tag API to include tags

* feat: create tag API to include tags

* feat: create tag API to include tags

* feat: create url API to include tags

* feat: create url API to include tags

* feat: create url API to include tags

* feat: create url API to include tags

* feat: create url API to include tags

* feat: create url API to include tags

* feat: create url API to include tags

* feat: create url API to include tags

* feat: update url API to include tags

* feat: update url API to include tags

* feat: update url API to include tags

* feat: update url API to include tags

* feat: update url API to include tags

* feat: update url API to include tags

* feat: update url API to include tags

* feat: update url API to include tags

* feat: update url API to include tags

* feat: update url API to include tags

* feat: update url API to include tags

* feat: update url API to include tags

* feat: update url API to include tags

* feat: search-link-with-tags

* feat: search-link-with-tags

* feat: search-link-with-tags

* feat: search-link-with-tags

* feat: search-link-with-tags

* feat: search-link-with-tags

* feat: search-link-with-tags

* feat: search-link-with-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: merge link-audit-to-include-tags with develop

* feat: link-audit-to-include-tags

* feat: search for tags in lower cap (#1973)

* feat: search for tags in lower cap

* feat: search for tags in lower cap

* feat(tagging): add tags to link audit history (#1974)

* chore(datadog): refactor custom metric names (#1965)

* feat(tagging): add frontend tagging on create new link form (#1919)

* feat(tagging): add frontend tagging on create new link form

* chore: refactor autocomplete and address comments

* chore: refactor text field height and add disable submit checks

* chore: refactor max tag length in helper error message

* chore(tagging): refactor max number of tags per link

* chore(tagging): update tag validation tests for underscores

* feat(tagging): add dropdown for tags on user page search bar (#1934)

* feat(tagging): add dropdown for tags on user page search bar

* feat(tagging): add link icon on search dropdown

* feat(tagging): refactor link icon and add tag icon on search dropdown

* feat(tagging): revert link icon to original size

* build(deps): bump winston from 3.3.3 to 3.8.1 (#1889)

* build(deps): bump express-fileupload from 1.2.1 to 1.4.0 (#1890)

* feat(tagging): add frontend API integrations on create new link form (#1971)

* feat(tagging): add frontend tagging on create new link form

* chore: refactor autocomplete and address comments

* chore: refactor text field height and add disable submit checks

* chore: refactor max tag length in helper error message

* chore(tagging): refactor max number of tags per link

* chore(tagging): update tag validation tests for underscores

* feat(tagging): add frontend API integrations for create new link form

* chore(tagging): update tag validation tests for underscores

* chore(tagging): refactor tags to use redux instead of useState

* Feat/add tag to link audit frontend (#1975)

* feat: added TagList component by using mui/Chip to show tags in Link Audit

* feat: added TagList component by using mui/Chip to show tags in Link Audit

* feat: added TagList component by using mui/Chip to show tags in Link Audit

* feat(tagging): add editing of link tags (#1976)

* feat(tagging): add frontend tagging on create new link form

* chore: refactor autocomplete and address comments

* chore: refactor text field height and add disable submit checks

* chore: refactor max tag length in helper error message

* chore(tagging): refactor max number of tags per link

* chore(tagging): update tag validation tests for underscores

* feat(tagging): add frontend API integrations for create new link form

* chore(tagging): update tag validation tests for underscores

* chore(tagging): refactor tags to use redux instead of useState

* feat(tagging): add editing of link tags

* feat(tagging): use manual save button for editing link tags

* fix: return successful response when no URLs are found (#1979)

* fix(tagging): reset tags state after link creation (#1982)

* feat(tagging): add tags to links on user page (#1972)

* feat(tagging): add tags to links on user page

* feat(tagging): apply search when clicking on tags

* chore(tagging): remove duplicate identifier for tags

* fix: revise findUrlsForUser to return urls in correct order (#1981)

* fix: revise findUrlsForUser to return urls in correct order

* fix: revise findUrlsForUser to return urls in correct order

* fix: revise findUrlsForUser to return urls in correct order

* fix: revise findUrlsForUser to return urls in correct order

* fix: revise findUrlsForUser to return urls in correct order

* fix: revise findUrlsForUser to return urls in correct order

* fix: revise findUrlsForUser to return urls in correct order

* fix: revise findUrlsForUser to return urls in correct order

* fix: revise findUrlsForUser to return urls in correct order

* fix: fix urlMapper to correctly check for empty tagStrings before parsing (#1989)

* chore: remove disallowed file extensions (#1985)

* Fix/link tagging for file upload (#1986)

* fix: add tags when creating new link from file

* chore: update sentry message

* fix: wrap backend errors in json messages (#1991)

* fix(tagging): serialize single tags for file uploads (#1990)

* fix(tagging): serialize single tags for file uploads

* chore(tagging): add comment for preprocessing file tags

* feat: add job and job item models

* feat: add jobmanagementservice

* chore: fix conflicts

* chore: rename JobStatusEnum to JobItemStatusEnum

* chore: remove JobItemStatusEnum - Ready

* chore: replaced isSuccess to getJobStatus in JobManagementService

Co-authored-by: thanhdatle <thanhdat.toby@gmail.com>
Co-authored-by: halfwhole <41856541+halfwhole@users.noreply.github.com>

* chore: add error message for invalid date string and csv header

* Feat/bulk/frontend/status bar (#2040)

* chore: add icons

* feat: add StatusBarComponent

* chore: fix alignment

* chore: add actions and reducers

* chore: fix JSX linting error with eslint

* chore: attach actions and reducers to StatusBar component

* chore: display QR code inprogress after bulk upload (#2041)

* fix: combine class styles

* chore: add docs inline for disabling eslint no-undef

* Feat/bulk/frontend/status bar button (#2047)

* chore: refactor existing DownloadButton to separate component from logic

* chore: add CloseButton as a reusable component

* chore: add DownloadBulkButton to StatusBar

* chore: styling

* chore: rename icon

* Feat/bulk/all lambda (#2033)

* feat: add lambda deployment and sample code

* feat: add qrcode and zip lambda code

* feat: add createCsv, uploadToS3 and sendsqsMessage logic

* feat: update handler logic

* feat: stream files to s3 bulk-qrcode-generation

* chore: add assets

* chore: add sns publish method

* chore: refactor code

* chore: temp remove unnecessary ci build commadns

* chore: fix qrcode url

* chore: import services instead of functions

* Revert "chore: temp remove unnecessary ci build commadns"

This reverts commit f4474a19e25a82aa0205fdc5bdb7c7ef8562824a.

* chore: set memorySize, ephemeralStorageSize, timeout on serverless

* fix: clean up dir on err

* chore: use archiver directory false

* chore: remove streamToS3 from exports

* chore: set domain in env variables

Co-authored-by: Alexis <gweiying@gmail.com>

* Feat/bulk/all cleanup unused (#2082)

* chore: remove JobItemType from JobItem

* chore: remove JobItemStatusEnum Ready

* chore: refactor Job module to group files and remove mappers

Co-authored-by: Jim Engay <e0425954@u.nus.edu>

* Feat/bulk/all create job (#2083)

* feat: add sqs client and service

* feat: create job and job items and sendSqsmessage in bulk controller

* chore: move qrCode job creation into JobController

* chore: generalize sqs message sending

* chore: add sqs timeout

* chore: fix missing region

* chore: create qrBatchSize and sqsRegion env variable

* chore: fix error logging and type

* chore: fix bulk tests

* chore: fix lambda params

* chore: fix env variable documentation

Co-authored-by: Jim Engay <e0425954@u.nus.edu>

* Feat/bulk/all update job (#2085)

* feat: add sqs client and service

* feat: create job and job items and sendSqsmessage in bulk controller

* chore: move qrCode job creation into JobController

* chore: generalize sqs message sending

* chore: add sqs timeout

* chore: fix missing region

* chore: create qrBatchSize and sqsRegion env variable

* chore: fix error logging and type

* chore: fix bulk tests

* chore: fix lambda params

* chore: add JobItemId to job_items model for easy update

* chore: refactor logic to update jobItemStatus

* feat: expose endpoint to update jobItem

* chore: use env var for lambda hash value

* chore: use http post request to send completion callback

* chore: fix validation

* chore: add tests

* chore: fix error catching for lambda

* chore: add status to job table

* chore: add logic to update job after job item callback

* chore: fix tests

* chore: fix tests

* fix: call next to pass control

* fix: typo in docs

Co-authored-by: halfwhole <41856541+halfwhole@users.noreply.github.com>

* chore: refactor job status computation logic

Co-authored-by: halfwhole <41856541+halfwhole@users.noreply.github.com>

* chore: fix lint errors after merging suggestions

* chore: attach only jobId to req body in updateJobItem

* chore: change enum from Failed to Failure

* chore: add unique constraint on jobItemId

Co-authored-by: Jim Engay <e0425954@u.nus.edu>
Co-authored-by: halfwhole <41856541+halfwhole@users.noreply.github.com>

* Feat/bulk/all get job server (#2092)

* feat: add sqs client and service

* feat: create job and job items and sendSqsmessage in bulk controller

* chore: move qrCode job creation into JobController

* chore: generalize sqs message sending

* chore: add sqs timeout

* chore: fix missing region

* chore: create qrBatchSize and sqsRegion env variable

* chore: fix error logging and type

* chore: fix bulk tests

* chore: fix lambda params

* chore: add JobItemId to job_items model for easy update

* chore: refactor logic to update jobItemStatus

* feat: expose endpoint to update jobItem

* chore: use env var for lambda hash value

* chore: use http post request to send completion callback

* chore: fix validation

* chore: add tests

* chore: fix error catching for lambda

* chore: add status to job table

* chore: add logic to update job after job item callback

* chore: fix tests

* chore: fix tests

* fix: call next to pass control

* fix: typo in docs

Co-authored-by: halfwhole <41856541+halfwhole@users.noreply.github.com>

* chore: refactor job status computation logic

Co-authored-by: halfwhole <41856541+halfwhole@users.noreply.github.com>

* chore: fix lint errors after merging suggestions

* chore: attach only jobId to req body in updateJobItem

* chore: change enum from Failed to Failure

* fix: add env variable to feature flag job creation

* chore: add repository methods to retrieve jobs

* chore: add service methods for long polling and retrieving job information

* chore: add endpoints for users to retrieve their latest job and updated job status

* chore: add tests

* fix: add env variables to docker-compose

* chore: add env variable for bulk download bucket

* chore: fix tests

* chore: fix typos in test

* chore: fix tests

* chore: change job status endpoint to get

* chore: rename jobItemIds to jobItemUrls

* chore: update error statuses

* chore: fix lint errors

Co-authored-by: Jim Engay <e0425954@u.nus.edu>
Co-authored-by: halfwhole <41856541+halfwhole@users.noreply.github.com>

* Feat/bulk/all get job client (#2093)

* feat: add sqs client and service

* feat: create job and job items and sendSqsmessage in bulk controller

* chore: move qrCode job creation into JobController

* chore: generalize sqs message sending

* chore: add sqs timeout

* chore: fix missing region

* chore: create qrBatchSize and sqsRegion env variable

* chore: fix error logging and type

* chore: fix bulk tests

* chore: fix lambda params

* chore: add JobItemId to job_items model for easy update

* chore: refactor logic to update jobItemStatus

* feat: expose endpoint to update jobItem

* chore: use env var for lambda hash value

* chore: use http post request to send completion callback

* chore: fix validation

* chore: add tests

* chore: fix error catching for lambda

* chore: add status to job table

* chore: add logic to update job after job item callback

* chore: fix tests

* chore: fix tests

* fix: call next to pass control

* fix: add env variable to feature flag job creation

* chore: add repository methods to retrieve jobs

* chore: add service methods for long polling and retrieving job information

* chore: add endpoints for users to retrieve their latest job and updated job status

* chore: add tests

* fix: add env variables to docker-compose

* chore: add env variable for bulk download bucket

* fix: env variable naming in docker-compose

* chore: fix tests

* chore: fix tests

* fix: status bar should appear even if no urls

* chore: pass download urls to Download QR code button

* chore: add callback variable to actions and reducers

* chore: remove redundant bulkQRCodesStarted action

* chore: add client-side logic to retrieve user job

* chore: add component logic for status bar

* chore: fix end to end tests

* fix: uncomment sqs.sendService function

* chore: update api call on client for job update

Co-authored-by: Jim Engay <e0425954@u.nus.edu>

* Feat/bulk/all email send (#2099)

* chore: make sender domain optional

* chore: add email sending for job completion

* chore: fix local mailDev logging for non-OTP emails

* chore: fix types

* chore: fix tests

* Fix/bulk/all errors (#2102)

* chore: add dogstatsd variables

* fix: add promise to papaparse and refactor bulk validation

* chore: fix bulk upload error styling and handling

* chore: fix tests

* chore: fix types

* chore: add enums to shared folder

* chore: add email sending logic into email service

* chore: fix copy (#2103)

* chore: fix copy

* chore: update copy

Co-authored-by: halfwhole <41856541+halfwhole@users.noreply.github.com>

Co-authored-by: halfwhole <41856541+halfwhole@users.noreply.github.com>

* Feat/bulk/all api guard (#2104)

* chore: refactor guard to use api key access

* chore: remove unused env variables and files

* chore: add tests

* chore: remove admin default email

* chore: fix email copy (#2107)

* chore: get header from shared folder

* chore: create shared types for bulk download file names

* chore: remove duplicate REPLICA_URI

* chore: add unauthorized error message

Co-authored-by: Jim Engay <e0425954@u.nus.edu>
Co-authored-by: halfwhole <41856541+halfwhole@users.noreply.github.com>
Co-authored-by: Jim Vincent Andes Engay <65295129+jimvae@users.noreply.github.com>
Co-authored-by: thanhdatle <thanhdat.toby@gmail.com>
gweiying added a commit that referenced this pull request Dec 6, 2022
* feat: bulk frontend modal (#1958)

* chore: create new CreateTypeButton for CreateLinkForm

* chore: swap isFile state boolean to createType enum

* chore: add CreateType BULK button

* feat: add BulkUpload form

* chore: fix button disabling check

* chore: add download sample csv functionality

* fix: bugs

* chore: add user actions for bulk create

* fix: misspelling and children nesting

* chore: remove isFile from LinkFormStyles

* chore: try to fix the css

* chore: refactor FileInputField component (#1960)

* chore: refactor FileInputField component

* fix: remove unused styles

* feat: connect bulk csv upload to backend

* fix: tag serialization and deserialization on FormData

* fix: renamed button

* chore: add e2e tests for bulk creation (#2022)

* chore: add e2e tests for bulk creation

* chore: clean up unused code

Co-authored-by: halfwhole <41856541+halfwhole@users.noreply.github.com>

* chore: add small wait time to stop test flakiness

Co-authored-by: halfwhole <41856541+halfwhole@users.noreply.github.com>

* feat(bulk-backend): Job and JobItem DB model, repository and service (#2007)

* Feat/link audit to include tags (#1950)

* feat: added tags table and many to many rel to urls

* feat: create tag API to include tags

* feat: create tag API to include tags

* feat: create tag API to include tags

* feat: create tag API to include tags

* feat: create tag API to include tags

* feat: create tag API to include tags

* feat: create tag API to include tags

* feat: create tag API to include tags

* feat: create tag API to include tags

* feat: create tag API to include tags

* feat: create tag API to include tags

* feat: create tag API to include tags

* feat: create tag API to include tags

* feat: create tag API to include tags

* feat: create url API to include tags

* feat: create url API to include tags

* feat: create url API to include tags

* feat: create url API to include tags

* feat: create url API to include tags

* feat: create url API to include tags

* feat: create url API to include tags

* feat: create url API to include tags

* feat: update url API to include tags

* feat: update url API to include tags

* feat: update url API to include tags

* feat: update url API to include tags

* feat: update url API to include tags

* feat: update url API to include tags

* feat: update url API to include tags

* feat: update url API to include tags

* feat: update url API to include tags

* feat: update url API to include tags

* feat: update url API to include tags

* feat: update url API to include tags

* feat: update url API to include tags

* feat: search-link-with-tags

* feat: search-link-with-tags

* feat: search-link-with-tags

* feat: search-link-with-tags

* feat: search-link-with-tags

* feat: search-link-with-tags

* feat: search-link-with-tags

* feat: search-link-with-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: link-audit-to-include-tags

* feat: merge link-audit-to-include-tags with develop

* feat: link-audit-to-include-tags

* feat: search for tags in lower cap (#1973)

* feat: search for tags in lower cap

* feat: search for tags in lower cap

* feat(tagging): add tags to link audit history (#1974)

* chore(datadog): refactor custom metric names (#1965)

* feat(tagging): add frontend tagging on create new link form (#1919)

* feat(tagging): add frontend tagging on create new link form

* chore: refactor autocomplete and address comments

* chore: refactor text field height and add disable submit checks

* chore: refactor max tag length in helper error message

* chore(tagging): refactor max number of tags per link

* chore(tagging): update tag validation tests for underscores

* feat(tagging): add dropdown for tags on user page search bar (#1934)

* feat(tagging): add dropdown for tags on user page search bar

* feat(tagging): add link icon on search dropdown

* feat(tagging): refactor link icon and add tag icon on search dropdown

* feat(tagging): revert link icon to original size

* build(deps): bump winston from 3.3.3 to 3.8.1 (#1889)

* build(deps): bump express-fileupload from 1.2.1 to 1.4.0 (#1890)

* feat(tagging): add frontend API integrations on create new link form (#1971)

* feat(tagging): add frontend tagging on create new link form

* chore: refactor autocomplete and address comments

* chore: refactor text field height and add disable submit checks

* chore: refactor max tag length in helper error message

* chore(tagging): refactor max number of tags per link

* chore(tagging): update tag validation tests for underscores

* feat(tagging): add frontend API integrations for create new link form

* chore(tagging): update tag validation tests for underscores

* chore(tagging): refactor tags to use redux instead of useState

* Feat/add tag to link audit frontend (#1975)

* feat: added TagList component by using mui/Chip to show tags in Link Audit

* feat: added TagList component by using mui/Chip to show tags in Link Audit

* feat: added TagList component by using mui/Chip to show tags in Link Audit

* feat(tagging): add editing of link tags (#1976)

* feat(tagging): add frontend tagging on create new link form

* chore: refactor autocomplete and address comments

* chore: refactor text field height and add disable submit checks

* chore: refactor max tag length in helper error message

* chore(tagging): refactor max number of tags per link

* chore(tagging): update tag validation tests for underscores

* feat(tagging): add frontend API integrations for create new link form

* chore(tagging): update tag validation tests for underscores

* chore(tagging): refactor tags to use redux instead of useState

* feat(tagging): add editing of link tags

* feat(tagging): use manual save button for editing link tags

* fix: return successful response when no URLs are found (#1979)

* fix(tagging): reset tags state after link creation (#1982)

* feat(tagging): add tags to links on user page (#1972)

* feat(tagging): add tags to links on user page

* feat(tagging): apply search when clicking on tags

* chore(tagging): remove duplicate identifier for tags

* fix: revise findUrlsForUser to return urls in correct order (#1981)

* fix: revise findUrlsForUser to return urls in correct order

* fix: revise findUrlsForUser to return urls in correct order

* fix: revise findUrlsForUser to return urls in correct order

* fix: revise findUrlsForUser to return urls in correct order

* fix: revise findUrlsForUser to return urls in correct order

* fix: revise findUrlsForUser to return urls in correct order

* fix: revise findUrlsForUser to return urls in correct order

* fix: revise findUrlsForUser to return urls in correct order

* fix: revise findUrlsForUser to return urls in correct order

* fix: fix urlMapper to correctly check for empty tagStrings before parsing (#1989)

* chore: remove disallowed file extensions (#1985)

* Fix/link tagging for file upload (#1986)

* fix: add tags when creating new link from file

* chore: update sentry message

* fix: wrap backend errors in json messages (#1991)

* fix(tagging): serialize single tags for file uploads (#1990)

* fix(tagging): serialize single tags for file uploads

* chore(tagging): add comment for preprocessing file tags

* feat: add job and job item models

* feat: add jobmanagementservice

* chore: fix conflicts

* chore: rename JobStatusEnum to JobItemStatusEnum

* chore: remove JobItemStatusEnum - Ready

* chore: replaced isSuccess to getJobStatus in JobManagementService

Co-authored-by: thanhdatle <thanhdat.toby@gmail.com>
Co-authored-by: halfwhole <41856541+halfwhole@users.noreply.github.com>

* chore: add error message for invalid date string and csv header

* Feat/bulk/frontend/status bar (#2040)

* chore: add icons

* feat: add StatusBarComponent

* chore: fix alignment

* chore: add actions and reducers

* chore: fix JSX linting error with eslint

* chore: attach actions and reducers to StatusBar component

* chore: display QR code inprogress after bulk upload (#2041)

* fix: combine class styles

* chore: add docs inline for disabling eslint no-undef

* Feat/bulk/frontend/status bar button (#2047)

* chore: refactor existing DownloadButton to separate component from logic

* chore: add CloseButton as a reusable component

* chore: add DownloadBulkButton to StatusBar

* chore: styling

* chore: rename icon

* Feat/bulk/all lambda (#2033)

* feat: add lambda deployment and sample code

* feat: add qrcode and zip lambda code

* feat: add createCsv, uploadToS3 and sendsqsMessage logic

* feat: update handler logic

* feat: stream files to s3 bulk-qrcode-generation

* chore: add assets

* chore: add sns publish method

* chore: refactor code

* chore: temp remove unnecessary ci build commadns

* chore: fix qrcode url

* chore: import services instead of functions

* Revert "chore: temp remove unnecessary ci build commadns"

This reverts commit f4474a19e25a82aa0205fdc5bdb7c7ef8562824a.

* chore: set memorySize, ephemeralStorageSize, timeout on serverless

* fix: clean up dir on err

* chore: use archiver directory false

* chore: remove streamToS3 from exports

* chore: set domain in env variables

Co-authored-by: Alexis <gweiying@gmail.com>

* Feat/bulk/all cleanup unused (#2082)

* chore: remove JobItemType from JobItem

* chore: remove JobItemStatusEnum Ready

* chore: refactor Job module to group files and remove mappers

Co-authored-by: Jim Engay <e0425954@u.nus.edu>

* Feat/bulk/all create job (#2083)

* feat: add sqs client and service

* feat: create job and job items and sendSqsmessage in bulk controller

* chore: move qrCode job creation into JobController

* chore: generalize sqs message sending

* chore: add sqs timeout

* chore: fix missing region

* chore: create qrBatchSize and sqsRegion env variable

* chore: fix error logging and type

* chore: fix bulk tests

* chore: fix lambda params

* chore: fix env variable documentation

Co-authored-by: Jim Engay <e0425954@u.nus.edu>

* Feat/bulk/all update job (#2085)

* feat: add sqs client and service

* feat: create job and job items and sendSqsmessage in bulk controller

* chore: move qrCode job creation into JobController

* chore: generalize sqs message sending

* chore: add sqs timeout

* chore: fix missing region

* chore: create qrBatchSize and sqsRegion env variable

* chore: fix error logging and type

* chore: fix bulk tests

* chore: fix lambda params

* chore: add JobItemId to job_items model for easy update

* chore: refactor logic to update jobItemStatus

* feat: expose endpoint to update jobItem

* chore: use env var for lambda hash value

* chore: use http post request to send completion callback

* chore: fix validation

* chore: add tests

* chore: fix error catching for lambda

* chore: add status to job table

* chore: add logic to update job after job item callback

* chore: fix tests

* chore: fix tests

* fix: call next to pass control

* fix: typo in docs

Co-authored-by: halfwhole <41856541+halfwhole@users.noreply.github.com>

* chore: refactor job status computation logic

Co-authored-by: halfwhole <41856541+halfwhole@users.noreply.github.com>

* chore: fix lint errors after merging suggestions

* chore: attach only jobId to req body in updateJobItem

* chore: change enum from Failed to Failure

* chore: add unique constraint on jobItemId

Co-authored-by: Jim Engay <e0425954@u.nus.edu>
Co-authored-by: halfwhole <41856541+halfwhole@users.noreply.github.com>

* Feat/bulk/all get job server (#2092)

* feat: add sqs client and service

* feat: create job and job items and sendSqsmessage in bulk controller

* chore: move qrCode job creation into JobController

* chore: generalize sqs message sending

* chore: add sqs timeout

* chore: fix missing region

* chore: create qrBatchSize and sqsRegion env variable

* chore: fix error logging and type

* chore: fix bulk tests

* chore: fix lambda params

* chore: add JobItemId to job_items model for easy update

* chore: refactor logic to update jobItemStatus

* feat: expose endpoint to update jobItem

* chore: use env var for lambda hash value

* chore: use http post request to send completion callback

* chore: fix validation

* chore: add tests

* chore: fix error catching for lambda

* chore: add status to job table

* chore: add logic to update job after job item callback

* chore: fix tests

* chore: fix tests

* fix: call next to pass control

* fix: typo in docs

Co-authored-by: halfwhole <41856541+halfwhole@users.noreply.github.com>

* chore: refactor job status computation logic

Co-authored-by: halfwhole <41856541+halfwhole@users.noreply.github.com>

* chore: fix lint errors after merging suggestions

* chore: attach only jobId to req body in updateJobItem

* chore: change enum from Failed to Failure

* fix: add env variable to feature flag job creation

* chore: add repository methods to retrieve jobs

* chore: add service methods for long polling and retrieving job information

* chore: add endpoints for users to retrieve their latest job and updated job status

* chore: add tests

* fix: add env variables to docker-compose

* chore: add env variable for bulk download bucket

* chore: fix tests

* chore: fix typos in test

* chore: fix tests

* chore: change job status endpoint to get

* chore: rename jobItemIds to jobItemUrls

* chore: update error statuses

* chore: fix lint errors

Co-authored-by: Jim Engay <e0425954@u.nus.edu>
Co-authored-by: halfwhole <41856541+halfwhole@users.noreply.github.com>

* Feat/bulk/all get job client (#2093)

* feat: add sqs client and service

* feat: create job and job items and sendSqsmessage in bulk controller

* chore: move qrCode job creation into JobController

* chore: generalize sqs message sending

* chore: add sqs timeout

* chore: fix missing region

* chore: create qrBatchSize and sqsRegion env variable

* chore: fix error logging and type

* chore: fix bulk tests

* chore: fix lambda params

* chore: add JobItemId to job_items model for easy update

* chore: refactor logic to update jobItemStatus

* feat: expose endpoint to update jobItem

* chore: use env var for lambda hash value

* chore: use http post request to send completion callback

* chore: fix validation

* chore: add tests

* chore: fix error catching for lambda

* chore: add status to job table

* chore: add logic to update job after job item callback

* chore: fix tests

* chore: fix tests

* fix: call next to pass control

* fix: add env variable to feature flag job creation

* chore: add repository methods to retrieve jobs

* chore: add service methods for long polling and retrieving job information

* chore: add endpoints for users to retrieve their latest job and updated job status

* chore: add tests

* fix: add env variables to docker-compose

* chore: add env variable for bulk download bucket

* fix: env variable naming in docker-compose

* chore: fix tests

* chore: fix tests

* fix: status bar should appear even if no urls

* chore: pass download urls to Download QR code button

* chore: add callback variable to actions and reducers

* chore: remove redundant bulkQRCodesStarted action

* chore: add client-side logic to retrieve user job

* chore: add component logic for status bar

* chore: fix end to end tests

* fix: uncomment sqs.sendService function

* chore: update api call on client for job update

Co-authored-by: Jim Engay <e0425954@u.nus.edu>

* Feat/bulk/all email send (#2099)

* chore: make sender domain optional

* chore: add email sending for job completion

* chore: fix local mailDev logging for non-OTP emails

* chore: fix types

* chore: fix tests

* Fix/bulk/all errors (#2102)

* chore: add dogstatsd variables

* fix: add promise to papaparse and refactor bulk validation

* chore: fix bulk upload error styling and handling

* chore: fix tests

* chore: fix types

* chore: add enums to shared folder

* chore: add email sending logic into email service

* chore: fix copy (#2103)

* chore: fix copy

* chore: update copy

Co-authored-by: halfwhole <41856541+halfwhole@users.noreply.github.com>

Co-authored-by: halfwhole <41856541+halfwhole@users.noreply.github.com>

* Feat/bulk/all api guard (#2104)

* chore: refactor guard to use api key access

* chore: remove unused env variables and files

* chore: add tests

* chore: remove admin default email

* chore: fix email copy (#2107)

* chore: get header from shared folder

* chore: create shared types for bulk download file names

* chore: remove duplicate REPLICA_URI

* chore: add unauthorized error message

Co-authored-by: Jim Engay <e0425954@u.nus.edu>
Co-authored-by: halfwhole <41856541+halfwhole@users.noreply.github.com>
Co-authored-by: Jim Vincent Andes Engay <65295129+jimvae@users.noreply.github.com>
Co-authored-by: thanhdatle <thanhdat.toby@gmail.com>
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