@devtable/dashboard 2.4.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/README.md +25 -1
  2. package/dist/api-caller/index.d.ts +13 -7
  3. package/dist/api-caller/types.d.ts +1 -1
  4. package/dist/contexts/index.d.ts +1 -3
  5. package/dist/contexts/model-context.d.ts +24165 -0
  6. package/dist/contexts/panel-context.d.ts +0 -1
  7. package/dist/dashboard.es.js +9680 -15352
  8. package/dist/dashboard.umd.js +38 -19
  9. package/dist/definition-editor/data-editor-modal.d.ts +2 -2
  10. package/dist/definition-editor/global-variables-guide.d.ts +2 -2
  11. package/dist/definition-editor/query-editor/data-preview.d.ts +3 -3
  12. package/dist/definition-editor/query-editor/editor.d.ts +1 -1
  13. package/dist/definition-editor/query-editor/form.d.ts +4 -5
  14. package/dist/definition-editor/query-editor/index.d.ts +2 -2
  15. package/dist/definition-editor/query-editor/select-or-add-query.d.ts +1 -1
  16. package/dist/definition-editor/sql-snippet-editor/editor.d.ts +2 -2
  17. package/dist/filter/filter-checkbox/editor.d.ts +1 -1
  18. package/dist/filter/filter-checkbox/render.d.ts +1 -1
  19. package/dist/filter/filter-date-range/editor.d.ts +1 -1
  20. package/dist/filter/filter-date-range/render.d.ts +1 -1
  21. package/dist/filter/filter-multi-select/editor.d.ts +1 -1
  22. package/dist/filter/filter-multi-select/render.d.ts +1 -1
  23. package/dist/filter/filter-query-field/index.d.ts +1 -1
  24. package/dist/filter/filter-query-field/select-data-source.d.ts +1 -1
  25. package/dist/filter/filter-query-field/test-query.d.ts +1 -1
  26. package/dist/filter/filter-select/editor.d.ts +1 -1
  27. package/dist/filter/filter-select/render.d.ts +1 -1
  28. package/dist/filter/filter-settings/filter-settings.d.ts +0 -2
  29. package/dist/filter/filter-settings/index.d.ts +2 -4
  30. package/dist/filter/filter-text-input/editor.d.ts +1 -1
  31. package/dist/filter/filter-text-input/render.d.ts +1 -1
  32. package/dist/filter/index.d.ts +2 -6
  33. package/dist/index.d.ts +1 -0
  34. package/dist/layout/index.d.ts +1 -1
  35. package/dist/layout/read-only.d.ts +2 -2
  36. package/dist/main/actions.d.ts +1 -3
  37. package/dist/main/full-screen-panel.d.ts +2 -2
  38. package/dist/main/main.d.ts +2 -2
  39. package/dist/main/read-only.d.ts +2 -2
  40. package/dist/main/use-sticky-area-style.d.ts +1 -0
  41. package/dist/model/context.d.ts +11 -0
  42. package/dist/model/dashboard.d.ts +8579 -684
  43. package/dist/model/{filter → filters/filter}/checkbox.d.ts +0 -0
  44. package/dist/model/{filter → filters/filter}/common.d.ts +0 -0
  45. package/dist/model/{filter → filters/filter}/date-range.d.ts +0 -0
  46. package/dist/model/{filter → filters/filter}/index.d.ts +0 -0
  47. package/dist/model/{filter → filters/filter}/multi-select.d.ts +0 -0
  48. package/dist/model/{filter → filters/filter}/select.d.ts +0 -0
  49. package/dist/model/{filter → filters/filter}/text-input.d.ts +0 -0
  50. package/dist/{main/use-filters.d.ts → model/filters/index.d.ts} +1430 -16
  51. package/dist/model/index.d.ts +4 -1
  52. package/dist/model/queries/index.d.ts +116 -0
  53. package/dist/model/queries/mute-query.d.ts +17 -0
  54. package/dist/model/queries/query.d.ts +31 -0
  55. package/dist/model/queries/types.d.ts +5 -0
  56. package/dist/model/sql-snippets/index.d.ts +26 -0
  57. package/dist/model/sql-snippets/sql-snippet.d.ts +9 -0
  58. package/dist/panel/index.d.ts +2 -2
  59. package/dist/panel/plugin-adaptor.d.ts +7 -0
  60. package/dist/panel/settings/index.d.ts +2 -2
  61. package/dist/panel/settings/pick-query/index.d.ts +2 -2
  62. package/dist/panel/title-bar.d.ts +2 -2
  63. package/dist/panel/viz/index.d.ts +3 -3
  64. package/dist/plugins/hooks/index.d.ts +2 -0
  65. package/dist/plugins/hooks/use-channel-event.d.ts +2 -0
  66. package/dist/plugins/hooks/use-storage-data.d.ts +6 -0
  67. package/dist/plugins/index.d.ts +4 -0
  68. package/dist/plugins/json-plugin-storage.d.ts +12 -0
  69. package/dist/plugins/message-channels.d.ts +7 -0
  70. package/dist/plugins/plugin-context.d.ts +12 -0
  71. package/dist/plugins/plugin-data-migrator/index.d.ts +1 -0
  72. package/dist/plugins/plugin-data-migrator/plugin-data-migrator.d.ts +13 -0
  73. package/dist/plugins/plugin-manager.d.ts +18 -0
  74. package/dist/plugins/viz-components/table/index.d.ts +2 -0
  75. package/dist/{panel/viz → plugins/viz-components}/table/type.d.ts +1 -0
  76. package/dist/{panel/viz → plugins/viz-components}/table/value-type-selector.d.ts +0 -0
  77. package/dist/{panel/viz → plugins/viz-components}/table/value.d.ts +0 -0
  78. package/dist/plugins/viz-components/table/viz-table-panel.d.ts +3 -0
  79. package/dist/plugins/viz-components/table/viz-table.d.ts +3 -0
  80. package/dist/plugins/viz-manager/components.d.ts +22 -0
  81. package/dist/plugins/viz-manager/impl.d.ts +10 -0
  82. package/dist/plugins/viz-manager/index.d.ts +4 -0
  83. package/dist/plugins/viz-manager/types.d.ts +12 -0
  84. package/dist/style.css +1 -1
  85. package/dist/types/dashboard.d.ts +4 -12
  86. package/dist/types/plugin/index.d.ts +101 -0
  87. package/dist/utils/download.d.ts +6 -0
  88. package/dist/utils/sql.d.ts +7 -6
  89. package/package.json +25 -6
  90. package/dist/contexts/context-info-context.d.ts +0 -5
  91. package/dist/contexts/definition-context.d.ts +0 -7
  92. package/dist/contexts/filter-values-context.d.ts +0 -4
  93. package/dist/panel/viz/table/index.d.ts +0 -10
  94. package/dist/panel/viz/table/panel.d.ts +0 -3
