Skip to content

Commit

Permalink
Merge pull request #10 from DynamoDS/root-sample-files
Browse files Browse the repository at this point in the history
Root sample files, Dynamo 1.0 files
  • Loading branch information
QilongTang authored Feb 27, 2024
2 parents ac4e1d8 + d9ad6fc commit 73e1335
Show file tree
Hide file tree
Showing 10 changed files with 82 additions and 6 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dynamods/dynamo-home",
"version": "1.0.4",
"version": "1.0.5",
"description": "",
"author": "Autodesk Inc.",
"main": "index.js",
Expand Down
3 changes: 2 additions & 1 deletion src/assets/home.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions src/assets/samples.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@ export const samples = [
FileName: 'Samples',
FilePath: 'Path',
Children: [
{
FileName: 'loco.dyn',
FilePath:
'D:\\ProgramData\\Autodesk\\RVT 2025\\Dynamo\\non-samples\\Loco_file.dyn',
Children: null
},
{
FileName: 'lose.dyn',
FilePath:
'C:\\ProgramData\\Autodesk\\RVT 2025\\Dynamo\\samples\\Lose_file.dyn',
Children: null
},
{
FileName: 'Basics',
FilePath: 'C:\\ProgramData\\Autodesk\\RVT 2025\\Dynamo\\samples\\en-US\\Basics',
Expand Down
23 changes: 23 additions & 0 deletions src/components/Common/CustomIcons.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import React from 'react';
import styles from '../Common/CustomIcons.module.css';

export const GridViewIcon = () => (
<svg
width="36"
Expand Down Expand Up @@ -32,3 +34,24 @@ export const ListViewIcon = () => (
/>
</svg>
);

export const QuestionMarkIcon = () => (
<div style={{ verticalAlign: "center", marginLeft: "5px", marginTop: "4px", marginRight: "5px" }}>
<svg
className={styles['questionMarkIcon']}
width="16"
height="16"
viewBox="0 0 16 16"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
fillRule="evenodd"
clipRule="evenodd"
d="M8.00008 15.3337C12.0502 15.3337 15.3334 12.0504 15.3334 8.00033C15.3334 3.95024 12.0502 0.666992 8.00008 0.666992C3.94999 0.666992 0.666748 3.95024 0.666748 8.00033C0.666748 12.0504 3.94999 15.3337 8.00008 15.3337ZM8.00008 5.33366C7.15681 5.33366 6.66675 5.89343 6.66675 6.36396C6.66675 6.73215 6.36827 7.03063 6.00008 7.03063C5.63189 7.03063 5.33342 6.73215 5.33342 6.36396C5.33342 4.96007 6.63422 4.00033 8.00008 4.00033C9.36594 4.00033 10.6667 4.96007 10.6667 6.36396C10.6667 7.16403 10.2248 7.76798 9.61551 8.11926C9.32651 8.2859 9.0747 8.46968 8.90124 8.66562C8.73248 8.85625 8.66675 9.02371 8.66675 9.18214V9.33366C8.66675 9.70185 8.36827 10.0003 8.00008 10.0003C7.63189 10.0003 7.33342 9.70185 7.33342 9.33366V9.18214C7.33342 8.6042 7.58993 8.13536 7.9029 7.78182C8.21117 7.43361 8.60058 7.16537 8.94951 6.96418C9.21746 6.80968 9.33342 6.61013 9.33342 6.36396C9.33342 5.89343 8.84336 5.33366 8.00008 5.33366ZM9.00008 11.667C9.00008 12.2193 8.55237 12.667 8.00008 12.667C7.4478 12.667 7.00008 12.2193 7.00008 11.667C7.00008 11.1147 7.4478 10.667 8.00008 10.667C8.55237 10.667 9.00008 11.1147 9.00008 11.667Z"
fill="#999999"
/>
</svg>
</div>
);

3 changes: 3 additions & 0 deletions src/components/Common/CustomIcons.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.questionMarkIcon:hover path {
fill: #DCDCDC;
}
29 changes: 29 additions & 0 deletions src/components/Recent/CustomAuthorCellRenderer.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import React from "react";
import { FormattedMessage, useIntl } from 'react-intl';
import { Tooltip } from '../Common/Tooltip.jsx';
import { QuestionMarkIcon } from '../Common/CustomIcons.jsx';
import styles from './CustomCellRenderer.module.css';


/**
* Exports a custom cell renderer for the author cell.
* @param value - the name of the graph
* @param row - the data associate with this row containing all the information for the graph
*/
export const CustomAuthorCellRenderer = ({ value, row }) => {
const intl = useIntl();
const author = value;
const isOldFormat = author === intl.formatMessage({ id: 'recent.item.old.format' });

console.log(author);
console.log(isOldFormat);
return (
<div className={styles["title-cell"]}>
<p>{author}</p>
{isOldFormat &&
<Tooltip content={<FormattedMessage id="recent.item.old.format.tooltip" />}>
<QuestionMarkIcon />
</Tooltip>}
</div>
);
};
2 changes: 2 additions & 0 deletions src/components/Recent/PageRecent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { useState, useEffect } from 'react';
import { GraphGridItem } from './GraphGridItem.jsx';
import { CustomNameCellRenderer } from './CustomNameCellRenderer.jsx';
import { CustomLocationCellRenderer } from './CustomLocationCellRenderer.jsx';
import { CustomAuthorCellRenderer } from "./CustomAuthorCellRenderer.jsx";
import { GraphTable } from './GraphTable.jsx';
import { GridViewIcon, ListViewIcon } from '../Common/CustomIcons.jsx';
import { openFile } from '../../functions/utility.js';
Expand Down Expand Up @@ -60,6 +61,7 @@ export function RecentPage ({ setIsDisabled }){
Header: 'Author',
accessor: 'Author',
resizable: true,
Cell: CustomAuthorCellRenderer,
},
{
Header: 'Date Modified',
Expand Down
6 changes: 5 additions & 1 deletion src/components/Samples/SamplesGrid.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ const renderSample = (sample, key) => {
} else {
// Render a SamplesGridItem for leaf nodes
return (
<SamplesGridItem key={key} FileName={sample.FileName} FilePath={sample.FilePath} />
<div className={styles["sample-container"]}>
<div className={styles["graphs-grid"]}>
<SamplesGridItem key={key} FileName={sample.FileName} FilePath={sample.FilePath} />
</div>
</div>
);
}
};
Expand Down
4 changes: 3 additions & 1 deletion src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,7 @@
"learning.title.text.guides": "Interactive Guides",
"learning.title.text.videos": "Video Tutorials",
"samples.showsamples.text": "Show Samples in Folder",
"main.page.loading.text": "Loading"
"main.page.loading.text": "Loading",
"recent.item.old.format": "Dynamo 1.x file format",
"recent.item.old.format.tooltip": "Author and thumbnail not available for files saved in Dynamo 1.x format"
}

0 comments on commit 73e1335

Please sign in to comment.