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

[Nu-1778] provide activities panel #6979

Merged
merged 110 commits into from
Oct 24, 2024
Merged
Changes from 1 commit
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
886fc9b
NU-1778 provide activities panel
Dzuming Aug 26, 2024
4e7c741
NU-1778 get data from API
Dzuming Aug 28, 2024
e8e3b77
NU-1778 provide scenario basic data
Dzuming Aug 28, 2024
7b2d8ea
NU-1778 handle comments
Dzuming Aug 28, 2024
c8eddae
NU-1778 make scenario version id optional
Dzuming Aug 28, 2024
463b654
NU-1778 provide action icon
Dzuming Aug 28, 2024
30939bf
NU-1778 handle header actions
Dzuming Aug 28, 2024
2c28e07
NU-1778 provide infinite scroll
Dzuming Aug 29, 2024
a1e0a55
NU-1778 provide additional fields handling
Dzuming Aug 29, 2024
4b493c1
Merge branch 'refs/heads/staging' into NU-1778-activities
Dzuming Sep 5, 2024
fc2370c
NU-1778 resolve scrolling issue
Dzuming Sep 5, 2024
a3115d1
NU-1778 provide date separator and show more less button
Dzuming Sep 12, 2024
06d579b
NU-1778 items highlight
Dzuming Sep 12, 2024
8b536f5
NU-1778 refactors
Dzuming Sep 12, 2024
bb32714
Merge branch 'refs/heads/staging' into NU-1778-activities
Dzuming Sep 16, 2024
f8aae4a
NU-1778 provide a search mechanism
Dzuming Sep 17, 2024
e3dc85c
NU-1778 search panel style
Dzuming Sep 17, 2024
0a26707
NU-1778 found item style
Dzuming Sep 17, 2024
6c97203
NU-1778 get the next item from results on enter button click
Dzuming Sep 17, 2024
f2ef9d2
NU-1778 provide results highlight
Dzuming Sep 19, 2024
334095f
NU-1778 provide loader on Activities load
Dzuming Sep 20, 2024
ad4f313
NU-1778 update types
Dzuming Sep 20, 2024
06a0288
NU-1778 Show Today and Yesterday in a Date
Dzuming Sep 20, 2024
c076e09
NU-1778 provide an option to open specific version
Dzuming Sep 23, 2024
65b4fbd
NU-1778 provide an option to display overrideDisplayableName
Dzuming Sep 23, 2024
c0e5a5a
NU-1778 provide an option to open compare version dialog
Dzuming Sep 23, 2024
6e6b03b
NU-1778 fix scrollbar style
Dzuming Sep 23, 2024
0478222
NU-1778 provide an option to add comment
Dzuming Sep 23, 2024
212303e
NU-1778 provide add attachment functionality
Dzuming Sep 24, 2024
82bf9ce
NU-1778 provide a download attachment option
Dzuming Sep 24, 2024
1499531
NU-1778 fixes related to the intergation with BE
Dzuming Sep 25, 2024
affb1ab
NU-1778 fix search logic
Dzuming Sep 25, 2024
fcd920a
NU-1778 adjust activity icons
Dzuming Sep 25, 2024
3f1c6b6
Merge branch 'refs/heads/staging' into NU-1778-activities
Dzuming Sep 26, 2024
00a7387
NU-1778 restore deprecated attachment logic
Dzuming Sep 26, 2024
3b5c2e3
NU-1778 fix compare issue
Dzuming Sep 26, 2024
224326c
NU-1778 don't show compare action icon when the activity version is t…
Dzuming Sep 26, 2024
7930b0b
NU-1778 fix items rendering
Dzuming Sep 29, 2024
54b8f72
NU-1778 include additional fields to the search
Dzuming Sep 30, 2024
a4a5331
NU-1778 more items button rename
Dzuming Sep 30, 2024
f8a098d
NU-1778 more fixes
Dzuming Sep 30, 2024
792f0b8
NU-1778 move fetch activities to redux
Dzuming Oct 1, 2024
fe698a9
NU-1778 fix format date
Dzuming Oct 1, 2024
5835780
NU-1778 provide e2e tests
Dzuming Oct 3, 2024
11087f1
NU-1778 activities panel refactor
Dzuming Oct 3, 2024
dbf2bfc
NU-1778 set toolbar items
Dzuming Oct 3, 2024
ae1628b
Merge branch 'refs/heads/staging' into NU-1778-activities
Dzuming Oct 3, 2024
7c4e262
NU-1778 update changelog
Dzuming Oct 3, 2024
20d6012
Merge branch 'refs/heads/staging' into NU-1778-activities
Dzuming Oct 3, 2024
1be8ebd
NU-1778 add ActivitiesPanel value
Dzuming Oct 3, 2024
ddbfdf6
Updated snapshots (#6980)
github-actions[bot] Oct 3, 2024
d75aec2
Updated snapshots (#6982)
github-actions[bot] Oct 4, 2024
d4d4a50
NU-1778 fix search by additional fields
Dzuming Oct 4, 2024
100f6dc
NU-1778 resolve toggle items issues
Dzuming Oct 4, 2024
54bad22
NU-1778 fix test
Dzuming Oct 4, 2024
78702d0
Updated snapshots (#6983)
github-actions[bot] Oct 4, 2024
0997c28
NU-1797 move visible state mapping to selector
Dzuming Oct 7, 2024
2576681
NU-1778 use translations
Dzuming Oct 7, 2024
d426c11
Merge branch 'refs/heads/staging' into NU-1778-activities
Dzuming Oct 8, 2024
6dd6f0d
NU-1778 fix tests
Dzuming Oct 8, 2024
4fec3c8
NU-1778 fix tests
Dzuming Oct 8, 2024
6339536
NU-1778 fix tests
Dzuming Oct 8, 2024
3f40391
Updated snapshots (#6997)
github-actions[bot] Oct 8, 2024
912faa7
NU-1778 fix tests
Dzuming Oct 9, 2024
a259c77
NU-1778 fix tests
Dzuming Oct 9, 2024
2a83acc
Merge branch 'refs/heads/staging' into NU-1778-activities
Dzuming Oct 9, 2024
9f75bfa
Updated snapshots (#6998)
github-actions[bot] Oct 10, 2024
415714c
Updated snapshots (#7003)
github-actions[bot] Oct 10, 2024
710afe9
NU-1778 fix tests
Dzuming Oct 10, 2024
fcf210d
Updated snapshots (#7005)
github-actions[bot] Oct 10, 2024
db8f299
NU-1778 change scrollbar colors
Dzuming Oct 11, 2024
bc11755
NU-1778 remove only from tests
Dzuming Oct 14, 2024
f05e53f
NU-1778 change hide items limit
Dzuming Oct 14, 2024
89310eb
NU-1778 change padding
Dzuming Oct 14, 2024
45dcbc3
NU-1778 fix search
Dzuming Oct 15, 2024
66c71bf
Merge branch 'refs/heads/staging' into NU-1778-activities
Dzuming Oct 15, 2024
f6cf76e
Updated snapshots (#7020)
github-actions[bot] Oct 15, 2024
6b3e4ef
Merge branch 'refs/heads/staging' into NU-1778-activities
Dzuming Oct 15, 2024
88f47aa
Merge remote-tracking branch 'origin/NU-1778-activities' into NU-1778…
Dzuming Oct 15, 2024
d1f571a
Merge branch 'refs/heads/staging' into NU-1778-activities
Dzuming Oct 16, 2024
e4f9e60
NU-1778 fix date range grouping
Dzuming Oct 16, 2024
37be343
NU-1778 add padding to toggle button
Dzuming Oct 16, 2024
3e33196
NU-1778 fix activities search issue
Dzuming Oct 16, 2024
660da56
NU-1778 fix activities items style
Dzuming Oct 16, 2024
d704783
NU-1778 fix active item color
Dzuming Oct 16, 2024
5f60f92
NU-1778 fix clear activities
Dzuming Oct 16, 2024
66dfc74
Updated snapshots (#7034)
github-actions[bot] Oct 16, 2024
bfe3e74
NU-1778 fix tests
Dzuming Oct 17, 2024
e49b361
Merge remote-tracking branch 'origin/NU-1778-activities' into NU-1778…
Dzuming Oct 17, 2024
7e84053
NU-1778 adjust style
Dzuming Oct 17, 2024
a156586
NU-1778 adjust style
Dzuming Oct 17, 2024
97b26c2
Updated snapshots (#7035)
github-actions[bot] Oct 17, 2024
f996f92
NU-1778 adjust style
Dzuming Oct 17, 2024
5f9311c
NU-1778 adjust style
Dzuming Oct 17, 2024
e53edc4
Updated snapshots (#7037)
github-actions[bot] Oct 17, 2024
db8290a
NU-1778 fix range
Dzuming Oct 17, 2024
ea276c3
Updated snapshots (#7041)
github-actions[bot] Oct 17, 2024
ab2965d
NU-1778 fix tests
Dzuming Oct 18, 2024
c0f62ce
NU-1778 next fixes
Dzuming Oct 21, 2024
d934b65
Merge branch 'refs/heads/staging' into NU-1778-activities
Dzuming Oct 22, 2024
bcb3b7d
NU-1778 fix tests
Dzuming Oct 22, 2024
b589ebe
Merge branch 'refs/heads/staging' into NU-1778-activities
Dzuming Oct 22, 2024
1395bc8
NU-1778 expand/collapse all results on search
Dzuming Oct 22, 2024
b4dc450
NU-1778 update deployment style
Dzuming Oct 22, 2024
19dd9bf
NU-1778 types update
Dzuming Oct 22, 2024
36a7a7d
NU-1778 fix styles
Dzuming Oct 23, 2024
3fd83c9
NU-1778 fix test
Dzuming Oct 23, 2024
532f5fe
Merge branch 'staging' into NU-1778-activities
Dzuming Oct 24, 2024
65dd113
Merge remote-tracking branch 'origin/NU-1778-activities' into NU-1778…
Dzuming Oct 24, 2024
0155e54
Updated snapshots (#7072)
github-actions[bot] Oct 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
NU-1778 change hide items limit
Dzuming committed Oct 14, 2024
commit f05e53fa498029b3627fd2a253e7b971a99b134e
Original file line number Diff line number Diff line change
@@ -14,6 +14,7 @@ import { useDispatch, useSelector } from "react-redux";
import { getProcessName } from "../../../reducers/selectors/graph";
import { getScenarioActivities, updateScenarioActivities } from "../../../actions/nk/scenarioActivities";
import { getVisibleActivities } from "../../../reducers/selectors/activities";
import { handleToggleActivities } from "./helpers/handleToggleActivities";

const StyledVariableSizeList = styled(VariableSizeList)(({ theme }) => ({
"::-webkit-scrollbar": {
@@ -98,44 +99,20 @@ export const ActivitiesPanel = (props: ToolbarPanelProps) => {
});

const handleHideRows = (uiGeneratedId: string, sameItemOccurrence: number) => {
let buttonIndex: number;

dispatch(
updateScenarioActivities((prevState) => {
return prevState.map((data, prevStateItemIndex) => {
if (data.uiGeneratedId === uiGeneratedId) {
return { ...data, isClicked: false };
}

buttonIndex = prevState.findIndex((uiActivity) => uiActivity.uiGeneratedId === uiGeneratedId);

if (prevStateItemIndex <= buttonIndex && prevStateItemIndex > buttonIndex - sameItemOccurrence - 1) {
return { ...data, isHidden: true };
}

return data;
});
const { uiActivities, buttonPosition } = handleToggleActivities(prevState, uiGeneratedId, sameItemOccurrence);
listRef.current.scrollToItem(buttonPosition - 2);
return uiActivities;
}),
);
listRef.current.scrollToItem(buttonIndex - sameItemOccurrence - 2);
};

const handleShowRows = (uiGeneratedId: string, sameItemOccurrence: number) => {
dispatch(
updateScenarioActivities((prevState) => {
return prevState.map((uiActivity, prevStateItemIndex) => {
if (uiActivity.uiGeneratedId === uiGeneratedId) {
return { ...uiActivity, isClicked: true };
}

const buttonIndex = prevState.findIndex((uiActivity) => uiActivity.uiGeneratedId === uiGeneratedId);

if (prevStateItemIndex < buttonIndex && prevStateItemIndex >= buttonIndex - sameItemOccurrence) {
return { ...uiActivity, isHidden: false };
}

return uiActivity;
});
const { uiActivities } = handleToggleActivities(prevState, uiGeneratedId, sameItemOccurrence);
return uiActivities;
}),
);
};
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ const getLatestDateItem = (uiActivities: UIActivity[]) => {

export const extendActivitiesWithUIData = (activitiesDataWithMetadata: Activity[]) => {
const uiActivities: UIActivity[] = [];
const hideItemsOptionAvailableLimit = 4;
const hideItemsOptionAvailableLimit = 3;

const recursiveDateLabelDesignation = (
currentActivity: Activity,
@@ -103,8 +103,9 @@ export const extendActivitiesWithUIData = (activitiesDataWithMetadata: Activity[
};

const initiallyHideItems = (sameItemOccurrence: number) => {
for (let i = uiActivities.length - sameItemOccurrence; i < uiActivities.length; i++) {
const item = uiActivities[i];
const itemOnly = uiActivities.filter((uiActivity) => uiActivity.uiType === "item");
for (let i = itemOnly.length - sameItemOccurrence; i < itemOnly.length; i++) {
const item = itemOnly[i];

if (item.uiType === "item") {
item.isHidden = true;
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { UIActivity } from "../ActivitiesPanel";

export const handleToggleActivities = (activities: UIActivity[], uiGeneratedId: string, sameItemOccurrence: number) => {
const newState = [...activities];

const buttonIndex = newState.findIndex((uiActivity) => uiActivity.uiGeneratedId === uiGeneratedId);

if (buttonIndex === -1) return { activities, buttonPosition: -1 };

let itemsToSetState = sameItemOccurrence;
let iteration = 0;

while (itemsToSetState > 0) {
const targetIndex = buttonIndex - iteration + 1;

if (targetIndex < 0 || targetIndex >= newState.length) break;

const itemToHide = newState[targetIndex];

if (itemToHide.uiType === "item") {
newState[targetIndex] = { ...itemToHide, isHidden: !itemToHide.isHidden };
itemsToSetState--;
}

iteration++;
}

const clickedItem = newState[buttonIndex];

if (clickedItem.uiType === "toggleItemsButton") {
newState[buttonIndex] = { ...clickedItem, isClicked: !clickedItem.isClicked };
}

return { uiActivities: newState, buttonPosition: buttonIndex - iteration };
};