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

PR for [UX] Migrate existing markdown content to TSX pages #1056 Turn UX Design to Implementation #1077

Open
wants to merge 24 commits into
base: features/ux
Choose a base branch
from

Conversation

jamelachahbar
Copy link
Contributor

@jamelachahbar jamelachahbar commented Oct 27, 2024

πŸ› οΈ Description

#1056
PR for turning figma design into implementation.
Top Menu Bar, Sidebar + Sample Page created.
Tests created

πŸ“· Screenshots

image

Jest test results

image

πŸ“‹ Checklist

πŸ”¬ How did you test this change?

  • 🀏 Lint tests
  • [] 🀞 PS -WhatIf / az validate
  • πŸ‘ Manually deployed + verified
  • πŸ’ͺ Unit tests
  • πŸ™Œ Integration tests

πŸ™‹β€β™€οΈ Do any of the following that apply?

  • 🚨 This is a breaking change.
  • 🀏 The change is less than 20 lines of code.

πŸ“‘ Did you update docs/changelog.md?

  • βœ… Updated changelog (required for dev PRs)
  • ➑️ Will add log in a future PR (feature branch PRs only)
  • ❎ Log not needed (small/internal change)

πŸ“– Did you update documentation?

  • βœ… Public docs in docs (required for dev)
  • βœ… Internal dev docs in src (required for dev)
  • ➑️ Will add docs in a future PR (feature branch PRs only)
  • ❎ Docs not needed (small/internal change)

@jamelachahbar
Copy link
Contributor Author

@flanakin, I forget to sync with latest from ux branch. There are conflicts that need to be resolved.
Should we always create new branch with each change? This one contains the commits of the previews pr, only the last commit should be reviewed.

@jamelachahbar
Copy link
Contributor Author

jamelachahbar commented Oct 27, 2024 via email

@akiskips akiskips self-requested a review October 28, 2024 12:04
Copy link
Contributor

@akiskips akiskips left a comment

Choose a reason for hiding this comment

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

Tested deployment locally

src/web/components/SideBar.tsx Outdated Show resolved Hide resolved
src/web/components/TopMenuBar.tsx Outdated Show resolved Hide resolved
src/web/package.json Outdated Show resolved Hide resolved
src/web/pages/PowerBIReportsPage.tsx Outdated Show resolved Hide resolved
src/web/pages/SamplePage.tsx Outdated Show resolved Hide resolved
src/web/public/logo-windows.png Outdated Show resolved Hide resolved
src/web/public/sidebar-left-svgrepo-com.png Outdated Show resolved Hide resolved
src/web/public/sidebar-right-svgrepo-com.png Outdated Show resolved Hide resolved
src/web/tsconfig.json Outdated Show resolved Hide resolved
src/web/tsconfig.json Outdated Show resolved Hide resolved
Copy link
Contributor

@microsoft-github-policy-service[bot]

@jamelachahbar already contributed before to code

import { FluentProvider, webLightTheme } from '@fluentui/react-components';

interface Props {
children: React.ReactNode;
Copy link
Member

Choose a reason for hiding this comment

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

Import ReactNode directly

import React from 'react';
import { FluentProvider, webLightTheme } from '@fluentui/react-components';

interface Props {
Copy link
Member

Choose a reason for hiding this comment

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

Add JSDOC

children: React.ReactNode;
}

function FluentUIProvider({ children }: Props) {
Copy link
Member

Choose a reason for hiding this comment

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

Lets use arrow functions for functional components

Copy link
Member

Choose a reason for hiding this comment

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

Also, Add JSDOC

People24Filled,
PanelLeftExpandRegular,
PanelLeftContractRegular,
} from "@fluentui/react-icons";
Copy link
Member

Choose a reason for hiding this comment

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

Single quotes for TS code

PanelLeftContractRegular,
} from "@fluentui/react-icons";

// Styles for the sidebar using Fluent UI's `makeStyles`
Copy link
Member

Choose a reason for hiding this comment

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

No need for this comment

} from "@fluentui/react-icons";

