# 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.

# This file is used to configure the GUI shown in users' browser.
# To add a new configuration:
#   1. Add a new property, its default value and the environment variable name in the gui section in this file
#   2. Add the corresponding parsing logic in core/config/src/main/scala/org/apache/texera/config/GuiConfig.scala
#   3. Add the sending logic in core/src/main/scala/org/apache/texera/web/resource/UserConfigResource.scala
#   4. Add the frontend definition in frontend/src/app/common/type/gui-config.ts and frontend/src/app/common/service/gui-config.service.mock.ts
# To change the default value of a configuration:
#   1. Change the default value in the gui section in this file
#   2. Change the default value in frontend/src/app/common/service/gui-config.service.mock.ts
gui {
  login {
    # whether local login is enabled
    local-login = true
    local-login = ${?GUI_LOGIN_LOCAL_LOGIN}

    # whether google login is enabled
    google-login = true
    google-login = ${?GUI_LOGIN_GOOGLE_LOGIN}

    # Can be configured as { username: "texera", password: "password" }
    # If configured, this will be automatically filled into the local login input box
    default-local-user {
      username = ""
      username = ${?GUI_LOGIN_DEFAULT_LOCAL_USER_USERNAME}

      password = ""
      password = ${?GUI_LOGIN_DEFAULT_LOCAL_USER_PASSWORD}
    }
  }

  workflow-workspace {
    # whether user preset feature is enabled, requires user system to be enabled
    user-preset-enabled = false
    user-preset-enabled = ${?GUI_WORKFLOW_WORKSPACE_USER_PRESET_ENABLED}

    # whether export execution result is supported
    export-execution-result-enabled = false
    export-execution-result-enabled = ${?GUI_WORKFLOW_WORKSPACE_EXPORT_EXECUTION_RESULT_ENABLED}

    # whether automatically correcting attribute name on change is enabled
    # see AutoAttributeCorrectionService for more details
    auto-attribute-correction-enabled = true
    auto-attribute-correction-enabled = ${?GUI_WORKFLOW_WORKSPACE_AUTO_ATTRIBUTE_CORRECTION_ENABLED}

    # default data transfer batch size for workflows
    default-data-transfer-batch-size = 400
    default-data-transfer-batch-size = ${?GUI_WORKFLOW_WORKSPACE_DEFAULT_DATA_TRANSFER_BATCH_SIZE}

    # default execution mode for workflows, can be either MATERIALIZED or PIPELINED
    default-execution-mode = PIPELINED
    default-execution-mode = ${?GUI_WORKFLOW_WORKSPACE_DEFAULT_EXECUTION_MODE}

    # whether selecting files from datasets instead of the local file system.
    selecting-files-from-datasets-enabled = true
    selecting-files-from-datasets-enabled = ${?GUI_WORKFLOW_WORKSPACE_SELECTING_FILES_FROM_DATASETS_ENABLED}

    # whether workflow executions tracking feature is enabled
    workflow-executions-tracking-enabled = false
    workflow-executions-tracking-enabled = ${?GUI_WORKFLOW_WORKSPACE_WORKFLOW_EXECUTIONS_TRACKING_ENABLED}

    # whether linkBreakpoint is supported
    link-breakpoint-enabled = true
    link-breakpoint-enabled = ${?GUI_WORKFLOW_WORKSPACE_LINK_BREAKPOINT_ENABLED}

    # whether rendering jointjs components asynchronously
    async-rendering-enabled = false
    async-rendering-enabled = ${?GUI_WORKFLOW_WORKSPACE_ASYNC_RENDERING_ENABLED}

    # whether time-travel is enabled
    timetravel-enabled = false
    timetravel-enabled = ${?GUI_WORKFLOW_WORKSPACE_TIMETRAVEL_ENABLED}

    # Whether to connect to local or production shared editing server. Set to true if you have
    # reverse proxy set up for y-websocket.
    production-shared-editing-server = false
    production-shared-editing-server = ${?GUI_WORKFLOW_WORKSPACE_PRODUCTION_SHARED_EDITING_SERVER}

    # The port of the python language server. If not set, no port will be used in the final url
    python-language-server-port = 3000
    python-language-server-port = ${?GUI_WORKFLOW_WORKSPACE_PYTHON_LANGUAGE_SERVER_PORT}

    # maximum number of console messages to store per operator
    operator-console-message-buffer-size = 100
    operator-console-message-buffer-size = ${?GUI_WORKFLOW_WORKSPACE_OPERATOR_CONSOLE_MESSAGE_BUFFER_SIZE}

    # whether to send email notification when workflow execution is completed/failed/paused/killed
    workflow-email-notification-enabled = false
    workflow-email-notification-enabled = ${?GUI_WORKFLOW_WORKSPACE_WORKFLOW_EMAIL_NOTIFICATION_ENABLED}

    # amount of time to be elapsed in minutes before user is detected as inactive
    active-time-in-minutes = 15
    active-time-in-minutes = ${?GUI_WORKFLOW_WORKSPACE_ACTIVE_TIME_IN_MINUTES}

    # whether AI copilot feature is enabled
    copilot-enabled = false
    copilot-enabled = ${?GUI_WORKFLOW_WORKSPACE_COPILOT_ENABLED}

    # the limit of columns to be displayed in the result table
    limit-columns = 15
    limit-columns = ${?GUI_WORKFLOW_WORKSPACE_LIMIT_COLUMNS}
  }
}