Browse Source

Merge branch 'dev' of https://github.com/abpframework/abp into dev

pull/4209/head
Halil İbrahim Kalkan 6 years ago
parent
commit
3385e6511e
  1. 21
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/GetSourceCommand.cs
  2. 22
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs
  3. 5
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/Services/SourceCodeDownloadService.cs
  4. 25
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/ProjectReferenceReplaceStep.cs
  5. 5
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/ProjectBuildArgs.cs
  6. 1
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionModuleAdder.cs
  7. 2
      npm/ng-packs/apps/dev-app/src/app/app.module.ts
  8. 1
      npm/ng-packs/packages/core/src/lib/models/common.ts
  9. 14
      npm/ng-packs/packages/core/src/lib/services/rest.service.ts

21
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/GetSourceCommand.cs

@ -48,16 +48,22 @@ namespace Volo.Abp.Cli.Commands
var outputFolder = GetOutPutFolder(commandLineArgs);
Logger.LogInformation("Output folder: " + outputFolder);
var gitHubLocalRepositoryPath = commandLineArgs.Options.GetOrNull(Options.GitHubLocalRepositoryPath.Long);
if (gitHubLocalRepositoryPath != null)
var gitHubAbpLocalRepositoryPath = commandLineArgs.Options.GetOrNull(Options.GitHubAbpLocalRepositoryPath.Long);
if (gitHubAbpLocalRepositoryPath != null)
{
Logger.LogInformation("GitHub Local Repository Path: " + gitHubLocalRepositoryPath);
Logger.LogInformation("GitHub Abp Local Repository Path: " + gitHubAbpLocalRepositoryPath);
}
var gitHubVoloLocalRepositoryPath = commandLineArgs.Options.GetOrNull(Options.GitHubVoloLocalRepositoryPath.Long);
if (gitHubVoloLocalRepositoryPath != null)
{
Logger.LogInformation("GitHub Volo Local Repository Path: " + gitHubVoloLocalRepositoryPath);
}
commandLineArgs.Options.Add(CliConsts.Command, commandLineArgs.Command);
await _sourceCodeDownloadService.DownloadAsync(
commandLineArgs.Target, outputFolder, version, gitHubLocalRepositoryPath, commandLineArgs.Options);
commandLineArgs.Target, outputFolder, version, gitHubAbpLocalRepositoryPath, gitHubVoloLocalRepositoryPath, commandLineArgs.Options);
}
private static string GetOutPutFolder(CommandLineArgs commandLineArgs)
@ -117,11 +123,16 @@ namespace Volo.Abp.Cli.Commands
public const string Long = "output-folder";
}
public static class GitHubLocalRepositoryPath
public static class GitHubAbpLocalRepositoryPath
{
public const string Long = "abp-path";
}
public static class GitHubVoloLocalRepositoryPath
{
public const string Long = "volo-path";
}
public static class Version
{
public const string Short = "v";

22
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs

@ -86,10 +86,16 @@ namespace Volo.Abp.Cli.Commands
Logger.LogInformation("Mobile App: " + mobileApp);
}
var gitHubLocalRepositoryPath = commandLineArgs.Options.GetOrNull(Options.GitHubLocalRepositoryPath.Long);
if (gitHubLocalRepositoryPath != null)
var gitHubAbpLocalRepositoryPath = commandLineArgs.Options.GetOrNull(Options.GitHubAbpLocalRepositoryPath.Long);
if (gitHubAbpLocalRepositoryPath != null)
{
Logger.LogInformation("GitHub Local Repository Path: " + gitHubLocalRepositoryPath);
Logger.LogInformation("GitHub Abp Local Repository Path: " + gitHubAbpLocalRepositoryPath);
}
var gitHubVoloLocalRepositoryPath = commandLineArgs.Options.GetOrNull(Options.GitHubVoloLocalRepositoryPath.Long);
if (gitHubVoloLocalRepositoryPath != null)
{
Logger.LogInformation("GitHub Volo Local Repository Path: " + gitHubVoloLocalRepositoryPath);
}
var templateSource = commandLineArgs.Options.GetOrNull(Options.TemplateSource.Short, Options.TemplateSource.Long);
@ -127,7 +133,8 @@ namespace Volo.Abp.Cli.Commands
databaseProvider,
uiFramework,
mobileApp,
gitHubLocalRepositoryPath,
gitHubAbpLocalRepositoryPath,
gitHubVoloLocalRepositoryPath,
templateSource,
commandLineArgs.Options,
connectionString
@ -299,11 +306,16 @@ namespace Volo.Abp.Cli.Commands
public const string Long = "output-folder";
}
public static class GitHubLocalRepositoryPath
public static class GitHubAbpLocalRepositoryPath
{
public const string Long = "abp-path";
}
public static class GitHubVoloLocalRepositoryPath
{
public const string Long = "volo-path";
}
public static class Version
{
public const string Short = "v";

5
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/Services/SourceCodeDownloadService.cs

@ -25,7 +25,7 @@ namespace Volo.Abp.Cli.Commands.Services
Logger = NullLogger<SourceCodeDownloadService>.Instance;
}
public async Task DownloadAsync(string moduleName, string outputFolder, string version, string gitHubLocalRepositoryPath, AbpCommandLineOptions options)
public async Task DownloadAsync(string moduleName, string outputFolder, string version, string gitHubAbpLocalRepositoryPath, string gitHubVoloLocalRepositoryPath, AbpCommandLineOptions options)
{
Logger.LogInformation("Downloading source code of " + moduleName);
Logger.LogInformation("Version: " + version);
@ -39,7 +39,8 @@ namespace Volo.Abp.Cli.Commands.Services
DatabaseProvider.NotSpecified,
UiFramework.NotSpecified,
null,
gitHubLocalRepositoryPath,
gitHubAbpLocalRepositoryPath,
gitHubVoloLocalRepositoryPath,
null,
options
)

