Skip to content

Commit

Permalink
[Playground][Frontend] Run timer fix; CodeRunner and OutputType extra…
Browse files Browse the repository at this point in the history
…ction. (#24871)

* timer fix rough draft (#24617)

* comments (#24617)

* comments (1) (#24617)

* cancel run on reset (#24617)

* regenerated mocks (#24617)

* runStopDate (#24617)

* OutputFilterTypeController (#24617)

* resetErrorMessageText (#24617)

Co-authored-by: alexeyinkin <leha@inkin.ru>

* resetErrorMessageText (#24617)

Co-authored-by: alexeyinkin <leha@inkin.ru>

* comments (#24617)

* missing license (#24617)

* a commit for re-running rat check on github

* deleted comment "a commit for re-running rat check on github"

* fixes after merge with master (#24617)

* merge fixes (#24617)

* regenerated yaml files (#24617)

* snippetEditingControllerGetter refinement (#24617)

Co-authored-by: darkhan.nausharipov <darkhan.nausharipov@kzn.akvelon.com>
Co-authored-by: alexeyinkin <leha@inkin.ru>
  • Loading branch information
3 people committed Jan 19, 2023
1 parent 13a740b commit 1c4e424
Show file tree
Hide file tree
Showing 21 changed files with 1,061 additions and 516 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ final kClearOutputShortcut = BeamShortcut(
onInvoke: (_) => Provider.of<PlaygroundController>(
context,
listen: false,
).clearOutput(),
).codeRunner.clearResult(),
),
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ class _CloseListenerState extends State<CloseListener> {
void initState() {
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
html.window.onBeforeUnload.listen((event) async {
Provider.of<PlaygroundController>(context, listen: false).cancelRun();
Provider.of<PlaygroundController>(context, listen: false)
.codeRunner
.cancelRun();
});
});
super.initState();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ class CodeTextAreaWrapper extends StatelessWidget {

@override
Widget build(BuildContext context) {
if (playgroundController.result?.errorMessage?.isNotEmpty ?? false) {
if (playgroundController.codeRunner.result?.errorMessage?.isNotEmpty ??
false) {
WidgetsBinding.instance.addPostFrameCallback((_) {
_handleError(context, playgroundController);
});
Expand Down Expand Up @@ -83,11 +84,11 @@ class CodeTextAreaWrapper extends StatelessWidget {
void _handleError(BuildContext context, PlaygroundController controller) {
PlaygroundComponents.toastNotifier.add(
Toast(
description: controller.result?.errorMessage ?? '',
description: controller.codeRunner.result?.errorMessage ?? '',
title: AppLocalizations.of(context)!.runCode,
type: ToastType.error,
),
);
controller.resetError();
controller.resetErrorMessageText();
}
}
2 changes: 1 addition & 1 deletion playground/frontend/lib/utils/analytics_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import 'package:playground_components/playground_components.dart';

String getAnalyticsExampleName(PlaygroundController controller) {
final customCodeName = 'Custom code, sdk ${controller.sdk?.title}';
if (controller.isExampleChanged) {
if (controller.codeRunner.isExampleChanged) {
return customCodeName;
}
return controller.selectedExample?.path ?? customCodeName;
Expand Down
89 changes: 81 additions & 8 deletions playground/frontend/playground_components/assets/symbols/go.g.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@
- Fatalf
- Fatalln
- FetchSize
- FieldIndexByTag
- File
- Flatten
- FreeDiskSpace
Expand Down Expand Up @@ -348,6 +349,7 @@
- ImpulseValue
- InboundTagToNode
- Include
- InferFieldNames
- Info
- Infof
- Infoln
Expand Down Expand Up @@ -751,6 +753,7 @@
- SkipK
- SkipPtr
- SkipW
- SklearnModel
- Smallest
- SmallestPerKey
- Source
Expand Down Expand Up @@ -887,11 +890,18 @@
- Warnf
- Warnln
- WindowInto
- WithArgs
- WithContext
- WithContextf
- WithExpansionAddr
- WithExtraPackages
- WithIndexes
- WithQueryLocation
- WithReadBucketAuto
- WithReadBundleSize
- WithReadFilter
- WithWriteBatchSize
- WithWriteOrdered
- Wrap
- WrapIterable
- WrapMethods
Expand Down Expand Up @@ -1401,6 +1411,10 @@ CancelJobResponse:
- String
properties:
- State
Checkpoint:
properties:
- Reapply
- SR
Class:
methods:
- String
Expand Down Expand Up @@ -1668,7 +1682,6 @@ DataSink:
- UID
DataSource:
methods:
- Checkpoint
- Down
- FinishBundle
- ID
Expand Down Expand Up @@ -1749,6 +1762,25 @@ Discard:
- Up
properties:
- UID
DiscoverSchemaTransformRequest:
methods:
- Descriptor
- ProtoMessage
- ProtoReflect
- Reset
- String
DiscoverSchemaTransformResponse:
methods:
- Descriptor
- GetError
- GetSchemaTransformConfigs
- ProtoMessage
- ProtoReflect
- Reset
- String
properties:
- Error
- SchemaTransformConfigs
DisplayData:
methods:
- Descriptor
Expand Down Expand Up @@ -2173,6 +2205,7 @@ ExpansionResponse:
- Transform
ExpansionServiceClient:
methods:
- DiscoverSchemaTransform
- Expand
ExpansionServiceRunner:
methods:
Expand All @@ -2182,6 +2215,7 @@ ExpansionServiceRunner:
- String
ExpansionServiceServer:
methods:
- DiscoverSchemaTransform
- Expand
ExternalConfigurationPayload:
methods:
Expand Down Expand Up @@ -3195,6 +3229,7 @@ JobOptions:
- Region
- RetainDocker
- ServiceAccountEmail
- Streaming
- Subnetwork
- TeardownPolicy
- TempLocation
Expand All @@ -3203,7 +3238,6 @@ JobOptions:
- Update
- Worker
- WorkerHarnessThreads
- WorkerJar
- WorkerRegion
- WorkerZone
- Zone
Expand Down Expand Up @@ -3381,6 +3415,7 @@ LockRTracker:
- GetRestriction
- IsBounded
- IsDone
- String
- TryClaim
- TrySplit
properties:
Expand Down Expand Up @@ -4237,6 +4272,10 @@ PlanSnapshot:
Port:
properties:
- URL
PredictionResult:
properties:
- Example
- Inference
PrepareJobRequest:
methods:
- Descriptor
Expand Down Expand Up @@ -4694,6 +4733,11 @@ ReadModifyWriteStateSpec:
- String
properties:
- CoderId
ReadOption:
properties:
- BucketAuto
- BundleSize
- Filter
ReadOptions:
properties:
- IDAttribute
Expand Down Expand Up @@ -4947,6 +4991,34 @@ SchemaProvider:
- BuildDecoder
- BuildEncoder
- FromLogicalType
SchemaTransformConfig:
methods:
- Descriptor
- GetConfigSchema
- GetInputPcollectionNames
- GetOutputPcollectionNames
- ProtoMessage
- ProtoReflect
- Reset
- String
properties:
- ConfigSchema
- InputPcollectionNames
- OutputPcollectionNames
SchemaTransformPayload:
methods:
- Descriptor
- GetConfigurationRow
- GetConfigurationSchema
- GetIdentifier
- ProtoMessage
- ProtoReflect
- Reset
- String
properties:
- ConfigurationRow
- ConfigurationSchema
- Identifier
Scope:
methods:
- ID
Expand Down Expand Up @@ -5153,6 +5225,7 @@ SplitResult:
- RI
- RS
- TId
- Unsuccessful
SplittableDoFn:
methods:
- CreateInitialRestrictionFn
Expand Down Expand Up @@ -6016,6 +6089,7 @@ Tracker:
- GetRestriction
- IsBounded
- IsDone
- String
- TryClaim
- TrySplit
Transaction:
Expand Down Expand Up @@ -6304,7 +6378,6 @@ TypeMismatchError:
- Error
properties:
- Got
U: {}
UnimplementedArtifactRetrievalServiceServer:
methods:
- GetArtifact
Expand Down Expand Up @@ -6334,6 +6407,7 @@ UnimplementedBeamFnWorkerStatusServer:
- WorkerStatus
UnimplementedExpansionServiceServer:
methods:
- DiscoverSchemaTransform
- Expand
UnimplementedJobServiceServer:
methods:
Expand Down Expand Up @@ -6397,7 +6471,6 @@ UserFn:
UserStateAdapter:
methods:
- NewStateProvider
V: {}
Value:
methods:
- Clear
Expand All @@ -6409,7 +6482,6 @@ Value:
- Write
properties:
- Key
W: {}
WallTimeWatermarkEstimator:
methods:
- CurrentWatermark
Expand Down Expand Up @@ -6560,9 +6632,10 @@ WriteFilesPayload:
- SideInputs
- Sink
- WindowedWrites
WriteOption:
properties:
- BatchSize
- Ordered
Writer:
methods:
- SaveData
X: {}
"Y": {}
Z: {}
Loading

0 comments on commit 1c4e424

Please sign in to comment.