From 7363377331262e853b550723b18034a494fdee2f Mon Sep 17 00:00:00 2001 From: James Dunkerley Date: Thu, 14 Nov 2024 12:01:04 +0000 Subject: [PATCH] Linting and Widgets (#11551) - Fix any issues identified by the doc writer. - Alter all `default_widget` functions: all now take display and all use the type check signature. - Review widgets on AWS APIs and make sure display is correct. --- .../lib/Standard/AWS/0.0.0-dev/src/AWS.enso | 6 ++-- .../AWS/0.0.0-dev/src/AWS_Credential.enso | 13 ++++---- .../AWS/0.0.0-dev/src/AWS_Region.enso | 2 +- .../Redshift/Internal/Redshift_Dialect.enso | 2 +- .../lib/Standard/AWS/0.0.0-dev/src/S3/S3.enso | 2 +- .../Base/0.0.0-dev/src/Data/Base_64.enso | 2 ++ .../Base/0.0.0-dev/src/Data/Decimal.enso | 4 +-- .../0.0.0-dev/src/Data/Filter_Condition.enso | 5 ++-- .../0.0.0-dev/src/Data/Index_Sub_Range.enso | 5 ++-- .../Base/0.0.0-dev/src/Data/Locale.enso | 4 +-- .../Base/0.0.0-dev/src/Data/Numbers.enso | 4 +-- .../0.0.0-dev/src/Data/Read/Return_As.enso | 7 ++--- .../0.0.0-dev/src/Data/Text/Encoding.enso | 7 ++--- .../0.0.0-dev/src/Data/Text/Extensions.enso | 2 +- .../src/Data/Text/Text_Sub_Range.enso | 5 ++-- .../Base/0.0.0-dev/src/Data/Time/Date.enso | 5 ++-- .../0.0.0-dev/src/Data/Time/Time_Of_Day.enso | 5 ++-- .../0.0.0-dev/src/Data/Time/Time_Zone.enso | 5 ++-- .../Base/0.0.0-dev/src/Data/Vector.enso | 1 + .../0.0.0-dev/src/Enso_Cloud/Enso_File.enso | 2 +- .../0.0.0-dev/src/Enso_Cloud/Enso_Secret.enso | 4 +-- .../Internal/Existing_Enso_Asset.enso | 2 +- .../Base/0.0.0-dev/src/Errors/Common.enso | 2 +- .../Standard/Base/0.0.0-dev/src/Metadata.enso | 3 +- .../Base/0.0.0-dev/src/Network/HTTP.enso | 2 +- .../src/Network/HTTP/Cache_Policy.enso | 2 +- .../0.0.0-dev/src/System/File_Format.enso | 5 ++-- .../Base/0.0.0-dev/src/Widget_Helpers.enso | 5 ++-- .../src/Connection/Connection_Options.enso | 6 ++-- .../0.0.0-dev/src/Connection/Credentials.enso | 4 +-- .../src/Connection/Postgres_Connection.enso | 6 ++-- .../Database/0.0.0-dev/src/Dialect.enso | 2 +- .../src/Internal/Data_Link_Setup.enso | 2 +- .../Internal/Postgres/Postgres_Dialect.enso | 2 +- .../src/Internal/SQLite/SQLite_Dialect.enso | 2 +- .../Internal/SQLite/SQLite_Error_Mapper.enso | 4 ++- .../Upload/Operations/Upload_Table.enso | 2 +- .../0.0.0-dev/src/Google_Analytics.enso | 5 ++-- .../src/Google_Analytics_Account.enso | 30 +++++++++---------- .../src/Google_Analytics_Property.enso | 9 +++--- .../0.0.0-dev/src/Google_Credential.enso | 7 ++--- .../src/Internal/SQLServer_Dialect.enso | 2 +- .../src/Internal/Snowflake_Dialect.enso | 2 +- .../Table/0.0.0-dev/src/Columns_To_Add.enso | 6 ++-- .../Table/0.0.0-dev/src/Columns_To_Keep.enso | 6 ++-- .../Table/0.0.0-dev/src/Rows_To_Read.enso | 6 ++-- .../0.0.0-dev/src/Simple_Expression.enso | 3 +- .../Standard/Test/0.0.0-dev/src/Faker.enso | 4 +-- .../0.0.0-dev/src/Table/Visualization.enso | 2 +- .../Visualization/0.0.0-dev/src/Widgets.enso | 2 +- 50 files changed, 110 insertions(+), 117 deletions(-) diff --git a/distribution/lib/Standard/AWS/0.0.0-dev/src/AWS.enso b/distribution/lib/Standard/AWS/0.0.0-dev/src/AWS.enso index 1101b8fa9c9..29c98d8a071 100644 --- a/distribution/lib/Standard/AWS/0.0.0-dev/src/AWS.enso +++ b/distribution/lib/Standard/AWS/0.0.0-dev/src/AWS.enso @@ -38,8 +38,8 @@ type AWS - region_service: The region and service to use for signing the request. Defaults to the region and service parsed from the URI. @uri (Text_Input display=..Always) - @format File_Format.default_widget @headers Header.default_widget + @format File_Format.default_widget @credentials AWS_Credential.default_widget signed_fetch : URI -> HTTP_Method -> (Vector (Header | Pair Text Text)) -> File_Format -> AWS_Credential -> AWS_Region_Service -> Any signed_fetch (uri:URI=(Missing_Argument.throw "uri")) (method:HTTP_Method=..Get) (headers:(Vector (Header | Pair Text Text))=[]) (format = Auto_Detect) credentials:AWS_Credential=..Default (region_service:AWS_Region_Service=(AWS.resolve_region_and_service uri)) = if_fetch_method method <| @@ -71,10 +71,10 @@ type AWS - region_service: The region and service to use for signing the request. Defaults to the region and service parsed from the URI. @uri (Text_Input display=..Always) - @format File_Format.default_widget @headers Header.default_widget + @format File_Format.default_widget @credentials AWS_Credential.default_widget - signed_post : (URI | Text) -> Request_Body -> HTTP_Method -> Vector (Header | Pair Text Text) -> Response ! Request_Error | HTTP_Error + signed_post : URI -> Request_Body -> HTTP_Method -> Vector (Header | Pair Text Text) -> Any -> AWS_Credential -> AWS_Region_Service -> Response ! Request_Error | HTTP_Error signed_post (uri:URI=(Missing_Argument.throw "uri")) (body:Request_Body=..Empty) (method:HTTP_Method=..Post) (headers:(Vector (Header | Pair Text Text))=[]) (response_format = Auto_Detect) credentials:AWS_Credential=..Default (region_service:AWS_Region_Service=(AWS.resolve_region_and_service uri)) = if_post_method method <| request = Request.new method uri (Header.unify_vector headers) body http = with_hash_and_client HTTP.new hash_method=AWS.hash_bytes make_client=(_make_client credentials region_service) diff --git a/distribution/lib/Standard/AWS/0.0.0-dev/src/AWS_Credential.enso b/distribution/lib/Standard/AWS/0.0.0-dev/src/AWS_Credential.enso index 4acfc3ca81c..b0a26338c5e 100644 --- a/distribution/lib/Standard/AWS/0.0.0-dev/src/AWS_Credential.enso +++ b/distribution/lib/Standard/AWS/0.0.0-dev/src/AWS_Credential.enso @@ -20,7 +20,7 @@ type AWS_Credential Arguments: - profile: AWS profile name (if empty uses default). - @profile (make_single_choice AWS_Credential.profile_names) + @profile (make_single_choice AWS_Credential.profile_names display=..Always) Profile profile:Text='default' ## Access using IAM via an AWS access key ID and secret access key. @@ -28,8 +28,8 @@ type AWS_Credential Arguments: - access_key_id: AWS access key ID. - secret_access_key: AWS secret access key. - @access_key_id make_text_secret_selector - @secret_access_key make_text_secret_selector + @access_key_id (make_text_secret_selector display=..Always) + @secret_access_key (make_text_secret_selector display=..Always) Key (access_key_id : (Text|Enso_Secret) = (Missing_Argument.throw "access_key_id")) (secret_access_key : (Text|Enso_Secret) = (Missing_Argument.throw "secret_access_key")) ## PRIVATE @@ -40,7 +40,8 @@ type AWS_Credential Default, Profile, Key. - default_region: The default region to use for operations that may require a region but it is not explicitly specified. - @default_region AWS_Region.default_widget + @base_credential (AWS_Credential.default_widget display=..Always) + @default_region (AWS_Region.default_widget display=..Always) With_Configuration (base_credential : AWS_Credential) (default_region : AWS_Region) ## ICON cloud @@ -68,8 +69,8 @@ type AWS_Credential ## ICON metadata Sets the default region for operations that need it but do not specify it explicitly. - @region AWS_Region.default_widget - with_default_region self (region : AWS_Region) -> AWS_Credential = case self of + @region (AWS_Region.default_widget display=..Always) + with_default_region self (region : AWS_Region = (Missing_Argument.throw "region")) -> AWS_Credential = case self of AWS_Credential.With_Configuration base_credential _ -> AWS_Credential.With_Configuration base_credential region _ -> AWS_Credential.With_Configuration self region diff --git a/distribution/lib/Standard/AWS/0.0.0-dev/src/AWS_Region.enso b/distribution/lib/Standard/AWS/0.0.0-dev/src/AWS_Region.enso index 2f81b1f9507..df60bebe242 100644 --- a/distribution/lib/Standard/AWS/0.0.0-dev/src/AWS_Region.enso +++ b/distribution/lib/Standard/AWS/0.0.0-dev/src/AWS_Region.enso @@ -27,7 +27,7 @@ type AWS_Region Java_Region.regions.map .id ## PRIVATE - default_widget (display : Display = Display.When_Modified) -> Widget = + default_widget (display : Display = ..When_Modified) -> Widget = options = [Option "Default" ("..Default")] + AWS_Region.all_region_ids.map id-> code = "(..Region "+id.pretty+")" Option id code diff --git a/distribution/lib/Standard/AWS/0.0.0-dev/src/Database/Redshift/Internal/Redshift_Dialect.enso b/distribution/lib/Standard/AWS/0.0.0-dev/src/Database/Redshift/Internal/Redshift_Dialect.enso index 3966e40d8f1..ad59e55f475 100644 --- a/distribution/lib/Standard/AWS/0.0.0-dev/src/Database/Redshift/Internal/Redshift_Dialect.enso +++ b/distribution/lib/Standard/AWS/0.0.0-dev/src/Database/Redshift/Internal/Redshift_Dialect.enso @@ -6,6 +6,7 @@ from Standard.Table import Aggregate_Column, Value_Type import Standard.Database.Connection.Connection.Connection import Standard.Database.DB_Column.DB_Column import Standard.Database.Dialect +import Standard.Database.Dialect_Flag.Dialect_Flag import Standard.Database.Feature.Feature import Standard.Database.Internal.Base_Generator import Standard.Database.Internal.Column_Fetcher as Column_Fetcher_Module @@ -24,7 +25,6 @@ import Standard.Database.Internal.Postgres.Postgres_Type_Mapping.Postgres_Type_M import Standard.Database.Internal.SQL_Type_Mapping.SQL_Type_Mapping import Standard.Database.Internal.SQL_Type_Reference.SQL_Type_Reference import Standard.Database.Internal.Statement_Setter.Statement_Setter -import Standard.Database.Dialect_Flag.Dialect_Flag import Standard.Database.SQL.SQL_Builder import Standard.Database.SQL_Statement.SQL_Statement import Standard.Database.SQL_Type.SQL_Type diff --git a/distribution/lib/Standard/AWS/0.0.0-dev/src/S3/S3.enso b/distribution/lib/Standard/AWS/0.0.0-dev/src/S3/S3.enso index b0b4cc9239b..737fea94ed0 100644 --- a/distribution/lib/Standard/AWS/0.0.0-dev/src/S3/S3.enso +++ b/distribution/lib/Standard/AWS/0.0.0-dev/src/S3/S3.enso @@ -128,7 +128,7 @@ get_object bucket key credentials:AWS_Credential=AWS_Credential.Default delimite - If the object does not exist, an `S3_Key_Not_Found` error is thrown. @credentials AWS_Credential.default_widget head : Text -> Text -> AWS_Credential -> Dictionary Text Any ! S3_Error -head (bucket : Text = Missing_Argument.throw "bucket") key:Text="" credentials:AWS_Credential=AWS_Credential.Default = +head (bucket : Text = Missing_Argument.throw "bucket") key:Text="" credentials:AWS_Credential=..Default = response = raw_head bucket key credentials pairs = response.sdkFields.map f-> [f.memberName, f.getValueOrDefault response] Dictionary.from_vector pairs diff --git a/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Base_64.enso b/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Base_64.enso index f0b09db0275..8a370bbaf06 100644 --- a/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Base_64.enso +++ b/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Base_64.enso @@ -12,10 +12,12 @@ type Base_64 ## ICON convert Converts a string to bytes using the specified encoding, and encodes that to base64. + @encoding Encoding.default_widget encode_text (text : Text) (encoding : Encoding = Encoding.utf_8) -> Text = Base64.getEncoder.encodeToString (text.bytes encoding) ## ICON convert Decodes a base64 encoded string, using the provided encoding. + @encoding Encoding.default_widget decode_text (encoded_text : Text) (encoding : Encoding = Encoding.utf_8) -> Text ! Encoding_Error = Text.from_bytes (Base64.getDecoder.decode encoded_text) encoding diff --git a/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Decimal.enso b/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Decimal.enso index 234cdda42dd..f1aeebc7a78 100644 --- a/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Decimal.enso +++ b/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Decimal.enso @@ -1153,8 +1153,8 @@ type Decimal Decimal.parse "(123,456,789.654)" format="###,###.##;(###,###.##)" # => -123456789.654 - parse : Text -> Locale | Nothing -> Decimal ! Number_Parse_Error ! Illegal_Argument - parse text locale:Locale=Locale.default format:Text="" -> Decimal ! Number_Parse_Error ! Illegal_Argument = + parse : Text -> Locale -> Text -> Decimal ! Number_Parse_Error ! Illegal_Argument + parse text:Text locale:Locale=Locale.default format:Text="" -> Decimal ! Number_Parse_Error ! Illegal_Argument = Illegal_Argument.handle_java_exception <| # `getInstance` returns `DecimalFormat` or a subclass of `DecimalFormat`. decimal_format = NumberFormat.getInstance locale.java_locale diff --git a/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Filter_Condition.enso b/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Filter_Condition.enso index e6763ab06d2..e5b30231316 100644 --- a/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Filter_Condition.enso +++ b/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Filter_Condition.enso @@ -256,8 +256,7 @@ type Filter_Condition ## PRIVATE Creates a Single_Choice Widget for delimiters. - default_widget : Boolean -> Boolean -> Boolean -> Boolean -> Boolean -> Boolean -> Boolean -> Boolean -> Widget - default_widget include_comparable=True include_text=True include_boolean=True include_nullable=True include_numeric=True include_date=True include_time=True include_date_time=True = + default_widget include_comparable:Boolean=True include_text:Boolean=True include_boolean:Boolean=True include_nullable:Boolean=True include_numeric:Boolean=True include_date:Boolean=True include_time:Boolean=True include_date_time:Boolean=True display:Display=..When_Modified -> Widget = options = Vector.build builder-> equatable_types = make_any_selector add_text=include_text add_boolean=include_boolean add_number=include_numeric add_date=include_date add_time=include_time add_date_time=include_date_time builder.append (Option "Equals" "..Equal" [["to", equatable_types]]) @@ -297,7 +296,7 @@ type Filter_Condition value_editor = Widget.Vector_Editor item_editor=equatable_types display=Display.Always item_default='""' builder.append (Option "Is In" "..Is_In" [["values", value_editor]]) - make_single_choice options + make_single_choice options display=display ## Specifies the action of a Filter_Condition. type Filter_Action diff --git a/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Index_Sub_Range.enso b/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Index_Sub_Range.enso index f2af5b579bd..95dc0af8ac1 100644 --- a/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Index_Sub_Range.enso +++ b/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Index_Sub_Range.enso @@ -94,9 +94,8 @@ type Index_Sub_Range [o1, o2, o4, o5, o6, o7, o3] ## PRIVATE - default_widget : (Integer|Nothing) -> Widget - default_widget count:(Integer|Nothing)=Nothing = - Single_Choice display=Display.Always (Index_Sub_Range.default_options count) + default_widget count:(Integer|Nothing)=Nothing display:Display=..Always -> Widget = + Single_Choice display=display (Index_Sub_Range.default_options count) ## PRIVATE Resolves a vector of ranges or indices into a vector of ranges that fit diff --git a/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Locale.enso b/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Locale.enso index 82c992be908..548e32e9bdb 100644 --- a/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Locale.enso +++ b/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Locale.enso @@ -460,8 +460,8 @@ type Locale ## PRIVATE Gets the default drop down option for Locale. - default_widget : Widget - default_widget = Widget.Single_Choice values=Locale.widget_options display=Display.When_Modified + default_widget display:Display=..When_Modified -> Widget = + Widget.Single_Choice values=Locale.widget_options display=display ## PRIVATE predefined_locale_fields : Vector Text diff --git a/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Numbers.enso b/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Numbers.enso index 91a40f88d28..042662fe7b1 100644 --- a/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Numbers.enso +++ b/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Numbers.enso @@ -793,8 +793,8 @@ type Float Float.parse "(123,456,789.654)" format="###,###.##;(###,###.##)" # => -123456789.654 - parse : Text -> Locale | Nothing -> Float ! Number_Parse_Error ! Illegal_Argument - parse text (locale : Locale | Nothing = Nothing) (format : Text | Nothing = Nothing) -> Float ! Number_Parse_Error ! Illegal_Argument = + parse : Text -> Locale | Nothing -> Text | Nothing -> Float ! Number_Parse_Error ! Illegal_Argument + parse text:Text (locale : Locale | Nothing = Nothing) (format : Text | Nothing = Nothing) -> Float ! Number_Parse_Error ! Illegal_Argument = case locale.is_nothing && format.is_nothing of True -> Panic.catch NumberFormatException (Double.parseDouble text) _-> diff --git a/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Read/Return_As.enso b/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Read/Return_As.enso index a5b40abfd25..4ac255c3721 100644 --- a/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Read/Return_As.enso +++ b/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Read/Return_As.enso @@ -1,6 +1,6 @@ import project.Any.Any -import project.Data.Text.Text import project.Data.Read.Many_Files_List.Many_Files_List +import project.Data.Text.Text import project.Data.Vector.Vector import project.Error.Error import project.Errors.Common.Type_Error @@ -49,10 +49,9 @@ type Return_As _ -> Panic.throw (Type_Error.Error Return_As value "Expected `return` to be a Return_As type, but got {got}.") ## PRIVATE - default_widget : Widget - default_widget = + default_widget display:Display=..When_Modified -> Widget = options = _get_known_return_classes.map .get_dropdown_options - Single_Choice display=Display.Always values=options + Single_Choice display=display values=options ## PRIVATE type Return_As_Base diff --git a/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Text/Encoding.enso b/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Text/Encoding.enso index edeb5df7133..c4b6e629b55 100644 --- a/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Text/Encoding.enso +++ b/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Text/Encoding.enso @@ -19,12 +19,11 @@ polyglot java import org.enso.base.Text_Utils ## Represents a character encoding. type Encoding ## PRIVATE - Gets the default drop down option for this encoding. - default_widget : Widget - default_widget = + Gets the default drop down option for Encoding. + default_widget display:Display=..When_Modified -> Widget = fqn = Meta.get_qualified_type_name Encoding values = [Option "UTF-8" fqn+".utf_8", Option "ASCII" fqn+".ascii", Option "UTF-16LE" fqn+".utf_16_le", Option "UTF-16BE" fqn+".utf_16_be", Option "UTF-32LE" fqn+".utf_32_le", Option "UTF-32BE" fqn+".utf_32_be", Option "Windows-1250" fqn+".windows_1250", Option "Windows-1251" fqn+".windows_1251", Option "Windows-1252" fqn+".windows_1252", Option "Windows-1253" fqn+".windows_1253", Option "Windows-1254" fqn+".windows_1254", Option "Windows-1255" fqn+".windows_1255", Option "Windows-1256" fqn+".windows_1256", Option "Windows-1257" fqn+".windows_1257", Option "Windows-1258" fqn+".windows_1258"] - Single_Choice values=values display=Display.When_Modified + Single_Choice values=values display=display ## PRIVATE ADVANCED diff --git a/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Text/Extensions.enso b/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Text/Extensions.enso index 7f85781c873..0064956a1e0 100644 --- a/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Text/Extensions.enso +++ b/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Text/Extensions.enso @@ -335,7 +335,7 @@ Text.find_all self pattern:Text|Regex=".*" case_sensitivity:Case_Sensitivity=..S # Evaluates to true "CONTACT@enso.org".match regex Case_Sensitivity.Insensitive Text.match : Text|Regex -> Case_Sensitivity -> Boolean ! Regex_Syntax_Error | Illegal_Argument -Text.match self pattern:Text|Regex=".*" case_sensitivity:Case_Sensitivity=..Sensitive -> Boolean = +Text.match self pattern:Text|Regex=".*" case_sensitivity:Case_Sensitivity=..Sensitive -> Boolean ! Regex_Syntax_Error | Illegal_Argument = case_insensitive = case_sensitivity.is_case_insensitive_in_memory compiled_pattern = Regex.compile pattern case_insensitive=case_insensitive compiled_pattern.matches self diff --git a/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Text/Text_Sub_Range.enso b/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Text/Text_Sub_Range.enso index fe5020c9280..38d7abc0167 100644 --- a/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Text/Text_Sub_Range.enso +++ b/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Text/Text_Sub_Range.enso @@ -65,10 +65,9 @@ type Text_Sub_Range The widget for `Text_Sub_Range` also displays options for `Index_Sub_Range` since the former is supposed to 'expand' the latter and is always used together with it. - default_widget : Widget - default_widget = + default_widget display:Display=..When_Modified -> Widget = options = Index_Sub_Range.default_options + Text_Sub_Range.default_options - Single_Choice display=Display.Always options + Single_Choice display=display options type Codepoint_Ranges ## PRIVATE diff --git a/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Time/Date.enso b/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Time/Date.enso index cb25b88edb0..74350875b73 100644 --- a/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Time/Date.enso +++ b/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Time/Date.enso @@ -845,10 +845,9 @@ type Date ## PRIVATE Gets the default drop down option for Date. - default_widget : Boolean -> Widget - default_widget (include_today:Boolean=False) = + default_widget (include_today:Boolean=False) display:Display=..When_Modified -> Widget = options = [Option "" "Date.new"] + (if include_today then [Option "" "Date.today"] else []) - Widget.Single_Choice values=options display=Display.When_Modified + Widget.Single_Choice values=options display=display ## PRIVATE week_days_between start end = diff --git a/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Time/Time_Of_Day.enso b/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Time/Time_Of_Day.enso index efd8e18ecf8..f3e2f41bbb3 100644 --- a/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Time/Time_Of_Day.enso +++ b/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Time/Time_Of_Day.enso @@ -518,10 +518,9 @@ type Time_Of_Day ## PRIVATE Gets the default drop down option for Time_Of_Day. - default_widget : Boolean -> Widget - default_widget (include_now:Boolean=False) = + default_widget (include_now:Boolean=False) display:Display=..When_Modified -> Widget = options = [Option "" "Time_Of_Day.new"] + (if include_now then [Option "" "Time_Of_Day.now"] else []) - Widget.Single_Choice values=options display=Display.When_Modified + Widget.Single_Choice values=options display=display ## PRIVATE Time_Of_Day.from (that:JS_Object) = diff --git a/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Time/Time_Zone.enso b/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Time/Time_Zone.enso index 75c55383eb9..2dd879d2ad2 100644 --- a/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Time/Time_Zone.enso +++ b/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Time/Time_Zone.enso @@ -203,10 +203,9 @@ type Time_Zone ## PRIVATE Gets the default drop down option for Time_Zone. - default_widget : Widget - default_widget = + default_widget display:Display=..When_Modified -> Widget = options = [Option "System" "Time_Zone.system", Option "Local" "Time_Zone.local", Option "UTC" "Time_Zone.utc", Option "Named" "(Time_Zone.parse 'UTC')", Option "custom" "(Time_Zone.new 1 0 0)"] - Widget.Single_Choice values=options display=Display.When_Modified + Widget.Single_Choice values=options display=display ## ICON time Gets a list of all the time zone names that are predefined. diff --git a/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Vector.enso b/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Vector.enso index 12871a9a886..a05719073ba 100644 --- a/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Vector.enso +++ b/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Vector.enso @@ -1558,6 +1558,7 @@ type Map_Error Indicates that a method should not wrap thrown errors in `Map_Error`. @Builtin_Type type No_Wrap + ## PRIVATE Value ## PRIVATE diff --git a/distribution/lib/Standard/Base/0.0.0-dev/src/Enso_Cloud/Enso_File.enso b/distribution/lib/Standard/Base/0.0.0-dev/src/Enso_Cloud/Enso_File.enso index 6ac78269c63..5cfdef23c4f 100644 --- a/distribution/lib/Standard/Base/0.0.0-dev/src/Enso_Cloud/Enso_File.enso +++ b/distribution/lib/Standard/Base/0.0.0-dev/src/Enso_Cloud/Enso_File.enso @@ -252,7 +252,7 @@ type Enso_File Arguments: - name: The name of the label to create. - color: The color of the label to create. - create_label : Text -> Text -> Nothing + create_label : Text -> Color -> Nothing create_label (name : Text) (color : Color) -> Nothing = # TODO once cloud also checks for tag existance, if the Write context is enabled we could avoid this check as cloud will do it anyway - then we'll have only one request instead of 2 each time # Cloud ticket: https://github.com/enso-org/cloud-v2/issues/1544 diff --git a/distribution/lib/Standard/Base/0.0.0-dev/src/Enso_Cloud/Enso_Secret.enso b/distribution/lib/Standard/Base/0.0.0-dev/src/Enso_Cloud/Enso_Secret.enso index 33ee5cb1348..5e465197ed5 100644 --- a/distribution/lib/Standard/Base/0.0.0-dev/src/Enso_Cloud/Enso_Secret.enso +++ b/distribution/lib/Standard/Base/0.0.0-dev/src/Enso_Cloud/Enso_Secret.enso @@ -34,8 +34,8 @@ type Enso_Secret private Value internal_name:Text id:Text internal_path:Enso_Path ## GROUP Metadata - ICON metadata - The name of the secret. + ICON metadata + The name of the secret. name : Text name self = self.internal_name diff --git a/distribution/lib/Standard/Base/0.0.0-dev/src/Enso_Cloud/Internal/Existing_Enso_Asset.enso b/distribution/lib/Standard/Base/0.0.0-dev/src/Enso_Cloud/Internal/Existing_Enso_Asset.enso index 4d3f49c794b..842880e3d48 100644 --- a/distribution/lib/Standard/Base/0.0.0-dev/src/Enso_Cloud/Internal/Existing_Enso_Asset.enso +++ b/distribution/lib/Standard/Base/0.0.0-dev/src/Enso_Cloud/Internal/Existing_Enso_Asset.enso @@ -25,7 +25,7 @@ import project.Runtime.Context from project.Data.Boolean import Boolean, False, True from project.Data.Text.Extensions import all from project.Enso_Cloud.Data_Link_Helpers import data_link_extension -from project.Enso_Cloud.Public_Utils import get_required_field, get_optional_field +from project.Enso_Cloud.Public_Utils import get_optional_field, get_required_field ## PRIVATE Currently, most of the Cloud API relies on asset IDs and not paths. diff --git a/distribution/lib/Standard/Base/0.0.0-dev/src/Errors/Common.enso b/distribution/lib/Standard/Base/0.0.0-dev/src/Errors/Common.enso index ede708dad9e..dcd08b6278f 100644 --- a/distribution/lib/Standard/Base/0.0.0-dev/src/Errors/Common.enso +++ b/distribution/lib/Standard/Base/0.0.0-dev/src/Errors/Common.enso @@ -14,8 +14,8 @@ from project.Data.Boolean import Boolean, False, True polyglot java import java.lang.ArithmeticException polyglot java import java.lang.ClassCastException polyglot java import java.lang.OutOfMemoryError -polyglot java import org.enso.base.CompareException polyglot java import org.enso.base.cache.ResponseTooLargeException +polyglot java import org.enso.base.CompareException ## An error indicating that no value was found. type Not_Found diff --git a/distribution/lib/Standard/Base/0.0.0-dev/src/Metadata.enso b/distribution/lib/Standard/Base/0.0.0-dev/src/Metadata.enso index f625f371aa3..27b709d19df 100644 --- a/distribution/lib/Standard/Base/0.0.0-dev/src/Metadata.enso +++ b/distribution/lib/Standard/Base/0.0.0-dev/src/Metadata.enso @@ -99,8 +99,7 @@ type Widget JS_Object.from_pairs (type_pair + cons_pair + field_pairs) ## PRIVATE -make_single_choice : Vector -> Display -> Widget -make_single_choice values display:Display=..Always = +make_single_choice values:Vector display:Display=..Always -> Widget = make_option value = case value of _ : Vector -> Choice.Option value.first value.second _ : Text -> Choice.Option value value.pretty diff --git a/distribution/lib/Standard/Base/0.0.0-dev/src/Network/HTTP.enso b/distribution/lib/Standard/Base/0.0.0-dev/src/Network/HTTP.enso index b4b138236d7..bee4ce27cc8 100644 --- a/distribution/lib/Standard/Base/0.0.0-dev/src/Network/HTTP.enso +++ b/distribution/lib/Standard/Base/0.0.0-dev/src/Network/HTTP.enso @@ -36,8 +36,8 @@ from project.Data.Boolean import Boolean, False, True from project.Data.Json.Extensions import all from project.Data.Text.Extensions import all -polyglot java import java.lang.IllegalArgumentException polyglot java import java.io.IOException +polyglot java import java.lang.IllegalArgumentException polyglot java import java.net.http.HttpClient polyglot java import java.net.http.HttpClient.Builder as ClientBuilder polyglot java import java.net.http.HttpClient.Redirect diff --git a/distribution/lib/Standard/Base/0.0.0-dev/src/Network/HTTP/Cache_Policy.enso b/distribution/lib/Standard/Base/0.0.0-dev/src/Network/HTTP/Cache_Policy.enso index cad1bcece43..8de49a1a284 100644 --- a/distribution/lib/Standard/Base/0.0.0-dev/src/Network/HTTP/Cache_Policy.enso +++ b/distribution/lib/Standard/Base/0.0.0-dev/src/Network/HTTP/Cache_Policy.enso @@ -12,7 +12,7 @@ type Cache_Policy ## Don't use the response cache. No_Cache - # Default to using the cache for GET requests, unless explicitly disabled + ## Default to using the cache for GET requests, unless explicitly disabled should_use_cache self request:Request -> Boolean = case self of Cache_Policy.Default -> if request.method == HTTP_Method.Get then True else False Cache_Policy.Use_Cache -> True diff --git a/distribution/lib/Standard/Base/0.0.0-dev/src/System/File_Format.enso b/distribution/lib/Standard/Base/0.0.0-dev/src/System/File_Format.enso index 1c7f17e5e1e..bcad590f86c 100644 --- a/distribution/lib/Standard/Base/0.0.0-dev/src/System/File_Format.enso +++ b/distribution/lib/Standard/Base/0.0.0-dev/src/System/File_Format.enso @@ -145,10 +145,9 @@ type File_Format format_types.flat_map .get_name_patterns . flat_map .patterns . distinct ## PRIVATE - default_widget : Widget - default_widget = + default_widget display:Display=..When_Modified -> Widget = options = ([Auto_Detect]+format_types).flat_map .get_dropdown_options - Single_Choice display=Display.Always values=options + Single_Choice display=display values=options ## PRIVATE Builds a widget intended to be used for `name_filter` of `File.list` and diff --git a/distribution/lib/Standard/Base/0.0.0-dev/src/Widget_Helpers.enso b/distribution/lib/Standard/Base/0.0.0-dev/src/Widget_Helpers.enso index f8ee75da29a..9942601a0cd 100644 --- a/distribution/lib/Standard/Base/0.0.0-dev/src/Widget_Helpers.enso +++ b/distribution/lib/Standard/Base/0.0.0-dev/src/Widget_Helpers.enso @@ -15,10 +15,9 @@ from project.Metadata.Choice import Option ## PRIVATE Creates a Single_Choice Widget for text or secret value. -make_text_secret_selector : Widget -make_text_secret_selector = +make_text_secret_selector display:Display=..When_Modified -> Widget = fqn = Meta.get_qualified_type_name Enso_Secret - make_single_choice [['', '""'], ['', fqn+".get"]] + make_single_choice [['', '""'], ['', fqn+".get"]] display=display ## PRIVATE Creates a Regex / Text Widget for search and replace. diff --git a/distribution/lib/Standard/Database/0.0.0-dev/src/Connection/Connection_Options.enso b/distribution/lib/Standard/Database/0.0.0-dev/src/Connection/Connection_Options.enso index e8cdfad56a1..a5ed7b61c88 100644 --- a/distribution/lib/Standard/Database/0.0.0-dev/src/Connection/Connection_Options.enso +++ b/distribution/lib/Standard/Database/0.0.0-dev/src/Connection/Connection_Options.enso @@ -1,4 +1,5 @@ from Standard.Base import all +import Standard.Base.Metadata.Display import Standard.Base.Metadata.Widget from Standard.Base.Metadata.Choice import Option from Standard.Base.Metadata.Widget import Single_Choice, Text_Input, Vector_Editor @@ -20,13 +21,12 @@ type Connection_Options ## PRIVATE Widget to design connection options. - default_widget : Widget - default_widget = + default_widget display:Display=..Always -> Widget = fqn = Meta.get_qualified_type_name Pair . take (..Before_Last '.') default = 'pair "key" "value"' pair = Option "Pair" fqn+".pair" [["first", Text_Input], ["second", make_text_secret_selector]] item_editor = Single_Choice display=..Always values=[pair] - Vector_Editor item_editor=item_editor display=..Always item_default=default + Vector_Editor item_editor=item_editor display=display item_default=default ## PRIVATE Connection_Options.from (that:Vector) = Connection_Options.Value that diff --git a/distribution/lib/Standard/Database/0.0.0-dev/src/Connection/Credentials.enso b/distribution/lib/Standard/Database/0.0.0-dev/src/Connection/Credentials.enso index bfbf920c1ba..16fbf40e37c 100644 --- a/distribution/lib/Standard/Database/0.0.0-dev/src/Connection/Credentials.enso +++ b/distribution/lib/Standard/Database/0.0.0-dev/src/Connection/Credentials.enso @@ -20,7 +20,7 @@ type Credentials to_display_text self -> Text = self.to_text.to_display_text ## PRIVATE - default_widget (include_nothing : Boolean = True) -> Widget = + default_widget (include_nothing : Boolean = True) display:Display=..When_Modified -> Widget = fqn = Meta.get_qualified_type_name Credentials values = [Option "Username_And_Password" fqn+".Username_And_Password"] + if include_nothing then [Option "No credentials" "Nothing"] else [] - Single_Choice values=values display=Display.When_Modified + Single_Choice values=values display=display diff --git a/distribution/lib/Standard/Database/0.0.0-dev/src/Connection/Postgres_Connection.enso b/distribution/lib/Standard/Database/0.0.0-dev/src/Connection/Postgres_Connection.enso index 418088b6b6e..59d001aaf23 100644 --- a/distribution/lib/Standard/Database/0.0.0-dev/src/Connection/Postgres_Connection.enso +++ b/distribution/lib/Standard/Database/0.0.0-dev/src/Connection/Postgres_Connection.enso @@ -11,9 +11,9 @@ import project.Connection.Connection.Connection import project.DB_Table.DB_Table import project.Dialect import project.Internal.Connection.Entity_Naming_Properties.Entity_Naming_Properties +import project.Internal.Data_Link_Setup.Data_Link_Setup import project.Internal.IR.Query.Query import project.Internal.JDBC_Connection -import project.Internal.Data_Link_Setup.Data_Link_Setup import project.Internal.SQL_Type_Reference.SQL_Type_Reference import project.SQL_Query.SQL_Query import project.SQL_Statement.SQL_Statement @@ -137,7 +137,7 @@ type Postgres_Connection tables self name_like=Nothing database=self.database schema=Nothing types=self.dialect.default_table_types all_fields=False = self.connection.tables name_like database schema types all_fields - ## ALIAS read, load, open, import + ## ALIAS import, load, open, read GROUP Standard.Base.Input ICON data_input Set up a query returning a Table object, which can be used to work with @@ -159,7 +159,7 @@ type Postgres_Connection query : SQL_Query -> Text -> DB_Table ! Table_Not_Found query self query:SQL_Query alias="" = self.connection.query query alias - ## ALIAS query, load, open, import + ## ALIAS import, load, open, query GROUP Standard.Base.Input ICON data_input Execute the query and load the results into memory as a Table. diff --git a/distribution/lib/Standard/Database/0.0.0-dev/src/Dialect.enso b/distribution/lib/Standard/Database/0.0.0-dev/src/Dialect.enso index 0cdc22a596a..9172ce703d0 100644 --- a/distribution/lib/Standard/Database/0.0.0-dev/src/Dialect.enso +++ b/distribution/lib/Standard/Database/0.0.0-dev/src/Dialect.enso @@ -8,6 +8,7 @@ from Standard.Table import Aggregate_Column, Join_Kind, Value_Type import project.Connection.Connection.Connection import project.DB_Column.DB_Column import project.DB_Table.DB_Table +import project.Dialect_Flag.Dialect_Flag import project.Internal.Column_Fetcher.Column_Fetcher import project.Internal.DB_Wrapped_Error.DB_Wrapped_Error import project.Internal.Error_Mapper.Error_Mapper @@ -23,7 +24,6 @@ import project.Internal.SQL_Type_Mapping.SQL_Type_Mapping import project.Internal.SQL_Type_Reference.SQL_Type_Reference import project.Internal.SQLite.SQLite_Dialect import project.Internal.Statement_Setter.Statement_Setter -import project.Dialect_Flag.Dialect_Flag import project.SQL.SQL_Builder import project.SQL_Statement.SQL_Statement import project.SQL_Type.SQL_Type diff --git a/distribution/lib/Standard/Database/0.0.0-dev/src/Internal/Data_Link_Setup.enso b/distribution/lib/Standard/Database/0.0.0-dev/src/Internal/Data_Link_Setup.enso index 666611170f9..f1112184866 100644 --- a/distribution/lib/Standard/Database/0.0.0-dev/src/Internal/Data_Link_Setup.enso +++ b/distribution/lib/Standard/Database/0.0.0-dev/src/Internal/Data_Link_Setup.enso @@ -4,7 +4,7 @@ import Standard.Base.Errors.File_Error.File_Error import Standard.Base.Errors.Illegal_Argument.Illegal_Argument import Standard.Base.Errors.Illegal_State.Illegal_State import Standard.Base.Runtime.Context -from Standard.Base.Enso_Cloud.Data_Link_Helpers import data_link_extension, secure_value_to_json, save_password_for_data_link +from Standard.Base.Enso_Cloud.Data_Link_Helpers import data_link_extension, save_password_for_data_link, secure_value_to_json import project.Connection.Credentials.Credentials import project.SQL_Statement.SQL_Statement diff --git a/distribution/lib/Standard/Database/0.0.0-dev/src/Internal/Postgres/Postgres_Dialect.enso b/distribution/lib/Standard/Database/0.0.0-dev/src/Internal/Postgres/Postgres_Dialect.enso index 87c4dfc5f36..4066a961800 100644 --- a/distribution/lib/Standard/Database/0.0.0-dev/src/Internal/Postgres/Postgres_Dialect.enso +++ b/distribution/lib/Standard/Database/0.0.0-dev/src/Internal/Postgres/Postgres_Dialect.enso @@ -14,6 +14,7 @@ import project.Connection.Connection.Connection import project.DB_Column.DB_Column import project.DB_Table.DB_Table import project.Dialect +import project.Dialect_Flag.Dialect_Flag import project.Internal.Base_Generator import project.Internal.Common.Database_Distinct_Helper import project.Internal.Common.Database_Join_Helper @@ -33,7 +34,6 @@ import project.Internal.Replace_Params.Replace_Params import project.Internal.SQL_Type_Mapping.SQL_Type_Mapping import project.Internal.SQL_Type_Reference.SQL_Type_Reference import project.Internal.Statement_Setter.Statement_Setter -import project.Dialect_Flag.Dialect_Flag import project.SQL.SQL_Builder import project.SQL.SQL_Fragment import project.SQL_Statement.SQL_Statement diff --git a/distribution/lib/Standard/Database/0.0.0-dev/src/Internal/SQLite/SQLite_Dialect.enso b/distribution/lib/Standard/Database/0.0.0-dev/src/Internal/SQLite/SQLite_Dialect.enso index edd089ef7fe..b342bc522e0 100644 --- a/distribution/lib/Standard/Database/0.0.0-dev/src/Internal/SQLite/SQLite_Dialect.enso +++ b/distribution/lib/Standard/Database/0.0.0-dev/src/Internal/SQLite/SQLite_Dialect.enso @@ -11,6 +11,7 @@ import project.Connection.Connection.Connection import project.DB_Column.DB_Column import project.DB_Table.DB_Table import project.Dialect +import project.Dialect_Flag.Dialect_Flag import project.Internal.Aggregate_Helper import project.Internal.Aggregate_Helper.Aggregate_With_Helper_Expressions import project.Internal.Base_Generator @@ -31,7 +32,6 @@ import project.Internal.SQL_Type_Reference.SQL_Type_Reference import project.Internal.SQLite.SQLite_Error_Mapper.SQLite_Error_Mapper import project.Internal.SQLite.SQLite_Type_Mapping.SQLite_Type_Mapping import project.Internal.Statement_Setter.Statement_Setter -import project.Dialect_Flag.Dialect_Flag import project.SQL.SQL_Builder import project.SQL_Statement.SQL_Statement import project.SQL_Type.SQL_Type diff --git a/distribution/lib/Standard/Database/0.0.0-dev/src/Internal/SQLite/SQLite_Error_Mapper.enso b/distribution/lib/Standard/Database/0.0.0-dev/src/Internal/SQLite/SQLite_Error_Mapper.enso index 3928fa22b52..81b047c5eb5 100644 --- a/distribution/lib/Standard/Database/0.0.0-dev/src/Internal/SQLite/SQLite_Error_Mapper.enso +++ b/distribution/lib/Standard/Database/0.0.0-dev/src/Internal/SQLite/SQLite_Error_Mapper.enso @@ -18,7 +18,9 @@ type SQLite_Error_Mapper ## PRIVATE SQLite does not mind SQLite NULL primary keys. is_null_primary_key_violation : SQL_Error -> Boolean - is_null_primary_key_violation _ = False + is_null_primary_key_violation error = + _ = error + False ## PRIVATE is_table_already_exists_error : SQL_Error -> Boolean diff --git a/distribution/lib/Standard/Database/0.0.0-dev/src/Internal/Upload/Operations/Upload_Table.enso b/distribution/lib/Standard/Database/0.0.0-dev/src/Internal/Upload/Operations/Upload_Table.enso index dc9b841811c..7f9d69f69a3 100644 --- a/distribution/lib/Standard/Database/0.0.0-dev/src/Internal/Upload/Operations/Upload_Table.enso +++ b/distribution/lib/Standard/Database/0.0.0-dev/src/Internal/Upload/Operations/Upload_Table.enso @@ -14,7 +14,7 @@ import project.Internal.In_Transaction.In_Transaction import project.Internal.IR.Query.Query import project.SQL_Query.SQL_Query from project.Dialect import Temp_Table_Style -from project.Errors import SQL_Error, Table_Already_Exists, Different_Connections +from project.Errors import Different_Connections, SQL_Error, Table_Already_Exists from project.Internal.JDBC_Connection import log_sql_if_enabled from project.Internal.Upload.Helpers.Argument_Checks import resolve_primary_key from project.Internal.Upload.Helpers.Constants import default_batch_size diff --git a/distribution/lib/Standard/Google_Api/0.0.0-dev/src/Google_Analytics.enso b/distribution/lib/Standard/Google_Api/0.0.0-dev/src/Google_Analytics.enso index 9070abe738e..b869072c5cb 100644 --- a/distribution/lib/Standard/Google_Api/0.0.0-dev/src/Google_Analytics.enso +++ b/distribution/lib/Standard/Google_Api/0.0.0-dev/src/Google_Analytics.enso @@ -5,18 +5,19 @@ from Standard.Base.Metadata import make_single_choice, Widget from Standard.Base.Metadata.Choice import Option from Standard.Base.Metadata.Widget import Single_Choice, Text_Input, Vector_Editor -from Standard.Table import Data_Formatter, Table import Standard.Table.Rows_To_Read.Rows_To_Read +from Standard.Table import Data_Formatter, Table from Standard.Table.Table import from_java_table -import project.Google_Credential.Google_Credential import project.Google_Analytics_Account.Google_Analytics_Account import project.Google_Analytics_Account.Google_Analytics_Account_Filter import project.Google_Analytics_Field.Google_Analytics_Field import project.Google_Analytics_Property.Google_Analytics_Property +import project.Google_Credential.Google_Credential polyglot java import org.enso.google.GoogleAnalyticsReader +## Type providing API access to Google Analytics. type Google_Analytics ## GROUP Standard.Base.Input ICON data_input diff --git a/distribution/lib/Standard/Google_Api/0.0.0-dev/src/Google_Analytics_Account.enso b/distribution/lib/Standard/Google_Api/0.0.0-dev/src/Google_Analytics_Account.enso index febdf9e31a2..7ff50fb9cd6 100644 --- a/distribution/lib/Standard/Google_Api/0.0.0-dev/src/Google_Analytics_Account.enso +++ b/distribution/lib/Standard/Google_Api/0.0.0-dev/src/Google_Analytics_Account.enso @@ -1,5 +1,5 @@ from Standard.Base import all -from Standard.Base.Metadata import make_single_choice, Widget +from Standard.Base.Metadata import Display, make_single_choice, Widget from Standard.Base.Metadata.Choice import Option from Standard.Base.Metadata.Widget import Text_Input, Vector_Editor @@ -58,6 +58,7 @@ type Google_Analytics_Account ## Filter for Google Analytics accounts. type Google_Analytics_Account_Filter + ## Filter to all accounts. All_Accounts ## Filter to a single account @@ -69,26 +70,25 @@ type Google_Analytics_Account_Filter Accounts accounts:Vector ## PRIVATE - default_widget : Any -> Any -> Widget - default_widget self_arg cache = + default_widget self_arg cache display:Display=..Always -> Widget = _ = self_arg default = [Option "" "..All_Accounts", Option "" "..Account", Option "" "..Accounts"] Panic.catch Any handler=_->(make_single_choice default) <| credentials = cache.if_not_nothing <| cache "credentials" options = Google_Analytics.list_accounts credentials=(credentials.if_nothing Google_Credential.Default) limit=(..First 10) . map p->(Option (p.name + " (" + p.id + ")") "..Account "+p.id.pretty) - make_single_choice default+options display=..Always + make_single_choice default+options display=display - ## PRIVATE - private as_java self -> Array | Nothing = case self of - Google_Analytics_Account_Filter.All_Accounts -> Nothing - Google_Analytics_Account_Filter.Account acc -> case acc of - _ : Google_Analytics_Account -> [acc.java_record].to_array - _ : Text -> [_create_analytics_account_from_text acc].to_array - Google_Analytics_Account_Filter.Accounts accounts -> - vec = accounts.map acc-> case acc of - _ : Google_Analytics_Account -> acc.java_record - _ : Text -> _create_analytics_account_from_text acc - vec.to_array + ## PRIVATE + private as_java self -> Array | Nothing = case self of + Google_Analytics_Account_Filter.All_Accounts -> Nothing + Google_Analytics_Account_Filter.Account acc -> case acc of + _ : Google_Analytics_Account -> [acc.java_record].to_array + _ : Text -> [_create_analytics_account_from_text acc].to_array + Google_Analytics_Account_Filter.Accounts accounts -> + vec = accounts.map acc-> case acc of + _ : Google_Analytics_Account -> acc.java_record + _ : Text -> _create_analytics_account_from_text acc + vec.to_array ## PRIVATE Creates a Google Analytics account from a text ID. diff --git a/distribution/lib/Standard/Google_Api/0.0.0-dev/src/Google_Analytics_Property.enso b/distribution/lib/Standard/Google_Api/0.0.0-dev/src/Google_Analytics_Property.enso index 706051c9350..ca8a231b2e9 100644 --- a/distribution/lib/Standard/Google_Api/0.0.0-dev/src/Google_Analytics_Property.enso +++ b/distribution/lib/Standard/Google_Api/0.0.0-dev/src/Google_Analytics_Property.enso @@ -1,6 +1,6 @@ from Standard.Base import all import Standard.Base.Errors.Illegal_Argument.Illegal_Argument -from Standard.Base.Metadata import make_single_choice, Widget +from Standard.Base.Metadata import Display, make_single_choice, Widget from Standard.Base.Metadata.Choice import Option import project.Google_Analytics.Google_Analytics @@ -65,13 +65,12 @@ type Google_Analytics_Property Google_Analytics.list_dimensions self credentials ## PRIVATE - default_widget : Any -> Any -> Widget - default_widget self_arg cache = + default_widget self_arg cache display:Display=..Always -> Widget = _ = self_arg - Panic.catch Any handler=_->(Widget.Text_Input display=..Always) <| + Panic.catch Any handler=_->(Widget.Text_Input display=display) <| credentials = cache.if_not_nothing <| cache "credentials" options = Google_Analytics.list_properties account=..All_Accounts credentials=(credentials.if_nothing Google_Credential.Default) limit=(..First 10) . map p->(Option (p.name + " (" + p.id + ")") p.id.pretty) - make_single_choice options display=..Always + make_single_choice options display=display ## PRIVATE Google_Analytics_Property.from (that:Text) = diff --git a/distribution/lib/Standard/Google_Api/0.0.0-dev/src/Google_Credential.enso b/distribution/lib/Standard/Google_Api/0.0.0-dev/src/Google_Credential.enso index 105d3e59eb2..571b3f17350 100644 --- a/distribution/lib/Standard/Google_Api/0.0.0-dev/src/Google_Credential.enso +++ b/distribution/lib/Standard/Google_Api/0.0.0-dev/src/Google_Credential.enso @@ -1,6 +1,6 @@ from Standard.Base import all import Standard.Base.Errors.Common.Missing_Argument -from Standard.Base.Metadata import make_single_choice, Choice, Widget +from Standard.Base.Metadata import Choice, Display, make_single_choice, Widget from Standard.Base.Metadata.Choice import Option polyglot java import com.google.api.gax.core.CredentialsProvider @@ -45,9 +45,8 @@ type Google_Credential Google_Credential.Default -> Nothing ## PRIVATE - default_widget : Widget - default_widget = - make_single_choice [Option "File" "..From_File", Option "Default" "..Default"] + default_widget display:Display=..When_Modified -> Widget = + make_single_choice [Option "File" "..From_File", Option "Default" "..Default"] display=display ## PRIVATE Google_Credential.from (that:File) = Google_Credential.From_File that diff --git a/distribution/lib/Standard/Microsoft/0.0.0-dev/src/Internal/SQLServer_Dialect.enso b/distribution/lib/Standard/Microsoft/0.0.0-dev/src/Internal/SQLServer_Dialect.enso index 77bdf220435..dd35316dad7 100644 --- a/distribution/lib/Standard/Microsoft/0.0.0-dev/src/Internal/SQLServer_Dialect.enso +++ b/distribution/lib/Standard/Microsoft/0.0.0-dev/src/Internal/SQLServer_Dialect.enso @@ -16,6 +16,7 @@ import Standard.Database.Connection.Connection.Connection import Standard.Database.DB_Column.DB_Column import Standard.Database.DB_Table.DB_Table import Standard.Database.Dialect +import Standard.Database.Dialect_Flag.Dialect_Flag import Standard.Database.Feature.Feature import Standard.Database.Internal.Base_Generator import Standard.Database.Internal.Common.Database_Distinct_Helper @@ -35,7 +36,6 @@ import Standard.Database.Internal.Replace_Params.Replace_Params import Standard.Database.Internal.SQL_Type_Mapping.SQL_Type_Mapping import Standard.Database.Internal.SQL_Type_Reference.SQL_Type_Reference import Standard.Database.Internal.Statement_Setter.Statement_Setter -import Standard.Database.Dialect_Flag.Dialect_Flag import Standard.Database.SQL.SQL_Builder import Standard.Database.SQL.SQL_Fragment import Standard.Database.SQL_Statement.SQL_Statement diff --git a/distribution/lib/Standard/Snowflake/0.0.0-dev/src/Internal/Snowflake_Dialect.enso b/distribution/lib/Standard/Snowflake/0.0.0-dev/src/Internal/Snowflake_Dialect.enso index 9f1d7862168..01983b6e0ea 100644 --- a/distribution/lib/Standard/Snowflake/0.0.0-dev/src/Internal/Snowflake_Dialect.enso +++ b/distribution/lib/Standard/Snowflake/0.0.0-dev/src/Internal/Snowflake_Dialect.enso @@ -17,6 +17,7 @@ import Standard.Database.Connection.Connection.Connection import Standard.Database.DB_Column.DB_Column import Standard.Database.DB_Table.DB_Table import Standard.Database.Dialect +import Standard.Database.Dialect_Flag.Dialect_Flag import Standard.Database.Feature.Feature import Standard.Database.Internal.Aggregate_Helper import Standard.Database.Internal.Aggregate_Helper.Aggregate_With_Helper_Expressions @@ -39,7 +40,6 @@ import Standard.Database.Internal.Replace_Params.Replace_Params import Standard.Database.Internal.SQL_Type_Mapping.SQL_Type_Mapping import Standard.Database.Internal.SQL_Type_Reference.SQL_Type_Reference import Standard.Database.Internal.Statement_Setter.Statement_Setter -import Standard.Database.Dialect_Flag.Dialect_Flag import Standard.Database.SQL.SQL_Builder import Standard.Database.SQL.SQL_Fragment import Standard.Database.SQL_Statement.SQL_Statement diff --git a/distribution/lib/Standard/Table/0.0.0-dev/src/Columns_To_Add.enso b/distribution/lib/Standard/Table/0.0.0-dev/src/Columns_To_Add.enso index 252c37f838d..3653d05dc4e 100644 --- a/distribution/lib/Standard/Table/0.0.0-dev/src/Columns_To_Add.enso +++ b/distribution/lib/Standard/Table/0.0.0-dev/src/Columns_To_Add.enso @@ -1,5 +1,5 @@ from Standard.Base import all -from Standard.Base.Metadata import make_single_choice, Widget +from Standard.Base.Metadata import Display, make_single_choice, Widget ## PRIVATE type Columns_To_Add @@ -10,8 +10,8 @@ type Columns_To_Add First columns:Integer=1 ## PRIVATE - default_widget -> Widget = - make_single_choice [["All_Columns", "..All_Columns"], ["First", "..First"]] + default_widget display:Display=..When_Modified -> Widget = + make_single_choice [["All_Columns", "..All_Columns"], ["First", "..First"]] display=display ## PRIVATE Gets the number of columns to add (or Nothing if all columns). diff --git a/distribution/lib/Standard/Table/0.0.0-dev/src/Columns_To_Keep.enso b/distribution/lib/Standard/Table/0.0.0-dev/src/Columns_To_Keep.enso index 39a71ccc711..c6487b01923 100644 --- a/distribution/lib/Standard/Table/0.0.0-dev/src/Columns_To_Keep.enso +++ b/distribution/lib/Standard/Table/0.0.0-dev/src/Columns_To_Keep.enso @@ -1,5 +1,5 @@ from Standard.Base import Text, Vector -from Standard.Base.Metadata import make_single_choice, Widget +from Standard.Base.Metadata import Display, make_single_choice, Widget ## Specifies which columns to keep in a union operation. type Columns_To_Keep @@ -30,6 +30,6 @@ type Columns_To_Keep The default widget for `Columns_To_Keep`. It does not display the internal `In_Any_Warn_On_Missing` variant, since that variant is only meant to be used as the default value. - default_widget -> Widget = - make_single_choice <| + default_widget display:Display=..When_Modified -> Widget = + make_single_choice display=display <| ["In_Any", "In_All", "In_List"].map c-> [c, ".."+c] diff --git a/distribution/lib/Standard/Table/0.0.0-dev/src/Rows_To_Read.enso b/distribution/lib/Standard/Table/0.0.0-dev/src/Rows_To_Read.enso index 9faf724c840..2a4492e9b06 100644 --- a/distribution/lib/Standard/Table/0.0.0-dev/src/Rows_To_Read.enso +++ b/distribution/lib/Standard/Table/0.0.0-dev/src/Rows_To_Read.enso @@ -1,5 +1,5 @@ from Standard.Base import all -from Standard.Base.Metadata import make_single_choice, Widget +from Standard.Base.Metadata import Display, make_single_choice, Widget import project.Errors.Not_All_Rows_Downloaded import project.Table.Table @@ -18,8 +18,8 @@ type Rows_To_Read First_With_Warning rows:Integer=1000 ## PRIVATE - default_widget -> Widget = - make_single_choice [["All_Rows", "..All_Rows"], ["First", "..First"]] + default_widget display:Display=..When_Modified -> Widget = + make_single_choice [["All_Rows", "..All_Rows"], ["First", "..First"]] display=display ## PRIVATE Gets the number of rows to read (or Nothing if all rows). diff --git a/distribution/lib/Standard/Table/0.0.0-dev/src/Simple_Expression.enso b/distribution/lib/Standard/Table/0.0.0-dev/src/Simple_Expression.enso index 74de6d7c30a..3987644ea67 100644 --- a/distribution/lib/Standard/Table/0.0.0-dev/src/Simple_Expression.enso +++ b/distribution/lib/Standard/Table/0.0.0-dev/src/Simple_Expression.enso @@ -66,8 +66,7 @@ type Simple_Expression ## PRIVATE Create a widget for operation - default_widget : Table_Ref -> Display -> Widget - default_widget table:Table_Ref display=Display.Always = + default_widget table:Table_Ref display:Display=..Always -> Widget = with_everything = Widget_Helpers.make_column_ref_by_name_selector table add_text=True add_number=True add_boolean=True add_date=True add_time=True add_date_time=True add_nothing=True with_all_types = Widget_Helpers.make_column_ref_by_name_selector table add_text=True add_number=True add_boolean=True add_date=True add_time=True add_date_time=True with_number_text = Widget_Helpers.make_column_ref_by_name_selector table add_text=True add_number=True diff --git a/distribution/lib/Standard/Test/0.0.0-dev/src/Faker.enso b/distribution/lib/Standard/Test/0.0.0-dev/src/Faker.enso index c033d79ddfd..35f2196fcad 100644 --- a/distribution/lib/Standard/Test/0.0.0-dev/src/Faker.enso +++ b/distribution/lib/Standard/Test/0.0.0-dev/src/Faker.enso @@ -125,7 +125,7 @@ type Faker Arguments - bit_length: specifies the range of values to select from. The values will be between -2^bit_length and 2^bit_length. - large_integer : Integer -> Integer -> Integer + large_integer : Integer -> Integer large_integer self bit_length = BigInteger.new bit_length 0 self.generator @@ -141,7 +141,7 @@ type Faker Arguments - bit_length: specifies the range of values to select from. The values will be between -2^bit_length and 2^bit_length. - decimal : Integer -> Integer -> Integer + decimal : Integer -> Integer decimal self bit_length = (self.large_integer bit_length) + self.float diff --git a/distribution/lib/Standard/Visualization/0.0.0-dev/src/Table/Visualization.enso b/distribution/lib/Standard/Visualization/0.0.0-dev/src/Table/Visualization.enso index e0c3db10496..d909ba4bf0b 100644 --- a/distribution/lib/Standard/Visualization/0.0.0-dev/src/Table/Visualization.enso +++ b/distribution/lib/Standard/Visualization/0.0.0-dev/src/Table/Visualization.enso @@ -59,7 +59,7 @@ prepare_visualization y max_rows=1000 = Column Limit max_columns = 250 -##PRIVATE +## PRIVATE whitespace_count : Column -> Integer | Nothing whitespace_count col = find_whitespace col = diff --git a/distribution/lib/Standard/Visualization/0.0.0-dev/src/Widgets.enso b/distribution/lib/Standard/Visualization/0.0.0-dev/src/Widgets.enso index 1a9c60c4db7..79cf058b1d9 100644 --- a/distribution/lib/Standard/Visualization/0.0.0-dev/src/Widgets.enso +++ b/distribution/lib/Standard/Visualization/0.0.0-dev/src/Widgets.enso @@ -1,6 +1,6 @@ from Standard.Base import all -import Standard.Base.Metadata.Widget import Standard.Base.Errors.Common.Not_Invokable +import Standard.Base.Metadata.Widget from Standard.Base.Logging import all from Standard.Base.Meta import Instrumentor