25
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/ProjectReferenceReplaceStep.cs

@ -22,10 +22,13 @@ namespace Volo.Abp.Cli.ProjectBuilding.Building.Steps
return;
}
var localVoloRepoPath = context.BuildArgs.VoloGitHubLocalRepositoryPath;
new ProjectReferenceReplacer.LocalProjectPathReferenceReplacer(
context.Files,
context.Module?.Namespace ?? "MyCompanyName.MyProjectName",
localAbpRepoPath
localAbpRepoPath,
localVoloRepoPath
).Run();
}
else
@ -177,12 +180,14 @@ namespace Volo.Abp.Cli.ProjectBuilding.Building.Steps
public class LocalProjectPathReferenceReplacer : ProjectReferenceReplacer
{
private readonly string _gitHubLocalRepositoryPath;
private readonly string _gitHubAbpLocalRepositoryPath;
private readonly string _gitHubVoloLocalRepositoryPath;
public LocalProjectPathReferenceReplacer(List<FileEntry> entries, string projectName, string gitHubLocalRepositoryPath)
public LocalProjectPathReferenceReplacer(List<FileEntry> entries, string projectName, string gitHubAbpLocalRepositoryPath, string gitHubVoloLocalRepositoryPath)
: base(entries, projectName)
{
_gitHubLocalRepositoryPath = gitHubLocalRepositoryPath;
_gitHubAbpLocalRepositoryPath = gitHubAbpLocalRepositoryPath;
_gitHubVoloLocalRepositoryPath = gitHubVoloLocalRepositoryPath;
}
protected override XmlElement GetNewReferenceNode(XmlDocument doc, string oldNodeIncludeValue)
@ -204,9 +209,17 @@ namespace Volo.Abp.Cli.ProjectBuilding.Building.Steps
includeValue = includeValue.TrimStart('\\');
}
includeValue = _gitHubLocalRepositoryPath.EnsureEndsWith('\\') + includeValue;
if (!string.IsNullOrWhiteSpace(_gitHubVoloLocalRepositoryPath))
{
if (includeValue.StartsWith("abp\\", StringComparison.InvariantCultureIgnoreCase))
{
return _gitHubAbpLocalRepositoryPath.EnsureEndsWith('\\') + includeValue.Substring("abp\\".Length);
}
return _gitHubVoloLocalRepositoryPath.EnsureEndsWith('\\') + "abp\\" + includeValue;
}
return includeValue;
return _gitHubAbpLocalRepositoryPath.EnsureEndsWith('\\') + includeValue;
}
}
}

5
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/ProjectBuildArgs.cs

@ -24,6 +24,9 @@ namespace Volo.Abp.Cli.ProjectBuilding
[CanBeNull]
public string AbpGitHubLocalRepositoryPath { get; set; }
[CanBeNull]
public string VoloGitHubLocalRepositoryPath { get; set; }
[CanBeNull]
public string TemplateSource { get; set; }
@ -41,6 +44,7 @@ namespace Volo.Abp.Cli.ProjectBuilding
UiFramework uiFramework = UiFramework.NotSpecified,
MobileApp? mobileApp = null,
[CanBeNull] string abpGitHubLocalRepositoryPath = null,
[CanBeNull] string voloGitHubLocalRepositoryPath = null,
[CanBeNull] string templateSource = null,
Dictionary<string, string> extraProperties = null,
[CanBeNull] string connectionString = null)
@ -52,6 +56,7 @@ namespace Volo.Abp.Cli.ProjectBuilding
UiFramework = uiFramework;
MobileApp = mobileApp;
AbpGitHubLocalRepositoryPath = abpGitHubLocalRepositoryPath;
VoloGitHubLocalRepositoryPath = voloGitHubLocalRepositoryPath;
TemplateSource = templateSource;
ExtraProperties = extraProperties ?? new Dictionary<string, string>();
ConnectionString = connectionString;

1
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionModuleAdder.cs

@ -129,6 +129,7 @@ namespace Volo.Abp.Cli.ProjectModification
targetModuleFolder,
version,
null,
null,
null
);

2
npm/ng-packs/apps/dev-app/src/app/app.module.ts

@ -23,6 +23,8 @@ const LOGGERS = [NgxsLoggerPluginModule.forRoot({ disabled: false })];
AppRoutingModule,
CoreModule.forRoot({
environment,
sendNullsAsQueryParam: false,
skipGetAppConfiguration: false,
}),
ThemeSharedModule.forRoot(),
AccountConfigModule.forRoot({ redirectUrl: '/' }),

1
npm/ng-packs/packages/core/src/lib/models/common.ts

@ -13,6 +13,7 @@ export namespace ABP {
*/
requirements?: Config.Requirements;
skipGetAppConfiguration?: boolean;
sendNullsAsQueryParam?: boolean;
}
export interface Test {

14
npm/ng-packs/packages/core/src/lib/services/rest.service.ts

@ -1,5 +1,5 @@
import { HttpClient, HttpRequest } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Injectable, Inject } from '@angular/core';
import { Store } from '@ngxs/store';
import { Observable, throwError } from 'rxjs';
import { catchError } from 'rxjs/operators';
@ -7,12 +7,18 @@ import { RestOccurError } from '../actions/rest.actions';
import { Rest } from '../models/rest';
import { ConfigState } from '../states/config.state';
import { isUndefinedOrEmptyString } from '../utils/common-utils';
import { ABP } from '../models/common';
import { CORE_OPTIONS } from '../tokens/options.token';
@Injectable({
providedIn: 'root',
})
export class RestService {
constructor(private http: HttpClient, private store: Store) {}
constructor(
@Inject(CORE_OPTIONS) private options: ABP.Root,
private http: HttpClient,
private store: Store,
) {}
private getApiFromStore(apiName: string): string {
return this.store.selectSnapshot(ConfigState.getApiUrl(apiName));
@ -41,8 +47,10 @@ export class RestService {
params: Object.keys(params).reduce((acc, key) => {
const value = params[key];
if (!isUndefinedOrEmptyString(value)) acc[key] = value;
if (isUndefinedOrEmptyString(value)) return acc;
if (value === null && !this.options.sendNullsAsQueryParam) return acc;
acc[key] = value;
return acc;
}, {}),
}),

Loading…
Cancel
Save