Skip to content

Commit

Permalink
rebase post #1240
Browse files Browse the repository at this point in the history
  • Loading branch information
akphi committed Jun 28, 2022
1 parent 098a276 commit 44780b1
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,7 @@ import {
} from '@finos/legend-shared';
import { APPLICATION_EVENT } from '../stores/ApplicationEvent.js';
import { configureComponents } from '@finos/legend-art';
import type {
GraphPluginManager,
PackageableElement,
} from '@finos/legend-graph';
import type { GraphPluginManager } from '@finos/legend-graph';
import type { LegendApplicationPluginManager } from './LegendApplicationPluginManager.js';
import { setupPureLanguageService } from '../stores/PureLanguageSupport.js';

Expand Down Expand Up @@ -271,21 +268,3 @@ export abstract class LegendApplication {
}
}
}

export const packageableElementFormatOptionLabel = (option: {
label: string;
value: PackageableElement;
darkMode?: boolean;
}): React.ReactNode => {
const stylePrefix = option.darkMode
? 'packageable-element-format-option-label--dark'
: 'packageable-element-format-option-label';
return (
<div className={stylePrefix}>
<div className={`${stylePrefix}__name`}>{option.label}</div>
{option.value.package && (
<div className={`${stylePrefix}__tag`}>{`${option.value.path}`}</div>
)}
</div>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/**
* Copyright (c) 2020-present, Goldman Sachs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import type { PackageableElement } from '@finos/legend-graph';

export const packageableElementFormatOptionLabel = (option: {
label: string;
value: PackageableElement;
darkMode?: boolean;
}): React.ReactNode => {
const className = option.darkMode
? 'packageable-element-format-option-label--dark'
: 'packageable-element-format-option-label';

return (
<div className={className}>
<div className={`${className}__name`}>{option.label}</div>
{option.value.package && (
<div className={`${className}__tag`}>{option.value.path}</div>
)}
</div>
);
};
1 change: 1 addition & 0 deletions packages/legend-application/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export * from './components/shared/TextInputEditor.js';
export * from './components/shared/LambdaEditor.js';
export * from './components/shared/BasicValueSpecificationEditor.js';
export * from './components/shared/LambdaParameterValuesEditor.js';
export * from './components/shared/PackageableElementOption.js';
export * from './components/shared/execution-plan-viewer/ExecutionPlanViewer.js';

export { LambdaEditorState } from './stores/shared/LambdaEditorState.js';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

@use 'mixins' as *;

.packageable-element-format-option-label {
Expand Down
1 change: 0 additions & 1 deletion packages/legend-application/style/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
@forward 'components/backdrop';
@forward 'components/notification';
@forward 'components/virtual-assistant';
@forward 'components/value-spec-editor';

// Shared
@forward 'components/shared/documentation-link';
Expand Down

0 comments on commit 44780b1

Please sign in to comment.