VirtualBox

Ignore:
Timestamp:
Jan 2, 2017 9:20:49 PM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
112554
Message:

TestManager: Added filtering to the reports page.

File:
1 edited

Legend:

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

    r65053 r65054  
    901901        return True;
    902902
    903     def _generateResultFilter(self, oFilter, oResultLogic, tsNow, sPeriod, enmResultsGroupingType, aoGroupMembers,
    904                               fOnlyFailures, fOnlyNeedingReason):
     903    def _generateResultFilter(self, oFilter, oResultLogic, tsNow, sPeriod, enmResultsGroupingType = None, aoGroupMembers = None,
     904                              fOnlyFailures = False, fOnlyNeedingReason = False):
    905905        """
    906906        Generates the result filter for the left hand side.
     
    927927                 u' <dl>\n';
    928928
    929         for iCrit, oCrit in enumerate(oFilter.aCriteria):
     929        for oCrit in oFilter.aCriteria:
    930930            if len(oCrit.aoPossible) > 0:
    931931                sClass = 'sf-collapsable' if oCrit.sState == oCrit.ksState_Selected else 'sf-expandable';
     
    11881188        return self.ksDispatchRcAllDone;
    11891189
    1190     def _actionGenericReport(self, oModelType, oReportType):
     1190    def _actionGenericReport(self, oModelType, oFilterType, oReportType):
    11911191        """
    11921192        Generic report action.
    11931193        oReportType is a child of WuiReportContentBase.
     1194        oFilterType is a child of ModelFilterBase.
    11941195        oModelType is a child of ReportModelBase.
    11951196        """
     
    12071208            if aidSubjects is None:
    12081209                raise WuiException('Missing parameter %s' % (self.ksParamReportSubjectIds,));
     1210        oFilter = oFilterType().initFromParams(self);
    12091211        self._checkForUnknownParameters();
    12101212
     
    12171219            self.ksParamReportSubjectIds:       aidSubjects,
    12181220        };
    1219 
    1220         oModel   = oModelType(self._oDb, tsEffective, cPeriods, cHoursPerPeriod, sSubject, aidSubjects);
     1221        ## @todo oFilter.
     1222
     1223        oModel   = oModelType(self._oDb, tsEffective, cPeriods, cHoursPerPeriod, sSubject, aidSubjects, oFilter);
    12211224        oContent = oReportType(oModel, dParams, fSubReport = False, fnDPrint = self._oSrvGlue.dprint, oDisp = self);
    12221225        (self._sPageTitle, self._sPageBody) = oContent.show();
    12231226        sNavi = self._generateReportNavigation(tsEffective, cHoursPerPeriod, cPeriods);
    12241227        self._sPageBody = sNavi + self._sPageBody;
     1228
     1229        self._sPageFilter = self._generateResultFilter(oFilter, oModel, tsEffective, '%s hours' % (cHoursPerPeriod * cPeriods,));
    12251230        return True;
    12261231
    12271232    def _actionReportSummary(self):
    12281233        """ Action wrapper. """
    1229         from testmanager.core.report                import ReportLazyModel;
     1234        from testmanager.core.report                import ReportLazyModel, ReportFilter;
    12301235        from testmanager.webui.wuireport            import WuiReportSummary;
    1231         return self._actionGenericReport(ReportLazyModel, WuiReportSummary);
     1236        return self._actionGenericReport(ReportLazyModel, ReportFilter, WuiReportSummary);
    12321237
    12331238    def _actionReportRate(self):
    12341239        """ Action wrapper. """
    1235         from testmanager.core.report                import ReportLazyModel;
     1240        from testmanager.core.report                import ReportLazyModel, ReportFilter;
    12361241        from testmanager.webui.wuireport            import WuiReportSuccessRate;
    1237         return self._actionGenericReport(ReportLazyModel, WuiReportSuccessRate);
     1242        return self._actionGenericReport(ReportLazyModel, ReportFilter, WuiReportSuccessRate);
    12381243
    12391244    def _actionReportTestCaseFailures(self):
    12401245        """ Action wrapper. """
    1241         from testmanager.core.report                import ReportLazyModel;
     1246        from testmanager.core.report                import ReportLazyModel, ReportFilter;
    12421247        from testmanager.webui.wuireport            import WuiReportTestCaseFailures;
    1243         return self._actionGenericReport(ReportLazyModel, WuiReportTestCaseFailures);
     1248        return self._actionGenericReport(ReportLazyModel, ReportFilter, WuiReportTestCaseFailures);
    12441249
    12451250    def _actionReportFailureReasons(self):
    12461251        """ Action wrapper. """
    1247         from testmanager.core.report                import ReportLazyModel;
     1252        from testmanager.core.report                import ReportLazyModel, ReportFilter;
    12481253        from testmanager.webui.wuireport            import WuiReportFailureReasons;
    1249         return self._actionGenericReport(ReportLazyModel, WuiReportFailureReasons);
     1254        return self._actionGenericReport(ReportLazyModel, ReportFilter, WuiReportFailureReasons);
    12501255
    12511256    def _actionGraphWiz(self):
Note: See TracChangeset for help on using the changeset viewer.

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