Skip to content

Commit

Permalink
Add stub for create catalog view button + add create_view icon (#28091)
Browse files Browse the repository at this point in the history
As titled
  • Loading branch information
salazarm authored Feb 28, 2025
1 parent c598d2b commit 5d4264b
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ import cost_rupee from '../icon-svgs/cost_rupee.svg';
import cost_yen from '../icon-svgs/cost_yen.svg';
import cpu from '../icon-svgs/cpu.svg';
import create from '../icon-svgs/create.svg';
import create_view from '../icon-svgs/create_view.svg';
import credit_card from '../icon-svgs/credit_card.svg';
import credits from '../icon-svgs/credits.svg';
import curly_braces from '../icon-svgs/curly_braces.svg';
Expand Down Expand Up @@ -506,6 +507,7 @@ export const Icons = {
cost_yen,
cpu,
create,
create_view,
credit_card,
credits,
curly_braces,
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {AssetGraphAssetSelectionInput} from 'shared/asset-graph/AssetGraphAssetS
import {useAssetGraphExplorerFilters} from 'shared/asset-graph/useAssetGraphExplorerFilters.oss';
import {AssetSelectionInput} from 'shared/asset-selection/input/AssetSelectionInput.oss';
import {CatalogViewSelector} from 'shared/assets/CatalogViewSelector.oss';
import {CreateCatalogViewButton} from 'shared/assets/CreateCatalogViewButton.oss';
import styled from 'styled-components';

import {AssetEdges} from './AssetEdges';
Expand Down Expand Up @@ -784,6 +785,9 @@ const AssetGraphExplorerWithData = ({
/>
)}
</GraphQueryInputFlexWrap>
{featureEnabled(FeatureFlag.flagSelectionSyntax) ? (
<CreateCatalogViewButton />
) : null}
<AssetLiveDataRefreshButton />
<LaunchAssetExecutionButton
preferredJobName={explorerPath.pipelineName}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {useSetRecoilState} from 'recoil';
import {FeatureFlag} from 'shared/app/FeatureFlags.oss';
import {AssetGraphFilterBar} from 'shared/asset-graph/AssetGraphFilterBar.oss';
import {CatalogViewSelector} from 'shared/assets/CatalogViewSelector.oss';
import {CreateCatalogViewButton} from 'shared/assets/CreateCatalogViewButton.oss';
import {useAssetCatalogFiltering} from 'shared/assets/useAssetCatalogFiltering.oss';

import {AssetTable} from './AssetTable';
Expand Down Expand Up @@ -265,14 +266,7 @@ export const AssetsCatalogTable = ({
isLoading={filteredAssetsLoading || loading}
isFiltered={isFiltered}
actionBarComponents={
<div
style={{
display: 'grid',
gridTemplateColumns: 'auto auto minmax(0, 1fr)',
gap: 12,
alignItems: 'flex-start',
}}
>
<Box flex={{gap: 12, alignItems: 'flex-start'}}>
<ButtonGroup<AssetViewType>
activeItems={new Set([view])}
buttons={[
Expand All @@ -288,7 +282,8 @@ export const AssetsCatalogTable = ({
/>
{featureEnabled(FeatureFlag.flagSelectionSyntax) ? <CatalogViewSelector /> : filterButton}
{filterInput}
</div>
{featureEnabled(FeatureFlag.flagSelectionSyntax) ? <CreateCatalogViewButton /> : null}
</Box>
}
belowActionBarComponents={
featureEnabled(FeatureFlag.flagSelectionSyntax) ? null : (
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const CreateCatalogViewButton = () => null;
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,15 @@ export class CustomErrorListener implements ANTLRErrorListener<any> {
msg: string,
_e: RecognitionException | undefined,
): void {
let from = charPositionInLine;
if (offendingSymbol?.text === '<EOF>') {
// If the error is at the very end of the input, set the from to the start of the input
from = 0;
}
this.errors.push({
message: msg,
offendingSymbol: offendingSymbol?.text,
from: charPositionInLine,
from,
to: charPositionInLine + (offendingSymbol?.text?.length ?? Infinity),
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ export const useSelectionInputLintingAndHighlighting = ({
return null;
}
if (error.error.offendingSymbol) {
const symbol = error.error.offendingSymbol;
if (symbol === '<EOF>') {
return 'Selection is incomplete';
}
return (
<Box flex={{direction: 'row', alignItems: 'center'}}>
Unexpected input
Expand Down

2 comments on commit 5d4264b

@github-actions
Copy link

Choose a reason for hiding this comment

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

Deploy preview for dagit-core-storybook ready!

✅ Preview
https://dagit-core-storybook-37qcblv1o-elementl.vercel.app

Built with commit 5d4264b.
This pull request is being automatically deployed with vercel-action

@github-actions
Copy link

Choose a reason for hiding this comment

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

Deploy preview for dagit-storybook ready!

✅ Preview
https://dagit-storybook-16ipsn92h-elementl.vercel.app

Built with commit 5d4264b.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.