Skip to content

Commit

Permalink
feat: add modelCompose icon and created time (microsoft#466)
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-krasn authored Aug 3, 2020
1 parent 78996ea commit 2fa32ef
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
27 changes: 23 additions & 4 deletions src/react/components/pages/modelCompose/composeModelView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the MIT license.

import React from "react";
import { Customizer, IColumn, ICustomizations, Modal, DetailsList, SelectionMode, DetailsListLayoutMode, PrimaryButton, TextField } from "@fluentui/react";
import { Customizer, IColumn, ICustomizations, Modal, DetailsList, SelectionMode, DetailsListLayoutMode, PrimaryButton, TextField, FontIcon } from "@fluentui/react";
import { getDarkGreyTheme, getPrimaryGreenTheme, getPrimaryGreyTheme } from "../../../../common/themes";
import { strings } from "../../../../common/strings";
import { IModel } from "./modelCompose";
Expand Down Expand Up @@ -43,18 +43,37 @@ export default class ComposeModelView extends React.Component<IComposeModelViewP
const columns: IColumn[] = [
{
key: "column1",
name: strings.modelCompose.column.icon.name,
minWidth: 16,
maxWidth: 16,
className: "composed-icon-cell",
ariaLabel: strings.modelCompose.columnAria.icon,
isIconOnly: true,
onRender: (model) => model.attributes?.isComposed ? <FontIcon iconName={"Merge"} className="model-fontIcon" /> : null
},
{
key: "column2",
name: strings.modelCompose.column.id.headerName,
minWidth: 250,
maxWidth: 250,
minWidth: 150,
maxWidth: 300,
isResizable: true,
onRender: (model) => <span>{model.modelId}</span>,
},
{
key: "column2",
key: "column3",
name: strings.modelCompose.column.name.headerName,
minWidth: 50,
maxWidth: 300,
isResizable: true,
onRender: (model) => <span>{model.modelName}</span>,
},
{
key: "column4",
name: strings.modelCompose.column.created.headerName,
minWidth: 100,
maxWidth: 200,
isResizable: true,
onRender: (model) => <span>{new Date(model.createdDateTime).toLocaleString()}</span>,
}
];

Expand Down
2 changes: 1 addition & 1 deletion src/react/components/pages/modelCompose/modelCompose.scss
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ h4 {
}

.modal-list-container {
margin: 0.5rem;
margin-top: 1rem;
max-height: 40vh;
overflow-x: hidden;
}
Expand Down

0 comments on commit 2fa32ef

Please sign in to comment.