<commit_before><!--
* 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.
-->

<div ng-controller="CubeRefreshCtrl">
<div class="row">
    <div class="col-xs-8">
      <ng-form name="forms.model_setting_form" novalidate>
        <!--Cube Partition Type-->
        <div class="form-group" ng-hide="true">
            <div class="row">
                <label class="control-label col-xs-12 col-sm-3 no-padding-right font-color-default"><b>Partition Type</b></label>
                <div class="col-xs-12 col-sm-6">
                    <select class="form-control"
                        ng-if="state.mode=='edit'"
                        chosen ng-model="modelsManager.selectedModel.partition_desc.partition_type"
                        ng-options="ddt as ddt for ddt in cubeConfig.cubePartitionTypes">
                        <option value=""></option>
                    </select>
                    <span ng-if="state.mode=='view'">{{modelsManager.selectedModel.partition_desc.partition_type}}</span>
                </div>
            </div>
        </div>

        <!--Partition Column-->
        <div class="form-group">
            <div class="row">
                <label class="control-label col-xs-12 col-sm-3 no-padding-right font-color-default"><b>Partition Date Column</b></label>
                <div class="col-xs-12 col-sm-6">

                    <select style="width: 100%" chosen data-placeholder="e.g. DEFAULT.TEST_KYLIN_FACT.CAL_DT"
                            ng-model="modelsManager.selectedModel.partition_desc.partition_date_column"
                            ng-if="state.mode=='edit'"
                            data-placement=""
                            ng-options="modelsManager.selectedModel.fact_table+'.'+columns.name as modelsManager.selectedModel.fact_table+'.'+columns.name for columns in getPartitonColumns(modelsManager.selectedModel.fact_table)" >
                        <option value="">--Select Partition Column--</option>
                    </select>
                    <small class="help-block text-red" ng-show="state.mode=='edit'">(Column Type should be DATE or TIMESTAMP Type)</small>

                    <span ng-if="state.mode=='view'">
                        {{!!(modelsManager.selectedModel.partition_desc.partition_date_column)?modelsManager.selectedModel.partition_desc.partition_date_column: ''}}</span>
                </div>
            </div>
        </div>

        <!--Date Format-->
        <div class="form-group">
          <div class="row">
            <label class="control-label col-xs-12 col-sm-3 no-padding-right font-color-default"><b>Date Format</b></label>
            <div class="col-xs-12 col-sm-6">
              <select style="width: 100%" chosen
                      ng-required="modelsManager.selectedModel.partition_desc.partition_date_format"
                      ng-model="modelsManager.selectedModel.partition_desc.partition_date_format"
                      ng-if="state.mode=='edit'"
                      data-placement=""
                      ng-options="ddt as ddt for ddt in cubeConfig.partitionDateFormatOpt">
                <option value="">--Select Date Format--</option>
              </select>
              <span ng-if="state.mode=='view'&&modelsManager.selectedModel.partition_desc.partition_date_column">{{(modelsManager.selectedModel.partition_desc.partition_date_format)}}</span>
            </div>
          </div>
        </div>

          <div class="form-group" ng-show="userService.hasRole('ROLE_ADMIN')">
              <div class="row">
                  <label class="control-label col-xs-12 col-sm-3 no-padding-right font-color-default"><b>Cube Size</b></label>
                  <div class="col-xs-12 col-sm-6">
                      <select class="form-control"
                              ng-if="state.mode=='edit'"
                              chosen ng-model="modelsManager.selectedModel.capacity"
                              ng-options="ddt as ddt for ddt in cubeConfig.cubeCapacities">
                          <option value=""></option>
                      </select>
                      <span ng-if="state.mode=='view'">{{modelsManager.selectedModel.capacity}}</span>
                  </div>
              </div>
          </div>

        <!--Filter Condition-->
        <div class="form-group">
            <div class="row">
                <label class="control-label col-xs-12 col-sm-3 no-padding-right font-color-default"><b>Filter</b></label>
                <div class="col-xs-12 col-sm-6">

                    <!--edit mode-->
                    <div class="form-group" ng-if="state.mode=='edit'"
                         style="font-family:'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro'">
                        <label for="filter_condition"
                               style="color: #930f80;"><b>WHERE</b></label>
                        <textarea id="filter_condition" type="text"
                                  style="height:150px"
                                  class="form-control box-default"
                                  placeholder="Please input WHERE clause without typing 'WHERE'"
                                  ng-model="modelsManager.selectedModel.filter_condition">
                        </textarea>
                    </div>

                    <!--view mode-->
                    <div class="form-group row" ng-if="state.mode=='view'"
                         style="font-family:'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro'">
                        <div ng-if="modelsManager.selectedModel.filter_condition" class="col-md-11 col-md-offset-1">
                            <p style="color: #930f80;"><b>WHERE</b></p>
                            <span>{{modelsManager.selectedModel.filter_condition}}</span>
                        </div>
                    </div>

                </div>
            </div>
        </div>
       </ng-form>
    </div>

    <div class="col-xs-4">
        <div class="box box-solid">
            <div class="box-header">
                <h4 class="box-title">Tips</h4>
            </div>
            <div class="box-body">
                <div class="row">
                    <div class="col-xs-12">
                        <ol class="text-info">
                            <li>Partition date column not required,leave as default if cube always need full build</li>
                            <li>Partition date column will select 'date' type column from fact table</li>
                            <li>Where clause to filter data from source</li>
                            <li>Do not include date column which will be used for incremental refresh</li>
                            <li>Do not include "Where"</li>
                            <li>Please verify SQL when finish cube design from SQL view of cube</li>
                        </ol>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</div>
