@@ -96,9 +96,23 @@ let searchTypeBoolean = computed(() => {
9696});
9797
9898// The watch is set up first and then the initialization of the searchType
99- // value so that the watch is triggered, which resets the state.
99+ // value so that the watch is triggered, which resets the state. This only
100+ // applies to non-production (e.g., dev, test) websites.
100101
101- watch (searchType, () => {resetStates ();});
102+ if (! cveGenericGlobalsStore .isProductionWebsite )
103+ watch (searchType, () => {
104+ resetStates ();
105+
106+ if (searchType .value == legacyOptionLabel && route .query ? .id ) {
107+
108+ // For the legacy find, the route has a valid ID, which is inserted
109+ // in the input field. Because it's a valid CVEID, the search button
110+ // is enabled.
111+
112+ cveId = route .query .id ;
113+ cveListSearchStore .isSearchButtonDisabled = false ;
114+ }
115+ });
102116
103117searchType .value = searchOptionLabel;
104118
@@ -151,8 +165,22 @@ function startSearch() {
151165 query: {query: cveListSearchStore .query }});
152166 } else
153167 cveListSearchStore .search ();
168+ } else if (route .name !== ' CVERecord' || ! route .query ? .id
169+ || (route .query .id !== cveId)) {
170+
171+ // This is for the legacy find and is only applicable on the non-production
172+ // websites. This push to the router will trigger a lookup for the CVE
173+ // record.
174+
175+ router .push ({name: cveRecordRouteName, query: {id: cveId}});
154176 } else {
155- router .push ({name: cveRecordRouteName, query: {id: cveId}})
177+
178+ // Non-production website in legacy find, with the user possibly wanting
179+ // a reload with the same CVEID. Probably the easiest option is to
180+ // reload the page; otherwise, without doing this there's no way to trigger
181+ // another lookup for the same CVEID.
182+
183+ router .go (0 );
156184 }
157185}
158186
0 commit comments