datagrok-ai / public

Public package repository for the Datagrok.ai platform
MIT License
45 stars 26 forks source link

#2995: Tools: use decorators in typescript template #2995

Closed santee closed 1 month ago

santee commented 2 months ago

Use decorators on create/add actions in datagrok tools instead of comments

dnillovna commented 2 months ago

This issue has been mirrored in Jira: https://reddata.atlassian.net/browse/GROK-16507

santee commented 2 months ago

grok create still creates

/* Do not change these import lines to match external modules in webpack configuration */
import * as grok from 'datagrok-api/grok';
import * as ui from 'datagrok-api/ui';
import * as DG from 'datagrok-api/dg';

export const _package = new DG.Package();

//name: info
export function info() {
  grok.shell.info(_package.webRoot);
}

Besides, please confirm that viewer class disposes of subscriptions created in onTableAttached

Things like grok add function helloworld do not use decorators.