VirtualBox

Ignore:
Timestamp:
Jun 5, 2016 5:46:15 PM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
107799
Message:

testmanager: adding sComment columns to TestCases, TestGroups and SchedGroups.

Location:
trunk/src/VBox/ValidationKit/testmanager/webui
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/testmanager/webui/wuiadminschedgroup.py

    r56295 r61472  
    8484                                         fReadOnly = self._sMode == WuiFormContentBase.ksMode_Show);
    8585
     86        oForm.addMultilineText  (SchedGroupData.ksParam_sComment,     oData.sComment,         'Comment');
    8687        oForm.addSubmit()
    8788
     
    100101        self._asColumnHeaders = [
    101102            'ID',  'Name', 'Enabled', 'Scheduler Type',
    102             'Build Source', 'Validation Kit Source', 'Test Groups', 'TestBoxes', 'Actions',
     103            'Build Source', 'Validation Kit Source', 'Test Groups', 'TestBoxes', 'Note', 'Actions',
    103104        ];
    104105
    105106        self._asColumnAttribs = [
    106107            'align="right"', 'align="center"', 'align="center"', 'align="center"',
    107             'align="center"', 'align="center"', '', '', 'align="center"',
     108            'align="center"', 'align="center"', '', '', 'align="center"', 'align="center"',
    108109        ];
    109110
     
    181182            aoMembers,
    182183            aoTestBoxes,
     184            self._formatCommentCell(oEntry.sComment),
    183185            aoActions,
    184186        ];
  • trunk/src/VBox/ValidationKit/testmanager/webui/wuiadmintestbox.py

    r61468 r61472  
    235235                                   fBracketed = False);
    236236        # Comment
    237         oComment = None;
    238         if oEntry.sComment is not None:
    239             sComment = oEntry.sComment.strip();
    240             if len(sComment) > 64:
    241                 oComment = WuiRawHtml('<span title="%s">%s...</span>'
    242                                       % (webutils.escapeAttr(sComment), webutils.escapeElem(sComment[:60]),));
    243             elif len(sComment) > 0:
    244                 oComment = WuiRawHtml(webutils.escapeElem(sComment));
     237        oComment = self._formatCommentCell(oEntry.sComment);
    245238
    246239        # Group link.
  • trunk/src/VBox/ValidationKit/testmanager/webui/wuiadmintestcase.py

    r61272 r61472  
    6464        self._asColumnHeaders = \
    6565        [
    66             'Name', 'Active', 'Default Timeout', 'Base Command / Variations', 'Validation Kit Files',
    67             'Test Case Prereqs', 'Global Resources', 'Actions'
     66            'Name', 'Active', 'Timeout', 'Base Command / Variations', 'Validation Kit Files',
     67            'Test Case Prereqs', 'Global Rsrces', 'Note', 'Actions'
    6868        ];
    6969        self._asColumnAttribs = \
    7070        [
    71             '', '', '', '', '',
    72             'valign="top"', 'valign="top"', 'align="center"'
     71            '', '', 'align="center"', '', '',
     72            'valign="top"', 'valign="top"', 'align="center"', 'align="center"'
    7373        ];
    7474
     
    154154        aoRet.append(WuiRawHtml(sHtml));
    155155
     156        # Comment (note).
     157        aoRet.append(self._formatCommentCell(oEntry.sComment));
     158
    156159        # Show actions that can be taken.
    157160        aoActions = [ WuiTmLink('Details', WuiAdmin.ksScriptName,
     
    237240        oForm.addListOfResources(TestCaseDataEx.ksParam_aoDepGlobalResources, aoGlobalResrcDeps, 'Depends on resources')
    238241
     242        oForm.addMultilineText(TestCaseDataEx.ksParam_sComment, oData.sComment, 'Comment');
     243
    239244        oForm.addSubmit();
    240245
  • trunk/src/VBox/ValidationKit/testmanager/webui/wuiadmintestgroup.py

    r56295 r61472  
    7474                                        fReadOnly = self._sMode == WuiFormContentBase.ksMode_Show);
    7575
     76        oForm.addMultilineText  (TestGroupData.ksParam_sComment,         self._oData.sComment,       'Comment');
    7677        oForm.addSubmit();
    7778        return True;
     
    8889        WuiListContentBase.__init__(self, aoEntries, iPage, cItemsPerPage, tsEffective,
    8990                                    sTitle = 'Test Groups', fnDPrint = fnDPrint, oDisp = oDisp);
    90         self._asColumnHeaders = [ 'ID', 'Name', 'Description', 'Test Cases', 'Actions' ];
    91         self._asColumnAttribs = [ 'align="right"', '', '', '', 'align="center"' ];
     91        self._asColumnHeaders = [ 'ID', 'Name', 'Description', 'Test Cases', 'Note', 'Actions' ];
     92        self._asColumnAttribs = [ 'align="right"', '', '', '', 'align="center"', 'align="center"' ];
    9293
    9394
     
    178179                 oEntry.sDescription if oEntry.sDescription is not None else '',
    179180                 oTestCases,
     181                 self._formatCommentCell(oEntry.sComment, cMaxLines = max(3, len(oEntry.aoMembers) * 2)),
    180182                 aoActions ];
    181183
  • trunk/src/VBox/ValidationKit/testmanager/webui/wuicontentbase.py

    r61424 r61472  
    203203    Outputs the given text within a span of the given CSS class.
    204204    """
    205     def __init__(self, sSpanClass, sText):
    206         WuiRawHtml.__init__(self,
    207                             u'<span class="%s">%s</span>'
    208                             % (webutils.escapeAttr(sSpanClass), webutils.escapeElem(sText),));
     205    def __init__(self, sSpanClass, sText, sTitle = None):
     206        if sTitle is None:
     207            WuiRawHtml.__init__(self,
     208                                u'<span class="%s">%s</span>'
     209                                % ( webutils.escapeAttr(sSpanClass),  webutils.escapeElem(sText),));
     210        else:
     211            WuiRawHtml.__init__(self,
     212                                u'<span class="%s" title="%s">%s</span>'
     213                                % ( webutils.escapeAttr(sSpanClass), webutils.escapeAttr(sTitle), webutils.escapeElem(sText),));
     214
    209215
    210216
     
    692698        self._asColumnAttribs   = [];
    693699
     700    def _formatCommentCell(self, sComment, cMaxLines = 3, cchMaxLine = 63):
     701        """
     702        Helper functions for formatting comment cell.
     703        Returns None or WuiRawHtml instance.
     704        """
     705        # Nothing to do for empty comments.
     706        if sComment is None:
     707            return None;
     708        sComment = sComment.strip();
     709        if len(sComment) == 0:
     710            return None;
     711
     712        # Restrict the text if necessary, making the whole text available thru mouse-over.
     713        ## @todo this would be better done by java script or smth, so it could automatically adjust to the table size.
     714        if len(sComment) > cchMaxLine or sComment.count('\n') >= cMaxLines:
     715            sShortHtml = '';
     716            for iLine, sLine in enumerate(sComment.split('\n')):
     717                if iLine >= cMaxLines:
     718                    break;
     719                if iLine > 0:
     720                    sShortHtml += '<br>\n';
     721                if len(sLine) > cchMaxLine:
     722                    sShortHtml += webutils.escapeElem(sLine[:(cchMaxLine - 3)]);
     723                    sShortHtml += '...';
     724                else:
     725                    sShortHtml += webutils.escapeElem(sLine);
     726            return WuiRawHtml('<span class="tmcomment" title="%s">%s</span>' % (webutils.escapeAttr(sComment), sShortHtml,));
     727
     728        return WuiRawHtml('<span class="tmcomment">%s</span>' % (webutils.escapeElem(sComment).replace('\n', '<br>'),));
     729
    694730    def _formatListEntry(self, iEntry):
    695731        """
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette