Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into wip/mwu/cloud-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mwu-tow committed Feb 1, 2023
2 parents 3c2aaf6 + a618dd6 commit e9ca339
Show file tree
Hide file tree
Showing 65 changed files with 1,179 additions and 698 deletions.
9 changes: 6 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@
API and added builders for customizing less common settings.][3516]
- [Allow control of sort direction in `First` and `Last` aggregations.][3517]
- [Implemented `Text.write`, replacing `File.write_text`.][3518]
- [Removed obsolete `select`, `group`, `sort` and releated types from tables.]
[3519]
- [Removed obsolete `select`, `group`, `sort` and releated types from
tables.][3519]
- [Removed obsolete `from_xls` and `from_xlsx` functions. Added support for
reading column names from first row in `File_Format.Excel`][3523]
- [Added `File_Format.Delimited` support to `Table.write` for new files.][3528]
Expand Down Expand Up @@ -298,6 +298,8 @@
backend.][4063]
- [Updated `Text.starts_with`, `Text.ends_with` and `Text.contains` to new
simpler API.][4078]
- [Updated `Table.set` to new API. New `Column.parse` function and added case
sensitivity to `Filter_Condition` and column functions.][4097]

[debug-shortcuts]:
https://github.com/enso-org/enso/blob/develop/app/gui/docs/product/shortcuts.md#debug
Expand Down Expand Up @@ -459,6 +461,7 @@
[4052]: https://github.com/enso-org/enso/pull/4052
[4063]: https://github.com/enso-org/enso/pull/4063
[4078]: https://github.com/enso-org/enso/pull/4078
[4097]: https://github.com/enso-org/enso/pull/4097

#### Enso Compiler

Expand Down Expand Up @@ -590,7 +593,7 @@
[3631]: https://github.com/enso-org/enso/pull/3631
[3633]: https://github.com/enso-org/enso/pull/3633
[3637]: https://github.com/enso-org/enso/pull/3637
[3637]: https://github.com/enso-org/enso/pull/3638
[3638]: https://github.com/enso-org/enso/pull/3638
[3641]: https://github.com/enso-org/enso/pull/3641
[3658]: https://github.com/enso-org/enso/pull/3658
[3671]: https://github.com/enso-org/enso/pull/3671
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,14 +179,14 @@ class TableVisualization extends Visualization {
if (content instanceof Object) {
const type = content.type
if (type === 'Date') {
to_render = new Date(content.year, content.month, content.day)
to_render = new Date(content.year, content.month - 1, content.day)
.toISOString()
.substring(0, 10)
} else if (type === 'Time_Of_Day') {
const js_date = new Date(
0,
0,
0,
1,
content.hour,
content.minute,
content.second,
Expand All @@ -198,7 +198,7 @@ class TableVisualization extends Visualization {
} else if (type === 'Date_Time') {
const js_date = new Date(
content.year,
content.month,
content.month - 1,
content.day,
content.hour,
content.minute,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import project.Any.Any
import project.Data.Text.Case_Sensitivity.Case_Sensitivity
import project.Data.Text.Extensions
import project.Data.Text.Regex
import project.Data.Text.Text
Expand All @@ -7,6 +8,9 @@ import project.Nothing.Nothing

from project.Data.Boolean import all

from project.Metadata.Widget import Single_Choice
import project.Metadata.Display

polyglot java import org.enso.base.Regex_Utils

from project.Data.Filter_Condition.Filter_Condition import all
Expand Down Expand Up @@ -39,31 +43,31 @@ type Filter_Condition
It accepts a Text value to check if the value contains it. In case of
Table operations, it can accept another column - then the corresponding
values from the source column and the provided column are checked.
Starts_With (prefix:Text)
Starts_With (prefix:Text) (case_sensitivity:Case_Sensitivity=Case_Sensitivity.Default)

## Does the value end with a suffix (Text only)?

? Table Operations
It accepts a Text value to check if the value contains it. In case of
Table operations, it can accept another column - then the corresponding
values from the source column and the provided column are checked.
Ends_With (suffix:Text)
Ends_With (suffix:Text) (case_sensitivity:Case_Sensitivity=Case_Sensitivity.Default)

## Does the value contain the substring (Text only)?

? Table Operations
It accepts a Text value to check if the value contains it. In case of
Table operations, it can accept another column - then the corresponding
values from the source column and the provided column are checked.
Contains (substring:Text)
Contains (substring:Text) (case_sensitivity:Case_Sensitivity=Case_Sensitivity.Default)

## Is the substring not present in the value (Text only)?

? Table Operations
It accepts a Text value to check if the value contains it. In case of
Table operations, it can accept another column - then the corresponding
values from the source column and the provided column are checked.
Not_Contains (substring:Text)
Not_Contains (substring:Text) (case_sensitivity:Case_Sensitivity=Case_Sensitivity.Default)

## Is equal to Nothing?
Is_Nothing
Expand Down Expand Up @@ -165,10 +169,10 @@ type Filter_Condition
Not_Equal value -> !=value
Between lower upper -> elem ->
(lower <= elem) && (elem <= upper)
Starts_With prefix -> _.starts_with prefix
Ends_With suffix -> _.ends_with suffix
Contains substring -> _.contains substring
Not_Contains substring -> v-> v.contains substring . not
Starts_With prefix case_sensitivity -> _.starts_with prefix case_sensitivity
Ends_With suffix case_sensitivity -> _.ends_with suffix case_sensitivity
Contains substring case_sensitivity -> _.contains substring case_sensitivity
Not_Contains substring case_sensitivity -> v-> v.contains substring case_sensitivity . not
Is_Nothing -> elem -> case elem of
Nothing -> True
_ -> False
Expand Down Expand Up @@ -196,6 +200,13 @@ type Filter_Condition
Is_In values -> values.contains
Not_In values -> elem -> values.contains elem . not

## PRIVATE
Gets a widget set up for a Filter_Condition.
widget_for_filter_condition =
## values = ["(Filter_Condition.Equal to=_)", "(Filter_Condition.Not_Equal to=_)", "(Filter_Condition.Is_In values=_)", "(Filter_Condition.Not_In values=_)", "Filter_Condition.Is_True", "Filter_Condition.Is_False", "Filter_Condition.Is_Nothing", "Filter_Condition.Not_Nothing", "Filter_Condition.Is_Empty", "Filter_Condition.Not_Empty", "(Filter_Condition.Less than=_)", "(Filter_Condition.Equal_Or_Less than=_)", "(Filter_Condition.Greater than=_)", "(Filter_Condition.Equal_Or_Greater than=_)", "(Filter_Condition.Between lower=_ upper=_)", "(Filter_Condition.Starts_With prefix=_)", "(Filter_Condition.Ends_With suffix=_)", "(Filter_Condition.Contains substring=_)", "(Filter_Condition.Not_Contains substring=_)", "(Filter_Condition.Like pattern=_)", "(Filter_Condition.Not_Like pattern=_)"]
values = ["(Filter_Condition.Equal _)", "(Filter_Condition.Not_Equal _)", "(Filter_Condition.Is_In _)", "(Filter_Condition.Not_In _)", "Filter_Condition.Is_True", "Filter_Condition.Is_False", "Filter_Condition.Is_Nothing", "Filter_Condition.Not_Nothing", "Filter_Condition.Is_Empty", "Filter_Condition.Not_Empty", "(Filter_Condition.Less _)", "(Filter_Condition.Equal_Or_Less _)", "(Filter_Condition.Greater _)", "(Filter_Condition.Equal_Or_Greater _)", "(Filter_Condition.Between _ _)", "(Filter_Condition.Starts_With _)", "(Filter_Condition.Ends_With _)", "(Filter_Condition.Contains _)", "(Filter_Condition.Not_Contains _)", "(Filter_Condition.Like _)", "(Filter_Condition.Not_Like _)"]
Single_Choice values display=Display.Always

## PRIVATE
sql_like_to_regex sql_pattern =
regex_pattern = Regex_Utils.sql_like_pattern_to_regex sql_pattern
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ Text.starts_with self prefix case_sensitivity=Case_Sensitivity.Sensitive = case
Case_Sensitivity.Default -> self.starts_with prefix Case_Sensitivity.Sensitive
Case_Sensitivity.Sensitive -> Text_Utils.starts_with self prefix
Case_Sensitivity.Insensitive locale ->
self.take (Index_Sub_Range.First prefix.length) . equals_ignore_case prefix locale=locale
self.take (Index_Sub_Range.First prefix.length) . equals_ignore_case prefix locale=locale

## ALIAS Check Suffix

Expand Down Expand Up @@ -770,7 +770,7 @@ Text.ends_with self suffix case_sensitivity=Case_Sensitivity.Sensitive = case ca
Case_Sensitivity.Default -> self.ends_with suffix Case_Sensitivity.Sensitive
Case_Sensitivity.Sensitive -> Text_Utils.ends_with self suffix
Case_Sensitivity.Insensitive locale ->
self.take (Index_Sub_Range.Last suffix.length) . equals_ignore_case suffix locale=locale
self.take (Index_Sub_Range.Last suffix.length) . equals_ignore_case suffix locale=locale

## ALIAS Contains

Expand Down Expand Up @@ -812,7 +812,7 @@ Text.contains self term="" case_sensitivity=Case_Sensitivity.Sensitive = case ca
Case_Sensitivity.Default -> self.contains term Case_Sensitivity.Sensitive
Case_Sensitivity.Sensitive -> Text_Utils.contains self term
Case_Sensitivity.Insensitive locale ->
Text_Utils.contains_case_insensitive self term locale.java_locale
Text_Utils.contains_case_insensitive self term locale.java_locale

## Takes an integer and returns a new text, consisting of `count` concatenated
copies of `self`.
Expand Down
42 changes: 30 additions & 12 deletions distribution/lib/Standard/Base/0.0.0-dev/src/Metadata.enso
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,16 @@ type Display
## Parameter is only shown on the expanded view.
Expanded_Only

type Parameter_Type
Parameter value:Text label:Text="code" parameters:(Vector Widget)=[] icon:Text=""
type Choice
## Describes an entry in a Single_Choice or Multiple_Choice widget.

Fields:
- value: The code to insert for the entry.
- label: The text to display for the entry. By default, the `value` is used.
- parameters: A list of parameters for the arguments for the `value`.
This provides the structure needed for nested widgets.
- icon: The icon to display for the entry. By default, no icon is used.
Option value:Text label:Text=value parameters:(Vector (Pair Text Widget))=[] icon:Text=""

type File_Action
## The File or Folder is for reading from.
Expand All @@ -27,30 +35,40 @@ type File_Action
## The File or Folder is for writing to.
Save


type Widget
## Describe a code parameter.
Code_Input label:(Nothing|Text)=Nothing display:Display=Display.When_Modified
Code_Input label:(Nothing | Text)=Nothing display:Display=Display.When_Modified

## Describe a boolean parameter.
Boolean_Input label:Nothing|Text=Nothing display:Display=Display.When_Modified
Boolean_Input label:(Nothing | Text)=Nothing display:Display=Display.When_Modified

## Describe a numeric parameter.
Numeric_Input label:Nothing|Text=Nothing display:Display=Display.When_Modified minimum:Integer|Nothing=Nothing maximum:Integer|Nothing=Nothing step:Number=1 decimal_places:Integer=0 allow_outside:Boolean=True
Numeric_Input label:(Nothing | Text)=Nothing display:Display=Display.When_Modified minimum:Integer|Nothing=Nothing maximum:Integer|Nothing=Nothing step:Number=1 decimal_places:Integer=0 allow_outside:Boolean=True

## Describes a text widget.
Text_Input label:Nothing|Text=Nothing display:Display=Display.When_Modified quote_values:Boolean=True suggestions:(Vector Text)=[]
Text_Input label:(Nothing | Text)=Nothing display:Display=Display.When_Modified quote_values:Boolean=True suggestions:(Vector Text)=[]

## Describes a single value widget (drowdown).

## Describes a single value widget.
Single_Choice values:(Vector Parameter) label:Nothing|Text=Nothing display:Display=Display.When_Modified quote_values:Boolean=False allow_custom:Boolean=True
Fields:
- values: A list of choices to display.
If a `Text` value is used, it is treated as `Option value:Text`.
- label: The text to display for the widget.
By default, the parameter name is used.
- display: The display mode for the parameter.
- quote_values: Should the values be quoted automatically?
- allow_custom: Allow the user to enter a value not in the list?
Single_Choice values:(Vector (Choice | Text)) label:(Nothing | Text)=Nothing display:Display=Display.When_Modified quote_values:Boolean=False allow_custom:Boolean=True

## Describes a multi value widget.
Multiple_Choice values:(Vector Parameter) label:Nothing|Text=Nothing display:Display=Display.When_Modified quote_values:Boolean=False
Multiple_Choice values:(Vector (Choice | Text)) label:(Nothing | Text)=Nothing display:Display=Display.When_Modified quote_values:Boolean=False

## Describes a list editor widget.
Vector_Editor item_editor:Widget values:((Vector Parameter)|Nothing)=Nothing label:Nothing|Text=Nothing display:Display=Display.When_Modified
Vector_Editor item_editor:Widget values:((Vector (Choice | Text)) | Nothing)=Nothing label:(Nothing | Text)=Nothing display:Display=Display.When_Modified

## Describes a folder chooser.
Folder_Browse label:Nothing|Text=Nothing display:Display=Display.When_Modified
Folder_Browse label:(Nothing | Text)=Nothing display:Display=Display.When_Modified

## Describes a file chooser.
File_Browse label:Nothing|Text=Nothing display:Display=Display.When_Modified action:File_Action=File_Action.Open file_types:(Vector Pair)=[Pair "All Files" "*.*"]
File_Browse label:(Nothing | Text)=Nothing display:Display=Display.When_Modified action:File_Action=File_Action.Open file_types:(Vector Pair)=[Pair.new "All Files" "*.*"]
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,13 @@ type Postgres_Options
Arguments:
- host: The hostname of the database server (defaults to localhost).
- port: The port of the database server (defaults to 5432).
- database: The database to connect to. If empty, the default database will be used.
- schema: The schema to connect to. If empty, the default schema will be used.
- credentials: The credentials to use for the connection (defaults to PGPass or No Authentication).
- database: The database to connect to. By default, it will use the
database provided in `PGDATABASE` environment variable, or if that is
not defined, it will fall back to a default database name: `postgres`.
- schema: The schema to connect to. If empty, the default schema will be
used.
- credentials: The credentials to use for the connection (defaults to
PGPass or No Authentication).
- use_ssl: Whether to use SSL (defaults to `SSL_Mode.Prefer`).
- client_cert: The client certificate to use or `Nothing` if not needed.
Postgres (host:Text=default_postgres_host) (port:Integer=default_postgres_port) (database:Text=default_postgres_database) (schema:Text="") (credentials:(Credentials|Nothing)=Nothing) (use_ssl:SSL_Mode=SSL_Mode.Prefer) (client_cert:(Client_Certificate|Nothing)=Nothing)
Expand Down Expand Up @@ -97,4 +101,4 @@ default_postgres_port =
port -> Integer.parse port . catch Number_Parse_Error.Error (_->hardcoded_port)

## PRIVATE
default_postgres_database = Environment.get "PGDATABASE" ""
default_postgres_database = Environment.get "PGDATABASE" "postgres"
Loading

0 comments on commit e9ca339

Please sign in to comment.