Skip to content

Commit

Permalink
Release v.12.2.7200.0
Browse files Browse the repository at this point in the history
  • Loading branch information
SFBuild committed Nov 7, 2019
1 parent 91af5f7 commit bc5938d
Show file tree
Hide file tree
Showing 220 changed files with 6,140 additions and 1,383 deletions.
Binary file modified AssemblyInfoShare/SharedAssemblyInfo.cs
Binary file not shown.
122 changes: 119 additions & 3 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,55 @@
module.exports = function (grunt) {
'use strict';
var fs = require('fs');

grunt.registerMultiTask("assertMinified", "Asserts if minified files are updated correctly", function() {
var paths = grunt.file.expand( this.data.paths );
var output = this.data.output;
var removeSourceMapLine = function (x){
if(x.lastIndexOf("\n")>0) {
return x.substring(0, x.lastIndexOf("\n"));
} else {
return x;
}
};

var suite = 'minified';
var out = [];

var failurePaths = [];
var files = {};

paths.forEach(function( path ) {
var testFilePath = path.replace(".min.js", ".test.min.js");
if (grunt.file.exists(testFilePath)){
var expectedFile = grunt.file.read(testFilePath);
var sourceFile = grunt.file.read(path);
if ( removeSourceMapLine(sourceFile) != removeSourceMapLine(expectedFile) ) {
failurePaths.push(path);
//grunt.fail.fatal("The minified file for " + path + " is not the updated with latest changes. Run 'grunt uglify:minify' command to update the minified files.");
}
}
});

out.push("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
out.push("<testsuites> <testsuite name=\"" + suite + "\" tests=\"" + (paths.length || 0) + "\" failures=\"" + failurePaths.length + "\" errors=\"0\">");

failurePaths.forEach(function( path ) {
out.push("\t<testcase name=\"" + path + "\">");
out.push("\t\t<failure message=\"" + "Not updated minified files." + "\">");
out.push("The minified file for " + path + " is not the updated with latest changes. Run grunt uglify:minify command to update the minified files.");
out.push("\t\t</failure>");
out.push("\t</testcase>");
});

// we need at least 1 empty test
if (failurePaths.lenght === 0) {
out.push("\t<testcase name=\"" + suite + "\" />");
}
out.push("</testsuite></testsuites>");

fs.writeFileSync(output, out.join('\n'));
});

//Project Configuration
grunt.initConfig({
Expand All @@ -17,10 +67,57 @@ module.exports = function (grunt) {
'!node_modules/**/*.js',
'!Tests/**/*.js',
'!Telerik.Sitefinity.Frontend.*/gruntfile.js',
'!Telerik.Sitefinity.Frontend.Media/assets/magnific/*'
'!Telerik.Sitefinity.Frontend.Media/assets/magnific/*',
'!**/*min.js'
]
},

watch: {
options: {
spawn: false
},
js: {
files: ['Telerik.Sitefinity.Frontend.*/**/*.js',
'!Telerik.Sitefinity.Frontend.*/**/designerview-*.js',
'!Telerik.Sitefinity.Frontend.*/**/*.min.js']
}
},

uglify: {
options : {
sourceMap : true,
sourceMapIncludeSources : true
},
minify: {
files: grunt.file.expandMapping(['Telerik.Sitefinity.Frontend.*/**/*.js',
'!Telerik.Sitefinity.Frontend.*/**/designerview-*.js',
'!Telerik.Sitefinity.Frontend.*/**/*.min.js'], './', {
rename: function(destBase, destPath) {
return destBase+destPath.replace('.js', '.min.js');
}
})
},
test: {
files: grunt.file.expandMapping(['Telerik.Sitefinity.Frontend.*/**/*.js',
'!Telerik.Sitefinity.Frontend.*/**/designerview-*.js',
'!Telerik.Sitefinity.Frontend.*/**/*.min.js'], './', {
rename: function(destBase, destPath) {
return destBase+destPath.replace('.js', '.test.min.js');
}
})
}
},

assertMinified: {
js: {
paths: ['Telerik.Sitefinity.Frontend.*/**/*.min.js',
'!Telerik.Sitefinity.Frontend.*/**/designerview-*.js',
'!Telerik.Sitefinity.Frontend.*/**/*.test.min.js',
'!Telerik.Sitefinity.Frontend.*/**/*.min.min.js'],
output: "Tests/FeatherWidgets.ClientTest/TestResults/assertMinified.xml"
}
},

jasmine: {
newsTests:{
src: [
Expand Down Expand Up @@ -183,16 +280,35 @@ module.exports = function (grunt) {
src: ['../feather/Telerik.Sitefinity.Frontend/client-components/selectors/**/*.html'],
dest: '../feather/Tests/Telerik.Sitefinity.Frontend.ClientTest/templates.js'
},
},
}

});

// on watch events configure jshint and uglify to only run on changed file
grunt.event.on('watch', function(action, filepath) {
grunt.config(['jshint.src', 'uglify.minify.files'], filepath);
grunt.config('jshint.src', filepath);
grunt.config('uglify.minify.files',
grunt.file.expandMapping(new Array(filepath), './', {
rename: function(destBase, destPath) {
return destBase+destPath.replace('.js', '.min.js');
}
}));
grunt.task.run('jshint');
grunt.task.run('uglify:minify');
});

//Load the needed plugins
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.loadNpmTasks("grunt-contrib-connect");
grunt.loadNpmTasks('grunt-html2js');
grunt.loadNpmTasks("grunt-contrib-uglify");

//Default task(s)
grunt.registerTask('default', ['jshint','html2js','jasmine']);
grunt.registerTask('default', ['jshint','html2js','jasmine', 'uglify:test', 'assertMinified']);
//Watches for changes in the js files and minifies only the changed file
grunt.registerTask('dev', ['watch', 'html2js', 'jasmine', 'assertMinified']);

};
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ The Feather Project
This repository contains custom MVC widgets which are part of [Project Feather](http://projectfeather.sitefinity.com).


| Test | Status |
|----|----|
| Unit | [![Build Status](https://feather-ci.sitefinity.com/buildStatus/icon?job=Master_FeatherWidgetsUnitTests)](https://feather-ci.sitefinity.com/job/Master_FeatherWidgetsUnitTests/) |
| Integration | [![Build Status](https://feather-ci.sitefinity.com/buildStatus/icon?job=Master_FeatherWidgetsIntegrationTests)](https://feather-ci.sitefinity.com/job/Master_FeatherWidgetsIntegrationTests/) |

# Related Repositories

[feather](https://github.com/Sitefinity/feather) - This repository contains the core infrastructure related to the Feather project.
Expand All @@ -14,8 +19,6 @@ This repository contains custom MVC widgets which are part of [Project Feather](

# Sitefinity compatibility

Since Sitefinity 10.2.6602.0 this project is included along with the standard Sitefinity distribution.

| Feather version | Sitefinity version |
|----|----|
| v.1.9.800.0 - latest | 10.0.6400.0 to 10.0.9999 |
Expand Down Expand Up @@ -43,7 +46,7 @@ Since Sitefinity 10.2.6602.0 this project is included along with the standard Si

This project has been released under the Apache License, version 2.0, the text of which is included below. This license applies ONLY to the project-specific source of each repository and does not extend to Telerik Sitefinity CMS itself, or any other 3rd party libraries used in a repository. For licensing information about Telerik Sitefinity CMS, see the [License Agreements page](http://www.sitefinity.com/purchase/license-agreement) at [Sitefinity.com](http://www.sitefinity.com/).

Copyright © 2005-2017 Telerik AD
Copyright © 2005-2017 Telerik AD

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Telerik.Sitefinity.Blogs.Model;
using Telerik.Sitefinity.Frontend.Blogs.Mvc.Models.Blog;
using Telerik.Sitefinity.Frontend.Blogs.Mvc.StringResources;
using Telerik.Sitefinity.Frontend.Mvc.Helpers;
using Telerik.Sitefinity.Frontend.Mvc.Infrastructure.Controllers;
using Telerik.Sitefinity.Frontend.Mvc.Infrastructure.Controllers.Attributes;
using Telerik.Sitefinity.Modules.Pages.Configuration;
Expand All @@ -18,8 +19,15 @@ namespace Telerik.Sitefinity.Frontend.Blogs.Mvc.Controllers
/// This class represents the controller of the Blog widget.
/// </summary>
[Localization(typeof(BlogListResources))]
[ControllerToolboxItem(Name = "Blog_MVC", Title = "Blogs", SectionName = ToolboxesConfig.ContentToolboxSectionName, ModuleName = "Blogs", CssClass = BlogController.WidgetIconCssClass)]
public class BlogController: Controller, IPersonalizable
[ControllerToolboxItem(
Name = BlogController.WidgetName,
Title = nameof(BlogListResources.BlogsList),
Description = nameof(BlogListResources.BlogsListDescription),
ResourceClassId = nameof(BlogListResources),
SectionName = ToolboxesConfig.ContentToolboxSectionName,
ModuleName = "Blogs",
CssClass = BlogController.WidgetIconCssClass)]
public class BlogController : Controller, IPersonalizable
{
#region Properties

Expand Down Expand Up @@ -110,16 +118,21 @@ public ActionResult Index(int? page)
{
var viewModel = this.Model.CreateListViewModel(page: page ?? 1);

this.InitializeListViewBag("/{0}");

if (SystemManager.CurrentHttpContext != null)
this.AddCacheDependencies(this.Model.GetKeysOfDependentObjects(viewModel));
var redirectPageUrlTemplate = UrlHelpers.GetRedirectPagingUrl();
this.InitializeListViewBag(redirectPageUrlTemplate);

var fullTemplateName = this.listTemplateNamePrefix + this.ListTemplateName;

if (this.ShouldReturnDetails(this.Model.ContentViewDisplayMode, viewModel))
return this.Details((Blog)viewModel.Items.First().DataItem);

if (SystemManager.CurrentHttpContext != null)
{
this.AddCacheDependencies(this.Model.GetKeysOfDependentObjects(viewModel));
if (viewModel.ContentType != null)
this.AddCacheVariations(viewModel.ContentType, viewModel.ProviderName);
}

return this.View(fullTemplateName, viewModel);
}

Expand Down Expand Up @@ -186,6 +199,7 @@ private void InitializeListViewBag(string redirectPageUrl)
private string listTemplateNamePrefix = "List.";
private string detailTemplateName = "DetailPage";
private string detailTemplateNamePrefix = "Detail.";
private const string WidgetName = "Blog_MVC";

#endregion
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,15 @@ namespace Telerik.Sitefinity.Frontend.Blogs.Mvc.Controllers
/// This class represents the controller of the Blog post widget.
/// </summary>
[Localization(typeof(BlogPostResources))]
[ControllerToolboxItem(Name = "BlogPost_MVC", Title = "Blog posts", SectionName = ToolboxesConfig.ContentToolboxSectionName, ModuleName = "Blogs", CssClass = BlogPostController.WidgetIconCssClass)]
public class BlogPostController : ContentBaseController, IContentLocatableView, IRouteMapper, IPersonalizable
[ControllerToolboxItem(
Name = BlogPostController.WidgetName,
Title = nameof(BlogPostResources.BlogPostsViewTitle),
Description = nameof(BlogPostResources.BlogPostsViewDescription),
SectionName = ToolboxesConfig.ContentToolboxSectionName,
ModuleName = "Blogs",
ResourceClassId = nameof(BlogPostResources),
CssClass = BlogPostController.WidgetIconCssClass)]
public class BlogPostController : ContentBaseController, IContentLocatableView, IRouteMapper, IPersonalizable, ICanFilterByParent
{
#region Properties

Expand Down Expand Up @@ -150,21 +157,29 @@ public override MetadataModel MetadataFields
/// </returns>
public ActionResult Index(int? page)
{
ITaxon taxonFilter = TaxonUrlEvaluator.GetTaxonFromQuery(this.HttpContext, this.Model.UrlKeyPrefix);
if (this.Model.ParentFilterMode != ParentFilterMode.CurrentlyOpen)
{
ITaxon taxonFilter = TaxonUrlEvaluator.GetTaxonFromQuery(this.HttpContext, this.Model.UrlKeyPrefix);

this.InitializeListViewBag();
this.SetRedirectUrlQueryString(taxonFilter);
this.InitializeListViewBag();
this.SetRedirectUrlQueryString(taxonFilter);

this.UpdatePageFromQuery(ref page, this.Model.UrlKeyPrefix);
var viewModel = this.Model.CreateListViewModel(taxonFilter, this.ExtractValidPage(page));
this.AddCacheDependencies(this.Model.GetKeysOfDependentObjects(viewModel));
this.UpdatePageFromQuery(ref page, this.Model.UrlKeyPrefix);
var viewModel = this.Model.CreateListViewModel(taxonFilter, this.ExtractValidPage(page));

var fullTemplateName = this.listTemplateNamePrefix + this.ListTemplateName;

if (this.ShouldReturnDetails(this.Model.ContentViewDisplayMode, viewModel))
return this.Details((BlogPost)viewModel.Items.First().DataItem);
var fullTemplateName = this.listTemplateNamePrefix + this.ListTemplateName;

return this.View(fullTemplateName, viewModel);
if (this.ShouldReturnDetails(this.Model.ContentViewDisplayMode, viewModel))
return this.Details((BlogPost)viewModel.Items.First().DataItem);

this.AddCacheDependencies(this.Model.GetKeysOfDependentObjects(viewModel));
if (viewModel.ContentType != null)
this.AddCacheVariations(viewModel.ContentType, viewModel.ProviderName);

return this.View(fullTemplateName, viewModel);
}

return this.Content(string.Empty);
}

/// <summary>
Expand Down Expand Up @@ -200,12 +215,19 @@ public ActionResult Successors(Blog parentItem, int? page)
public ActionResult ListByTaxon(ITaxon taxonFilter, int? page)
{
if (taxonFilter != null)
this.InitializeListViewBag("/" + taxonFilter.UrlName + "/{0}");
{
var redirectPageUrlTemplate = UrlHelpers.GetRedirectPagingUrl(taxonFilter);
this.InitializeListViewBag(redirectPageUrlTemplate);
}

var viewModel = this.Model.CreateListViewModel(taxonFilter, page ?? 1);

if (SystemManager.CurrentHttpContext != null)
{
this.AddCacheDependencies(this.Model.GetKeysOfDependentObjects(viewModel));
if (viewModel.ContentType != null)
this.AddCacheVariations(viewModel.ContentType, viewModel.ProviderName);
}

var fullTemplateName = this.listTemplateNamePrefix + this.ListTemplateName;
return this.View(fullTemplateName, viewModel);
Expand All @@ -232,6 +254,8 @@ public ActionResult ListByDate(DateTime from, DateTime to, int? page)
if (SystemManager.CurrentHttpContext != null)
{
this.AddCacheDependencies(this.Model.GetKeysOfDependentObjects(viewModel));
if (viewModel.ContentType != null)
this.AddCacheVariations(viewModel.ContentType, viewModel.ProviderName);
}

var fullTemplateName = this.listTemplateNamePrefix + this.ListTemplateName;
Expand Down Expand Up @@ -267,6 +291,16 @@ public ActionResult Details(BlogPost item)
return this.View(fullTemplateName, viewModel);
}

/// <summary>
/// Gets the parent types.
/// </summary>
/// <returns>Collection of parent types to filter by.</returns>
[NonAction]
public IEnumerable<Type> GetParentTypes()
{
return new[] { typeof(Blog) };
}

#endregion

#region Overrides
Expand Down Expand Up @@ -413,6 +447,7 @@ private void SetRedirectUrlQueryString(ITaxon taxon)
var taxonQueryStringParams = HyperLinkHelpers.BuildTaxonQueryStringParams(taxon, this.Model.UrlKeyPrefix);
this.ViewBag.RedirectPageUrlTemplate = this.ViewBag.RedirectPageUrlTemplate + taxonQueryStringParams;
}

#endregion

#region Private fields and constants
Expand All @@ -429,6 +464,7 @@ private void SetRedirectUrlQueryString(ITaxon taxon)

private bool? disableCanonicalUrlMetaTag;
private bool openInSamePage = true;
private const string WidgetName = "BlogPost_MVC";

#endregion
}
Expand Down
Loading

0 comments on commit bc5938d

Please sign in to comment.