From 7bca28a6335ff4633a5c7109a837c896ec262505 Mon Sep 17 00:00:00 2001 From: Alexander Date: Thu, 13 Jan 2022 17:41:04 +0400 Subject: [PATCH 1/4] [BEAM-13619] Added loading animation to the catalog --- .../modules/examples/example_selector.dart | 37 +++++++++++++------ 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/playground/frontend/lib/modules/examples/example_selector.dart b/playground/frontend/lib/modules/examples/example_selector.dart index d2024fd0eb69..80f2f7dc1165 100644 --- a/playground/frontend/lib/modules/examples/example_selector.dart +++ b/playground/frontend/lib/modules/examples/example_selector.dart @@ -18,6 +18,7 @@ import 'package:flutter/material.dart'; import 'package:playground/config/theme.dart'; +import 'package:playground/constants/colors.dart'; import 'package:playground/constants/sizes.dart'; import 'package:playground/modules/examples/components/examples_components.dart'; import 'package:playground/modules/examples/models/selector_size_model.dart'; @@ -151,18 +152,30 @@ class _ExampleSelectorState extends State color: Theme.of(context).backgroundColor, borderRadius: BorderRadius.circular(kMdBorderRadius), ), - child: Column( - children: [ - SearchField(controller: textController), - const TypeFilter(), - ExampleList( - controller: scrollController, - selectedExample: playgroundState.selectedExample!, - animationController: animationController, - dropdown: examplesDropdown, - ), - ], - ), + child: exampleState.sdkCategories == null || + playgroundState.selectedExample == null + ? const Center( + child: SizedBox( + height: kContainerHeight, + width: kContainerHeight, + child: CircularProgressIndicator( + color: kLightPrimary, + ), + ), + ) + : Column( + children: [ + SearchField(controller: textController), + const TypeFilter(), + ExampleList( + controller: scrollController, + selectedExample: + playgroundState.selectedExample!, + animationController: animationController, + dropdown: examplesDropdown, + ), + ], + ), ), ), ), From 0523227e9113d5169ae8eafe2324fa691cf0c497 Mon Sep 17 00:00:00 2001 From: Alexander Date: Fri, 14 Jan 2022 18:32:21 +0400 Subject: [PATCH 2/4] [BEAM-13619] Refactored loading indicator component --- .../loading_indicator/loading_indicator.dart | 21 ++++++++++ .../modules/examples/example_selector.dart | 41 ++++++++----------- 2 files changed, 39 insertions(+), 23 deletions(-) create mode 100644 playground/frontend/lib/components/loading_indicator/loading_indicator.dart diff --git a/playground/frontend/lib/components/loading_indicator/loading_indicator.dart b/playground/frontend/lib/components/loading_indicator/loading_indicator.dart new file mode 100644 index 000000000000..3ee20cea25d0 --- /dev/null +++ b/playground/frontend/lib/components/loading_indicator/loading_indicator.dart @@ -0,0 +1,21 @@ +import 'package:flutter/material.dart'; +import 'package:playground/constants/colors.dart'; + +class LoadingIndicator extends StatelessWidget { + final double size; + + const LoadingIndicator({Key? key, required this.size}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Center( + child: SizedBox( + height: size, + width: size, + child: const CircularProgressIndicator( + color: kLightPrimary, + ), + ), + ); + } +} diff --git a/playground/frontend/lib/modules/examples/example_selector.dart b/playground/frontend/lib/modules/examples/example_selector.dart index 80f2f7dc1165..be7189a60fc1 100644 --- a/playground/frontend/lib/modules/examples/example_selector.dart +++ b/playground/frontend/lib/modules/examples/example_selector.dart @@ -17,8 +17,8 @@ */ import 'package:flutter/material.dart'; +import 'package:playground/components/loading_indicator/loading_indicator.dart'; import 'package:playground/config/theme.dart'; -import 'package:playground/constants/colors.dart'; import 'package:playground/constants/sizes.dart'; import 'package:playground/modules/examples/components/examples_components.dart'; import 'package:playground/modules/examples/models/selector_size_model.dart'; @@ -154,28 +154,8 @@ class _ExampleSelectorState extends State ), child: exampleState.sdkCategories == null || playgroundState.selectedExample == null - ? const Center( - child: SizedBox( - height: kContainerHeight, - width: kContainerHeight, - child: CircularProgressIndicator( - color: kLightPrimary, - ), - ), - ) - : Column( - children: [ - SearchField(controller: textController), - const TypeFilter(), - ExampleList( - controller: scrollController, - selectedExample: - playgroundState.selectedExample!, - animationController: animationController, - dropdown: examplesDropdown, - ), - ], - ), + ? const LoadingIndicator(size: kContainerHeight) + : _buildDropdownContent(playgroundState), ), ), ), @@ -188,6 +168,21 @@ class _ExampleSelectorState extends State ); } + Widget _buildDropdownContent(PlaygroundState playgroundState) { + return Column( + children: [ + SearchField(controller: textController), + const TypeFilter(), + ExampleList( + controller: scrollController, + selectedExample: playgroundState.selectedExample!, + animationController: animationController, + dropdown: examplesDropdown, + ), + ], + ); + } + SelectorPositionModel findSelectorPositionData() { RenderBox? rBox = selectorKey.currentContext?.findRenderObject() as RenderBox; From 3da284a1fc7e9792ccbe34ae245805a9261c866c Mon Sep 17 00:00:00 2001 From: Alexander Date: Mon, 17 Jan 2022 12:09:43 +0400 Subject: [PATCH 3/4] [BEAM-13619] Added license to loading_indicator component --- .../loading_indicator/loading_indicator.dart | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/playground/frontend/lib/components/loading_indicator/loading_indicator.dart b/playground/frontend/lib/components/loading_indicator/loading_indicator.dart index 3ee20cea25d0..8d7fb142a28d 100644 --- a/playground/frontend/lib/components/loading_indicator/loading_indicator.dart +++ b/playground/frontend/lib/components/loading_indicator/loading_indicator.dart @@ -1,3 +1,21 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import 'package:flutter/material.dart'; import 'package:playground/constants/colors.dart'; From 8bf4ee05431277a69c855fe5bd4b05441a75456b Mon Sep 17 00:00:00 2001 From: Alexander Date: Mon, 17 Jan 2022 15:40:13 +0400 Subject: [PATCH 4/4] [BEAM-13619] Fixed _getPipelineResult method of code_repository --- .../editor/repository/code_repository/code_repository.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/playground/frontend/lib/modules/editor/repository/code_repository/code_repository.dart b/playground/frontend/lib/modules/editor/repository/code_repository/code_repository.dart index 9e86f0103e63..8f354ce9e8d6 100644 --- a/playground/frontend/lib/modules/editor/repository/code_repository/code_repository.dart +++ b/playground/frontend/lib/modules/editor/repository/code_repository/code_repository.dart @@ -166,6 +166,7 @@ class CodeRepository { final log = responses[1]; final error = responses[2]; return RunCodeResult( + pipelineUuid: pipelineUuid, status: status, output: prevOutput + output.output + error.output, log: prevLog + log.output,