Browse Source

Merge branch 'dev' into dev-client-validation

pull/5973/head
Mladen Macanovic 6 years ago
parent
commit
4a754d94a5
  1. 2
      framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo.Abp.AspNetCore.Components.WebAssembly.csproj
  2. 2
      framework/src/Volo.Abp.Validation/Volo/Abp/Validation/Localization/zh-Hans.json
  3. 3
      modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/en.json
  4. 3
      modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/sl.json
  5. 3
      modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/tr.json
  6. 5
      modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/zh-Hans.json
  7. 8
      modules/account/src/Volo.Abp.Account.Application/Volo/Abp/Account/AccountAppService.cs
  8. 27
      modules/account/src/Volo.Abp.Account.Web/Pages/Account/ForgotPassword.cshtml.cs
  9. 1
      modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/DocsAdminPermissionDefinitionProvider.cs
  10. 1
      modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/DocsAdminPermissions.cs
  11. 12
      modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Documents/PullDocumentInput.cs
  12. 7
      modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/Projects/ProjectAdminAppService.cs
  13. 6
      modules/docs/src/Volo.Docs.Admin.Web/DocsAdminWebAutoMapperProfile.cs
  14. 1
      modules/docs/src/Volo.Docs.Admin.Web/DocsAdminWebModule.cs
  15. 20
      modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Documents/Index.cshtml
  16. 43
      modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Documents/index.js
  17. 3
      modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/index.js
  18. 5
      modules/docs/src/Volo.Docs.Application/Volo/Docs/DocsApplicationAutoMapperProfile.cs
  19. 34
      modules/docs/src/Volo.Docs.Application/Volo/Docs/Documents/DocumentAppService.cs
  20. 7
      modules/docs/src/Volo.Docs.Application/Volo/Docs/Projects/ProjectAppService.cs
  21. 3
      npm/ng-packs/packages/schematics/src/utils/model.ts
  22. 7
      npm/ng-packs/packages/theme-shared/src/lib/components/toast/toast.component.html
  23. 345
      templates/app/angular/src/app/home/home.component.html
  24. 23
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/Pages/Index.razor
  25. 57
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/Pages/Index.razor.cs

2
framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo.Abp.AspNetCore.Components.WebAssembly.csproj

@ -20,7 +20,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="3.1.8" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="3.2.1" />
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="3.1.8" />
<PackageReference Include="Microsoft.AspNetCore.WebUtilities" Version="2.2.0" />
</ItemGroup>

2
framework/src/Volo.Abp.Validation/Volo/Abp/Validation/Localization/zh-Hans.json

@ -27,7 +27,7 @@
"ThisFieldMustMatchTheRegularExpression{0}": "字段必须匹配正则表达式'{0}'.",
"ThisFieldIsRequired.": "字段不可为空.",
"ThisFieldMustBeAStringWithAMaximumLengthOf{0}": "字段必须是长度为{0}的字符串.",
"ThisFieldMustBeAStringWithAMinimumLengthOf{1}AndAMaximumLengthOf{0}": "字段必须是最小长度为{1}并且最大长度{*}的字符串.",
"ThisFieldMustBeAStringWithAMinimumLengthOf{1}AndAMaximumLengthOf{0}": "字段必须是最小长度为{1}并且最大长度{0}的字符串.",
"ThisFieldIsNotAValidFullyQualifiedHttpHttpsOrFtpUrl": "字段{0}不是有效的完全限定的http,https或ftp URL.",
"ThisFieldIsInvalid.": "该字段无效."
}

3
modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/en.json

@ -56,6 +56,7 @@
"BackToLogin": "Back to login",
"ProfileTab:Password": "Change password",
"ProfileTab:PersonalInfo": "Personal info",
"ReturnToApplication": "Return to application"
"ReturnToApplication": "Return to application",
"Volo.Account:InvalidEmailAddress": "Can not find the given email address: {0}"
}
}

3
modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/sl.json

@ -48,6 +48,7 @@
"ConfirmPassword": "Potrditev (ponovitev) gesla",
"ResetPassword_Information": "Prosimo vnesite vaše novo geslo.",
"YourPasswordIsSuccessfullyReset": "Vaše geslo je uspešno ponastavljeno.",
"BackToLogin": "Nazaj na prijavo"
"BackToLogin": "Nazaj na prijavo",
"Volo.Account:InvalidEmailAddress": "Navedenega e-poštnega naslova ni mogoče najti: {0}"
}
}

3
modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/tr.json

@ -56,6 +56,7 @@
"BackToLogin": "Girişe dön",
"ProfileTab:Password": "Şifre değiştir",
"ProfileTab:PersonalInfo": "Kişisel bilgiler",
"ReturnToApplication": "Uygulamaya geri dön"
"ReturnToApplication": "Uygulamaya geri dön",
"Volo.Account:InvalidEmailAddress": "Email adresi bulunamadı: {0}"
}
}

5
modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/zh-Hans.json

@ -55,6 +55,9 @@
"BackToLogin": "返回登录",
"ProfileTab:Password": "更改密码",
"ProfileTab:PersonalInfo": "个人信息",
"ReturnToApplication": "返回到应用程序"
"ReturnToApplication": "返回到应用程序",
"Volo.Account:InvalidEmailAddress": "找不到给定的电子邮件地址:{0}",
"Volo.Account:SelfRegistrationDisabled": "自我注册已禁用!",
}
}

8
modules/account/src/Volo.Abp.Account.Application/Volo/Abp/Account/AccountAppService.cs

@ -1,7 +1,7 @@
using System.Linq;
using System.Threading.Tasks;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Identity;
using Volo.Abp.Account.Emailing;
using Volo.Abp.Account.Localization;
using Volo.Abp.Account.Settings;
using Volo.Abp.Application.Services;
using Volo.Abp.Identity;
@ -26,6 +26,7 @@ namespace Volo.Abp.Account
AccountEmailer = accountEmailer;
IdentitySecurityLogManager = identitySecurityLogManager;
UserManager = userManager;
LocalizationResource = typeof(AccountResource);
}
public virtual async Task<IdentityUserDto> RegisterAsync(RegisterDto input)
@ -66,8 +67,7 @@ namespace Volo.Abp.Account
var user = await UserManager.FindByEmailAsync(email);
if (user == null)
{
throw new BusinessException("Volo.Account:InvalidEmailAddress")
.WithData("Email", email);
throw new UserFriendlyException(L["Volo.Account:InvalidEmailAddress", email]);
}
return user;

27
modules/account/src/Volo.Abp.Account.Web/Pages/Account/ForgotPassword.cshtml.cs

@ -29,15 +29,24 @@ namespace Volo.Abp.Account.Web.Pages.Account
public virtual async Task<IActionResult> OnPostAsync()
{
await AccountAppService.SendPasswordResetCodeAsync(
new SendPasswordResetCodeDto
{
Email = Email,
AppName = "MVC", //TODO: Const!
ReturnUrl = ReturnUrl,
ReturnUrlHash = ReturnUrlHash
}
);
try
{
await AccountAppService.SendPasswordResetCodeAsync(
new SendPasswordResetCodeDto
{
Email = Email,
AppName = "MVC", //TODO: Const!
ReturnUrl = ReturnUrl,
ReturnUrlHash = ReturnUrlHash
}
);
}
catch (UserFriendlyException e)
{
Alerts.Danger(e.Message);
return Page();
}
return RedirectToPage(
"./PasswordResetLinkSent",

1
modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/DocsAdminPermissionDefinitionProvider.cs

@ -16,7 +16,6 @@ namespace Volo.Docs.Admin
projects.AddChild(DocsAdminPermissions.Projects.Create, L("Permission:Create"));
group.AddPermission(DocsAdminPermissions.Documents.Default, L("Permission:Documents"));
}
private static LocalizableString L(string name)

1
modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/DocsAdminPermissions.cs

@ -19,7 +19,6 @@ namespace Volo.Docs.Admin
public const string Default = GroupName + ".Documents";
}
public static string[] GetAll()
{
return ReflectionHelper.GetPublicConstantsRecursively(typeof(DocsAdminPermissions));

12
modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Documents/PullDocumentInput.cs

@ -5,17 +5,9 @@ using Volo.Docs.Documents;
namespace Volo.Docs.Admin.Documents
{
public class PullDocumentInput
public class PullDocumentInput : PullAllDocumentInput
{
public Guid ProjectId { get; set; }
[DynamicStringLength(typeof(DocumentConsts), nameof(DocumentConsts.MaxNameLength))]
public string Name { get; set; }
[DynamicStringLength(typeof(DocumentConsts), nameof(DocumentConsts.MaxLanguageCodeNameLength))]
public string LanguageCode { get; set; }
[DynamicStringLength(typeof(DocumentConsts), nameof(DocumentConsts.MaxVersionNameLength))]
public string Version { get; set; }
}
}
}

