@@ -16,6 +16,7 @@ import { UserContext } from "../user-context";
16
16
import { getProject , WorkspaceStatusIndicator } from "../workspaces/WorkspaceEntry" ;
17
17
import { adminMenu } from "./admin-menu" ;
18
18
import WorkspaceDetail from "./WorkspaceDetail" ;
19
+ import info from '../images/info.svg' ;
19
20
20
21
interface Props {
21
22
user ?: User
@@ -66,6 +67,15 @@ export function WorkspaceSearch(props: Props) {
66
67
}
67
68
68
69
const search = async ( ) => {
70
+ if ( ! props . user ) { // In the workspace search page
71
+ // This only allows searching for exact-matches of workspace or instance IDs
72
+ if ( ( queryTerm . length === 0 ) ||
73
+ ( ! matchesNewWorkspaceIdExactly ( queryTerm ) &&
74
+ ! matchesInstanceIdOrLegacyWorkspaceIdExactly ( queryTerm ) ) ) {
75
+ return ;
76
+ }
77
+ }
78
+
69
79
setSearching ( true ) ;
70
80
try {
71
81
const query : AdminGetWorkspacesQuery = {
@@ -105,6 +115,10 @@ export function WorkspaceSearch(props: Props) {
105
115
< button disabled = { searching } onClick = { search } > Search</ button >
106
116
</ div >
107
117
</ div >
118
+ < div className = { 'flex rounded-xl bg-gray-200 dark:bg-gray-800 text-gray-600 dark:text-gray-400 p-2 w-2/3 mb-2' } >
119
+ < img className = "w-4 h-4 m-1 ml-2 mr-4" alt = "info" src = { info } />
120
+ < span > Please enter complete IDs - this search does not perform partial-matching.</ span >
121
+ </ div >
108
122
< div className = "flex flex-col space-y-2" >
109
123
< div className = "px-6 py-3 flex justify-between text-sm text-gray-400 border-t border-b border-gray-200 dark:border-gray-800 mb-2" >
110
124
< div className = "w-8" > </ div >
0 commit comments