datagrok-ai / public

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

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

Closed santee closed 2 weeks ago

santee commented 1 month ago

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

dnillovna commented 1 month ago

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

santee commented 1 month 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.