Merge pull request #11276 from abpframework/auto-merge/rel-5-1/784

Merge branch dev with rel-5.1
pull/11287/head
Mehmet Erim 4 years ago committed by GitHub
commit 4e0ff27cd9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,7 @@
./1-fetch-and-build.ps1
./2-nuget-pack.ps1
./3-nuget-push.ps1
./4-npm-publish-mvc.ps1
./5-npm-publish-angular.ps1
./6-git-commit.ps1
echo "Create a new release on GitHub manually and run the step 8..."

@ -121,7 +121,6 @@ public class NpmPackagesUpdater : ITransientDependency
{
var fileName = Path.Combine(directoryName, ".npmrc");
var abpRegistry = "@abp:registry=https://www.myget.org/F/abp-nightly/npm";
var voloRegistry = await GetVoloRegistryAsync();
if (await NpmrcFileExistAsync(directoryName))
{
@ -132,11 +131,6 @@ public class NpmPackagesUpdater : ITransientDependency
fileContent += Environment.NewLine + abpRegistry;
}
if (!fileContent.Contains(voloRegistry))
{
fileContent += Environment.NewLine + voloRegistry;
}
File.WriteAllText(fileName, fileContent);
return;
@ -145,42 +139,10 @@ public class NpmPackagesUpdater : ITransientDependency
using var fs = File.Create(fileName);
var content = new UTF8Encoding(true)
.GetBytes(abpRegistry + Environment.NewLine + voloRegistry);
.GetBytes(abpRegistry);
fs.Write(content, 0, content.Length);
}
private async Task<string> GetVoloRegistryAsync()
{
var apikey = await GetApiKeyAsync();
if (string.IsNullOrWhiteSpace(apikey))
{
return "";
}
return "@volo:registry=https://www.myget.org/F/abp-commercial/auth/" + apikey + "/npm/";
}
public async Task<string> GetApiKeyAsync()
{
try
{
var client = _cliHttpClientFactory.CreateClient();
using (var response = await client.GetHttpResponseMessageWithRetryAsync(
url: $"{CliUrls.WwwAbpIo}api/myget/apikey/",
cancellationToken: CancellationTokenProvider.Token,
logger: Logger
))
{
return Encoding.Default.GetString(await response.Content.ReadAsByteArrayAsync());
}
}
catch (Exception)
{
return string.Empty;
}
}
private static bool IsAngularProject(string fileDirectory)
{
return File.Exists(Path.Combine(fileDirectory, "angular.json"));

@ -21,3 +21,10 @@ export function interpolate(text: string, params: string[]) {
.replace(/(['"]?\{\s*(\d+)\s*\}['"]?)/g, (_, match, digit) => params[digit] ?? match)
.replace(/\s+/g, ' ');
}
export function escapeHtmlChars(value: string) {
return (
value &&
value.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;')
);
}

@ -1,4 +1,4 @@
import { LocalizationService } from '@abp/ng.core';
import { escapeHtmlChars, LocalizationService } from '@abp/ng.core';
import { IdentityRoleDto } from '@abp/ng.identity/proxy';
import { EntityProp, ePropType } from '@abp/ng.theme.shared/extensions';
import { of } from 'rxjs';
@ -15,7 +15,7 @@ export const DEFAULT_ROLES_ENTITY_PROPS = EntityProp.createMany<IdentityRoleDto>
const { isDefault, isPublic, name } = data.record;
return of(
name +
escapeHtmlChars(name) +
(isDefault
? `<span class="badge rounded-pill bg-success ms-1">${t(
'AbpIdentity::DisplayName:IsDefault',

@ -1,4 +1,4 @@
import { LocalizationService } from '@abp/ng.core';
import { escapeHtmlChars, LocalizationService } from '@abp/ng.core';
import { IdentityUserDto } from '@abp/ng.identity/proxy';
import { EntityProp, ePropType } from '@abp/ng.theme.shared/extensions';
import { of } from 'rxjs';
@ -21,7 +21,9 @@ export const DEFAULT_USERS_ENTITY_PROPS = EntityProp.createMany<IdentityUserDto>
return of(
`
${!data.record.isActive ? inactiveIcon : ''}
<span class="${!data.record.isActive ? 'text-muted' : ''}">${data.record.userName}</span>`,
<span class="${!data.record.isActive ? 'text-muted' : ''}">${escapeHtmlChars(
data.record.userName,
)}</span>`,
);
},
},

@ -1,7 +1,7 @@
import { ABP, escapeHtmlChars } from '@abp/ng.core';
import { Type } from '@angular/core';
import { Observable, of } from 'rxjs';
import { O } from 'ts-toolbelt';
import { ABP } from '@abp/ng.core';
import { ActionCallback } from './actions';
import {
Prop,
@ -43,7 +43,8 @@ export class EntityProp<R = any> extends Prop<R> {
this.columnWidth = options.columnWidth;
this.sortable = options.sortable || false;
this.valueResolver = options.valueResolver || (data => of(data.record[this.name]));
this.valueResolver =
options.valueResolver || (data => of(escapeHtmlChars(data.record[this.name])));
this.action = options.action;
this.component = options.component;
this.enumList = options.enumList;

Loading…
Cancel
Save