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

[TASK-882] [TASK-1186] Project activity details modal #5210

Merged
merged 11 commits into from
Nov 4, 2024

Conversation

magicznyleszek
Copy link
Member

Checklist

  1. If you've added code that should be tested, add tests
  2. If you've changed APIs, update (or create!) the documentation
  3. Ensure the tests pass
  4. Run ./python-format.sh to make sure that your code lints and that you've followed our coding style
  5. Write a title and, if necessary, a description of your work suitable for publishing in our release notes
  6. Mention any related issues in this repository (as #ISSUE) and in other repositories (as kobotoolbox/other#ISSUE)
  7. Open an issue in the docs if there are UI/UX changes
  8. Create a testing plan for the reviewer and add it to the Testing section
  9. Add frontend or backend tag and any other appropriate tags to this pull request

Description

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

@magicznyleszek magicznyleszek marked this pull request as ready for review October 30, 2024 14:40
@magicznyleszek magicznyleszek changed the base branch from fe-project-history-logs to main October 30, 2024 15:04
# Conflicts:
#	jsapp/js/components/activity/activityLogs.query.ts
#	jsapp/js/components/activity/formActivity.tsx
@magicznyleszek magicznyleszek changed the title [TASK-882] Project activity details modal [TASK-882] [TASK-1186] Project activity details modal Oct 30, 2024
Copy link

@magicznyleszek magicznyleszek self-assigned this Oct 30, 2024
# Conflicts:
#	jsapp/js/components/activity/activityLogs.query.ts
#	jsapp/js/components/activity/formActivity.tsx
Copy link
Contributor

@pauloamorimbr pauloamorimbr left a 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';
}

Copy link
Contributor

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! 👍🏻

@magicznyleszek magicznyleszek merged commit f2124ea into main Nov 4, 2024
7 checks passed
@magicznyleszek magicznyleszek deleted the task-882-details-modal branch November 4, 2024 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants