Skip to content

Conversation

@mvolkmann
Copy link
Collaborator

No description provided.

const TeamResults = () => {
const { state } = useContext(AppContext);
const loading = selectTeamsLoading(state);
const [open, setOpen] = useState(false);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This tracks whether the "Add Team" dialog is open.

);
});

useEffect(() => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

On page load this gets settings from query parameters.

setSelectedTeamId(selectedTeamId);
}, []);

useEffect(() => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

When any setting changes, this update the URL query parameters.

const TeamSummaryCard = ({ team, index, onTeamSelect, selectedTeamId }) => {
const { state, dispatch } = useContext(AppContext);
const { teams, userProfile, csrf } = state;
const [open, setOpen] = useState(false);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This state is tracked in TeamResults now.

const [teamMembers, setTeamMembers] = useState(null);
const isLoading = useRef(true);
const [sortValue, setSortValue] = useState(SortOption.SENT_DATE);
const [dateRange, setDateRange] = useState(DateRange.THREE_MONTHS);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The changes in this file are for the story "Keep context in URL: View Feedback #2268".

const [dateRange, setDateRange] = useState(DateRange.THREE_MONTHS);
const [includeAll, setIncludeAll] = useState(false);

useEffect(() => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

On page load this gets all the settings from query parameters.

setSortValue(sort);
}, []);

useEffect(() => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

When any setting changes, this updates the URL query parameters.

vhscom
vhscom previously approved these changes Apr 29, 2024
@vhscom vhscom self-requested a review April 29, 2024 17:12
Comment on lines 85 to 87
toQP(selectedRole) {
return selectedRole.role;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe this is the line causing one of the CI tests to fail. Looks like selectedRole is sometimes undefined when making this call. I see we're grabbing it from state, so I suspect we need to defer QSP set-up until we have the needed state.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Great catch! I wonder how I can implement that delay. It's not obvious to me.
I could use setInterval and just check repeatedly.
Did you have another approach in mind?

S78901
S78901 previously approved these changes Apr 29, 2024
Copy link
Contributor

@vhscom vhscom left a comment

Choose a reason for hiding this comment

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

Excited to see our links come alive for deep-linking within the app!

@mvolkmann mvolkmann merged commit b33df2c into develop Apr 29, 2024
@S78901 S78901 deleted the feature-2265-team-directory-query-parameters branch April 29, 2024 18:58
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.

4 participants