<commit_msg>minor, UI fix edit model setting page display issue<commit_after><!--
* 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.
-->

<div class="row">
    <div class="col-xs-8">
      <ng-form name="forms.model_setting_form" novalidate>
        <!--Cube Partition Type-->
        <div class="form-group" ng-hide="true">
            <div class="row">
                <label class="control-label col-xs-12 col-sm-3 no-padding-right font-color-default"><b>Partition Type</b></label>
                <div class="col-xs-12 col-sm-6">
                    <select class="form-control"
                        ng-if="state.mode=='edit'"
                        chosen ng-model="modelsManager.selectedModel.partition_desc.partition_type"
                        ng-options="ddt as ddt for ddt in cubeConfig.cubePartitionTypes">
                        <option value=""></option>
                    </select>
                    <span ng-if="state.mode=='view'">{{modelsManager.selectedModel.partition_desc.partition_type}}</span>
                </div>
            </div>
        </div>

        <!--Partition Column-->
        <div class="form-group">
            <div class="row">
                <label class="control-label col-xs-12 col-sm-3 no-padding-right font-color-default"><b>Partition Date Column</b></label>
                <div class="col-xs-12 col-sm-6">

                    <select style="width: 100%" chosen data-placeholder="e.g. DEFAULT.TEST_KYLIN_FACT.CAL_DT"
                            ng-model="modelsManager.selectedModel.partition_desc.partition_date_column"
                            ng-if="state.mode=='edit'"
                            data-placement=""
                            ng-options="modelsManager.selectedModel.fact_table+'.'+columns.name as modelsManager.selectedModel.fact_table+'.'+columns.name for columns in getPartitonColumns(modelsManager.selectedModel.fact_table)" >
                        <option value="">--Select Partition Column--</option>
                    </select>
                    <small class="help-block text-red" ng-show="state.mode=='edit'">(Column Type should be DATE or TIMESTAMP Type)</small>

                    <span ng-if="state.mode=='view'">
                        {{!!(modelsManager.selectedModel.partition_desc.partition_date_column)?modelsManager.selectedModel.partition_desc.partition_date_column: ''}}</span>
                </div>
            </div>
        </div>

        <!--Date Format-->
        <div class="form-group">
          <div class="row">
            <label class="control-label col-xs-12 col-sm-3 no-padding-right font-color-default"><b>Date Format</b></label>
            <div class="col-xs-12 col-sm-6">
              <select style="width: 100%" chosen
                      ng-required="modelsManager.selectedModel.partition_desc.partition_date_format"
                      ng-model="modelsManager.selectedModel.partition_desc.partition_date_format"
                      ng-if="state.mode=='edit'"
                      data-placement=""
                      ng-options="ddt as ddt for ddt in cubeConfig.partitionDateFormatOpt">
                <option value="">--Select Date Format--</option>
              </select>
              <span ng-if="state.mode=='view'&&modelsManager.selectedModel.partition_desc.partition_date_column">{{(modelsManager.selectedModel.partition_desc.partition_date_format)}}</span>
            </div>
          </div>
        </div>

          <div class="form-group" ng-show="userService.hasRole('ROLE_ADMIN')">
              <div class="row">
                  <label class="control-label col-xs-12 col-sm-3 no-padding-right font-color-default"><b>Cube Size</b></label>
                  <div class="col-xs-12 col-sm-6">
                      <select class="form-control"
                              ng-if="state.mode=='edit'"
                              chosen ng-model="modelsManager.selectedModel.capacity"
                              ng-options="ddt as ddt for ddt in cubeConfig.cubeCapacities">
                          <option value=""></option>
                      </select>
                      <span ng-if="state.mode=='view'">{{modelsManager.selectedModel.capacity}}</span>
                  </div>
              </div>
          </div>

        <!--Filter Condition-->
        <div class="form-group">
            <div class="row">
                <label class="control-label col-xs-12 col-sm-3 no-padding-right font-color-default"><b>Filter</b></label>
                <div class="col-xs-12 col-sm-6">

                    <!--edit mode-->
                    <div class="form-group" ng-if="state.mode=='edit'"
                         style="font-family:'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro'">
                        <label for="filter_condition"
                               style="color: #930f80;"><b>WHERE</b></label>
                        <textarea id="filter_condition" type="text"
                                  style="height:150px"
                                  class="form-control box-default"
                                  placeholder="Please input WHERE clause without typing 'WHERE'"
                                  ng-model="modelsManager.selectedModel.filter_condition">
                        </textarea>
                    </div>

                    <!--view mode-->
                    <div class="form-group row" ng-if="state.mode=='view'"
                         style="font-family:'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro'">
                        <div ng-if="modelsManager.selectedModel.filter_condition" class="col-md-11 col-md-offset-1">
                            <p style="color: #930f80;"><b>WHERE</b></p>
                            <span>{{modelsManager.selectedModel.filter_condition}}</span>
                        </div>
                    </div>

                </div>
            </div>
        </div>
       </ng-form>
    </div>

    <div class="col-xs-4">
        <div class="box box-solid">
            <div class="box-header">
                <h4 class="box-title">Tips</h4>
            </div>
            <div class="box-body">
                <div class="row">
                    <div class="col-xs-12">
                        <ol class="text-info">
                            <li>Partition date column not required,leave as default if cube always need full build</li>
                            <li>Partition date column will select 'date' type column from fact table</li>
                            <li>Where clause to filter data from source</li>
                            <li>Do not include date column which will be used for incremental refresh</li>
                            <li>Do not include "Where"</li>
                            <li>Please verify SQL when finish cube design from SQL view of cube</li>
                        </ol>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

{'fraction_non_alphanumeric': 0.12957346583209653, 'fraction_numerical': 0.008001548686842615, 'mean_word_length': 1.6492307692307693, 'pattern_counts': {'":': 0, '<': 275, '<?xml version=': 0, '>': 275, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7148303', 'n_tokens_mistral': 4153, 'n_tokens_neox': 3865, 'n_words': 905}