-
-
Notifications
You must be signed in to change notification settings - Fork 181
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
[TASK-882] [TASK-1186] Project activity details modal #5210
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
move all activity related constants to separate file
# Conflicts: # jsapp/js/components/activity/activityLogs.query.ts # jsapp/js/components/activity/formActivity.tsx
magicznyleszek
changed the title
[TASK-882] Project activity details modal
[TASK-882] [TASK-1186] Project activity details modal
Oct 30, 2024
# Conflicts: # jsapp/js/components/activity/activityLogs.query.ts # jsapp/js/components/activity/formActivity.tsx
pauloamorimbr
approved these changes
Nov 1, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice! 💯
Comment on lines
+22
to
+66
// user info | ||
const testUsernames = ['Trent', 'Jane', 'Alice', 'Bob', 'Charlie']; | ||
const username = testUsernames[Math.floor(Math.random() * testUsernames.length)]; | ||
const user = `https://kf.beta.kbtdev.org/api/v2/users/${username.toLowerCase()}>/`; | ||
const user_uid = String(Math.random()); | ||
|
||
// action | ||
const action = Object.keys(AuditActions)[Math.floor(Math.random() * Object.keys(AuditActions).length)]; | ||
|
||
// log type | ||
const log_type = Object.keys(AuditTypes)[Math.floor(Math.random() * Object.keys(AuditTypes).length)]; | ||
|
||
// metadata | ||
const log_subtype = Object.keys(AuditSubTypes)[Math.floor(Math.random() * Object.keys(AuditSubTypes).length)]; | ||
const testSources = ['MacOS', 'iOS', 'Windows 98', 'CrunchBang Linux']; | ||
const source = testSources[Math.floor(Math.random() * testSources.length)]; | ||
const asset_uid = String(Math.random()); | ||
const ip_address = (Math.floor(Math.random() * 255) + 1) + '.' + (Math.floor(Math.random() * 255)) + '.' + (Math.floor(Math.random() * 255)) + '.' + (Math.floor(Math.random() * 255)); | ||
|
||
const metadata: ActivityLogsItem['metadata'] = { | ||
source, | ||
asset_uid, | ||
ip_address, | ||
log_subtype: log_subtype as AuditSubTypes, | ||
}; | ||
|
||
if (action === 'update-name') { | ||
metadata.old_name = 'I kwno somethign'; | ||
metadata.new_name = 'I know something'; | ||
} | ||
if (action === 'deploy' || action === 'redeploy') { | ||
metadata.latest_deployed_version_id = 'asd123f3fz'; | ||
} | ||
if (action === 'replace-form' || action === 'update-form') { | ||
metadata.latest_version_id = 'aet4b1213c'; | ||
} | ||
if ( | ||
action === 'add-user' || | ||
action === 'remove-user' || | ||
action === 'update-permission' || | ||
action === 'transfer' | ||
) { | ||
metadata.second_user = 'Josh'; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice extends to the mock! 👍🏻
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Checklist
./python-format.sh
to make sure that your code lints and that you've followed our coding styleDescription
Adds modal for "See details" button in the Project > Settings > Activity section.
Notes
Based on a discussion on Zulip and initial data architecture described at Notion I have created a "final" TS interface for all possible activities and a modal that displays a JSON.
Testing
Go to Project > Settings > Activity and in the table click "See details".
Related issues