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

User Customize Labels #946

Merged
merged 15 commits into from
Jul 19, 2024
Merged

User Customize Labels #946

merged 15 commits into from
Jul 19, 2024

Conversation

jiji14
Copy link
Contributor

@jiji14 jiji14 commented Dec 1, 2023

Related Issue

What I added

  1. getUserCustomLabels: Retrieve user's custom labels with keys(mode, purpose, replaced_mode) from the database and return a string array sorted by frequency.
  2. insertUserCustomLabel: Insert the user's custom label with a key in the database and then return the updated label.
  3. updateUserCustomLabel: Update the user's custom label with a key, including frequency, in the database and then return the updated label.
  4. deleteUserCustomLabel: Change the user's custom label with a key as !isActive in the database and then return the updated modes.

Unit Tests

  1. getUserCustomLabels
  2. InsertUserCustomLabel
  3. UpdateUserCustomLabel
  4. DeleteUserCustomLabel

Result

[ Database ]

Screenshot 2023-12-13 at 2 01 24 PM

[ UI ]

ui1 ui2 ui3

@jiji14 jiji14 marked this pull request as draft December 1, 2023 21:10
Increase new mode frequency(+1) and decrease old frequency(-1)
Reason: Javascript doesn't have sorted map data structure. We need to send the response value in sorted list.
@jiji14 jiji14 changed the title Customize Mode Feature - Step 1 Customize Mode Functions Dec 19, 2023
@jiji14 jiji14 marked this pull request as ready for review December 20, 2023 01:14
@jiji14 jiji14 changed the title Customize Mode Functions User Customize Mode Functions Dec 20, 2023
@jiji14 jiji14 changed the title User Customize Mode Functions User Customize Labels Jan 5, 2024
@@ -127,10 +127,14 @@ def getSettings(self):

@staticmethod
def createProfile(uuid, ts):
initProfileObj = {'user_id': uuid,
initProfileObj = {
'user_id': uuid,
'source':'Shankari',
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: can eventually remove this source since it is hardcoded and never used. I don't remember the full history (will need to check the blame) but IIRC, it was an early attempt at multi-tenancy (e.g. users from my team versus from other teams at Berkeley)

@shankari shankari merged commit cecde58 into e-mission:master Jul 19, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants