Browse Source

define ui for no metadata available

Mark deVilliers 2 years ago
parent
commit
85b71995f4
2 changed files with 42 additions and 26 deletions
  1. 32 24
      ui/search.js
  2. 10 2
      ui/src/Search.elm

+ 32 - 24
ui/search.js

@@ -10957,6 +10957,36 @@ var _user$project$Search$update = F2(
10957 10957
 		}
10958 10958
 	});
10959 10959
 var _user$project$Search$RefreshMetadata = {ctor: 'RefreshMetadata'};
10960
+var _user$project$Search$drawNoMetadata = A2(
10961
+	_elm_lang$html$Html$div,
10962
+	{ctor: '[]'},
10963
+	{
10964
+		ctor: '::',
10965
+		_0: A2(
10966
+			_elm_lang$html$Html$div,
10967
+			{ctor: '[]'},
10968
+			{
10969
+				ctor: '::',
10970
+				_0: _elm_lang$html$Html$text('no metadata available.'),
10971
+				_1: {ctor: '[]'}
10972
+			}),
10973
+		_1: {
10974
+			ctor: '::',
10975
+			_0: A2(
10976
+				_elm_lang$html$Html$button,
10977
+				{
10978
+					ctor: '::',
10979
+					_0: _elm_lang$html$Html_Events$onClick(_user$project$Search$RefreshMetadata),
10980
+					_1: {ctor: '[]'}
10981
+				},
10982
+				{
10983
+					ctor: '::',
10984
+					_0: _elm_lang$html$Html$text('refresh'),
10985
+					_1: {ctor: '[]'}
10986
+				}),
10987
+			_1: {ctor: '[]'}
10988
+		}
10989
+	});
10960 10990
 var _user$project$Search$drawFiltered = F2(
10961 10991
 	function (tag, items) {
10962 10992
 		var _p9 = tag;
@@ -11065,34 +11095,12 @@ var _user$project$Search$drawFiltered = F2(
11065 11095
 var _user$project$Search$view = function (model) {
11066 11096
 	var _p11 = model.all;
11067 11097
 	if (_p11.ctor === 'Nothing') {
11068
-		return A2(
11069
-			_elm_lang$html$Html$button,
11070
-			{
11071
-				ctor: '::',
11072
-				_0: _elm_lang$html$Html_Events$onClick(_user$project$Search$RefreshMetadata),
11073
-				_1: {ctor: '[]'}
11074
-			},
11075
-			{
11076
-				ctor: '::',
11077
-				_0: _elm_lang$html$Html$text('refresh'),
11078
-				_1: {ctor: '[]'}
11079
-			});
11098
+		return _user$project$Search$drawNoMetadata;
11080 11099
 	} else {
11081 11100
 		var _p13 = _p11._0;
11082 11101
 		var _p12 = _p13;
11083 11102
 		if (_p12.ctor === '[]') {
11084
-			return A2(
11085
-				_elm_lang$html$Html$button,
11086
-				{
11087
-					ctor: '::',
11088
-					_0: _elm_lang$html$Html_Events$onClick(_user$project$Search$RefreshMetadata),
11089
-					_1: {ctor: '[]'}
11090
-				},
11091
-				{
11092
-					ctor: '::',
11093
-					_0: _elm_lang$html$Html$text('refresh'),
11094
-					_1: {ctor: '[]'}
11095
-				});
11103
+			return _user$project$Search$drawNoMetadata;
11096 11104
 		} else {
11097 11105
 			return A2(
11098 11106
 				_elm_lang$html$Html$div,

+ 10 - 2
ui/src/Search.elm

@@ -222,12 +222,12 @@ view : Model -> Html Msg
222 222
 view model =
223 223
     case model.all of
224 224
         Nothing ->
225
-            button [ onClick RefreshMetadata ] [ text "refresh" ]
225
+            drawNoMetadata
226 226
 
227 227
         Just d ->
228 228
             case d of
229 229
                 [] ->
230
-                    button [ onClick RefreshMetadata ] [ text "refresh" ]
230
+                    drawNoMetadata
231 231
 
232 232
                 _ ->
233 233
                     div []
@@ -236,6 +236,14 @@ view model =
236 236
                         ]
237 237
 
238 238
 
239
+drawNoMetadata : Html Msg
240
+drawNoMetadata =
241
+    div []
242
+        [ div [] [ text "no metadata available." ]
243
+        , button [ onClick RefreshMetadata ] [ text "refresh" ]
244
+        ]
245
+
246
+
239 247
 drawFiltered : Maybe String -> Decoders.Items -> Html Msg
240 248
 drawFiltered tag items =
241 249
     case tag of