当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript view.createView函数代码示例

本文整理汇总了TypeScript中src/shared/utils/view.createView函数的典型用法代码示例。如果您正苦于以下问题:TypeScript createView函数的具体用法?TypeScript createView怎么用?TypeScript createView使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了createView函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: createView

export const initialStateHelper = (): TimeMachineState => ({
  timeRange: {lower: 'now() - 1h'},
  autoRefresh: AUTOREFRESH_DEFAULT,
  view: createView(),
  draftQueries: [{...defaultViewQuery(), hidden: false}],
  isViewingRawData: false,
  activeTab: TimeMachineTab.Queries,
  activeQueryIndex: 0,
  queryResults: initialQueryResultsState(),
  queryBuilder: {
    buckets: [],
    bucketsStatus: RemoteDataState.NotStarted,
    aggregateWindow: {period: 'auto'},
    functions: [],
    tags: [
      {
        valuesSearchTerm: '',
        keysSearchTerm: '',
        keys: [],
        keysStatus: RemoteDataState.NotStarted,
        values: [],
        valuesStatus: RemoteDataState.NotStarted,
      },
    ],
  },
})
开发者ID:influxdata,项目名称:influxdb,代码行数:26,代码来源:index.ts

示例2: test

  test('it resets tab and draftScript state on a timeMachine when activated', () => {
    const state = initialState()

    expect(state.activeTimeMachineID).toEqual(DE_TIME_MACHINE_ID)

    const activeTimeMachine = state.timeMachines[state.activeTimeMachineID]

    activeTimeMachine.activeQueryIndex = 2

    const view = createView<QueryViewProperties>()

    view.properties.queries = [
      {
        name: '',
        text: 'foo',
        editMode: QueryEditMode.Advanced,
        builderConfig: {
          buckets: [],
          tags: [],
          functions: [],
          aggregateWindow: {period: 'auto'},
        },
      },
      {
        name: '',
        text: 'bar',
        editMode: QueryEditMode.Builder,
        builderConfig: {
          buckets: [],
          tags: [],
          functions: [],
          aggregateWindow: {period: 'auto'},
        },
      },
    ]

    const nextState = timeMachinesReducer(
      state,
      setActiveTimeMachine(VEO_TIME_MACHINE_ID, {view})
    )

    expect(nextState.activeTimeMachineID).toEqual(VEO_TIME_MACHINE_ID)

    const nextTimeMachine =
      nextState.timeMachines[nextState.activeTimeMachineID]

    expect(nextTimeMachine.activeTab).toEqual(TimeMachineTab.Queries)
    expect(nextTimeMachine.activeQueryIndex).toEqual(0)
    expect(
      _.map(nextTimeMachine.draftQueries, q => _.omit(q, ['hidden']))
    ).toEqual(view.properties.queries)
  })
开发者ID:influxdata,项目名称:influxdb,代码行数:52,代码来源:index.test.ts

示例3: createView

export const initialStateHelper = (): TimeMachineState => ({
  timeRange: {lower: 'now() - 1h'},
  view: createView(),
  draftQueries: [{...defaultViewQuery(), hidden: false}],
  isViewingRawData: false,
  activeTab: TimeMachineTab.Queries,
  activeQueryIndex: 0,
  submitToken: 0,
  queryBuilder: {
    buckets: [],
    bucketsStatus: RemoteDataState.NotStarted,
    tags: [],
  },
})
开发者ID:viccom,项目名称:influxdb,代码行数:14,代码来源:timeMachines.ts

示例4: async

export const createNoteCell = (dashboardID: string) => async (
  dispatch,
  getState: GetState
) => {
  const dashboard = getState().dashboards.find(d => d.id === dashboardID)

  if (!dashboard) {
    throw new Error(`could not find dashboard with id "${dashboardID}"`)
  }

  const {note} = getState().noteEditor
  const view = createView<MarkdownView>(ViewType.Markdown)

  view.properties.note = note

  return dispatch(createCellWithView(dashboard, view))
}
开发者ID:viccom,项目名称:influxdb,代码行数:17,代码来源:notes.ts


注:本文中的src/shared/utils/view.createView函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。