epugh commented on a change in pull request #42: URL: https://github.com/apache/solr/pull/42#discussion_r637090384
########## File path: solr/webapp/web/partials/schema-designer.html ########## @@ -0,0 +1,919 @@ +<!-- +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 id="designer"> + <div class="clearfix"> + <div id="designer-top"> + <div id="actions" class="actions"> + + <div id="schema-selector"> + <div class="left"> + <select id="select-schema" placeholder-text-single="'Schema Selector'" + chosen + ng-model="currentSchema" + ng-change="loadSchema()" + ng-options="schema for schema in schemas"></select> + <button id="add" class="action" ng-click="showNewSchemaDialog()"><span>New Schema</span></button> + </div> + <div class="middle"> + <div id="schema-actions" class="schema-actions clearfix"> + <button id="addField" class="action" ng-click="toggleAddField('field')" ng-show="showSchemaActions"><span>Add Field</span></button> + <button id="addFieldType" class="action" ng-click="toggleAddField('type')" ng-show="showSchemaActions"><span>Add Field Type</span></button> + <div id="updateStatusMessage" ng-class="{working: updateWorking}" ng-show="updateStatusMessage"><span>{{updateStatusMessage}}</span></div> + + <div class="action add" data-rel="add" ng-show="showAddField" escape-pressed="hideAll()"> + + <p class="clearfix"><label for="add_name">name:</label> + <input type="text" id="add_name" ng-model="newField.name" focus-when="showAddField" placeholder="enter a name"></p> + + <p class="clearfix" ng-show="adding=='field'"><label for="add_type">field type:</label> + <select chosen type="text" id="add_type" ng-model="newField.type" ng-options="type for type in types"></select> + </p> + <p class="clearfix" ng-show="adding=='type'"><label for="add_class">class:</label> + <input type="text" id="add_class" ng-model="newField.class" placeholder="class name"></p> + + <p class="clearfix" ng-show="adding=='field'"><label for="add_default">default:</label> + <input type="text" id="add_default" ng-model="newField.default" placeholder="enter a default value if needed"></p> + + <p class="clearfix"> + <label class="checkbox" for="add_stored"> + <input type="checkbox" ng-model="newField.stored" id="add_stored" title="Full field should be stored in index." ng-true-value="'true'" ng-false-value="'false'"> + stored + </label> + </p> + + <p class="clearfix"> + <label class="checkbox" for="add_indexed"> + <input type="checkbox" ng-model="newField.indexed" id="add_indexed" title="Field should be indexed." ng-true-value="'true'" ng-false-value="'false'"> + indexed + </label> + </p> + + <p class="clearfix"> + <label class="checkbox" for="add_uninvertible"> + <input type="checkbox" ng-model="newField.uninvertible" id="add_uninvertible" title="Field should be uninvertible, it is generally recomended to use docValues instead." + ng-true-value="'true'" ng-false-value="'false'"> + uninvertible + </label> + </p> + + <p class="clearfix"> + <label class="checkbox" for="add_docValues"> + <input type="checkbox" ng-model="newField.docValues" id="add_docValues" title="DocValues should be stored for the field." ng-true-value="'true'" ng-false-value="'false'"> + docValues + </label> + </p> + + <p class="clearfix"> + <label class="checkbox" for="add_multiValued"> + <input type="checkbox" ng-model="newField.multiValued" id="add_multiValued" title="Multiple values are allowed for this field." ng-true-value="'true'" ng-false-value="'false'"> + multiValued + </label> + </p> + + <p class="clearfix" ng-show="adding=='field'"> + <label class="checkbox" for="add_required"> + <input type="checkbox" ng-model="newField.required" id="add_required" title="Field must be provided for all documents." ng-true-value="'true'" ng-false-value="'false'"> + required + </label> + </p> + + <p class="clearfix"> + <a ng-click="showOmit=!showOmit"> + <span class="add_showhide" ng-hide="showOmit">Show omit options</span> + <span class="add_showhide open" ng-show="showOmit">Hide omit options</span> + </a> + </p> + + <div ng-show="showOmit"> + + <p class="clearfix"> + <label class="checkbox" for="add_omitNorms"> + <input type="checkbox" ng-model="newField.omitNorms" id="add_omitNorms" title="Full field should be omitNorms in index." ng-true-value="'true'" ng-false-value="'false'"> + omitNorms + </label> + </p> + + <p class="clearfix"> + <label class="checkbox" for="add_omitTermFreqAndPositions"> + <input type="checkbox" ng-model="newField.omitTermFreqAndPositions" id="add_omitTermFreqAndPositions" title="Full field should be omitTermFreqAndPositions in index." + ng-true-value="'true'" ng-false-value="'false'"> + omitTermFreqAndPositions + </label> + </p> + + <p class="clearfix"> + <label class="checkbox" for="add_omitPositions"> + <input type="checkbox" ng-model="newField.omitPositions" id="add_omitPositions" title="Full field should be omitPositions in index." ng-true-value="'true'" ng-false-value="'false'"> + omitPositions + </label> + </p> + </div> + + <p class="clearfix"> + <a ng-click="showTermVectors=!showTermVectors"> + <span class="add_showhide" ng-hide="showTermVectors">Show term vector options</span> + <span class="add_showhide open" ng-show="showTermVectors">Hide term vector options</span> + </a> + </p> + <div ng-show="showTermVectors"> + + <p class="clearfix"> + <label class="checkbox" for="add_termVectors"> + <input type="checkbox" ng-model="newField.termVectors" id="add_termVectors" title="Full field should be termVectors in index." ng-true-value="'true'" ng-false-value="'false'"> + termVectors + </label> + </p> + + <p class="clearfix"> + <label class="checkbox" for="add_termPositions"> + <input type="checkbox" ng-model="newField.termPositions" id="add_termPositions" title="Full field should be termPositions in index." ng-true-value="'true'" ng-false-value="'false'"> + termPositions + </label> + </p> + + <p class="clearfix"> + <label class="checkbox" for="add_termOffsets"> + <input type="checkbox" ng-model="newField.termOffsets" id="add_termOffsets" title="Full field should be termOffsets in index." ng-true-value="'true'" ng-false-value="'false'"> + termOffsets + </label> + </p> + + <p class="clearfix"> + <label class="checkbox" for="add_termPayloads"> + <input type="checkbox" ng-model="newField.termPayloads" id="add_termPayloads" title="Full field should be termPayloads in index." ng-true-value="'true'" ng-false-value="'false'"> + termPayloads + </label> + </p> + + </div> + + <p class="clearfix"> + <a ng-click="showSort=!showSort"> + <span class="add_showhide" ng-hide="showSort">Show sort options</span> + <span class="add_showhide open" ng-show="showSort">Show sort options</span> + </a> + </p> + <div ng-show="showSort"> + <p class="clearfix"> + <label class="checkbox" for="add_sortMissingFirst"> + <input type="checkbox" ng-model="newField.sortMissingFirst" id="add_sortMissingFirst" title="Full field should be sortMissingFirst in index." ng-true-value="'true'" + ng-false-value="'false'"> + sortMissingFirst + </label> + </p> + + <p class="clearfix"> + <label class="checkbox" for="add_sortMissingLast"> + <input type="checkbox" ng-model="newField.sortMissingLast" id="add_sortMissingLast" title="Full field should be sortMissingLast in index." ng-true-value="'true'" + ng-false-value="'false'"> + sortMissingLast + </label> + </p> + + </div> + + <p class="clearfix" ng-show="adding=='type'"> + <a ng-click="showAnalysisJson=!showAnalysisJson"> + <span class="add_showhide" ng-hide="showAnalysisJson">Show text analysis JSON</span> + <span class="add_showhide open" ng-show="showAnalysisJson">Hide text analysis JSON</span> + </a> + </p> + <div ng-show="showAnalysisJson"> + <textarea ng-model="textAnalysisJson" name="add_analysis_json" id="add_analysis_json" title="Text Analysis JSON" rows="8" cols="40" placeholder=""></textarea> + </div> + + <p class="clearfix buttons"> + <button type="submit" class="submit" ng-class="{success: added}" ng-click="addField()"><span>Add</span></button> + <button type="reset" class="reset" ng-click="toggleAddField()"><span>Cancel</span></button> + </p> + + <div id="add-errors"> + <div ng-repeat="error in addErrors" ng-show="addErrors" class="error"><span>{{error}}</span></div> + </div> + </div> + </div> + </div> + <div class="right"> + <div ng-show="showSchemaActions"> + <button class="action publish-button" ng-click="togglePublish($event)"><span>Publish</span></button> + <button id="download-button" class="action" ng-click="downloadConfig()"><span>Download Config</span></button> + </div> + </div> + </div> + + <div id="error-dialog" class="error-dialog" ng-show="designerAPIError"> + <div id="error-dialog-note"><p class="clearfix"><img src="img/ico/prohibition.png"/> {{designerAPIError}}</p></div> + <div id="error-dialog-details"><div ng-show="designerAPIErrorDetails"><textarea rows="10" cols="55">{{designerAPIErrorDetails}}</textarea></div></div> + <div id="error-dialog-buttons" class="clearfix"> + <button type="reset" class="reload-error-button" ng-click="closeErrorDialog()" ng-show="isVersionMismatch"><span>Reload Schema</span></button> + <button type="reset" class="error-button" ng-click="closeErrorDialog()" ng-show="!isVersionMismatch"><span>OK</span></button> + </div> + </div> + + <div id="show-diff-dialog" class="diff" ng-show="showDiff && showPublish"> + <div ng-hide="schemaDiffExists" ng-show="!schemaDiffExists"> + <p class="clearfix diff-text">No differences found.</p> + </div> + {{fieldsDiff=schemaDiff.fieldsDiff;""}} + <div id="fields-diff" ng-hide="fieldsDiff == null" ng-show="Object.keys(fieldsDiff).length > 0"> + <div id="fields-updated" ng-hide="fieldsDiff.updated == null" ng-show="Object.keys(fieldsDiff.updated).length > 0"> + <p class="clearfix diff-text">Updated Fields</p> + <table class="diff"> + <tr> + <th>Name</th> + <th>Old</th> + <th>New</th> + </tr> + <tr ng-repeat="(field, fieldDiff) in fieldsDiff.updated"> + <td>{{ field }}</td> + <td><p class="old-value">{{fieldDiff[0] | json}}</p></td> + <td><p class="new-value">{{fieldDiff[1] | json}}</p></td> + </tr> + </table> + </div> + <div id="fields-added" ng-show="schemaDiff.addedFields.length > 0"> + <p class="clearfix diff-text">New Fields</p> + <ul> + <li class="clearfix element" ng-repeat="f in schemaDiff.addedFields"> + <p class="new-value"> {{f}} </p> + </li> + </ul> + </div> + <div id="fields-removed" ng-show="schemaDiff.removedFields.length > 0"> + <p class="clearfix diff-text">Removed Fields</p> + <ul> + <li class="clearfix element" ng-repeat="f in schemaDiff.removedFields"> + <p class="rem-value"> {{f}} </p> + </li> + </ul> + </div> + </div> + {{fieldTypesDiff=schemaDiff.fieldTypesDiff;""}} + <div id="fieldtypes-diff" ng-hide="fieldTypesDiff == null" ng-show="Object.keys(fieldTypesDiff).length > 0"> + <div id="fieldtypes-updated" ng-hide="fieldTypesDiff.updated == null" ng-show="Object.keys(fieldTypesDiff.updated).length > 0"> + <p class="clearfix diff-text">Updated Field Types</p> + <table class="diff" ng-show="Object.keys(fieldTypesDiff.updated).length > 0"> + <tr> + <th>Name</th> + <th>Old</th> + <th>New</th> + </tr> + <tr ng-repeat="(fieldType, fieldTypeDiff) in fieldTypesDiff.updated"> + <td>{{ fieldType }}</td> + <td><p class="old-value">{{fieldTypeDiff[0] | json}}</p></td> + <td><p class="new-value">{{fieldTypeDiff[1] | json}}</p></td> + </tr> + </table> + </div> + <div id="fieldtypes-added" ng-hide="fieldTypesDiff.added == null" ng-show="Object.keys(fieldTypesDiff.added).length > 0"> + <p class="clearfix diff-text">New Field Types</p> + <ul> + <li class="clearfix element" ng-repeat="fieldtype in fieldTypesDiff.added"> + <p class="new-value"> {{fieldtype | json}} </p> + </li> + </ul> + </div> + <div id="fieldtypes-removed" ng-show="schemaDiff.removedTypes.length > 0"> + <p class="clearfix diff-text">Removed Field Types</p> + <ul> + <li class="clearfix element" ng-repeat="fieldtype in schemaDiff.removedTypes"> + <p class="rem-value"> {{fieldtype}} </p> + </li> + </ul> + </div> + </div> + {{dynamicFieldsDiff=schemaDiff.dynamicFieldsDiff;""}} + <div id="dynamicfields-diff" ng-hide="dynamicFieldsDiff == null" ng-show="Object.keys(dynamicFieldsDiff).length > 0"> + <div id="dynamicfields-updated" ng-hide="dynamicFieldsDiff.updated == null" ng-show="Object.keys(dynamicFieldsDiff.updated).length > 0"> + <p class="clearfix diff-text">Updated Dynamic Fields</p> + <table class="diff"> + <tr> + <th>Name</th> + <th>Old</th> + <th>New</th> + </tr> + <tr ng-repeat="(dfield, dfieldDiff) in dynamicFieldsDiff.updated"> + <td>{{ dfield }}</td> + <td><p class="old-value">{{dfieldDiff[0] | json}}</p></td> + <td><p class="new-value">{{dfieldDiff[1] | json}}</p></td> + </tr> + </table> + </div> + <div id="dynamicfields-added" ng-hide="dynamicFieldsDiff.added == null" ng-show="Object.keys(dynamicFieldsDiff.added).length > 0"> + <p class="clearfix diff-text">New Dynamic Fields</p> + <ul> + <li class="clearfix" ng-repeat="dfield in dynamicFieldsDiff.added"> + <p class="new-value"> {{dfield | json}} </p> + </li> + </ul> + </div> + <div id="dynamicfields-removed" ng-hide="dynamicFieldsDiff.removed == null" ng-show="Object.keys(dynamicFieldsDiff.removed).length > 0"> + <p class="clearfix diff-text">Removed Dynamic Fields</p> + <ul> + <li class="clearfix" ng-repeat="dfield in dynamicFieldsDiff.removed"> + <p class="rem-value"> {{dfield.name}} </p> + </li> + </ul> + </div> + </div> + {{copyFieldsDiff=schemaDiff.copyFieldsDiff;""}} + <div id="copyfields-diff" ng-hide="copyFieldsDiff == null" ng-show="Object.keys(copyFieldsDiff).length > 0"> + <p class="clearfix diff-text">Copy Fields</p> + <table class="diff" ng-show="copyFieldsDiff.old.length > 0 || copyFieldsDiff.new.length > 0"> + <tr> + <th>Source</th> + <th>Destination</th> + </tr> + <tr ng-show="copyFieldsDiff.old.length > 0" ng-repeat="cfield in copyFieldsDiff.old"> + <td><p class="old-value">{{cfield.source}}</p></td> + <td><p class="old-value">{{cfield.dest}}</p></td> + </tr> + <tr ng-show="copyFieldsDiff.new.length > 0" ng-repeat="cfield in copyFieldsDiff.new"> + <td><p class="new-value">{{cfield.source}}</p></td> + <td><p class="new-value">{{cfield.dest}}</p></td> + </tr> + </table> + </div> + + <div class="clearfix diff-buttons"> + <button type="reset" class="reset" ng-click="toggleDiff()"><span>Close</span></button> + </div> + </div> + + <div id="publish-dialog" class="publish" ng-show="showPublish" escape-pressed="hideAll()"> + <div id="publish-dialog-note"><p class="clearfix">Publish schema and associated configs to Zookeeper as a Solr ConfigSet.</p></div> + <button class="action diff-button" ng-click="toggleDiff($event)"><span>Schema Diff</span></button> + <div id="publish-affected"> + <p class="clearfix">Affected collections:</p> + <ul> + <li class="clearfix" ng-repeat="coll in collectionsForConfig">{{coll}}</li> + </ul> + <div ng-show="collectionsForConfig.length == 0" class="clearfix">No existing collections</div> + </div> + <div id="reload-form"> + <div class="field-form" ng-show="collectionsForConfig.length > 0"> + <input type="checkbox" ng-model="reloadOnPublish" id="reload_on_publish" title="reload affected collections" ng-true-value="'true'" ng-false-value="'false'"/> + <label for="reload_on_publish" class="checkbox" title="Reload affected collections">Reload affected collections?</label> + </div> + </div> + + <div id="publish-new-coll"> + <p>Add new collection with published config?</p> + <form> + <p class="clearfix"><label for="add_coll_name">name:</label> + <input type="text" name="name" id="add_coll_name" ng-model="newCollection.name" placeholder="new collection"></p> + + <p class="clearfix"><label for="add_coll_numShards">numShards:</label> + <input type="text" name="numShards" id="add_coll_numShards" ng-model="newCollection.numShards"></p> + + <p class="clearfix"><label for="add_coll_replicationFactor">replicationFactor:</label> + <input type="text" name="replicationFactor" id="add_coll_replicationFactor" ng-model="newCollection.replicationFactor"></p> + </form> + <div class="field-form"> + <input type="checkbox" ng-model="newCollection.indexToCollection" id="add_coll_index_sample" title="index sample docs" ng-true-value="'true'" ng-false-value="'false'"/> + <label for="add_coll_index_sample" class="checkbox" title="Index sample docs">Index sample docs in new collection?</label> + </div> + </div> + <div class="field-form"> + <input type="checkbox" ng-model="disableDesigner" id="disable_designer" title="Disable future changes in schema designer" ng-true-value="'true'" ng-false-value="'false'"/> + <label for="disable_designer" class="checkbox" title="Disable future changes in schema designer">Disable future changes by the schema designer?</label> + </div> + <div ng-repeat="error in publishErrors" ng-show="publishErrors" class="clearfix note error"><span>{{error}}</span></div> + <div class="clearfix publish-buttons"> + <button type="submit" class="action publish-button" ng-click="doPublish()"><span>Publish</span></button> + <button type="reset" class="reset" ng-click="togglePublish()"><span>Cancel</span></button> + </div> + </div> + + <div id="confirm-dialog" class="action add" data-rel="add" ng-show="showConfirmEditSchema" style="display:block;"> + <p class="clearfix warn"><span>Warning: You've chosen to load an existing schema that is already being used by active collections. Making changes to the '{{confirmSchema}}' schema will impact existing documents in these collections. Please proceed with caution.<br/><br/></span></p> Review comment: "these collections" or should it be "those collections". nitpick I know! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org