7
modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/Projects/ProjectAdminAppService.cs

@ -42,9 +42,10 @@ namespace Volo.Docs.Admin.Projects
var totalCount = await _projectRepository.GetCountAsync();
var dtos = ObjectMapper.Map<List<Project>, List<ProjectDto>>(projects);
return new PagedResultDto<ProjectDto>(totalCount, dtos);
return new PagedResultDto<ProjectDto>(
totalCount,
ObjectMapper.Map<List<Project>, List<ProjectDto>>(projects)
);
}
public async Task<ProjectDto> GetAsync(Guid id)

6
modules/docs/src/Volo.Docs.Admin.Web/DocsAdminWebAutoMapperProfile.cs

@ -10,9 +10,11 @@ namespace Volo.Docs.Admin
{
public DocsAdminWebAutoMapperProfile()
{
CreateMap<CreateModel.CreateGithubProjectViewModel, CreateProjectDto>().Ignore(x => x.ExtraProperties);
CreateMap<CreateModel.CreateGithubProjectViewModel, CreateProjectDto>()
.Ignore(x => x.ExtraProperties);
CreateMap<EditModel.EditGithubProjectViewModel, UpdateProjectDto>().Ignore(x => x.ExtraProperties);
CreateMap<EditModel.EditGithubProjectViewModel, UpdateProjectDto>()
.Ignore(x => x.ExtraProperties);
CreateMap<ProjectDto, EditModel.EditGithubProjectViewModel > ()
.Ignore(x => x.GitHubAccessToken)

1
modules/docs/src/Volo.Docs.Admin.Web/DocsAdminWebModule.cs

@ -31,7 +31,6 @@ namespace Volo.Docs.Admin
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpNavigationOptions>(options =>
{
options.MenuContributors.Add(new DocsMenuContributor());

20
modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Documents/Index.cshtml

@ -98,7 +98,7 @@
</div>
</div>
<div class="col-auto">
<div class="input-group mb-2">
<div class="input-group-prepend">
@ -110,12 +110,12 @@
id="CreationTimeMin"
name="CreationTimeMin"
class="form-control datepicker"
placeholder="@L["StartDate"]">
placeholder="@L["StartDate"].Value">
<span>-</span>
<input type="date"
id="CreationTimeMax"
name="CreationTimeMax"
placeholder="@L["EndDate"]"
placeholder="@L["EndDate"].Value"
class="form-control datepicker">
</span>
</div>
@ -132,12 +132,12 @@
id="LastUpdatedTimeMin"
name="LastUpdatedTimeMin"
class="form-control datepicker"
placeholder="@L["StartDate"]">
placeholder="@L["StartDate"].Value">
<span>-</span>
<input type="date"
id="LastUpdatedTimeMax"
name="LastUpdatedTimeMax"
placeholder="@L["EndDate"]"
placeholder="@L["EndDate"].Value"
class="form-control datepicker">
</span>
</div>
@ -154,12 +154,12 @@
id="LastSignificantUpdateTimeMin"
name="LastSignificantUpdateTimeMin"
class="form-control datepicker"
placeholder="@L["StartDate"]">
placeholder="@L["StartDate"].Value">
<span>-</span>
<input type="date"
id="LastSignificantUpdateTimeMax"
name="LastSignificantUpdateTimeMax"
placeholder="@L["EndDate"]"
placeholder="@L["EndDate"].Value"
class="form-control datepicker">
</span>
</div>
@ -176,12 +176,12 @@
id="LastCachedTimeMin"
name="LastCachedTimeMin"
class="form-control datepicker"
placeholder="@L["StartDate"]">
placeholder="@L["StartDate"].Value">
<span>-</span>
<input type="date"
id="LastCachedTimeMax"
name="LastCachedTimeMax"
placeholder="@L["EndDate"]"
placeholder="@L["EndDate"].Value"
class="form-control datepicker">
</span>
</div>
@ -212,4 +212,4 @@
</abp-table>
</abp-card-body>
</abp-card>
</div>
</div>

43
modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Documents/index.js

@ -18,17 +18,20 @@
creationTimeMax: getFormattedDate($('#CreationTimeMax')),
lastUpdatedTimeMin: getFormattedDate($('#LastUpdatedTimeMin')),
lastUpdatedTimeMax: getFormattedDate($('#LastUpdatedTimeMax')),
lastSignificantUpdateTimeMin: getFormattedDate(
$('#LastSignificantUpdateTimeMin')
),
lastSignificantUpdateTimeMax: getFormattedDate(
$('#LastSignificantUpdateTimeMax')
),
lastSignificantUpdateTimeMin: getFormattedDate($('#LastSignificantUpdateTimeMin')),
lastSignificantUpdateTimeMax: getFormattedDate($('#LastSignificantUpdateTimeMax')),
lastCachedTimeMin: getFormattedDate($('#LastCachedTimeMin')),
lastCachedTimeMax: getFormattedDate($('#LastCachedTimeMax')),
};
};
var parseDateToLocaleDateString = function (date) {
var parsedDate = Date.parse(date);
return new Date(parsedDate).toLocaleDateString(
abp.localization.currentCulture.name
);
};
var dataTable = $('#DocumentsTable').DataTable(
abp.libs.datatables.normalizeConfiguration({
processing: true,
@ -55,9 +58,7 @@
service
.removeFromCache(data.record.id)
.then(function () {
abp.message.success(
l('RemovedFromCache')
);
abp.message.success(l('RemovedFromCache'));
dataTable.ajax.reload();
});
},
@ -74,9 +75,7 @@
service
.reindex(data.record.id)
.then(function () {
abp.message.success(
l('ReindexCompleted')
);
abp.message.success(l('ReindexCompleted'));
dataTable.ajax.reload();
});
},
@ -112,10 +111,7 @@
return '';
}
var date = Date.parse(creationTime);
return new Date(date).toLocaleDateString(
abp.localization.currentCulture.name
);
return parseDateToLocaleDateString(creationTime);
},
},
{
@ -126,10 +122,7 @@
return '';
}
var date = Date.parse(lastUpdatedTime);
return new Date(date).toLocaleDateString(
abp.localization.currentCulture.name
);
return parseDateToLocaleDateString(lastUpdatedTime);
},
},
{
@ -140,10 +133,7 @@
return '';
}
var date = Date.parse(lastSignificantUpdateTime);
return new Date(date).toLocaleDateString(
abp.localization.currentCulture.name
);
return parseDateToLocaleDateString(lastSignificantUpdateTime);
},
},
{
@ -154,10 +144,7 @@
return '';
}
var date = Date.parse(lastCachedTime);
return new Date(date).toLocaleDateString(
abp.localization.currentCulture.name
);
return parseDateToLocaleDateString(lastCachedTime);
},
},
],

