@databrainhq/plugin 0.14.83 → 0.14.84

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.
@@ -4,9 +4,10 @@ type Props = {
4
4
  onCloseModal: (value: boolean) => void;
5
5
  isShowRawCsvModal: boolean;
6
6
  metricItem?: ExternalMetrics;
7
+ workspaceId: string;
7
8
  sharingSettingsId?: string;
8
9
  query: string;
9
10
  };
10
- export declare const DownloadRawCsvModal: ({ onCloseModal, isShowRawCsvModal, metricItem, query, sharingSettingsId, }: Props) => React.JSX.Element;
11
- declare const _default: React.MemoExoticComponent<({ onCloseModal, isShowRawCsvModal, metricItem, query, sharingSettingsId, }: Props) => React.JSX.Element>;
11
+ export declare const DownloadRawCsvModal: ({ onCloseModal, isShowRawCsvModal, metricItem, query, sharingSettingsId, workspaceId, }: Props) => React.JSX.Element;
12
+ declare const _default: React.MemoExoticComponent<({ onCloseModal, isShowRawCsvModal, metricItem, query, sharingSettingsId, workspaceId, }: Props) => React.JSX.Element>;
12
13
  export default _default;
@@ -1,4 +1,4 @@
1
- import { ChartSettingsType, FilteredOptionResult, FloatingDropDownOption, KeywordFilteredResult, SearchColumn, SearchStateChatType, SelectedColumn, SqlColumns } from '@/types';
1
+ import { ChartSettingsType, FilteredOptionResult, FloatingDropDownOption, KeywordFilteredResult, SearchColumn, SearchStateChatType, SelectedColumn, SqlColumns, TableObjectType } from '@/types';
2
2
  export declare const getSearchKeywordList: (searchString: string) => string[];
3
3
  export declare const getFilteredKeywords: (keywordList: string[], isNumberFilter: boolean) => KeywordFilteredResult;
4
4
  export declare const parseNumberName: (keywords: string[]) => number;
@@ -72,10 +72,13 @@ export declare const determineChartType: ({ isProgressiveDimension, orderBy, dim
72
72
  isDifferentMeasureScales?: boolean | undefined;
73
73
  isNullValue?: boolean | undefined;
74
74
  }) => string;