// Styles for the sidebar using Fluent UI's `makeStyles`
const useStyles = makeStyles({
Copy link
Member

Choose a reason for hiding this comment

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

Lets move styling to a separate CSS file, that way it will not have to be compiled.

Copy link
Member

Choose a reason for hiding this comment

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

It will also be easier to write since we will have IntelliSense

// Styles for the sidebar using Fluent UI's `makeStyles`
const useStyles = makeStyles({
sidebar: {
minHeight: '100vh',
Copy link
Member

Choose a reason for hiding this comment

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

use dvh

const useStyles = makeStyles({
sidebar: {
minHeight: '100vh',
backgroundColor: '#f4f6f8',
Copy link
Member

Choose a reason for hiding this comment

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

How does this affect dark/light theme?

position: 'relative',
transition: 'width 0.2s ease',
paddingTop: '40px',
paddingRight: '18px',
Copy link
Member

Choose a reason for hiding this comment

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

Can we use constants for these?


// Styles for the sidebar using Fluent UI's `makeStyles`
const useStyles = makeStyles({
sidebar: {
Copy link
Member

Choose a reason for hiding this comment

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

Can we follow a naming for the classNames? that way they dont collide with Fluent's. Something like ftk-componentName-sidebar

@@ -0,0 +1,16 @@
import React from 'react';
Copy link
Member

Choose a reason for hiding this comment

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

Do we really need this component? could we add this provider in a root component?

position: 'relative',
transition: 'background-color 0.2s ease, color 0.2s ease',
'&:hover': {
backgroundColor: '#E6E6E6', // Updated neutral grey background on hover
Copy link
Member

Choose a reason for hiding this comment

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

Lets not add comments for CSS, most are self explanitory, also colors should be variables. Also lets think of theming early


const menuItems = [
{ name: 'Home', icon: <Home24Regular />, filledIcon: <Home24Filled />, route: '/' },
{ name: 'FinOps Hubs', icon: <DataUsage24Regular />, filledIcon: <DataUsage24Filled />, route: '/hubs' },
Copy link
Member

Choose a reason for hiding this comment

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

Can we move the routes to an enum?

{ name: 'Contributors', icon: <People24Regular />, filledIcon: <People24Filled />, route: '/contributors' },
];

function SideBar() {
Copy link
Member

Choose a reason for hiding this comment

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

Arrow function and JSDOC

icon={isCollapsed ? <PanelLeftExpandRegular /> : <PanelLeftContractRegular />}
className={classes.toggleButton}
onClick={toggleSidebar}
aria-label={isCollapsed ? 'Expand Sidebar' : 'Collapse Sidebar'}
Copy link
Member

Choose a reason for hiding this comment

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

Can we start early extracting all strings to a json file when we start thinking of our localization story?

@@ -0,0 +1,69 @@
import { Text, makeStyles, Image, Divider } from '@fluentui/react-components';

const useStyles = makeStyles({
Copy link
Member

Choose a reason for hiding this comment

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

Same comments as above

import OpenDataPage from './OpenDataPage';
import {PowerBIReportsPage} from './PowerBIReportsPage';
import CostOptimizationWorkbookPage from './CostOptimizationWorkbookPage';
import {SamplePage} from './SamplePage';
Copy link
Member

Choose a reason for hiding this comment

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

{ SamplePage }

import {PowerBIReportsPage} from './PowerBIReportsPage';
import CostOptimizationWorkbookPage from './CostOptimizationWorkbookPage';
import {SamplePage} from './SamplePage';
import FluentUIProvider from '../components/FluentUIProvider'; // Use your FluentUIProvider
Copy link
Member

Choose a reason for hiding this comment

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

remove comment


/**
Copy link
Member

Choose a reason for hiding this comment

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

use JSDOC style for comments

function OptimizationEnginePage() {
return (
<div>
<h1>Azure Optimization Engine</h1>
Copy link
Member

Choose a reason for hiding this comment

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

Can we start extracting all strings to a json file so we can later be able to handle localization?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Review πŸ‘€ PR that is ready to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants