diff --git a/timesketch/frontend-ng/src/components/Visualization/AggregationConfig.vue b/timesketch/frontend-ng/src/components/Visualization/AggregationConfig.vue
index 24b26904f5..3fb73e778a 100644
--- a/timesketch/frontend-ng/src/components/Visualization/AggregationConfig.vue
+++ b/timesketch/frontend-ng/src/components/Visualization/AggregationConfig.vue
@@ -20,8 +20,6 @@ limitations under the License.
@@ -116,14 +114,6 @@ export default {
splitByTimeline: {
type: Boolean,
},
- timelineFields: {
- type: Array,
- default: () => [],
- },
- loadingFields: {
- type: Boolean,
- default: false
- },
},
data() {
return {
diff --git a/timesketch/frontend-ng/src/components/Visualization/EventFieldSelect.vue b/timesketch/frontend-ng/src/components/Visualization/EventFieldSelect.vue
index bf4694c915..016c50eadf 100644
--- a/timesketch/frontend-ng/src/components/Visualization/EventFieldSelect.vue
+++ b/timesketch/frontend-ng/src/components/Visualization/EventFieldSelect.vue
@@ -17,9 +17,8 @@ limitations under the License.
[],
- },
- loadingFields: {
- type: Boolean,
- default: false
- },
},
data() {
return {
@@ -72,25 +63,26 @@ export default {
}
},
computed: {
- mappedTimelineFields() {
- const mappings = this.$store.state.meta.mappings;
-
- return this.timelineFields.map(field => {
- const mapping = mappings.find(m => m.field === field);
- const type = mapping ? mapping.type : 'unknown';
- return { text: field, value: { field, type } };
- });
+ allNonTimestampFields() {
+ let mappings = this.$store.state.meta.mappings
+ .filter(
+ (mapping) => {
+ return (
+ mapping['field'] !== 'datetime'
+ && mapping['field'] !== 'timestamp'
+ )
+ })
+ .map(
+ (mapping) => {
+ return {text: mapping['field'], value: mapping}}
+ )
+ return mappings
},
},
watch: {
field() {
this.selectedField = this.field
- },
- timelineFields(newFields) {
- if (!newFields || newFields.length === 0) {
- this.selectedField = null;
- }
- },
+ }
}
}
diff --git a/timesketch/frontend-ng/src/components/Visualization/VisualizationEditor.vue b/timesketch/frontend-ng/src/components/Visualization/VisualizationEditor.vue
index 9f14c9e215..3208bb3cdd 100644
--- a/timesketch/frontend-ng/src/components/Visualization/VisualizationEditor.vue
+++ b/timesketch/frontend-ng/src/components/Visualization/VisualizationEditor.vue
@@ -39,7 +39,7 @@ limitations under the License.
{
- this.availableTimelineFields = response.data.objects
- this.loadingFields = false
- })
- .catch(error => {
- console.error("Error fetching fields:", error);
- this.availableTimelineFields = [];
- this.loadingFields = false
- });
- }
- else {
- const promises = timelineIDs.map(timelineID => {
- return ApiClient.getTimelineFields(this.sketch.id, timelineID)
- .then(response => response.data.objects)
- .catch(error => {
- console.error("Error fetching timeline fields:", error);
- return []
- })
- })
-
- Promise.all(promises)
- .then(results => {
- // Flatten the arrays and create a set to guarantee uniqueness
- const union = [...new Set(results.flat())];
- this.availableTimelineFields = union
- this.loadingFields = false;
- })
- .catch(error => {
- console.error("Error in Promise.all", error)
- this.availableTimelineFields = []
- this.loadingFields = false;
- })
- }
- },
rename() {
this.renameVisualDialog = false
this.selectedChartTitle = this.selectedChartTitleDraft