package/README.md CHANGED
@@ -7,6 +7,30 @@ cd devtable/dashboard && yarn
7
7
  # 2. run demo
8
8
  cd devtable/dashboard/packages/core && yarn build
9
9
  ```
10
+
10
11
  see `package.json` for more scripts
11
12
 
12
- use `../demo` for debugging
13
+ use `../demo` for debugging
14
+
15
+ ## Testing
16
+
17
+ Use cypress for component testing.
18
+
19
+ ```shell
20
+ $ nx cypress dashboard
21
+ ```
22
+
23
+ Use vitest for other types of testing.
24
+
25
+ ```shell
26
+ $ nx vitest dashboard
27
+ ```
28
+
29
+ Use `-c ci` to run tests in headless mode.
30
+
31
+ ```shell
32
+ $ nx cypress dashboard -c ci
33
+ $ nx vitest dashboard -c ci
34
+ # run both in parallel
35
+ $ nx test dashboard -c ci
36
+ ```
@@ -1,5 +1,7 @@
1
- import { ContextInfoContextType, FilterValuesContextType } from '../contexts';
2
- import { IDashboardDefinition, IQuery } from '../types';
1
+ import { FilterValuesType } from '../model';
2
+ import { ContextInfoType } from '../model/context';
3
+ import { DataSourceType } from '../model/queries/types';
4
+ import { SQLSnippetModelInstance } from '../model/sql-snippets';
3
5
  import { IDataSource } from './types';
4
6
  interface IQueryByStaticSQL {
5
7
  type: 'postgresql';
@@ -8,13 +10,17 @@ interface IQueryByStaticSQL {
8
10
  }
9
11
  export declare const queryByStaticSQL: ({ type, key, sql }: IQueryByStaticSQL) => () => Promise<any>;
10
12
  interface IQueryBySQL {
11
- context: ContextInfoContextType;
12
- definitions: IDashboardDefinition;
13
+ context: ContextInfoType;
14
+ sqlSnippets: SQLSnippetModelInstance[];
13
15
  title: string;
14
- query?: IQuery;
15
- filterValues: FilterValuesContextType;
16
+ query: {
17
+ type: DataSourceType;
18
+ key: string;
19
+ sql: string;
20
+ };
21
+ filterValues: FilterValuesType;
16
22
  }
17
- export declare const queryBySQL: ({ context, definitions, title, query, filterValues }: IQueryBySQL) => () => Promise<any>;
23
+ export declare function queryBySQL({ context, sqlSnippets, title, query, filterValues }: IQueryBySQL): Promise<any>;
18
24
  export declare type TQuerySources = Record<string, string[]>;
19
25
  export declare function listDataSources(): Promise<IDataSource[]>;
20
26
  export {};
@@ -1,9 +1,9 @@
1
+ import { DataSourceType } from '../model/queries/types';
1
2
  export declare type PaginationResponse<T> = {
2
3
  total: number;
3
4
  offset: number;
4
5
  data: T[];
5
6
  };
6
- export declare type DataSourceType = 'postgresql' | 'mysql' | 'http';
7
7
  export interface IDataSource {
8
8
  id: string;
9
9
  type: DataSourceType;
@@ -1,5 +1,3 @@
1
- export * from './definition-context';
2
- export * from './context-info-context';
3
- export * from './filter-values-context';
1
+ export * from './model-context';
4
2
  export * from './layout-state-context';
5
3
  export * from './panel-context';