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

TNO-2195: Split view for managing folders and new configure page #1449

Merged
merged 5 commits into from
Jan 23, 2024

Conversation

jdtoombs
Copy link
Collaborator

@jdtoombs jdtoombs commented Jan 23, 2024

In this PR:

  • managing folders/viewing content is now in a split view on one page
  • active folder indicated with a blue marker and open folder
  • updated configure folder page
  • set up work for another ticket in regards to updating the view folder component
  • some refactoring
  • fix small layout bug on basic search page

image

@jdtoombs jdtoombs added enhancement New feature or request subscriber PR contains changes towards the subscriber application, labels Jan 23, 2024
@jdtoombs jdtoombs requested a review from Fosol January 23, 2024 00:13
@jdtoombs jdtoombs self-assigned this Jan 23, 2024
@@ -15,6 +15,7 @@ $bk-main: #dedede;
$highlightPrimary: #e8e9f1;
$highlightSecondary: #f8f7f8;
$highlightTertiary: #d6d9e7;
$highlight-active: #03bfdc;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

will also be used on side nav bar when updated (to highlight active menu item)

}, [currentFolder]);

React.useEffect(() => {
if ((!currentFolder && id) || currentFolder?.id !== Number(id)) {
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 user changes selected item on left side, or when folder is not set

Copy link
Collaborator

Choose a reason for hiding this comment

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

If the folder doesn't exist, won't this infinite loop?

</div>

<Modal
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Just moved Modal to different component, same code.

data={myFolders}
showActive={false}
/>
</SubscriberTableContainer>
<TooltipMenu
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Menu no longer used

import styled from 'styled-components';
import { Row } from 'tno-core';

export const FolderLanding = styled(Row)<{ split?: boolean }>`
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Split is true from the FolderLanding component when an action is defined
i.e) /folders/configure/5
In this case configure is the action and will cause the screen to split. Follows the format /action/id

@@ -84,18 +83,11 @@ export const AppRouter: React.FC<IAppRouter> = () => {
}
/>
<Route
path="/folders/:id"
path="/folders/:action?/:id?"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

optional params for router

@@ -84,7 +84,7 @@ export const NavbarOptions: INavbarOptions = {
folders: {
groupName: 'MY CONTENT',
label: 'My Folders',
path: 'landing/folders',
path: 'folders',
Copy link
Collaborator

Choose a reason for hiding this comment

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

thanks!

}, [currentFolder]);

React.useEffect(() => {
if ((!currentFolder && id) || currentFolder?.id !== Number(id)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

If the folder doesn't exist, won't this infinite loop?

const [myFolders, setMyFolders] = React.useState<IFolderModel[]>([]);
// action consits of the param of type /view /configure etc.
const { action, id } = useParams();
console.log(action, id);
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove

@Fosol Fosol merged commit 1d9a580 into bcgov:dev Jan 23, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request subscriber PR contains changes towards the subscriber application,
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants