Skip to content

[Data Views] Reset the time field when the updated index pattern does not have it#262001

Merged
jughosta merged 9 commits intoelastic:mainfrom
jughosta:260478-fix-data-view-time-field
Apr 14, 2026
Merged

[Data Views] Reset the time field when the updated index pattern does not have it#262001
jughosta merged 9 commits intoelastic:mainfrom
jughosta:260478-fix-data-view-time-field

Conversation

@jughosta
Copy link
Copy Markdown
Contributor

@jughosta jughosta commented Apr 8, 2026

Summary

This PR resets the previously loaded time field after changing the index pattern with a time field to an index pattern without a time field while entering it in the "Create data view" flyout.

Steps

  1. Start creating a new data view
  2. Enter an index pattern with a time field and wait for it to get loaded in the dropdown
  3. Change the index pattern to another one without a time field and wait for the dropdown to get disabled
  4. Save the data view
  5. Verify that no time field is assigned for it
  6. Additionally check that editing any of previously saved data views works without issues too

Testing data

PUT meow

PUT meow/_mapping
{
  "properties": {
    "message": {
      "type": "keyword"
    },
    "@timestamp": {
        "type": "date"
    }
  }
}
PUT meow/_doc/1
{
    "message": "test",
    "@timestamp": "2023-05-10T11:01:10Z"
 }

PUT meow2

PUT meow2/_mapping
{
  "properties": {
    "message": {
      "type": "keyword"
    }
  }
}
PUT meow2/_doc/1
{
    "message": "test2"
 }

Checklist

@jughosta jughosta self-assigned this Apr 8, 2026
@jughosta jughosta added release_note:fix Feature:Data Views Data Views code and UI - index patterns before 8.0 Team:DataDiscovery Discover, search (data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. t// backport:version Backport to applied version labels v9.4.0 v9.3.3 labels Apr 8, 2026
@jughosta
Copy link
Copy Markdown
Contributor Author

jughosta commented Apr 8, 2026

/flaky ftrConfig:src/platform/test/functional/apps/management/group1/config.ts:15

@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner

✅ Build triggered - kibana-flaky-test-suite-runner#11461

  • src/platform/test/functional/apps/management/group1/config.ts x15
@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner Stats

🟠 Some tests failed. - kibana-flaky-test-suite-runner#11461

[❌] src/platform/test/functional/apps/management/group1/config.ts: 0/15 tests passed.

see run history

@jughosta
Copy link
Copy Markdown
Contributor Author

jughosta commented Apr 8, 2026

/flaky ftrConfig:src/platform/test/functional/apps/management/group1/config.ts:15

@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner

✅ Build triggered - kibana-flaky-test-suite-runner#11464

  • src/platform/test/functional/apps/management/group1/config.ts x15
@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner Stats

🟠 Some tests failed. - kibana-flaky-test-suite-runner#11464

[❌] src/platform/test/functional/apps/management/group1/config.ts: 0/15 tests passed.

see run history

@jughosta
Copy link
Copy Markdown
Contributor Author

jughosta commented Apr 9, 2026

/flaky ftrConfig:src/platform/test/functional/apps/management/group1/config.ts:15

@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner

✅ Build triggered - kibana-flaky-test-suite-runner#11483

  • src/platform/test/functional/apps/management/group1/config.ts x15
@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner Stats

🎉 All tests passed! - kibana-flaky-test-suite-runner#11483

[✅] src/platform/test/functional/apps/management/group1/config.ts: 15/15 tests passed.

see run history

@jughosta
Copy link
Copy Markdown
Contributor Author

/flaky ftrConfig:src/platform/test/functional/apps/management/group1/config.ts:10

@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner

✅ Build triggered - kibana-flaky-test-suite-runner#11535

  • src/platform/test/functional/apps/management/group1/config.ts x10
@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner Stats

🎉 All tests passed! - kibana-flaky-test-suite-runner#11535

[✅] src/platform/test/functional/apps/management/group1/config.ts: 10/10 tests passed.

see run history

</>
</EuiFormRow>
</>
<TimestampFieldRenderer
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrapped into another component so useEffect can be used.

Comment on lines +159 to +162
if (!isLoadingOptions && value?.value && wasValueInTheListRef.current) {
wasValueInTheListRef.current = false;
reset();
}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New condition to address the bug

@elasticmachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] affected Scout: [ observability / profiling ] plugin / local-stateful-classic - APM integration not installed but setup completed - Admin user
  • [job] [logs] Scout: [ security / entity_store ] plugin / local-stateful-classic - Entity Store Logs Extraction with pagination (max 5 docs per page) - Should extract properly extract host with pagination

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
dataViewEditor 42.6KB 43.0KB +399.0B

History

cc @jughosta

@jughosta jughosta marked this pull request as ready for review April 13, 2026 13:38
@jughosta jughosta requested review from a team as code owners April 13, 2026 13:38
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)

Copy link
Copy Markdown
Contributor

@davismcphee davismcphee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works great, thanks!

@jughosta jughosta added v9.3.4 and removed v9.3.3 labels Apr 14, 2026
@jughosta jughosta merged commit 4b756bb into elastic:main Apr 14, 2026
24 checks passed
@jughosta jughosta deleted the 260478-fix-data-view-time-field branch April 14, 2026 07:49
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 9.3, 9.4

https://github.com/elastic/kibana/actions/runs/24387410523

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Apr 14, 2026
… not have it (elastic#262001)

- Resolves elastic#260478

## Summary

This PR resets the previously loaded time field after changing the index
pattern with a time field to an index pattern without a time field while
entering it in the "Create data view" flyout.

## Steps

1. Start creating a new data view
2. Enter an index pattern with a time field and wait for it to get
loaded in the dropdown
3. Change the index pattern to another one without a time field and wait
for the dropdown to get disabled
4. Save the data view
5. Verify that no time field is assigned for it
6. Additionally check that editing any of previously saved data views
works without issues too

### Testing data

```
PUT meow

PUT meow/_mapping
{
  "properties": {
    "message": {
      "type": "keyword"
    },
    "@timestamp": {
        "type": "date"
    }
  }
}
PUT meow/_doc/1
{
    "message": "test",
    "@timestamp": "2023-05-10T11:01:10Z"
 }

PUT meow2

PUT meow2/_mapping
{
  "properties": {
    "message": {
      "type": "keyword"
    }
  }
}
PUT meow2/_doc/1
{
    "message": "test2"
 }
```

### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

(cherry picked from commit 4b756bb)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Apr 14, 2026
… not have it (elastic#262001)

- Resolves elastic#260478

## Summary

This PR resets the previously loaded time field after changing the index
pattern with a time field to an index pattern without a time field while
entering it in the "Create data view" flyout.

## Steps

1. Start creating a new data view
2. Enter an index pattern with a time field and wait for it to get
loaded in the dropdown
3. Change the index pattern to another one without a time field and wait
for the dropdown to get disabled
4. Save the data view
5. Verify that no time field is assigned for it
6. Additionally check that editing any of previously saved data views
works without issues too

### Testing data

```
PUT meow

PUT meow/_mapping
{
  "properties": {
    "message": {
      "type": "keyword"
    },
    "@timestamp": {
        "type": "date"
    }
  }
}
PUT meow/_doc/1
{
    "message": "test",
    "@timestamp": "2023-05-10T11:01:10Z"
 }

PUT meow2

PUT meow2/_mapping
{
  "properties": {
    "message": {
      "type": "keyword"
    }
  }
}
PUT meow2/_doc/1
{
    "message": "test2"
 }
```

### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

(cherry picked from commit 4b756bb)
@kibanamachine
Copy link
Copy Markdown
Contributor

💚 All backports created successfully

Status Branch Result
9.3
9.4

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

tfcmarques pushed a commit to tfcmarques/kibana that referenced this pull request Apr 14, 2026
… not have it (elastic#262001)

- Resolves elastic#260478

## Summary

This PR resets the previously loaded time field after changing the index
pattern with a time field to an index pattern without a time field while
entering it in the "Create data view" flyout.

## Steps

1. Start creating a new data view
2. Enter an index pattern with a time field and wait for it to get
loaded in the dropdown
3. Change the index pattern to another one without a time field and wait
for the dropdown to get disabled
4. Save the data view
5. Verify that no time field is assigned for it
6. Additionally check that editing any of previously saved data views
works without issues too

### Testing data

```
PUT meow

PUT meow/_mapping
{
  "properties": {
    "message": {
      "type": "keyword"
    },
    "@timestamp": {
        "type": "date"
    }
  }
}
PUT meow/_doc/1
{
    "message": "test",
    "@timestamp": "2023-05-10T11:01:10Z"
 }

PUT meow2

PUT meow2/_mapping
{
  "properties": {
    "message": {
      "type": "keyword"
    }
  }
}
PUT meow2/_doc/1
{
    "message": "test2"
 }
```


### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.
kibanamachine added a commit that referenced this pull request Apr 14, 2026
…n does not have it (#262001) (#262957)

# Backport

This will backport the following commits from `main` to `9.4`:
- [[Data Views] Reset the time field when the updated index pattern does
not have it (#262001)](#262001)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Julia
Rechkunova","email":"julia.rechkunova@elastic.co"},"sourceCommit":{"committedDate":"2026-04-14T07:49:11Z","message":"[Data
Views] Reset the time field when the updated index pattern does not have
it (#262001)\n\n- Resolves
https://github.com/elastic/kibana/issues/260478\n\n## Summary\n\nThis PR
resets the previously loaded time field after changing the
index\npattern with a time field to an index pattern without a time
field while\nentering it in the \"Create data view\" flyout.\n\n##
Steps\n\n1. Start creating a new data view\n2. Enter an index pattern
with a time field and wait for it to get\nloaded in the dropdown\n3.
Change the index pattern to another one without a time field and
wait\nfor the dropdown to get disabled\n4. Save the data view\n5. Verify
that no time field is assigned for it\n6. Additionally check that
editing any of previously saved data views\nworks without issues
too\n\n### Testing data\n\n```\nPUT meow\n\nPUT meow/_mapping\n{\n
\"properties\": {\n \"message\": {\n \"type\": \"keyword\"\n },\n
\"@timestamp\": {\n \"type\": \"date\"\n }\n }\n}\nPUT meow/_doc/1\n{\n
\"message\": \"test\",\n \"@timestamp\": \"2023-05-10T11:01:10Z\"\n
}\n\nPUT meow2\n\nPUT meow2/_mapping\n{\n \"properties\": {\n
\"message\": {\n \"type\": \"keyword\"\n }\n }\n}\nPUT meow2/_doc/1\n{\n
\"message\": \"test2\"\n }\n```\n\n\n### Checklist\n\n- [x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n- [x] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n-
[x] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*`
labels.","sha":"4b756bb2d5b56247ce1a4f4ee19dc983d4006d4e","branchLabelMapping":{"^v9.5.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Feature:Data
Views","Team:DataDiscovery","backport:version","v9.4.0","v9.5.0","v9.3.4"],"title":"[Data
Views] Reset the time field when the updated index pattern does not have
it","number":262001,"url":"https://github.com/elastic/kibana/pull/262001","mergeCommit":{"message":"[Data
Views] Reset the time field when the updated index pattern does not have
it (#262001)\n\n- Resolves
https://github.com/elastic/kibana/issues/260478\n\n## Summary\n\nThis PR
resets the previously loaded time field after changing the
index\npattern with a time field to an index pattern without a time
field while\nentering it in the \"Create data view\" flyout.\n\n##
Steps\n\n1. Start creating a new data view\n2. Enter an index pattern
with a time field and wait for it to get\nloaded in the dropdown\n3.
Change the index pattern to another one without a time field and
wait\nfor the dropdown to get disabled\n4. Save the data view\n5. Verify
that no time field is assigned for it\n6. Additionally check that
editing any of previously saved data views\nworks without issues
too\n\n### Testing data\n\n```\nPUT meow\n\nPUT meow/_mapping\n{\n
\"properties\": {\n \"message\": {\n \"type\": \"keyword\"\n },\n
\"@timestamp\": {\n \"type\": \"date\"\n }\n }\n}\nPUT meow/_doc/1\n{\n
\"message\": \"test\",\n \"@timestamp\": \"2023-05-10T11:01:10Z\"\n
}\n\nPUT meow2\n\nPUT meow2/_mapping\n{\n \"properties\": {\n
\"message\": {\n \"type\": \"keyword\"\n }\n }\n}\nPUT meow2/_doc/1\n{\n
\"message\": \"test2\"\n }\n```\n\n\n### Checklist\n\n- [x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n- [x] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n-
[x] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*`
labels.","sha":"4b756bb2d5b56247ce1a4f4ee19dc983d4006d4e"}},"sourceBranch":"main","suggestedTargetBranches":["9.4","9.3"],"targetPullRequestStates":[{"branch":"9.4","label":"v9.4.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.5.0","branchLabelMappingKey":"^v9.5.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/262001","number":262001,"mergeCommit":{"message":"[Data
Views] Reset the time field when the updated index pattern does not have
it (#262001)\n\n- Resolves
https://github.com/elastic/kibana/issues/260478\n\n## Summary\n\nThis PR
resets the previously loaded time field after changing the
index\npattern with a time field to an index pattern without a time
field while\nentering it in the \"Create data view\" flyout.\n\n##
Steps\n\n1. Start creating a new data view\n2. Enter an index pattern
with a time field and wait for it to get\nloaded in the dropdown\n3.
Change the index pattern to another one without a time field and
wait\nfor the dropdown to get disabled\n4. Save the data view\n5. Verify
that no time field is assigned for it\n6. Additionally check that
editing any of previously saved data views\nworks without issues
too\n\n### Testing data\n\n```\nPUT meow\n\nPUT meow/_mapping\n{\n
\"properties\": {\n \"message\": {\n \"type\": \"keyword\"\n },\n
\"@timestamp\": {\n \"type\": \"date\"\n }\n }\n}\nPUT meow/_doc/1\n{\n
\"message\": \"test\",\n \"@timestamp\": \"2023-05-10T11:01:10Z\"\n
}\n\nPUT meow2\n\nPUT meow2/_mapping\n{\n \"properties\": {\n
\"message\": {\n \"type\": \"keyword\"\n }\n }\n}\nPUT meow2/_doc/1\n{\n
\"message\": \"test2\"\n }\n```\n\n\n### Checklist\n\n- [x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n- [x] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n-
[x] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*`
labels.","sha":"4b756bb2d5b56247ce1a4f4ee19dc983d4006d4e"}},{"branch":"9.3","label":"v9.3.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Julia Rechkunova <julia.rechkunova@elastic.co>
kibanamachine added a commit that referenced this pull request Apr 14, 2026
…n does not have it (#262001) (#262956)

# Backport

This will backport the following commits from `main` to `9.3`:
- [[Data Views] Reset the time field when the updated index pattern does
not have it (#262001)](#262001)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Julia
Rechkunova","email":"julia.rechkunova@elastic.co"},"sourceCommit":{"committedDate":"2026-04-14T07:49:11Z","message":"[Data
Views] Reset the time field when the updated index pattern does not have
it (#262001)\n\n- Resolves
https://github.com/elastic/kibana/issues/260478\n\n## Summary\n\nThis PR
resets the previously loaded time field after changing the
index\npattern with a time field to an index pattern without a time
field while\nentering it in the \"Create data view\" flyout.\n\n##
Steps\n\n1. Start creating a new data view\n2. Enter an index pattern
with a time field and wait for it to get\nloaded in the dropdown\n3.
Change the index pattern to another one without a time field and
wait\nfor the dropdown to get disabled\n4. Save the data view\n5. Verify
that no time field is assigned for it\n6. Additionally check that
editing any of previously saved data views\nworks without issues
too\n\n### Testing data\n\n```\nPUT meow\n\nPUT meow/_mapping\n{\n
\"properties\": {\n \"message\": {\n \"type\": \"keyword\"\n },\n
\"@timestamp\": {\n \"type\": \"date\"\n }\n }\n}\nPUT meow/_doc/1\n{\n
\"message\": \"test\",\n \"@timestamp\": \"2023-05-10T11:01:10Z\"\n
}\n\nPUT meow2\n\nPUT meow2/_mapping\n{\n \"properties\": {\n
\"message\": {\n \"type\": \"keyword\"\n }\n }\n}\nPUT meow2/_doc/1\n{\n
\"message\": \"test2\"\n }\n```\n\n\n### Checklist\n\n- [x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n- [x] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n-
[x] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*`
labels.","sha":"4b756bb2d5b56247ce1a4f4ee19dc983d4006d4e","branchLabelMapping":{"^v9.5.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Feature:Data
Views","Team:DataDiscovery","backport:version","v9.4.0","v9.5.0","v9.3.4"],"title":"[Data
Views] Reset the time field when the updated index pattern does not have
it","number":262001,"url":"https://github.com/elastic/kibana/pull/262001","mergeCommit":{"message":"[Data
Views] Reset the time field when the updated index pattern does not have
it (#262001)\n\n- Resolves
https://github.com/elastic/kibana/issues/260478\n\n## Summary\n\nThis PR
resets the previously loaded time field after changing the
index\npattern with a time field to an index pattern without a time
field while\nentering it in the \"Create data view\" flyout.\n\n##
Steps\n\n1. Start creating a new data view\n2. Enter an index pattern
with a time field and wait for it to get\nloaded in the dropdown\n3.
Change the index pattern to another one without a time field and
wait\nfor the dropdown to get disabled\n4. Save the data view\n5. Verify
that no time field is assigned for it\n6. Additionally check that
editing any of previously saved data views\nworks without issues
too\n\n### Testing data\n\n```\nPUT meow\n\nPUT meow/_mapping\n{\n
\"properties\": {\n \"message\": {\n \"type\": \"keyword\"\n },\n
\"@timestamp\": {\n \"type\": \"date\"\n }\n }\n}\nPUT meow/_doc/1\n{\n
\"message\": \"test\",\n \"@timestamp\": \"2023-05-10T11:01:10Z\"\n
}\n\nPUT meow2\n\nPUT meow2/_mapping\n{\n \"properties\": {\n
\"message\": {\n \"type\": \"keyword\"\n }\n }\n}\nPUT meow2/_doc/1\n{\n
\"message\": \"test2\"\n }\n```\n\n\n### Checklist\n\n- [x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n- [x] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n-
[x] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*`
labels.","sha":"4b756bb2d5b56247ce1a4f4ee19dc983d4006d4e"}},"sourceBranch":"main","suggestedTargetBranches":["9.4","9.3"],"targetPullRequestStates":[{"branch":"9.4","label":"v9.4.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.5.0","branchLabelMappingKey":"^v9.5.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/262001","number":262001,"mergeCommit":{"message":"[Data
Views] Reset the time field when the updated index pattern does not have
it (#262001)\n\n- Resolves
https://github.com/elastic/kibana/issues/260478\n\n## Summary\n\nThis PR
resets the previously loaded time field after changing the
index\npattern with a time field to an index pattern without a time
field while\nentering it in the \"Create data view\" flyout.\n\n##
Steps\n\n1. Start creating a new data view\n2. Enter an index pattern
with a time field and wait for it to get\nloaded in the dropdown\n3.
Change the index pattern to another one without a time field and
wait\nfor the dropdown to get disabled\n4. Save the data view\n5. Verify
that no time field is assigned for it\n6. Additionally check that
editing any of previously saved data views\nworks without issues
too\n\n### Testing data\n\n```\nPUT meow\n\nPUT meow/_mapping\n{\n
\"properties\": {\n \"message\": {\n \"type\": \"keyword\"\n },\n
\"@timestamp\": {\n \"type\": \"date\"\n }\n }\n}\nPUT meow/_doc/1\n{\n
\"message\": \"test\",\n \"@timestamp\": \"2023-05-10T11:01:10Z\"\n
}\n\nPUT meow2\n\nPUT meow2/_mapping\n{\n \"properties\": {\n
\"message\": {\n \"type\": \"keyword\"\n }\n }\n}\nPUT meow2/_doc/1\n{\n
\"message\": \"test2\"\n }\n```\n\n\n### Checklist\n\n- [x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n- [x] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n-
[x] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*`
labels.","sha":"4b756bb2d5b56247ce1a4f4ee19dc983d4006d4e"}},{"branch":"9.3","label":"v9.3.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Julia Rechkunova <julia.rechkunova@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels Feature:Data Views Data Views code and UI - index patterns before 8.0 release_note:fix Team:DataDiscovery Discover, search (data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. t// v9.3.4 v9.4.0 v9.5.0

5 participants