Skip to content

Commit

Permalink
Merge pull request #679 from axonivy/XIVY-15540-dataDocs
Browse files Browse the repository at this point in the history
XIVY-15540 show apiDoc for types
  • Loading branch information
ivy-rew authored Nov 27, 2024
2 parents 1cb436a + 8bc98bf commit f8b11fb
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ const TypeBrowser = ({ value, onChange, onDoubleClick, initSearchFilter, locatio

const [showHelper, setShowHelper] = useState(false);

const [type, setType] = useState('');
const { data: doc } = useMeta('meta/scripting/apiDoc', { context, method: '', paramTypes: [], type }, '');

useEffect(() => {
const typeComparator = (a: TypeBrowserObject, b: TypeBrowserObject) => {
const fqCompare = a.fullQualifiedName.localeCompare(b.fullQualifiedName);
Expand Down Expand Up @@ -186,6 +189,9 @@ const TypeBrowser = ({ value, onChange, onDoubleClick, initSearchFilter, locatio
const selectedRow = tableDynamic.getRowModel().rowsById[Object.keys(rowSelection)[0]];
setShowHelper(true);
const isIvyType = ivyTypes.some(javaClass => javaClass.fullQualifiedName === selectedRow.original.fullQualifiedName);

setType(selectedRow.original.fullQualifiedName);

if (location.includes('code')) {
onChange({
cursorValue: getCursorValue(selectedRow.original, isIvyType, typeAsList, true),
Expand Down Expand Up @@ -262,6 +268,7 @@ const TypeBrowser = ({ value, onChange, onDoubleClick, initSearchFilter, locatio
{showHelper && (
<pre className='browser-helptext'>
<b>{value}</b>
<code>{doc}</code>
</pre>
)}
<Checkbox label='Use Type as List' value={typeAsList} onChange={() => setTypeAsList(!typeAsList)} />
Expand Down

0 comments on commit f8b11fb

Please sign in to comment.