3
modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/index.js

@ -156,8 +156,7 @@
.confirm(l('ReIndexAllProjectConfirmationMessage'))
.done(function (accepted) {
if (accepted) {
volo.docs.admin.projectsAdmin
.reindexAll()
volo.docs.admin.projectsAdmin.reindexAll()
.then(function () {
abp.message.success(
l('SuccessfullyReIndexAllProject')

5
modules/docs/src/Volo.Docs.Application/Volo/Docs/DocsApplicationAutoMapperProfile.cs

@ -11,10 +11,9 @@ namespace Volo.Docs
{
CreateMap<Project, ProjectDto>();
CreateMap<VersionInfo, VersionInfoDto>();
CreateMap<Document, DocumentWithDetailsDto>()
.Ignore(x => x.Project).Ignore(x => x.Contributors);
CreateMap<Document, DocumentWithDetailsDto>().Ignore(x => x.Project).Ignore(x => x.Contributors);
CreateMap<DocumentContributor, DocumentContributorDto>();
CreateMap<DocumentResource, DocumentResourceDto>();
}
}
}
}

34
modules/docs/src/Volo.Docs.Application/Volo/Docs/Documents/DocumentAppService.cs

@ -213,8 +213,7 @@ namespace Volo.Docs.Documents
input.Version
);
if (!JsonConvertExtensions.TryDeserializeObject<DocumentParametersDto>(document.Content,
out var documentParameters))
if (!JsonConvertExtensions.TryDeserializeObject<DocumentParametersDto>(document.Content,out var documentParameters))
{
throw new UserFriendlyException(
$"Cannot validate document parameters file '{project.ParametersDocumentName}' for the project {project.Name}.");
@ -257,10 +256,10 @@ namespace Volo.Docs.Documents
}
var cacheKey = CacheKeyGenerator.GenerateDocumentUpdateInfoCacheKey(
project: project,
documentName: document.Name,
languageCode: document.LanguageCode,
version: document.Version
project,
document.Name,
document.LanguageCode,
document.Version
);
await DocumentUpdateCache.SetAsync(cacheKey, new DocumentUpdateInfo
@ -277,9 +276,10 @@ namespace Volo.Docs.Documents
protected virtual DocumentWithDetailsDto CreateDocumentWithDetailsDto(Project project, Document document)
{
var documentDto = ObjectMapper.Map<Document, DocumentWithDetailsDto>(document);
documentDto.Project = ObjectMapper.Map<Project, ProjectDto>(project);
documentDto.Contributors =
ObjectMapper.Map<List<DocumentContributor>, List<DocumentContributorDto>>(document.Contributors);
documentDto.Contributors = ObjectMapper.Map<List<DocumentContributor>, List<DocumentContributorDto>>(document.Contributors);
return documentDto;
}
@ -289,8 +289,7 @@ namespace Volo.Docs.Documents
Logger.LogInformation($"Not found in the cache. Requesting {documentName} from the source...");
var source = _documentStoreFactory.Create(project.DocumentStoreType);
var sourceDocument = await source.GetDocumentAsync(project, documentName, languageCode, version,
oldDocument?.LastSignificantUpdateTime);
var sourceDocument = await source.GetDocumentAsync(project, documentName, languageCode, version, oldDocument?.LastSignificantUpdateTime);
await _documentRepository.DeleteAsync(project.Id, sourceDocument.Name, sourceDocument.LanguageCode,
sourceDocument.Version);
@ -299,10 +298,10 @@ namespace Volo.Docs.Documents
Logger.LogInformation($"Document retrieved: {documentName}");
var cacheKey = CacheKeyGenerator.GenerateDocumentUpdateInfoCacheKey(
project: project,
documentName: sourceDocument.Name,
languageCode: sourceDocument.LanguageCode,
version: sourceDocument.Version
project,
sourceDocument.Name,
sourceDocument.LanguageCode,
sourceDocument.Version
);
await DocumentUpdateCache.SetAsync(cacheKey, new DocumentUpdateInfo
@ -351,12 +350,13 @@ namespace Volo.Docs.Documents
private string GetProjectVersionPrefixIfExist(Project project)
{
if (GetGithubVersionProviderSource(project) == GithubVersionProviderSource.Branches)
if (GetGithubVersionProviderSource(project) != GithubVersionProviderSource.Branches)
{
return project.ExtraProperties["VersionBranchPrefix"].ToString();
return string.Empty;
}
return "";
return project.ExtraProperties["VersionBranchPrefix"].ToString();
}
private GithubVersionProviderSource GetGithubVersionProviderSource(Project project)

7
modules/docs/src/Volo.Docs.Application/Volo/Docs/Projects/ProjectAppService.cs

@ -125,12 +125,13 @@ namespace Volo.Docs.Projects
private string GetProjectVersionPrefixIfExist(Project project)
{
if (GetGithubVersionProviderSource(project) == GithubVersionProviderSource.Branches)
if (GetGithubVersionProviderSource(project) != GithubVersionProviderSource.Branches)
{
return project.ExtraProperties["VersionBranchPrefix"].ToString();
return string.Empty;
}
return "";
return project.ExtraProperties["VersionBranchPrefix"].ToString();
}
private GithubVersionProviderSource GetGithubVersionProviderSource(Project project)

3
npm/ng-packs/packages/schematics/src/utils/model.ts

@ -134,7 +134,8 @@ export function createImportRefToInterfaceReducerCreator(params: ModelGeneratorP
return _interface.properties
.reduce<string[]>((refs, prop) => {
prop.refs.forEach(type => {
if (types[type]?.isEnum || type === _interface.ref) return;
if (types[type]?.isEnum) return;
if (interfaces.some(i => i.ref === type)) return;
refs.push(type);
});

7
npm/ng-packs/packages/theme-shared/src/lib/components/toast/toast.component.html

@ -9,8 +9,9 @@
<div class="abp-toast-title">
{{ toast.title | abpLocalization: toast.options?.titleLocalizationParams }}
</div>
<p class="abp-toast-message">
{{ toast.message | abpLocalization: toast.options?.messageLocalizationParams }}
</p>
<p
class="abp-toast-message"
[innerHTML]="toast.message | abpLocalization: toast.options?.messageLocalizationParams"
></p>
</div>
</div>

345
templates/app/angular/src/app/home/home.component.html

@ -1,14 +1,333 @@
<div id="AbpContentToolbar"></div>
<div class="jumbotron text-center">
<h1>{{ '::Welcome' | abpLocalization }}</h1>
<div class="row">
<div class="col-md-6 mx-auto">
<p>{{ '::LongWelcomeMessage' | abpLocalization }}</p>
<hr class="my-4" />
</div>
</div>
<a href="https://abp.io?ref=tmpl" target="_blank" class="btn btn-primary px-4">abp.io</a>
<a *ngIf="!hasLoggedIn" (click)="login()" class="px-4 btn btn-primary ml-1" role="button"
><i class="fa fa-sign-in"></i> {{ 'AbpAccount::Login' | abpLocalization }}</a
>
<div class="container">
<div class="p-5 text-center">
<div class="badge badge-success h5 rounded mb-4" role="alert">
<h5 class="m-1">
<i class="fas fa-rocket"></i> Congratulations, <strong>MyProjectName</strong> is
successfully running!
</h5>
</div>
<h1>{{ '::Welcome' | abpLocalization }}</h1>
<p class="lead px-lg-5 mx-lg-5">{{ '::LongWelcomeMessage' | abpLocalization }}</p>
<a *ngIf="!hasLoggedIn" (click)="login()" class="px-4 btn btn-primary ml-1" role="button"
><i class="fa fa-sign-in"></i> {{ 'AbpAccount::Login' | abpLocalization }}</a
>
</div>
<div class="my-3 text-center">
<h3>Let's improve your application!</h3>
<p>Here are some links to help you get started:</p>
</div>
<div class="card mt-4 mb-5">
<div class="card-body">
<div class="row text-center justify-content-md-center">
<ng-container
*ngTemplateOutlet="
starterLinkTemplate;
context: {
$implicit: {
title: 'Learn the ABP Framework',
description:
'Explore the compherensive documentation to learn how to build a modern web application.',
links: [
{
href: 'https://docs.abp.io/en/abp/latest?ref=tmpl',
label: 'See Documents'
}
]
}
}
"
></ng-container>
<ng-container
*ngTemplateOutlet="
starterLinkTemplate;
context: {
$implicit: {
title: 'Samples',
description: 'See the example projects built with the ABP Framework.',
links: [
{
href: 'https://docs.abp.io/en/abp/latest/Samples/Index?ref=tmpl',
label: 'All samples'
}
]
}
}
"
></ng-container>
<ng-container
*ngTemplateOutlet="
starterLinkTemplate;
context: {
$implicit: {
title: 'ABP Community',
description: 'Get involved with a vibrant community and become a contributor.',
links: [
{
href: 'https://community.abp.io/',
label: 'Community'
},
{
href: 'https://docs.abp.io/en/abp/latest/Contribution/Index?ref=tmpl',
label: 'Contribute'
}
]
}
}
"
></ng-container>
</div>
<div class="row text-center mt-lg-3 justify-content-md-center">
<ng-container
*ngTemplateOutlet="
starterLinkTemplate;
context: {
$implicit: {
title: 'ABP Blog',
description: 'Take a look at our recently published articles.',
links: [
{
href: 'https://blog.abp.io/abp?ref=tmpl',
label: 'See Blog'
}
]
}
}
"
></ng-container>
<ng-template #githubButtonsTemplate>
<p class="mb-1">
<iframe
scrolling="no"
src="https://buttons.github.io/buttons.html#href=https%3A%2F%2Fgithub.com%2Fabpframework%2Fabp&amp;title=&amp;aria-label=Star%20tabalinas%2Fjsgrid%20on%20GitHub&amp;data-icon=octicon-star&amp;data-text=Star&amp;data-size=large&amp;data-show-count=true"
style="
width: 122px;
height: 28px;
border: none;
display: inline-block;
margin-right: 4px;
"
></iframe>
<iframe
scrolling="no"
src="https://buttons.github.io/buttons.html#href=https%3A%2F%2Fgithub.com%2Fabpframework%2Fabp%2Fissues&amp;title=&amp;aria-label=Issue%20tabalinas%2Fjsgrid%20on%20GitHub&amp;data-icon=octicon-issue-opened&amp;data-text=Issue&amp;data-size=large"
style="
width: 72px;
height: 28px;
border: none;
display: inline-block;
margin-right: 4px;
"
></iframe>
<iframe
scrolling="no"
src="https://buttons.github.io/buttons.html#href=https%3A%2F%2Fgithub.com%2Fabpframework%2Fabp%2Ffork&amp;title=&amp;aria-label=Fork%20tabalinas%2Fjsgrid%20on%20GitHub&amp;data-icon=octicon-repo-forked&amp;data-text=Fork&amp;data-size=large&amp;"
style="width: 72px; height: 28px; border: none; display: inline-block"
></iframe>
</p>
</ng-template>
<ng-container
*ngTemplateOutlet="
starterLinkTemplate;
context: {
$implicit: {
title: 'Github',
description:
'Do you love the ABP Framework? Please <strong>give a star</strong> to support it!',
links: [
{
href: 'https://github.com/abpframework/abp/issues/new?template=feature.md',
label: 'Request a feature'
}
],
customTemplate: githubButtonsTemplate
}
}
"
></ng-container>
<ng-container
*ngTemplateOutlet="
starterLinkTemplate;
context: {
$implicit: {
title: 'Stackoverflow',
description: 'See answers to previously asked questions or ask a new one.',
links: [
{
href: 'https://stackoverflow.com/questions/tagged/abp',
label: 'Questions'
},
{
href: 'https://stackoverflow.com/questions/ask',
label: 'Ask a Question'
}
]
}
}
"
></ng-container>
</div>
</div>
</div>
<div class="mt-5 my-3 text-center">
<h3>Meet the ABP Commercial</h3>
<p>A Complete Web Application Platform Built on the ABP Framework</p>
</div>
<div class="card mt-4 mb-5">
<div class="card-body">
<p class="px-lg-5 mx-lg-5 py-3 text-center">
<a href="https://commercial.abp.io/" target="_blank">ABP Commercial</a> is a platform based
on the open source ABP framework. It provides pre-built application modules, rapid
application development tooling, professional UI themes, premium support and more.
</p>
<div class="row text-center justify-content-md-center">
<ng-container
*ngTemplateOutlet="
featuresTemplate;
context: {
$implicit: {
title: 'Startup Templates',
href: 'https://commercial.abp.io/startup-templates?ref=tmpl'
}
}
"
></ng-container>
<ng-container
*ngTemplateOutlet="
featuresTemplate;
context: {
$implicit: {
title: 'Application Modules',
href: 'https://commercial.abp.io/modules?ref=tmpl'
}
}
"
></ng-container>
<ng-container
*ngTemplateOutlet="
featuresTemplate;
context: {
$implicit: {
title: 'Developer<br />Tools',
href: 'https://commercial.abp.io/tools?ref=tmpl'
}
}
"
></ng-container>
<ng-container
*ngTemplateOutlet="
featuresTemplate;
context: {
$implicit: {
title: 'UI<br />Themes',
href: 'https://commercial.abp.io/themes?ref=tmpl'
}
}
"
></ng-container>
<ng-container
*ngTemplateOutlet="
featuresTemplate;
context: {
$implicit: {
title: 'Premium Support',
href: 'https://support.abp.io/QA/Questions?ref=tmpl'
}
}
"
></ng-container>
<ng-container
*ngTemplateOutlet="
featuresTemplate;
context: {
$implicit: {
title: 'Additional Services',
href: 'https://commercial.abp.io/additional-services?ref=tmpl'
}
}
"
></ng-container>
</div>
</div>
</div>
<div class="mb-5 text-center">
<p class="align-middle">
<a href="https://twitter.com/abpframework" target="_blank" class="mx-2"
><i class="fa fa-twitter"></i><span class="text-secondary"> Abp Framework</span></a
>
<a href="https://twitter.com/abpcommercial" target="_blank" class="mx-2"
><i class="fa fa-twitter"></i><span class="text-secondary"> Abp Commercial</span></a
>
<a href="https://github.com/abpframework/abp" target="_blank" class="mx-2"
><i class="fa fa-github"></i><span class="text-secondary"> abpframework</span></a
>
</p>
</div>
</div>
<ng-template #starterLinkTemplate let-context>
<div class="col-lg-4 border-left">
<div class="p-4">
<h5 class="mb-3">
<i class="fas fa-cubes text-secondary d-block my-3 fa-2x"></i> {{ context.title }}
</h5>
<p [innerHTML]="context.description"></p>
<ng-container
*ngIf="context.customTemplate"
[ngTemplateOutlet]="context.customTemplate"
></ng-container>
<a
*ngFor="let link of context.links"
[href]="link.href"
target="_blank"
class="btn btn-link px-1"
>{{ link.label }} <i class="fas fa-chevron-right"></i
></a>
</div>
</div>
</ng-template>
<ng-template #featuresTemplate let-context>
<div class="col-lg-2 border-left">
<div class="p-3">
<h6>
<i class="fas fa-plus d-block mb-3 fa- 2x text-secondary"></i>
<span [innerHTML]="context.title"></span>
<a [href]="context.href" target="_blank" class="d-block mt-2 btn btn-sm btn-link"
>Details <i class="fas fa-chevron-right"></i
></a>
</h6>
</div>
</div>
</ng-template>
<style scoped>
.col-lg-2.border-left:nth-of-type(6n + 1) {
border-left: 0 !important;
}
.col-lg-4.border-left:nth-of-type(3n + 1) {
border-left: 0 !important;
}
@media (max-width: 991px) {
.border-left {
border-left: 0 !important;
}
}
</style>

23
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/Pages/Index.razor

@ -13,29 +13,6 @@
<h5 class="m-1"> <i class="fas fa-rocket"></i> Congratulations, <strong>MyProjectName</strong> is successfully running!</h5>
</Badge>
<Card>
<CardHeader>
<CardTitle>UI Message Tests</CardTitle>
</CardHeader>
<CardBody>
<Button Color="Color.Info" Clicked="@OnInfoTestClicked">
INFO
</Button>
<Button Color="Color.Success" Clicked="@OnSuccessTestClicked">
SUCCESS
</Button>
<Button Color="Color.Warning" Clicked="@OnWarningTestClicked">
WARNING
</Button>
<Button Color="Color.Danger" Clicked="@OnErrorTestClicked">
DANGER
</Button>
<Button Color="Color.Secondary" Clicked="@OnConfirmTestClicked">
CONFIRM
</Button>
</CardBody>
</Card>
<h1>Welcome to the Application</h1>
<p class="lead px-lg-5 mx-lg-5">@L["LongWelcomeMessage"]</p>

57
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/Pages/Index.razor.cs

@ -1,62 +1,7 @@
using System;
using System.Collections.Generic;
using System.Security.Claims;
using System.Threading.Tasks;
using Blazorise;
using Microsoft.AspNetCore.Components;
using Volo.Abp.AspNetCore.Components.WebAssembly;
namespace MyCompanyName.MyProjectName.Blazor.Pages
namespace MyCompanyName.MyProjectName.Blazor.Pages
{
public partial class Index
{
private IEnumerable<Claim> _claims;
protected override async Task OnInitializedAsync()
{
var authState = await AuthenticationStateProvider.GetAuthenticationStateAsync();
if ( authState.User.Identity.IsAuthenticated )
{
_claims = authState.User.Claims;
}
}
Task OnInfoTestClicked()
{
return UiMessageService.InfoAsync( "This is the Info message", "Info", options =>
{
options.OkButtonIcon = IconName.InfoCircle;
options.OkButtonText = "Hello info";
} );
}
Task OnSuccessTestClicked()
{
return UiMessageService.SuccessAsync( "This is the Success message", "Success" );
}
Task OnWarningTestClicked()
{
return UiMessageService.WarnAsync( "This is the Warning message", "Warning" );
}
Task OnErrorTestClicked()
{
return UiMessageService.ErrorAsync( "This is the Error message", "Error" );
}
async Task OnConfirmTestClicked()
{
if ( await UiMessageService.ConfirmAsync( "Are you sure you want to delete the item?", "Confirm", options =>
{
options.CancelButtonText = "Do not delete it";
options.ConfirmButtonText = "Yes I'm sure";
} ) )
{
Console.WriteLine( "Confirmed" );
}
}
[Inject] IUiMessageService UiMessageService { get; set; }
}
}

Loading…
Cancel
Save