From 5fc65bf96950cb53d18e2e31e2ac9969e983af08 Mon Sep 17 00:00:00 2001 From: Carolina Capetillo Date: Fri, 22 Sep 2023 09:46:37 -0700 Subject: [PATCH 01/13] got rid of console logs --- src/store/modules/images.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/store/modules/images.js b/src/store/modules/images.js index c0e3780b..53b9fb9b 100644 --- a/src/store/modules/images.js +++ b/src/store/modules/images.js @@ -173,16 +173,12 @@ const actions = { // If it doesn't already exist, just add it to the array (front). if (old_image_index == -1) { - console.log('old') const updated_recent_images = [new_image, ...recent_images] commit('setRecentImages', updated_recent_images) - dispatch('group_images') } // Otherwise, replace the old version with the new one we fetched. else { - console.log('new image') recent_images[old_image_index] = new_image - dispatch('group_images') } // We don't have a toggle implemented yet. From 8e8ff793f0c5a65c082780e94032beaef9671f11 Mon Sep 17 00:00:00 2001 From: Carolina Capetillo Date: Mon, 25 Sep 2023 13:02:02 -0700 Subject: [PATCH 02/13] reverted changes for update_new_image. api call is now the correct url. and added a watcher in thumbnailrow component --- src/components/ImageDisplay/ThumbnailRow.vue | 12 ++++++++++-- src/store/modules/images.js | 11 +++++------ 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/components/ImageDisplay/ThumbnailRow.vue b/src/components/ImageDisplay/ThumbnailRow.vue index 66a60d49..49a6418b 100644 --- a/src/components/ImageDisplay/ThumbnailRow.vue +++ b/src/components/ImageDisplay/ThumbnailRow.vue @@ -27,7 +27,6 @@ diff --git a/src/components/sitepages/SiteData.vue b/src/components/sitepages/SiteData.vue index 6cf000a3..b8e5cc14 100644 --- a/src/components/sitepages/SiteData.vue +++ b/src/components/sitepages/SiteData.vue @@ -24,8 +24,7 @@ /> diff --git a/src/store/modules/images.js b/src/store/modules/images.js index 9455c4c7..b82164c3 100644 --- a/src/store/modules/images.js +++ b/src/store/modules/images.js @@ -60,6 +60,27 @@ const getters = { recent_images: state => state.recent_images, user_images: state => state.user_images, grouped_images: state => state.grouped_images, + recent_images_condensed: state => { + // First, generate a map of maximum SSTKNUM for each SMARTSTK + const maxSSTKNUMs = state.recent_images.reduce((acc, cur) => { + if (!cur.header || !cur.header.SMARTSTK || !cur.header.SSTKNUM) return acc // Skip if missing header, SMARTSTK or SSTKNUM + + if (!acc[cur.header.SMARTSTK] || cur.header.SSTKNUM > acc[cur.header.SMARTSTK]) { + acc[cur.header.SMARTSTK] = cur.header.SSTKNUM + } + return acc + }, {}) + + // Now, filter the original array + const filteredArr = state.recent_images.filter(el => { + // Keep if missing header, SMARTSTK or SSTKNUM + if (!el.header || !el.header.SMARTSTK || !el.header.SSTKNUM) return true + + // Keep if SSTKNUM is the maximum for its SMARTSTK + return el.header.SSTKNUM >= maxSSTKNUMs[el.header.SMARTSTK] + }) + return filteredArr + }, show_user_data_only: state => state.show_user_data_only, current_image_fits_header: state => state.current_image.fits_header, @@ -172,12 +193,12 @@ const actions = { if (old_image_index == -1) { const updated_recent_images = [new_image, ...recent_images] commit('setRecentImages', updated_recent_images) - dispatch('group_images') + // dispatch('group_images') } // Otherwise, replace the old version with the new one we fetched. else { recent_images[old_image_index] = new_image - dispatch('group_images') + // dispatch('group_images') } // We don't have a toggle implemented yet. // But eventually we want one to focus on the new image immediately. @@ -245,7 +266,7 @@ const actions = { } commit('setRecentImages', response) - dispatch('group_images') + // dispatch('group_images') }).catch(error => { console.warn(error) }) @@ -266,48 +287,47 @@ const actions = { 9012: [...grouped images...] } } - */ - group_images ({ commit, state, rootState, dispatch }) { - const currentSite = rootState.site_config.selected_site - let grouped_images_local = JSON.parse(JSON.stringify(state.grouped_images)) - if (!grouped_images_local.imageGroups) { - grouped_images_local.imageGroups = {} - } - const recent_images = state.recent_images - // Resetting grouped_images to an empty object when selecting a different site - // This prevents accumulation of thumbnails from previous sites selected by user - if (grouped_images_local.site && grouped_images_local.site !== currentSite) { - dispatch('reset_grouped_images') - grouped_images_local = { site: currentSite } - // If grouped_images_local object doesn't have a key of site (i.e. when page first loads and when user selects - // a different site), assign the value of currentSite to the new key of site - } else if (!grouped_images_local.site) { - grouped_images_local.site = currentSite - } - - for (const img of recent_images) { - const header = img && img.header - let SMARTSTK = header && header.SMARTSTK - // Creating a unique key (i.e. base_filename) for images where SMARTSK is 'no' while also avoiding grouping them as one stack - // We need this in order to display these images as thumbnails - if (!SMARTSTK || SMARTSTK === 'no') { - SMARTSTK = img && img.base_filename - grouped_images_local.imageGroups[SMARTSTK] = [] - grouped_images_local.imageGroups[SMARTSTK].push(img) - } - // Grouping images based on SMARTSTK - if (!grouped_images_local.imageGroups[SMARTSTK]) { - grouped_images_local.imageGroups[SMARTSTK] = [] - grouped_images_local.imageGroups[SMARTSTK].push(img) - } else { - grouped_images_local.imageGroups[SMARTSTK].push(img) - } - } - commit('setGroupedImages', { ...grouped_images_local }) - console.log('grouped images local,', grouped_images_local) - console.log('grouped images state,', state.grouped_images) - }, + */ + // group_images ({ commit, state, rootState, dispatch }) { + // const currentSite = rootState.site_config.selected_site + // let grouped_images_local = JSON.parse(JSON.stringify(state.grouped_images)) + // if (!grouped_images_local.imageGroups) { + // grouped_images_local.imageGroups = {} + // } + // const recent_images = state.recent_images + // // Resetting grouped_images to an empty object when selecting a different site + // // This prevents accumulation of thumbnails from previous sites selected by user + // if (grouped_images_local.site && grouped_images_local.site !== currentSite) { + // dispatch('reset_grouped_images') + // grouped_images_local = { site: currentSite } + // // If grouped_images_local object doesn't have a key of site (i.e. when page first loads and when user selects + // // a different site), assign the value of currentSite to the new key of site + // } else if (!grouped_images_local.site) { + // grouped_images_local.site = currentSite + // } + + // for (const img of recent_images) { + // const header = img && img.header + // let SMARTSTK = header && header.SMARTSTK + // // Creating a unique key (i.e. base_filename) for images where SMARTSK is 'no' while also avoiding grouping them as one stack + // // We need this in order to display these images as thumbnails + // if (!SMARTSTK || SMARTSTK === 'no') { + // SMARTSTK = img && img.base_filename + // grouped_images_local.imageGroups[SMARTSTK] = [] + // grouped_images_local.imageGroups[SMARTSTK].push(img) + // } + + // // Grouping images based on SMARTSTK + // if (!grouped_images_local.imageGroups[SMARTSTK]) { + // grouped_images_local.imageGroups[SMARTSTK] = [] + // grouped_images_local.imageGroups[SMARTSTK].push(img) + // } else { + // grouped_images_local.imageGroups[SMARTSTK].push(img) + // } + // } + // commit('setGroupedImages', { ...grouped_images_local }) + // }, // Resets grouped_images to an empty object // Dispatched when a different site is selected @@ -349,7 +369,7 @@ const actions = { commit('setCurrentImage', response[0]) commit('setRecentImages', response) - dispatch('group_images') + // dispatch('group_images') }).catch(error => { console.error(error) }) @@ -477,7 +497,7 @@ const actions = { commit('setCurrentImage', response[0]) commit('setRecentImages', response) - dispatch('group_images') + // dispatch('group_images') }).catch(error => { console.error(error) }) From c53392cbaf07b99d08dcb1ab613413d4671087fc Mon Sep 17 00:00:00 2001 From: Carolina Capetillo Date: Wed, 27 Sep 2023 10:25:35 -0700 Subject: [PATCH 05/13] forgot to delete 'grouped_images' on sitedata.vue --- src/components/sitepages/SiteData.vue | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/sitepages/SiteData.vue b/src/components/sitepages/SiteData.vue index b8e5cc14..0f1d9fb7 100644 --- a/src/components/sitepages/SiteData.vue +++ b/src/components/sitepages/SiteData.vue @@ -384,8 +384,7 @@ export default { ...mapState('images', [ 'recent_images', - 'current_image', - 'grouped_images' + 'current_image' ]), ...mapGetters('images', [ From 4fec482dbf737f42cadb210bdea171ba14c575c4 Mon Sep 17 00:00:00 2001 From: Carolina Capetillo Date: Wed, 27 Sep 2023 10:27:19 -0700 Subject: [PATCH 06/13] commented out more grouped images on images.js that were just taking space. leaving the commented out code there for when Wayne wants to use the group_images feature --- src/store/modules/images.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/store/modules/images.js b/src/store/modules/images.js index b82164c3..65c151aa 100644 --- a/src/store/modules/images.js +++ b/src/store/modules/images.js @@ -47,7 +47,7 @@ const state = { // grouped_images: object where images are grouped based on their SMARTSTK value // Before the action group_images, there's an example of what this object looks like after being populated - grouped_images: {}, + // grouped_images: {}, show_user_data_only: false, @@ -59,7 +59,7 @@ const getters = { current_image: state => state.current_image, recent_images: state => state.recent_images, user_images: state => state.user_images, - grouped_images: state => state.grouped_images, + // grouped_images: state => state.grouped_images, recent_images_condensed: state => { // First, generate a map of maximum SSTKNUM for each SMARTSTK const maxSSTKNUMs = state.recent_images.reduce((acc, cur) => { @@ -106,7 +106,7 @@ const getters = { const mutations = { setCurrentImage (state, the_current_image) { state.current_image = the_current_image }, setRecentImages (state, recent_image_list) { state.recent_images = recent_image_list }, - setGroupedImages (state, grouped_images) { state.grouped_images = grouped_images }, + // setGroupedImages (state, grouped_images) { state.grouped_images = grouped_images }, setUserImages (state, user_images_list) { state.user_images = user_images_list }, show_user_data_only (state, val) { state.show_user_data_only = val }, live_data (state, val) { state.live_data = val }, From 9aee1dbf42424428921b9dee8f57705a1e77639a Mon Sep 17 00:00:00 2001 From: Carolina Capetillo Date: Wed, 27 Sep 2023 10:32:24 -0700 Subject: [PATCH 07/13] forgot more code to comment out. last one --- src/store/modules/images.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/store/modules/images.js b/src/store/modules/images.js index 65c151aa..27b769ff 100644 --- a/src/store/modules/images.js +++ b/src/store/modules/images.js @@ -331,9 +331,9 @@ const actions = { // Resets grouped_images to an empty object // Dispatched when a different site is selected - reset_grouped_images ({ commit }) { - commit('setGroupedImages', {}) - }, + // reset_grouped_images ({ commit }) { + // commit('setGroupedImages', {}) + // }, async load_latest_x_images ({ dispatch, commit, state, rootState }, num_images) { // Old method of loading only a certain amount of images @@ -574,7 +574,7 @@ const actions = { } commit('setRecentImages', [placeholder_image]) commit('setCurrentImage', placeholder_image) - dispatch('reset_grouped_images') + // dispatch('reset_grouped_images') }, // Set this_image as the current displayed image @@ -613,10 +613,10 @@ const actions = { commit('setCurrentImage', first_image) }, - set_grouped_images ({ commit, state }) { - const grouped_images_local = state.grouped_images - commit('setGroupedImages', { ...grouped_images_local }) - }, + // set_grouped_images ({ commit, state }) { + // const grouped_images_local = state.grouped_images + // commit('setGroupedImages', { ...grouped_images_local }) + // }, async get_fits_url ({ rootState }, { base_filename, data_type, reduction_level }) { // Get the global configuration for all sites from an api call. From e702831c228f1a37f1238eb21bbdd5bbadf10ac6 Mon Sep 17 00:00:00 2001 From: Carolina Capetillo Date: Wed, 27 Sep 2023 12:20:34 -0700 Subject: [PATCH 08/13] got rid of commented out code on components cause it's an eyesore --- .../ImageDisplay/ControlRoomImages.vue | 1 - src/components/ImageDisplay/ThumbnailRow.vue | 16 ---------------- 2 files changed, 17 deletions(-) diff --git a/src/components/ImageDisplay/ControlRoomImages.vue b/src/components/ImageDisplay/ControlRoomImages.vue index 1de17d7a..90a302d9 100644 --- a/src/components/ImageDisplay/ControlRoomImages.vue +++ b/src/components/ImageDisplay/ControlRoomImages.vue @@ -59,7 +59,6 @@ export default { props: { sitecode: String }, - methods: { ...mapActions('images', [ 'set_current_image' diff --git a/src/components/ImageDisplay/ThumbnailRow.vue b/src/components/ImageDisplay/ThumbnailRow.vue index d806a279..713468c1 100644 --- a/src/components/ImageDisplay/ThumbnailRow.vue +++ b/src/components/ImageDisplay/ThumbnailRow.vue @@ -27,11 +27,6 @@ export default { type: Number, required: false } - // grouped_images: { - // default: () => ({}), - // type: Object, - // required: true - // } }, methods: { setActiveImage (item) { @@ -40,17 +35,6 @@ export default { thumbnailWithFallback (item) { return item.jpg_thumbnail_url || item.jpg_url } - // setActiveImage (item) { - // this.$emit('thumbnailClicked', item) - // }, - - // thumbnailWithFallback (item) { - // let thumbnailCover = item && item[0] && item[0].jpg_thumbnail_url - // if (!thumbnailCover) { - // thumbnailCover = item && item[0] && item[0].jpg_url - // } - // return thumbnailCover || 'https://via.placeholder.com/768?text=no+jpg+preview+available' - // } } } From 60d1c2183986c56ad150dddd334fc6cbbc5cf001 Mon Sep 17 00:00:00 2001 From: Carolina Capetillo Date: Wed, 27 Sep 2023 12:25:14 -0700 Subject: [PATCH 09/13] formatting changes before making PR --- src/store/modules/images.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/store/modules/images.js b/src/store/modules/images.js index 27b769ff..07a73f67 100644 --- a/src/store/modules/images.js +++ b/src/store/modules/images.js @@ -151,10 +151,10 @@ const actions = { * image, and add it into the 'latest_images' list. * */ + update_new_image ({ commit, state, rootState, dispatch }, new_base_filename) { // No need to get the latest if the new image is from a different site. const site = rootState.site_config.selected_site - // Get the image's site of origin from the beginning of the filename. const image_site_origin = new_base_filename.split('-')[0] if (site != image_site_origin) { @@ -173,6 +173,7 @@ const actions = { if (response.data.length == 0) { return } + const new_image = response.data const recent_images = state.recent_images @@ -185,10 +186,12 @@ const actions = { } const new_image_filename = new_image.base_filename + // Find the index of the image we want to update. // value will be -1 if it doesn't exist. const old_image_index = recent_images.findIndex(image => image.base_filename == new_image_filename) + // If it doesn't already exist, just add it to the array (front). if (old_image_index == -1) { const updated_recent_images = [new_image, ...recent_images] @@ -200,6 +203,7 @@ const actions = { recent_images[old_image_index] = new_image // dispatch('group_images') } + // We don't have a toggle implemented yet. // But eventually we want one to focus on the new image immediately. const incoming_image_takes_focus = false @@ -345,6 +349,7 @@ const actions = { // If a query size is specified, use the old method of retrieving X images const querySize = num_images // || 25 (original default); url = rootState.api_endpoints.active_api + `/${site}/latest_images/${querySize}` + // If a user is logged in and they want to see only their data, // add their id as a query string param for the api call. if (state.show_user_data_only && userid) { @@ -405,6 +410,7 @@ const actions = { // Query for site's local noon to noon url = rootState.api_endpoints.active_api + '/filtered_images' + let queryStart = null let queryEnd = null @@ -489,6 +495,7 @@ const actions = { await axios(body).then(async response => { response = response.data + // Empty response: if (response.length == 0) { dispatch('display_placeholder_image') From d117cb1c327f47e3db1b05c55bb194771f62d2e4 Mon Sep 17 00:00:00 2001 From: Carolina Capetillo Date: Wed, 27 Sep 2023 13:33:00 -0700 Subject: [PATCH 10/13] converts SSTKNUM to numbers to be able to compare --- src/store/modules/images.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/store/modules/images.js b/src/store/modules/images.js index 07a73f67..ff76c33f 100644 --- a/src/store/modules/images.js +++ b/src/store/modules/images.js @@ -65,7 +65,7 @@ const getters = { const maxSSTKNUMs = state.recent_images.reduce((acc, cur) => { if (!cur.header || !cur.header.SMARTSTK || !cur.header.SSTKNUM) return acc // Skip if missing header, SMARTSTK or SSTKNUM - if (!acc[cur.header.SMARTSTK] || cur.header.SSTKNUM > acc[cur.header.SMARTSTK]) { + if (!acc[cur.header.SMARTSTK] || Number(cur.header.SSTKNUM) > Number(acc[cur.header.SMARTSTK])) { acc[cur.header.SMARTSTK] = cur.header.SSTKNUM } return acc From 4d84cbc1f3ce0dc249d6aedb37c605c4e80c9a05 Mon Sep 17 00:00:00 2001 From: Carolina Capetillo Date: Wed, 27 Sep 2023 13:45:43 -0700 Subject: [PATCH 11/13] converts strings to numbers and correctly compares the values --- src/store/modules/images.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/store/modules/images.js b/src/store/modules/images.js index ff76c33f..55f9047a 100644 --- a/src/store/modules/images.js +++ b/src/store/modules/images.js @@ -65,8 +65,9 @@ const getters = { const maxSSTKNUMs = state.recent_images.reduce((acc, cur) => { if (!cur.header || !cur.header.SMARTSTK || !cur.header.SSTKNUM) return acc // Skip if missing header, SMARTSTK or SSTKNUM - if (!acc[cur.header.SMARTSTK] || Number(cur.header.SSTKNUM) > Number(acc[cur.header.SMARTSTK])) { - acc[cur.header.SMARTSTK] = cur.header.SSTKNUM + const num = parseInt(cur.header.SSTKNUM) // convert string to number + if (!acc[cur.header.SMARTSTK] || num > acc[cur.header.SMARTSTK]) { + acc[cur.header.SMARTSTK] = num } return acc }, {}) From 67dc5fb307201dc4acaee41f55fe4d8d9f43fbf7 Mon Sep 17 00:00:00 2001 From: Carolina Capetillo Date: Wed, 27 Sep 2023 13:57:34 -0700 Subject: [PATCH 12/13] got rid of group_images code --- src/store/modules/images.js | 73 ------------------------------------- 1 file changed, 73 deletions(-) diff --git a/src/store/modules/images.js b/src/store/modules/images.js index 55f9047a..3724cbae 100644 --- a/src/store/modules/images.js +++ b/src/store/modules/images.js @@ -45,10 +45,6 @@ const state = { // TODO: Write an action that will update a user's image list when images are added to their account user_images: [], - // grouped_images: object where images are grouped based on their SMARTSTK value - // Before the action group_images, there's an example of what this object looks like after being populated - // grouped_images: {}, - show_user_data_only: false, // determines whether 'current_images' is set to show the most recent images with live updates. @@ -59,7 +55,6 @@ const getters = { current_image: state => state.current_image, recent_images: state => state.recent_images, user_images: state => state.user_images, - // grouped_images: state => state.grouped_images, recent_images_condensed: state => { // First, generate a map of maximum SSTKNUM for each SMARTSTK const maxSSTKNUMs = state.recent_images.reduce((acc, cur) => { @@ -107,7 +102,6 @@ const getters = { const mutations = { setCurrentImage (state, the_current_image) { state.current_image = the_current_image }, setRecentImages (state, recent_image_list) { state.recent_images = recent_image_list }, - // setGroupedImages (state, grouped_images) { state.grouped_images = grouped_images }, setUserImages (state, user_images_list) { state.user_images = user_images_list }, show_user_data_only (state, val) { state.show_user_data_only = val }, live_data (state, val) { state.live_data = val }, @@ -197,12 +191,10 @@ const actions = { if (old_image_index == -1) { const updated_recent_images = [new_image, ...recent_images] commit('setRecentImages', updated_recent_images) - // dispatch('group_images') } // Otherwise, replace the old version with the new one we fetched. else { recent_images[old_image_index] = new_image - // dispatch('group_images') } // We don't have a toggle implemented yet. @@ -271,7 +263,6 @@ const actions = { } commit('setRecentImages', response) - // dispatch('group_images') }).catch(error => { console.warn(error) }) @@ -282,63 +273,7 @@ const actions = { @param {boolean} user_data_only: whether or not to filter by images Taken the active user or not. - Grouping images as they load and we group them based on their SMARTSTK value - After the for loop, the grouped_images_local looks something like this: - grouped_images_local: { - site: 'tst', - imageGroups: { - 1234: [...grouped images...], - 5678: [...grouped images...], - 9012: [...grouped images...] - } - } - */ - // group_images ({ commit, state, rootState, dispatch }) { - // const currentSite = rootState.site_config.selected_site - // let grouped_images_local = JSON.parse(JSON.stringify(state.grouped_images)) - // if (!grouped_images_local.imageGroups) { - // grouped_images_local.imageGroups = {} - // } - // const recent_images = state.recent_images - // // Resetting grouped_images to an empty object when selecting a different site - // // This prevents accumulation of thumbnails from previous sites selected by user - // if (grouped_images_local.site && grouped_images_local.site !== currentSite) { - // dispatch('reset_grouped_images') - // grouped_images_local = { site: currentSite } - // // If grouped_images_local object doesn't have a key of site (i.e. when page first loads and when user selects - // // a different site), assign the value of currentSite to the new key of site - // } else if (!grouped_images_local.site) { - // grouped_images_local.site = currentSite - // } - - // for (const img of recent_images) { - // const header = img && img.header - // let SMARTSTK = header && header.SMARTSTK - // // Creating a unique key (i.e. base_filename) for images where SMARTSK is 'no' while also avoiding grouping them as one stack - // // We need this in order to display these images as thumbnails - // if (!SMARTSTK || SMARTSTK === 'no') { - // SMARTSTK = img && img.base_filename - // grouped_images_local.imageGroups[SMARTSTK] = [] - // grouped_images_local.imageGroups[SMARTSTK].push(img) - // } - - // // Grouping images based on SMARTSTK - // if (!grouped_images_local.imageGroups[SMARTSTK]) { - // grouped_images_local.imageGroups[SMARTSTK] = [] - // grouped_images_local.imageGroups[SMARTSTK].push(img) - // } else { - // grouped_images_local.imageGroups[SMARTSTK].push(img) - // } - // } - // commit('setGroupedImages', { ...grouped_images_local }) - // }, - - // Resets grouped_images to an empty object - // Dispatched when a different site is selected - // reset_grouped_images ({ commit }) { - // commit('setGroupedImages', {}) - // }, async load_latest_x_images ({ dispatch, commit, state, rootState }, num_images) { // Old method of loading only a certain amount of images @@ -375,7 +310,6 @@ const actions = { commit('setCurrentImage', response[0]) commit('setRecentImages', response) - // dispatch('group_images') }).catch(error => { console.error(error) }) @@ -505,7 +439,6 @@ const actions = { commit('setCurrentImage', response[0]) commit('setRecentImages', response) - // dispatch('group_images') }).catch(error => { console.error(error) }) @@ -582,7 +515,6 @@ const actions = { } commit('setRecentImages', [placeholder_image]) commit('setCurrentImage', placeholder_image) - // dispatch('reset_grouped_images') }, // Set this_image as the current displayed image @@ -621,11 +553,6 @@ const actions = { commit('setCurrentImage', first_image) }, - // set_grouped_images ({ commit, state }) { - // const grouped_images_local = state.grouped_images - // commit('setGroupedImages', { ...grouped_images_local }) - // }, - async get_fits_url ({ rootState }, { base_filename, data_type, reduction_level }) { // Get the global configuration for all sites from an api call. const apiName = rootState.api_endpoints.active_api From 915e43bcd654cf8f33cf13bf05ad787af2e8d539 Mon Sep 17 00:00:00 2001 From: Carolina Capetillo Date: Wed, 27 Sep 2023 14:08:28 -0700 Subject: [PATCH 13/13] adds comment describing what recent_iamges_condensed is --- src/store/modules/images.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/store/modules/images.js b/src/store/modules/images.js index 3724cbae..d338a217 100644 --- a/src/store/modules/images.js +++ b/src/store/modules/images.js @@ -55,6 +55,7 @@ const getters = { current_image: state => state.current_image, recent_images: state => state.recent_images, user_images: state => state.user_images, + // Uses recent_images but removes any intermediate smartstack frames, so you only see the latest version of each smart stack recent_images_condensed: state => { // First, generate a map of maximum SSTKNUM for each SMARTSTK const maxSSTKNUMs = state.recent_images.reduce((acc, cur) => {