Search in sources :

Example 1 with AdminEmailLogPageData

use of teammates.ui.pagedata.AdminEmailLogPageData in project teammates by TEAMMATES.

the class AdminEmailLogPageActionTest method verifyActionResult.

private void verifyActionResult(int[][] expectedLogs, String... params) {
    AdminEmailLogPageAction action = getAction(params);
    ShowPageResult result = getShowPageResult(action);
    AdminEmailLogPageData pageData = (AdminEmailLogPageData) result.data;
    List<EmailLogEntry> actualLogs = getLogsFromLogTemplateRows(pageData.getLogs());
    verifyLogs(expectedLogs, actualLogs);
}
Also used : EmailLogEntry(teammates.common.util.EmailLogEntry) ShowPageResult(teammates.ui.controller.ShowPageResult) AdminEmailLogPageData(teammates.ui.pagedata.AdminEmailLogPageData) AdminEmailLogPageAction(teammates.ui.controller.AdminEmailLogPageAction)

Example 2 with AdminEmailLogPageData

use of teammates.ui.pagedata.AdminEmailLogPageData in project teammates by TEAMMATES.

the class AdminEmailLogPageActionTest method verifyContinueSearch.

private void verifyContinueSearch(String[] params, int[][] expected, int totalLogs) {
    AdminEmailLogPageAction action = getAction(params);
    ShowPageResult result = getShowPageResult(action);
    AdminEmailLogPageData pageData = (AdminEmailLogPageData) result.data;
    verifyStatusMessage(result.getStatusMessage(), totalLogs);
    verifyLogs(expected, getLogsFromLogTemplateRows(pageData.getLogs()));
}
Also used : ShowPageResult(teammates.ui.controller.ShowPageResult) AdminEmailLogPageData(teammates.ui.pagedata.AdminEmailLogPageData) AdminEmailLogPageAction(teammates.ui.controller.AdminEmailLogPageAction)

Example 3 with AdminEmailLogPageData

use of teammates.ui.pagedata.AdminEmailLogPageData in project teammates by TEAMMATES.

the class AdminEmailLogPageAction method execute.

@Override
protected ActionResult execute() {
    gateKeeper.verifyAdminPrivileges(account);
    AdminEmailLogPageData data = new AdminEmailLogPageData(account, sessionToken, getRequestParamValue("filterQuery"), getRequestParamAsBoolean("all"));
    if (data.getFilterQuery() == null) {
        data.setFilterQuery("");
    }
    // This is used to parse the filterQuery. If the query is not parsed, the filter function would ignore the query
    data.generateQueryParameters(data.getFilterQuery());
    String timeOffset = getRequestParamValue("offset");
    if (timeOffset != null && !timeOffset.isEmpty()) {
        data.setToDate(Long.parseLong(timeOffset));
    }
    if (data.isFromDateInQuery()) {
        searchEmailLogsWithExactTimePeriod(data);
    } else {
        searchEmailLogsWithTimeIncrement(data);
    }
    statusToAdmin = "adminEmailLogPage Page Load";
    if (timeOffset == null) {
        return createShowPageResult(Const.ViewURIs.ADMIN_EMAIL_LOG, data);
    }
    return createShowPageResult(Const.ViewURIs.ADMIN_EMAIL_LOG_AJAX, data);
}
Also used : AdminEmailLogPageData(teammates.ui.pagedata.AdminEmailLogPageData)

Aggregations

AdminEmailLogPageData (teammates.ui.pagedata.AdminEmailLogPageData)3 AdminEmailLogPageAction (teammates.ui.controller.AdminEmailLogPageAction)2 ShowPageResult (teammates.ui.controller.ShowPageResult)2 EmailLogEntry (teammates.common.util.EmailLogEntry)1