Skip to content
This repository was archived by the owner on Feb 12, 2025. It is now read-only.

Update VelocityProjectGridAction.cs #233

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 7 additions & 11 deletions project/WebDashboard/Dashboard/VelocityProjectGridAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,31 +79,27 @@ private HtmlFragmentResponse GenerateView(ProjectStatusListAndExceptions project
string actionName, ICruiseRequest request, IServerSpecifier serverSpecifier)
{
this.translations = Translations.RetrieveCurrent();
bool sortReverse = SortAscending(request.Request);
string category = request.Request.GetText("Category");
cruiseUrlBuilder = request.UrlBuilder;
urlBuilder = request.UrlBuilder.InnerBuilder;
ProjectGridSortColumn sortColumn = GetSortColumn(request.Request);
Hashtable velocityContext = new Hashtable();
velocityContext["forceBuildMessage"] = ForceBuildIfNecessary(request.Request);
velocityContext["parametersCall"] = new ServerLink(cruiseUrlBuilder, new DefaultServerSpecifier("null"), string.Empty, ProjectParametersAction.ActionName).Url;

velocityContext["wholeFarm"] = serverSpecifier == null ? true : false;

string category = request.Request.GetText("Category");
velocityContext["showCategoryColumn"] = string.IsNullOrEmpty(category) ? true : false;

ProjectGridSortColumn sortColumn = GetSortColumn(request.Request);
bool sortReverse = SortAscending(request.Request);

velocityContext["projectNameSortLink"] = GenerateSortLink(serverSpecifier, actionName, ProjectGridSortColumn.Name, sortColumn, sortReverse);
velocityContext["buildStatusSortLink"] = GenerateSortLink(serverSpecifier, actionName, ProjectGridSortColumn.BuildStatus, sortColumn, sortReverse);
velocityContext["lastBuildDateSortLink"] = GenerateSortLink(serverSpecifier, actionName, ProjectGridSortColumn.LastBuildDate, sortColumn, sortReverse);
velocityContext["serverNameSortLink"] = GenerateSortLink(serverSpecifier, actionName, ProjectGridSortColumn.ServerName, sortColumn, sortReverse);
velocityContext["projectCategorySortLink"] = GenerateSortLink(serverSpecifier, actionName, ProjectGridSortColumn.Category, sortColumn, sortReverse);
velocityContext["exceptions"] = projectStatusListAndExceptions.Exceptions;

ProjectGridRow[] projectGridRows = projectGrid.GenerateProjectGridRows(projectStatusListAndExceptions.StatusAndServerList, actionName, sortColumn, sortReverse, category, cruiseUrlBuilder, this.translations);

var parameters = new ProjectGridParameters(projectStatusListAndExceptions.StatusAndServerList, sortColumn, sortReverse, category, cruiseUrlBuilder, farmService, this.translations);
ProjectGridRow[] projectGridRows = projectGrid.GenerateProjectGridRows(parameters);
velocityContext["projectGrid"] = projectGridRows;
velocityContext["exceptions"] = projectStatusListAndExceptions.Exceptions;


Array categoryList = this.GenerateCategoryList(projectGridRows);
velocityContext["categoryList"] = categoryList;
velocityContext["barAtTop"] = (this.SuccessIndicatorBarLocation == IndicatorBarLocation.Top) ||
Expand Down