Skip to content

Commit

Permalink
Top level masonry refactor (#771)
Browse files Browse the repository at this point in the history
* chore: new nav bar

Signed-off-by: Frank Flitton <[email protected]>

* feat: url breadcrumbs feature (#784)

* chore: new nav bar

Signed-off-by: Frank Flitton <[email protected]>

* chore: navbar quick links

Signed-off-by: Frank Flitton <[email protected]>

* chore: task, workflow, launchplans

Signed-off-by: Frank Flitton <[email protected]>

* chore: remove unused import

Signed-off-by: Frank Flitton <[email protected]>

* chore: fixup navbar integration

Signed-off-by: Frank Flitton <[email protected]>

* chore: fix linter

Signed-off-by: Frank Flitton <[email protected]>

* chore: execution async value

Signed-off-by: Frank Flitton <[email protected]>

* chore: fix types build fail

Signed-off-by: Frank Flitton <[email protected]>

* chore: async self link

Signed-off-by: Frank Flitton <[email protected]>

* chore: add some exports

Signed-off-by: Frank Flitton <[email protected]>

* chore: change to names export

Signed-off-by: Frank Flitton <[email protected]>

* chore: spelling

Signed-off-by: Carina Ursu <[email protected]>

* chore: fix timestamps

Signed-off-by: Carina Ursu <[email protected]>

* chore: fix file upload type failure

Signed-off-by: Frank Flitton <[email protected]>

* chore: fix Executions title not updating

Signed-off-by: Frank Flitton <[email protected]>

* chore: remove depricated types file for dropzone

Signed-off-by: Frank Flitton <[email protected]>

* chore: fix execution launch plan self link

Signed-off-by: Frank Flitton <[email protected]>

* chore: pass custom component

Signed-off-by: Frank Flitton <[email protected]>

* chore: fix named entity cases

Signed-off-by: Frank Flitton <[email protected]>

* chore: different custom component style

Signed-off-by: Frank Flitton <[email protected]>

* chore: dynamic breadcrumb hook with event dispatch

Signed-off-by: Frank Flitton <[email protected]>

* chore: dynamic breadcrumb hook with event dispatch

Signed-off-by: Frank Flitton <[email protected]>

* chore: project and domains link to dashboard

Signed-off-by: Frank Flitton <[email protected]>

* chore: add localstorage setting

Signed-off-by: Frank Flitton <[email protected]>

* chore: get localstorage setting

Signed-off-by: Frank Flitton <[email protected]>

* chore: named entities self links

Signed-off-by: Frank Flitton <[email protected]>

* chore: spacing and scaffolding

Signed-off-by: Frank Flitton <[email protected]>

* chore: grey header color

Signed-off-by: Frank Flitton <[email protected]>

* fix/dropdown breadcrumbs (#799)

fix: dropdown breadcrumbs

Signed-off-by: Soham Parekh <[email protected]>
Co-authored-by: Soham Parekh <[email protected]>

* chore: global inject without emotion

Signed-off-by: Frank Flitton <[email protected]>

* chore: generate id

Signed-off-by: Frank Flitton <[email protected]>

* chore: initial unit tests

Signed-off-by: Frank Flitton <[email protected]>

* chore: fix incorrect localstore value

Signed-off-by: Frank Flitton <[email protected]>

* chore: named entities execution tests

Signed-off-by: Frank Flitton <[email protected]>

* chore: domain and project util tests

Signed-off-by: Frank Flitton <[email protected]>

* chore: fix execution list page title 404 ing

Signed-off-by: Frank Flitton <[email protected]>

* chore: fix swipe left to go back

Signed-off-by: Frank Flitton <[email protected]>

* chore: feature flag breadcrumb UI content

Signed-off-by: Frank Flitton <[email protected]>

* chore: set flags from url

Signed-off-by: Frank Flitton <[email protected]>

* chore: set flags from exxternal config

Signed-off-by: Frank Flitton <[email protected]>

* chore: set feature flags from env

Signed-off-by: Frank Flitton <[email protected]>

* chore: get flags from external env

Signed-off-by: Frank Flitton <[email protected]>

* chore: better docs from breadcrumbs interface

Signed-off-by: Frank Flitton <[email protected]>

---------

Signed-off-by: Frank Flitton <[email protected]>
Signed-off-by: Carina Ursu <[email protected]>
Signed-off-by: Soham Parekh <[email protected]>
Co-authored-by: Carina Ursu <[email protected]>
Co-authored-by: etdotal <[email protected]>
Co-authored-by: Soham Parekh <[email protected]>

* chore: console version bump

Signed-off-by: Frank Flitton <[email protected]>

---------

Signed-off-by: Frank Flitton <[email protected]>
Signed-off-by: Carina Ursu <[email protected]>
Signed-off-by: Soham Parekh <[email protected]>
Co-authored-by: Carina Ursu <[email protected]>
Co-authored-by: etdotal <[email protected]>
Co-authored-by: Soham Parekh <[email protected]>
  • Loading branch information
4 people authored Jul 26, 2023
1 parent 16abb34 commit fd145ec
Show file tree
Hide file tree
Showing 79 changed files with 7,191 additions and 3,234 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"workspaces": {
"packages": [
"packages/*",
"packages/**",
"website"
]
},
Expand Down
1 change: 0 additions & 1 deletion packages/components/src/AppInfo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export const INFO_WINDOW_WIDTH = 260;
const useStyles = makeStyles((theme: Theme) => ({
infoIcon: {
cursor: 'pointer',
marginLeft: theme.spacing(1),
backgroundColor: 'initial',
},
closeButton: {
Expand Down
3 changes: 1 addition & 2 deletions packages/console/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@flyteorg/console",
"version": "0.0.44",
"version": "0.0.45",
"description": "Flyteconsole main app module",
"main": "./dist/index.js",
"module": "./lib/index.js",
Expand Down Expand Up @@ -126,7 +126,6 @@
"@types/pure-render-decorator": "^0.2.27",
"@types/react": "^16.9.34",
"@types/react-dom": "^16.9.7",
"@types/react-dropzone": "^5.1.0",
"@types/react-router-dom": "^5.3.3",
"@types/react-virtualized": "^9.21.4",
"@types/serve-static": "^1.7.31",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import React, { PropsWithChildren, useContext } from 'react';
import { AppConfig } from '@flyteorg/common';
import { Breadcrumb } from 'components';

export interface ExternalConfigurationProviderProps {
registry?: {
nav?: React.FC<any>;
topLevelLayout?: React.FC<any>;
taskExecutionAttemps?: React.FC<any>;
additionalRoutes?: any;
additionalRoutes?: any[];
breadcrumbs?: Breadcrumb[];
};
env?: any;
config?: AppConfig;
Expand Down
23 changes: 23 additions & 0 deletions packages/console/src/basics/FeatureFlags/FeatureFlags.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,31 @@ import {

export { FeatureFlag } from './defaultConfig';

/**
* Set feature flag value for current session using URLSearchParams values
* @param search
* @returns
*/
const getSearchParamFlags = (search: string): FeatureFlagConfig => {
const urlParams = new URLSearchParams(search);
const flags: FeatureFlagConfig = {};
for (const [key, value] of urlParams.entries()) {
if (value === 'true') {
flags[key] = true;
} else if (value === 'false') {
flags[key] = false;
}
}
return flags as FeatureFlagConfig;
};

const search: string = window.location.search || '';

// To turn on flag for local development only - update flag value here
// REMOVE change prior to commit
let runtimeConfig: FeatureFlagConfig = {
...defaultFlagConfig,
...getSearchParamFlags(search),
// 'test-flag-true': true, <== locally turns flag on
};

Expand All @@ -32,6 +53,7 @@ interface FeatureFlagState {
}

interface FeatureFlagProviderProps {
externalFlags?: { [k: string]: boolean };
children?: React.ReactNode;
}

Expand All @@ -55,6 +77,7 @@ export const useFeatureFlagContext = () => useContext(FeatureFlagContext);
export const FeatureFlagsProvider = (props: FeatureFlagProviderProps) => {
const [flags, setFlags] = useState<FeatureFlagConfig>({
...defaultFlagConfig,
...props.externalFlags,
...runtimeConfig,
});

Expand Down
10 changes: 10 additions & 0 deletions packages/console/src/basics/FeatureFlags/defaultConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ export enum FeatureFlag {
// Production flags
LaunchPlan = 'launch-plan',

// Makes the header inline with the content
HorizontalLayout = 'horizontal-layout',

// Replace the page header with the breadcrumb context navigation with related item quicklinks
breadcrumbs = 'breadcrumbs',

// Test Only Mine flag
OnlyMine = 'only-mine',
}
Expand All @@ -24,6 +30,10 @@ export const defaultFlagConfig: FeatureFlagConfig = {
// If you need to turn it on locally -> update runtimeConfig in ./index.tsx file
'launch-plan': false,

'horizontal-layout': false,

breadcrumbs: false,

'only-mine': false,
};

Expand Down
2 changes: 1 addition & 1 deletion packages/console/src/common/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { Routes } from 'routes/routes';
export function isValidDate(input: string | Date): boolean {
const date = input instanceof Date ? input : new Date(input);
const time = date.getTime();
return !isNaN(time) && time > 0;
return !Number.isNaN(time) && time > 0;
}

/** Converts a Protobuf Timestamp object to a JS Date */
Expand Down
33 changes: 29 additions & 4 deletions packages/console/src/components/App/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ import {
ExternalConfigurationProvider,
ExternalConfigurationProviderProps,
} from 'basics/ExternalConfigurationProvider';
import TopLevelLayoutProvider from 'components/Navigation/TopLevelLayoutState';
import TopLevelLayout from 'components/Navigation/TopLevelLayout';
import NavBar from 'components/Navigation/NavBar';
import { SideNavigation } from 'components/Navigation/SideNavigation';
import GlobalStyles from 'components/utils/GlobalStyles';

export type AppComponentProps = ExternalConfigurationProviderProps;

Expand All @@ -55,8 +59,20 @@ export const AppComponent: React.FC<AppComponentProps> = (
}
const apiState = useAPIState();

const horizontalLayoutFlag =
`${env.HORIZONTAL_LAYOUT}`.trim().toLowerCase() === 'true';

const breadcrumbsFlag = `${env.BREADCRUMBS}`.trim().toLowerCase() === 'true';

return (
<FeatureFlagsProvider>
<FeatureFlagsProvider
externalFlags={{
...props.env,
breadcrumbs: breadcrumbsFlag,
'horizontal-layout': horizontalLayoutFlag,
}}
>
<GlobalStyles />
<LocalCacheProvider>
<StylesProvider
generateClassName={createGenerateClassName({
Expand All @@ -82,16 +98,25 @@ export const AppComponent: React.FC<AppComponentProps> = (
<ExternalConfigurationProvider {...props}>
<Router history={history}>
<ErrorBoundary fixed={true}>
<NavBar />
<ApplicationRouter />
<TopLevelLayoutProvider>
<TopLevelLayout
headerComponent={<NavBar />}
sideNavigationComponent={<SideNavigation />}
routerView={<ApplicationRouter />}
isHorizontalLayout={horizontalLayoutFlag}
/>
</TopLevelLayoutProvider>
</ErrorBoundary>
</Router>
</ExternalConfigurationProvider>
<SystemStatusBanner />
</SkeletonTheme>
</APIContext.Provider>
</FlyteApiProvider>
<ReactQueryDevtools initialIsOpen={false} />
<ReactQueryDevtools
initialIsOpen={false}
position="bottom-right"
/>
</QueryClientProvider>
</SnackbarProvider>
</ThemeProvider>
Expand Down
Loading

0 comments on commit fd145ec

Please sign in to comment.