75
- export declare const getChartSettings: ({ chartType, dimensions, measures, chartSettings, columns, }: {
75
+ export declare const getChartSettings: ({ chartType, dimensions, measures, chartSettings, columns, displayText, sqlMetadata, tableList, }: {
76
76
  chartType: ChartSettingsType['chartType'];
77
77
  dimensions: string[];
78
78
  measures: string[];
79
79
  chartSettings: ChartSettingsType;
80
80
  columns: string[];
81
+ displayText?: string | undefined;
82
+ sqlMetadata: Record<string, any>[];
83
+ tableList: TableObjectType[];
81
84
  }) => ChartSettingsType;
@@ -1,8 +1,9 @@
1
1
  import { FieldValues } from 'react-hook-form';
2
- declare const useDownloadRawCsv: ({ onCloseModal, sharingSettingsId, metricItem, }: {
2
+ declare const useDownloadRawCsv: ({ onCloseModal, sharingSettingsId, metricItem, workspaceId, }: {
3
3
  onCloseModal: (value: boolean) => void;
4
4
  metricItem?: Record<string, any> | undefined;
5
5
  sharingSettingsId?: string | undefined;
6
+ workspaceId: string;
6
7
  }) => {
7
8
  onSumbitSendCsvUrl: ({ values, query, }: {
8
9
  values: FieldValues;
@@ -34,6 +34,7 @@ export type TableColumn = {
34
34
  synonyms?: string[];
35
35
  columnTypeConfig?: string | Record<string, any>;
36
36
  dataMartColumnAlias?: string;
37
+ transform?: string;
37
38
  };
38
39
  export type TimeSeriesGroupType = 'yearly' | 'monthly' | 'weekly' | 'daily' | 'quarterly';
39
40
  export type TimeSeriesType = 'bar' | 'line' | 'area' | 'stack';
@@ -162909,6 +162909,7 @@ const tMe = new syt({
162909
162909
  t && /* @__PURE__ */ yt.jsx(
162910
162910
  Pp,
162911
162911
  {
162912
+ workspaceId: rM,
162912
162913
  metricItem: Me,
162913
162914
  isShowRawCsvModal: ct.show,
162914
162915
  onCloseModal: () => Zt({
@@ -167801,40 +167802,38 @@ const PE = {
167801
167802
  }, pre = ({
167802
167803
  onCloseModal: M,
167803
167804
  sharingSettingsId: N,
167804
- metricItem: n
167805
+ metricItem: n,
167806
+ workspaceId: r
167805
167807
  }) => {
167806
- var h;
167807
- const { data: r } = pHt(
167808
- (h = n == null ? void 0 : n.companyIntegration) == null ? void 0 : h.workspaceId
167809
- ), [i, u] = HM.useState(!1), [e, a] = HM.useState(""), { mutate: o } = zzt(), {
167810
- handleSubmit: t,
167811
- register: l,
167812
- setValue: T,
167813
- control: j,
167814
- formState: { errors: L }
167815
- } = p3(), I = HM.useMemo(() => {
167816
- const _ = r;
167808
+ const { data: i } = pHt(r), [u, e] = HM.useState(!1), [a, o] = HM.useState(""), { mutate: t } = zzt(), {
167809
+ handleSubmit: l,
167810
+ register: T,
167811
+ setValue: j,
167812
+ control: L,
167813
+ formState: { errors: I }
167814
+ } = p3(), C = HM.useMemo(() => {
167815
+ const _ = i;
167817
167816
  return {
167818
167817
  expireTimeInMin: (_ == null ? void 0 : _.expireTimeInMin) || 30,
167819
167818
  isEnable: _ == null ? void 0 : _.isEnable
167820
167819
  };
167821
- }, [r]);
167820
+ }, [i]);
167822
167821
  return {
167823
167822
  onSumbitSendCsvUrl: ({
167824
167823
  values: _,
167825
167824
  query: Z
167826
167825
  }) => {
167827
- u(!0), a("");
167828
- const zt = I.expireTimeInMin || 30, xt = new Date(Date.now() + zt * 60 * 1e3), It = Z, ct = _.emails;
167826
+ e(!0), o("");
167827
+ const zt = C.expireTimeInMin || 30, xt = new Date(Date.now() + zt * 60 * 1e3), It = Z, ct = _.emails;
167829
167828
  if (!Are(ct)) {
167830
- u(!1), a("please enter valid email");
167829
+ e(!1), o("please enter valid email");
167831
167830
  return;
167832
167831
  }
167833
167832
  if (!N) {
167834
- u(!1), a("no sharing settings are found");
167833
+ e(!1), o("no sharing settings are found");
167835
167834
  return;
167836
167835
  }
167837
- o(
167836
+ t(
167838
167837
  {
167839
167838
  configurations: {
167840
167839
  externalMetricId: n == null ? void 0 : n.id,
@@ -167854,22 +167853,22 @@ const PE = {
167854
167853
  },
167855
167854
  {
167856
167855
  onSuccess(Zt) {
167857
- Zt ? (u(!1), a(""), M(!1)) : (u(!1), a(b4));
167856
+ Zt ? (e(!1), o(""), M(!1)) : (e(!1), o(b4));
167858
167857
  },
167859
167858
  onError() {
167860
- u(!1), a(b4);
167859
+ e(!1), o(b4);
167861
167860
  }
167862
167861
  }
167863
167862
  );
167864
167863
  },
167865
- isDisableDownloadSettings: !N || !I.isEnable,
167866
- downloadCsvError: e,
167867
- handleSubmit: t,
167868
- isLoading: i,
167869
- register: l,
167870
- control: j,
167871
- setValue: T,
167872
- errors: L
167864
+ isDisableDownloadSettings: !N || !C.isEnable,
167865
+ downloadCsvError: a,
167866
+ handleSubmit: l,
167867
+ isLoading: u,
167868
+ register: T,
167869
+ control: L,
167870
+ setValue: j,
167871
+ errors: I
167873
167872
  };
167874
167873
  }, q2 = { required: "Required" };
167875
167874
  ({
@@ -167968,30 +167967,32 @@ const Pp = ({
167968
167967
  isShowRawCsvModal: N,
167969
167968
  metricItem: n,
167970
167969
  query: r,
167971
- sharingSettingsId: i
167970
+ sharingSettingsId: i,
167971
+ workspaceId: u
167972
167972
  }) => {
167973
167973
  const {
167974
- downloadCsvError: u,
167975
- handleSubmit: e,
167976
- isLoading: a,
167977
- onSumbitSendCsvUrl: o,
167978
- register: t,
167979
- control: l,
167980
- setValue: T,
167981
- isDisableDownloadSettings: j,
167982
- errors: L
167974
+ downloadCsvError: e,
167975
+ handleSubmit: a,
167976
+ isLoading: o,
167977
+ onSumbitSendCsvUrl: t,
167978
+ register: l,
167979
+ control: T,
167980
+ setValue: j,
167981
+ isDisableDownloadSettings: L,
167982
+ errors: I
167983
167983
  } = pre({
167984
167984
  onCloseModal: M,
167985
167985
  metricItem: n,
167986
- sharingSettingsId: i
167987
- }), I = () => {
167988
- var C;
167986
+ sharingSettingsId: i,
167987
+ workspaceId: u
167988
+ }), C = () => {
167989
+ var h;
167989
167990
  return /* @__PURE__ */ yt.jsx(yt.Fragment, { children: /* @__PURE__ */ yt.jsxs(
167990
167991
  "form",
167991
167992
  {
167992
- onSubmit: e(
167993
- (h) => o({
167994
- values: h,
167993
+ onSubmit: a(
167994
+ (_) => t({
167995
+ values: _,
167995
167996
  query: r
167996
167997
  })
167997
167998
  ),
@@ -168003,25 +168004,25 @@ const Pp = ({
168003
168004
  type: "subject",
168004
168005
  label: "Subject",
168005
168006
  placeholder: "enter a subject",
168006
- register: t("subject", q2),
168007
+ register: l("subject", q2),
168007
168008
  defaultValue: n == null ? void 0 : n.name,
168008
- error: (C = L.subject) == null ? void 0 : C.message,
168009
+ error: (h = I.subject) == null ? void 0 : h.message,
168009
168010
  isImportant: !0
168010
168011
  }
168011
168012
  ),
168012
168013
  /* @__PURE__ */ yt.jsx(
168013
168014
  W9,
168014
168015
  {
168015
- control: l,
168016
+ control: T,
168016
168017
  type: "text",
168017
168018
  label: "Send to",
168018
168019
  placeholder: "Enter email addresses separated by enter",
168019
- onChangeTags: (h) => T("emails", h),
168020
+ onChangeTags: (_) => j("emails", _),
168020
168021
  isImportant: !0,
168021
168022
  width: "100%"
168022
168023
  }
168023
168024
  ),
168024
- u && /* @__PURE__ */ yt.jsx(rnt, { message: u }),
168025
+ e && /* @__PURE__ */ yt.jsx(rnt, { message: e }),
168025
168026
  /* @__PURE__ */ yt.jsxs("div", { className: qk.downloadCsvNote, children: [
168026
168027
  /* @__PURE__ */ yt.jsx(Ai, { name: "info" }),
168027
168028
  /* @__PURE__ */ yt.jsxs("div", { className: qk.downloadCsvNoteText, children: [
@@ -168037,7 +168038,7 @@ const Pp = ({
168037
168038
  variant: "tab",
168038
168039
  type: "button",
168039
168040
  onClick: () => M(!1),
168040
- isDisabled: a,
168041
+ isDisabled: o,
168041
168042
  children: "Cancel"
168042
168043
  }
168043
168044
  ),
@@ -168046,7 +168047,7 @@ const Pp = ({
168046
168047
  {
168047
168048
  variant: "primary",
168048
168049
  type: "submit",
168049
- isDisabled: a || j,
168050
+ isDisabled: o || L,
168050
168051
  children: "Submit"
168051
168052
  }
168052
168053
  )
@@ -168062,7 +168063,7 @@ const Pp = ({
168062
168063
  onClose: () => M(!1),
168063
168064
  headerTitle: "Download Raw CSV",
168064
168065
  zIndex: 9999,
168065
- children: /* @__PURE__ */ yt.jsx("div", { className: qk.downloadCsv, children: /* @__PURE__ */ yt.jsx(I, {}) })
168066
+ children: /* @__PURE__ */ yt.jsx("div", { className: qk.downloadCsv, children: /* @__PURE__ */ yt.jsx(C, {}) })
168066
168067
  }
168067
168068
  );
168068
168069
  };
@@ -172526,6 +172527,7 @@ const noe = "_dbcLastCardLevel_wdhgx_7", Noe = "_dbcLastMetricCardLevel_wdhgx_13
172526
172527
  /* @__PURE__ */ yt.jsx(
172527
172528
  Pp,
172528
172529
  {
172530
+ workspaceId: $t,
172529
172531
  metricItem: M,
172530
172532
  isShowRawCsvModal: Me,
172531
172533
  onCloseModal: ee,
@@ -172861,6 +172863,7 @@ const noe = "_dbcLastCardLevel_wdhgx_7", Noe = "_dbcLastMetricCardLevel_wdhgx_13
172861
172863
  ct && /* @__PURE__ */ yt.jsx(
172862
172864
  Pp,
172863
172865
  {
172866
+ workspaceId: Me,
172864
172867
  metricItem: be.metric,
172865
172868
  isShowRawCsvModal: be.show,
172866
172869
  onCloseModal: () => oM({