You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by GitBox <gi...@apache.org> on 2021/07/09 08:05:04 UTC

[GitHub] [brooklyn-ui] tbouron commented on a change in pull request #241: Add support for an ancestor quick fix

tbouron commented on a change in pull request #241:
URL: https://github.com/apache/brooklyn-ui/pull/241#discussion_r666755869



##########
File path: ui-modules/blueprint-composer/app/views/main/graphical/graphical.state.html
##########
@@ -19,129 +19,258 @@
 
 <div class="palette-and-or-toolbar">
 
-  <div class="layout">
-    <div class="toolbar">
-        <div class="list-group">
-            <a class="hand list-group-item"
-               ng-repeat="section in vm.sections track by $index"
-               ng-class="{'active': vm.selectedSection === section}"
-               ng-click="vm.selectedSection = section">
-                <i class="fa fa-fw" ng-class="section.icon"></i>
-            </a>
-
-            <div class="spacer"></div>
-            <a class="hand list-group-item errors-square"
-               title="Click to show/hide details of errors"
-               ng-class="{ errorsActive: errorsPane.level }"
-               ng-show="allIssues.errors.count"
-               ng-click="errorsPane.level = errorsPane.level ? null : 'error-errors'">
-                <i class="fa fa-fw fa-times-circle"></i> {{ allIssues.errors.count }}
-            </a>
-            <a class="hand list-group-item warning-square"
-               title="Click to show/hide details of warnings"
-               ng-class="{ errorsActive: errorsPane.level }"
-               ng-show="!allIssues.errors.count && allIssues.warnings.count"
-               ng-click="errorsPane.level = errorsPane.level ? null : 'summary'">
-                <i class="fa fa-fw fa-exclamation-triangle"></i> {{ allIssues.warnings.count }}
-            </a>
+    <div class="layout">
+        <div class="toolbar">
+            <div class="list-group">
+                <a class="hand list-group-item"
+                   ng-repeat="section in vm.sections track by $index"
+                   ng-class="{'active': vm.selectedSection === section}"
+                   ng-click="vm.selectedSection = section">
+                    <i class="fa fa-fw" ng-class="section.icon"></i>
+                </a>
+
+                <div class="spacer"></div>
+                <a class="hand list-group-item errors-square"
+                   title="Click to show/hide details of errors"
+                   ng-class="{ errorsActive: errorsPane.level }"
+                   ng-show="allIssues.errors.count"
+                   ng-click="errorsPane.level = errorsPane.level ? null : 'error-errors'">
+                    <i class="fa fa-fw fa-times-circle"></i> {{ allIssues.errors.count }}
+                </a>
+                <a class="hand list-group-item warning-square"
+                   title="Click to show/hide details of warnings"
+                   ng-class="{ errorsActive: errorsPane.level }"
+                   ng-show="!allIssues.errors.count && allIssues.warnings.count"
+                   ng-click="errorsPane.level = errorsPane.level ? null : 'summary'">
+                    <i class="fa fa-fw fa-exclamation-triangle"></i> {{ allIssues.warnings.count }}
+                </a>
+            </div>
         </div>
-    </div>
 
-      <div ng-if="errorsPane.level == 'summary'" class="errors-popout">
-          <div class="errors-body">
+        <div ng-if="errorsPane.level == 'summary'" class="errors-popout">
+            <div class="errors-body">
+
+                <a ng-click="errorsPane.level = null" class="hand errors-close"><i class="fa fa-fw fa-times"></i></a>
+
+                <div ng-if="allIssues.errors.count">
+                    <a class="hand" ng-click="errorsPane.level = 'error-errors'">
+                        <ng-pluralize count="allIssues.errors.count"
+                                      when="{'one': '{} error', 'other': '{} errors'}" />
+                    </a>
+                    in
+                    <a class="hand" ng-click="errorsPane.level = 'error-entities'">
+                        <ng-pluralize count="vm.size(allIssues.errors.byEntity)"
+                                      when="{'one': '{} entity', 'other': '{} entities'}" />
+                    </a>
+                </div>
+
+                <div ng-if="allIssues.warnings.count">
+                    <a class="hand" ng-click="errorsPane.level = 'warning-errors'">
+                        <ng-pluralize count="allIssues.warnings.count"
+                                      when="{'one': '{} warning', 'other': '{} warnings'}" />
+                    </a>
+                    in
+                    <a class="hand" ng-click="errorsPane.level = 'warning-entities'">
+                        <ng-pluralize count="vm.size(allIssues.warnings.byEntity)"
+                                      when="{'one': '{} entity', 'other': '{} entities'}" />
+                    </a>
+                </div>
+
+                <div ng-if="!allIssues.errors.count && !allIssues.warnings.count">
+                    No errors or warnings.
+                </div>
+
+            </div>
+        </div>
+
+        <div ng-if="errorsPane.level == 'error-entities'" class="errors-popout">
+            <div class="errorsHeader">
+                <a ng-click="errorsPane.level = null" class="hand errors-close"><i class="fa fa-fw fa-times"></i></a>
 
-              <a ng-click="errorsPane.level = null" class="hand errors-close"><i class="fa fa-fw fa-times"></i></a>
+                <strong>
+                    <ng-pluralize count="vm.size(allIssues.errors.byEntity)"
+                                  when="{'one': '{} entity', 'other': '{} entities'}" />
+                </strong>
+
+                with
 
-            <div ng-if="allIssues.errors.count">
                 <a class="hand" ng-click="errorsPane.level = 'error-errors'">
-                {{ allIssues.errors.count }}
-                    <span ng-if="allIssues.errors.count == 1">error</span>
-                    <span ng-if="allIssues.errors.count != 1">errors</span>
+                    <ng-pluralize count="allIssues.errors.count"
+                                  when="{'one': '{} error', 'other': '{} errors'}" />
                 </a>
+            </div>
+
+            <div class="errors-body">
+                <div ng-repeat="(itemK,itemV) in allIssues.errors.byEntity" class="error-line">
+                    <div class="error-line-marker">
+                        <i class="fa fa-fw fa-times-circle"></i>
+                    </div>
+                    <div class="error-line-text">
+                        {{ vm.entitySummary(allIssues.entities[itemK]) }}:
+                        {{ itemV.length }} {{ itemV.length==1 ? 'error' : 'errors' }}
+                    </div>
+                    <div class="error-line-action">
+                        <a class="hand" ui-sref="main.graphical.edit.entity({entityId: itemK})">
+                            <i class="fa fa-fw fa-external-link"></i>
+                        </a>
+                    </div>
+                </div>
+            </div>
+        </div>
+
+        <div ng-if="errorsPane.level == 'error-errors'" class="errors-popout">
+            <div class="errorsHeader">
+                <a ng-click="errorsPane.level = null" class="hand errors-close"><i class="fa fa-fw fa-times"></i></a>
+
+                <strong>
+                    <ng-pluralize count="allIssues.errors.count"
+                                  when="{'one': '{} error', 'other': '{} errors'}" />
+                </strong>
+
+                <span ng-show="allIssues.errors.count != vm.size(allIssues.errors.byMessage)"> ({{ vm.size(allIssues.errors.byMessage) }} unique)</span>
+
                 in
+
                 <a class="hand" ng-click="errorsPane.level = 'error-entities'">
-                    {{ vm.size(allIssues.errors.byEntity) }}
-                    <span ng-if="vm.size(allIssues.errors.byEntity) == 1">entity</span>
-                    <span ng-if="vm.size(allIssues.errors.byEntity) != 1">entities</span>
+                    <ng-pluralize count="vm.size(allIssues.errors.byEntity)"
+                                  when="{'one': '{} entity', 'other': '{} entities'}" />
                 </a>
             </div>
 
-            <!-- TODO add links and panels for warnings -->
-            <div ng-if="allIssues.warnings.count">
-                {{ allIssues.warnings.count }}
-                    <span ng-if="allIssues.errors.count == 1">warning</span>
-                    <span ng-if="allIssues.errors.count != 1">warnings</span>
-                in {{ vm.size(allIssues.warnings.byEntity) }}
-                    <span ng-if="vm.size(allIssues.warnings.byEntity) == 1">entity</span>
-                    <span ng-if="vm.size(allIssues.warnings.byEntity) != 1">entities</span>
+            <div class="errors-body">
+                <div ng-repeat="(itemK,itemV) in allIssues.errors.byMessage" class="error-line">
+                    <div class="error-line-marker">
+                        <i class="fa fa-fw fa-times-circle"></i>
+                    </div>
+                    <div class="error-line-text">
+                      <span>
+                          <span ng-show="vm.messageNeedsPrefix(itemV)">
+                              {{ itemV.group }} {{ itemV.ref }}<span ng-show="itemV.message">:</span>
+                          </span>
+                          <span ng-show="itemV.message">
+                              <ng-bind-html ng-bind-html="itemV.message"></ng-bind-html>
+                          </span>
+                      </span>
+
+                        (<a class="hand" ng-click="errorsPane.focus = (errorsPane.focus == 'errors:'+itemK ? null : 'errors:'+itemK)"
+                            ng-class="{active: errorsPane.focus == 'errors:'+itemK }">
+                            <ng-pluralize count="itemV.issues.length"
+                                          when="{'one': '{} entity', 'other': '{} entities'}" />
+                        </a>
+                        <span ng-if="vm.size(itemV.quickFixes)">;
+                          <a class="hand" ng-click="errorsPane.focus = (errorsPane.focus == 'fixes:'+itemK ? null : 'fixes:'+itemK)"
+                             ng-class="{active: errorsPane.focus == 'fixes:'+itemK }">
+                             <ng-pluralize count="vm.size(itemV.quickFixes)"
+                                           when="{'one': '{} quick fix', 'other': '{} quick fixes'}" />
+                             available
+                          </a>
+                        </span>)
+
+                        <div class="error-line-sub" ng-if="errorsPane.focus == 'errors:'+itemK">
+                            <div ng-repeat="issue in itemV.issues" class="error-line-sub-line">
+                                <div class="error-line-marker">
+                                    <i class="fa fa-fw fa-circle"></i>
+                                </div>
+                                <div class="error-line-text">
+                                    {{ vm.entitySummary(issue.issue.entity) }}
+                                    <!-- could offer the issue-specific quick fixes; but clearer to navigate to entity and do there -->
+                                </div>
+                                <div class="error-line-action">
+                                    <a class="hand" ui-sref="main.graphical.edit.entity({entityId: issue.issue.entity._id})">
+                                        <i class="fa fa-fw fa-external-link"></i>
+                                    </a>
+                                </div>
+                            </div>
+                        </div>
+
+                        <div class="error-line-sub" ng-if="errorsPane.focus == 'fixes:'+itemK">
+                            <div ng-repeat="fix in itemV.quickFixes" class="error-line-sub-line">
+                                <div class="error-line-marker">
+                                    <i class="fa fa-fw fa-magic"></i>
+                                </div>
+                                <div class="error-line-text">
+                                    {{ fix.text }}
+                                    <a class="hand btn btn-xs btn-primary" style="float: right;" ng-click="vm.applyQuickFix(fix)"
+                                       ng-attr-title="{{ fix.tooltip }}"
+                                    >Apply
+                                        (<ng-pluralize count="vm.size(fix.issues)"

Review comment:
       @algairim It is at the end of the `ng-pluralize` directive, on line 197




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

To unsubscribe, e-mail: dev-unsubscribe@brooklyn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org