Compare commits
12 Commits
feature-13
...
aa38d17daf
| Author | SHA1 | Date | |
|---|---|---|---|
| aa38d17daf | |||
| d4fcbe0dc6 | |||
| 6a7bc39ff8 | |||
| b3a2ee7285 | |||
| a2326315a6 | |||
| 8684e97db7 | |||
| 1946623c9e | |||
| 40e7a3f8e0 | |||
| f0df620dc9 | |||
| 6a2bc0b4ab | |||
| c4036471f7 | |||
| e19cb5fcda |
@ -1,105 +0,0 @@
|
||||
trigger:
|
||||
branches:
|
||||
include:
|
||||
- Development
|
||||
paths:
|
||||
include:
|
||||
- "Fab2ApprovalSystem/*"
|
||||
exclude:
|
||||
- "**/*.yaml"
|
||||
- "**/*.yml"
|
||||
- "SQL/*"
|
||||
- "references/*"
|
||||
- "packages/*"
|
||||
- "Kendo/*"
|
||||
|
||||
pool:
|
||||
name: Mesa-IIS
|
||||
demands: Fab2ApprovalSystem-Development
|
||||
|
||||
variables:
|
||||
# solution: '**/*.sln'
|
||||
# buildPlatform: 'Any CPU'
|
||||
buildConfiguration: "Debug"
|
||||
ASPNETCORE_ENVIRONMENT: "Development"
|
||||
|
||||
steps:
|
||||
- script: |
|
||||
set assemblyTitle=Fab2ApprovalSystem
|
||||
echo %assemblyTitle%
|
||||
echo ##vso[task.setvariable variable=AssemblyTitle;]%assemblyTitle%
|
||||
echo $(AssemblyTitle)
|
||||
displayName: AssemblyTitle
|
||||
|
||||
- script: |
|
||||
set targetFrameworkVersion=v4.8
|
||||
echo %targetFrameworkVersion%
|
||||
echo ##vso[task.setvariable variable=TargetFrameworkVersion;]%targetFrameworkVersion%
|
||||
echo $(TargetFrameworkVersion)
|
||||
displayName: TargetFrameworkVersion
|
||||
|
||||
- script: |
|
||||
set coreVersion=na
|
||||
echo %coreVersion%
|
||||
echo ##vso[task.setvariable variable=CoreVersion;]%coreVersion%
|
||||
echo $(CoreVersion)
|
||||
displayName: CoreVersion
|
||||
|
||||
- script: |
|
||||
set configuration=Debug
|
||||
echo %configuration%
|
||||
echo ##vso[task.setvariable variable=Configuration;]%configuration%
|
||||
echo $(Configuration)
|
||||
displayName: Configuration
|
||||
|
||||
- script: |
|
||||
REM set nugetSource=https://messa017.infineon.com/v3/index.json
|
||||
set nugetSource=https://eaf-prod.mes.infineon.com/v3/index.json
|
||||
echo %nugetSource%
|
||||
echo ##vso[task.setvariable variable=NugetSource;]%nugetSource%
|
||||
echo $(NugetSource)
|
||||
displayName: NugetSource
|
||||
|
||||
- script: |
|
||||
set gitCommit=$(Build.SourceVersion)
|
||||
set gitCommitSeven=%gitCommit:~0,7%
|
||||
echo %gitCommitSeven%
|
||||
echo ##vso[task.setvariable variable=GitCommitSeven;]%gitCommitSeven%
|
||||
echo $(GitCommitSeven)
|
||||
displayName: GitCommitSeven
|
||||
|
||||
- script: |
|
||||
echo $(AssemblyTitle)
|
||||
echo $(Build.BuildId)
|
||||
echo $(Build.Reason)
|
||||
echo $(Build.Repository.Id)
|
||||
echo $(Build.Repository.Name)
|
||||
echo $(Build.SourceVersion)
|
||||
echo $(CoreVersion)
|
||||
echo $(Configuration)
|
||||
echo $(NugetSource)
|
||||
echo $(GitCommitSeven)
|
||||
echo $(TargetFrameworkVersion)
|
||||
REM echo $(pipelinePassword)
|
||||
displayName: "Echo Check"
|
||||
|
||||
- script: '"C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/MSBuild/Current/Bin/MSBuild.exe" /target:Restore /DetailedSummary /ConsoleLoggerParameters:PerformanceSummary;ErrorsOnly; /p:Configuration=$(Configuration);TargetFrameworkVersion=$(TargetFrameworkVersion) /p:RestoreSources=$(NugetSource) $(AssemblyTitle).csproj'
|
||||
workingDirectory: Fab2ApprovalSystem
|
||||
displayName: "Framework Restore"
|
||||
|
||||
- script: '"C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/MSBuild/Current/Bin/MSBuild.exe" /target:Build /DetailedSummary /ConsoleLoggerParameters:PerformanceSummary;ErrorsOnly; /p:Configuration=$(Configuration);TargetFrameworkVersion=$(TargetFrameworkVersion) $(AssemblyTitle).csproj'
|
||||
workingDirectory: Fab2ApprovalSystem
|
||||
displayName: "Framework Build"
|
||||
|
||||
- script: '"C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/MSBuild/Current/Bin/MSBuild.exe" /DetailedSummary /ConsoleLoggerParameters:PerformanceSummary;ErrorsOnly; /p:Configuration=$(Configuration);TargetFrameworkVersion=$(TargetFrameworkVersion) /p:DebugSymbols=false /p:DeleteExistingFiles=true /p:DeployOnBuild=true /p:EnableUpdateAble=true /p:ExcludeApp_Data=true /p:LastUsedBuildConfiguration=$(Configuration) /p:LastUsedPlatform="Any CPU" /p:LaunchSiteAfterPublish=true /p:OutputPath="D:\$(TargetFrameworkVersion)\$(Build.Repository.Name)\$(GitCommitSeven)-$(Build.BuildId)-$(Build.Repository.Name)-$(Configuration)" /p:PreCompileBeforePublish=true /p:PublishProvider=FileSystem /p:PublishUrl="D:/PublishUrl" /p:SiteUrlToLaunchAfterPublish="" /p:WDPMergeOption=DoNotMerge /p:WebPublishMethod=FileSystem $(AssemblyTitle).csproj'
|
||||
workingDirectory: Fab2ApprovalSystem
|
||||
displayName: "Framework Pack"
|
||||
|
||||
- script: '"C:/Program Files (x86)/IIS/Microsoft Web Deploy V3/MSDeploy.exe" -AllowUntrusted -dest:auto -disableLink:AppPoolExtension -disableLink:CertificateExtension -disableLink:ContentExtension -setParam:name="IIS Web Application Name",value=$(Build.Repository.Name) -setParamFile:"D:\$(TargetFrameworkVersion)\$(Build.Repository.Name)\$(GitCommitSeven)-$(Build.BuildId)-$(Build.Repository.Name)-$(Configuration)" "/_PublishedWebsites/$(Build.Repository.Name)_Package/$(Build.Repository.Name).SetParameters.xml" -source:package="D:\$(TargetFrameworkVersion)\$(Build.Repository.Name)\$(GitCommitSeven)-$(Build.BuildId)-$(Build.Repository.Name)-$(Configuration)" "/_PublishedWebsites/$(AssemblyTitle)_Package/$(AssemblyTitle).zip" -verb:sync'
|
||||
workingDirectory: Fab2ApprovalSystem
|
||||
displayName: "Framework Deploy"
|
||||
enabled: false
|
||||
|
||||
- script: 'echo $(Build.SourceVersion)-$(Build.BuildId)>bin_x_x_\$(Configuration)\$(CoreVersion)\win-x64\$(Build.Repository.Name).txt'
|
||||
displayName: "Force Fail"
|
||||
enabled: false
|
||||
@ -53,4 +53,36 @@ public class ECNController : ControllerBase {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
[Route("ecn/allNumbers")]
|
||||
public async Task<IActionResult> GetAllECNNumbers() {
|
||||
DateTime start = DateTime.Now;
|
||||
bool isInternalError = false;
|
||||
string errorMessage = "";
|
||||
|
||||
try {
|
||||
_logger.LogInformation($"Attempting to get all ECN#s");
|
||||
|
||||
IEnumerable<int> allEcnNumbers = await _ecnService.GetAllECNNumbers();
|
||||
|
||||
return Ok(allEcnNumbers);
|
||||
} catch (Exception ex) {
|
||||
isInternalError = true;
|
||||
errorMessage = $"Cannot get all ECN#s, because {ex.Message}";
|
||||
return Problem(errorMessage);
|
||||
} finally {
|
||||
string metricName = "GetAllECNNumbers";
|
||||
DateTime end = DateTime.Now;
|
||||
double millisecondsDiff = (end - start).TotalMilliseconds;
|
||||
_monInClient.PostAverage(metricName + "Latency", millisecondsDiff);
|
||||
|
||||
if (isInternalError) {
|
||||
_logger.LogError(errorMessage);
|
||||
_monInClient.PostStatus(metricName, StatusValue.Critical);
|
||||
} else {
|
||||
_monInClient.PostStatus(metricName, StatusValue.Ok);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -265,6 +265,7 @@ public class PCRBController : ControllerBase {
|
||||
|
||||
[HttpPost]
|
||||
[Route("pcrb/attachment")]
|
||||
[ApiExplorerSettings(IgnoreApi = true)]
|
||||
public async Task<IActionResult> UploadAttachment([FromForm] IFormFile file, [FromForm] PCRBAttachment attachment) {
|
||||
DateTime start = DateTime.Now;
|
||||
bool isArgumentError = false;
|
||||
|
||||
@ -132,9 +132,6 @@ builder.Services.AddSwaggerGen(c => {
|
||||
|
||||
WebApplication app = builder.Build();
|
||||
|
||||
if (Debugger.IsAttached)
|
||||
app.Services.GetRequiredService<IApprovalService>();
|
||||
|
||||
app.UseCors();
|
||||
|
||||
// Configure the HTTP request pipeline.
|
||||
|
||||
@ -219,7 +219,10 @@ public class ApprovalService : IApprovalService {
|
||||
queryBuilder.Append($"select a.*, src.SubRoleCategoryItem from Approval a ");
|
||||
queryBuilder.Append("join SubRole sr on a.SubRoleID=sr.SubRoleID ");
|
||||
queryBuilder.Append("join SubRoleCategory src on sr.SubRoleCategoryID=src.SubRoleCategoryID ");
|
||||
queryBuilder.Append($"where UserID={userId} and ");
|
||||
queryBuilder.Append($"where UserID={userId} and ItemStatus=0 and ");
|
||||
queryBuilder.Append($"(AssignedDate is not null and ");
|
||||
queryBuilder.Append($"AssignedDate <= '{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}' and ");
|
||||
queryBuilder.Append($"AssignedDate > '{DateTimeOffset.Now.AddYears(-2).DateTime.ToString("yyyy-MM-dd HH:mm:ss")}') and ");
|
||||
queryBuilder.Append($"((CompletedDate >= '{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}') or ");
|
||||
queryBuilder.Append($"(CompletedDate is null));");
|
||||
string sql = queryBuilder.ToString();
|
||||
|
||||
@ -4,6 +4,7 @@ namespace MesaFabApproval.API.Services;
|
||||
|
||||
public interface IECNService {
|
||||
Task<bool> IsValidECNNumber(int number);
|
||||
Task<IEnumerable<int>> GetAllECNNumbers();
|
||||
}
|
||||
|
||||
public class ECNService : IECNService {
|
||||
@ -43,4 +44,19 @@ public class ECNService : IECNService {
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<int>> GetAllECNNumbers() {
|
||||
try {
|
||||
_logger.LogInformation("Attempting to get all ECN#s");
|
||||
|
||||
string sql = "select ECNNumber from ECN where Deleted=0 and Cancelled=0";
|
||||
|
||||
IEnumerable<int> allEcnNumbers = await _dalService.QueryAsync<int>(sql);
|
||||
|
||||
return allEcnNumbers;
|
||||
} catch (Exception ex) {
|
||||
_logger.LogError($"Unable to get all ECN#s, because {ex.Message}");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -852,8 +852,8 @@ public class MRBService : IMRBService {
|
||||
convertToPart += partStr;
|
||||
}
|
||||
|
||||
dt.Rows.Add(action.Action, convertFromCustomer, convertFromPart, action.Quantity.ToString(),
|
||||
convertToCustomer, convertToPart,
|
||||
dt.Rows.Add(action.Action, convertFromCustomer, convertFromPart, action.LotNumber,
|
||||
action.Quantity.ToString(), convertToCustomer, convertToPart,
|
||||
DateTimeUtilities.GetDateAsStringMinDefault(action.AssignedDate),
|
||||
DateTimeUtilities.GetDateAsStringMaxDefault(action.CompletedDate),
|
||||
action.CompletedByUser is null ? "" : action.CompletedByUser.GetFullName());
|
||||
|
||||
@ -485,6 +485,20 @@ public class PCRBService : IPCRBService {
|
||||
int rowsAffected = await _dalService.ExecuteAsync(queryBuilder.ToString());
|
||||
|
||||
if (rowsAffected <= 0) throw new Exception("update failed in database");
|
||||
|
||||
IEnumerable<PCRBAttendee>? attendees = _cache.Get<IEnumerable<PCRBAttendee>>($"pcrbAttendees{attendee.PlanNumber}");
|
||||
if (attendees is not null) {
|
||||
foreach (PCRBAttendee cachedAttendee in attendees) {
|
||||
if (cachedAttendee.ID == attendee.ID) {
|
||||
cachedAttendee.Location = attendee.Location;
|
||||
cachedAttendee.Attended = attendee.Attended;
|
||||
cachedAttendee.JobTitle = attendee.JobTitle;
|
||||
cachedAttendee.AttendeeID = attendee.AttendeeID;
|
||||
cachedAttendee.Step = attendee.Step;
|
||||
}
|
||||
}
|
||||
_cache.Set($"pcrbAttendees{attendee.PlanNumber}", attendees, DateTimeOffset.Now.AddMinutes(15));
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
_logger.LogError($"Unable to update attendee, because {ex.Message}");
|
||||
throw;
|
||||
|
||||
84
MesaFabApproval.API/pipeline.yml
Normal file
84
MesaFabApproval.API/pipeline.yml
Normal file
@ -0,0 +1,84 @@
|
||||
trigger:
|
||||
branches:
|
||||
include:
|
||||
- master
|
||||
paths:
|
||||
include:
|
||||
- MesaFabApproval.API
|
||||
- MesaFabApproval.Shared
|
||||
|
||||
variables:
|
||||
buildConfiguration: "Release"
|
||||
|
||||
stages:
|
||||
- stage: Test
|
||||
displayName: "Test"
|
||||
pool:
|
||||
name: MesaFabApproval
|
||||
demands: Fab2ApprovalSystem-Dev
|
||||
jobs:
|
||||
- job: BuildPublish
|
||||
steps:
|
||||
- script: |
|
||||
echo build configuration: $(BuildConfiguration)
|
||||
displayName: "Echo Check"
|
||||
|
||||
- task: DotNetCoreCLI@2
|
||||
displayName: "Build"
|
||||
inputs:
|
||||
command: "build"
|
||||
configuration: $(BuildConfiguration)
|
||||
projects: MesaFabApproval.API
|
||||
|
||||
- task: DotNetCoreCLI@2
|
||||
displayName: "Publish"
|
||||
inputs:
|
||||
command: "publish"
|
||||
publishWebProjects: false
|
||||
projects: MesaFabApproval.API
|
||||
zipAfterPublish: true
|
||||
arguments: "-c $(BuildConfiguration) -o $(Build.ArtifactStagingDirectory) -r win-x64 --self-contained"
|
||||
|
||||
- task: CopyFiles@2
|
||||
displayName: "Copy Files"
|
||||
inputs:
|
||||
SourceFolder: "$(Build.ArtifactStagingDirectory)"
|
||||
TargetFolder: 'D:\$(Build.Repository.Name)\API\$(Build.BuildId)\$(BuildConfiguration)'
|
||||
CleanTargetFolder: true
|
||||
retryCount: "3"
|
||||
|
||||
- stage: Prod
|
||||
displayName: "Prod"
|
||||
pool:
|
||||
name: MesaFabApproval
|
||||
demands: Fab2ApprovalSystem
|
||||
jobs:
|
||||
- job: BuildPublish
|
||||
steps:
|
||||
- script: |
|
||||
echo build configuration: $(BuildConfiguration)
|
||||
displayName: "Echo Check"
|
||||
|
||||
- task: DotNetCoreCLI@2
|
||||
displayName: "Build"
|
||||
inputs:
|
||||
command: "build"
|
||||
configuration: $(BuildConfiguration)
|
||||
projects: MesaFabApproval.API
|
||||
|
||||
- task: DotNetCoreCLI@2
|
||||
displayName: "Publish"
|
||||
inputs:
|
||||
command: "publish"
|
||||
publishWebProjects: false
|
||||
projects: MesaFabApproval.API
|
||||
zipAfterPublish: true
|
||||
arguments: "-c $(BuildConfiguration) -o $(Build.ArtifactStagingDirectory) -r win-x64 --self-contained"
|
||||
|
||||
- task: CopyFiles@2
|
||||
displayName: "Copy Files"
|
||||
inputs:
|
||||
SourceFolder: "$(Build.ArtifactStagingDirectory)"
|
||||
TargetFolder: 'D:\$(Build.Repository.Name)\API\$(Build.BuildId)\$(BuildConfiguration)'
|
||||
CleanTargetFolder: true
|
||||
retryCount: "3"
|
||||
@ -1,65 +1,2 @@
|
||||
@page "/redirect"
|
||||
@attribute [AllowAnonymous]
|
||||
@inject MesaFabApprovalAuthStateProvider authStateProvider
|
||||
@inject IAuthenticationService authService
|
||||
@inject IUserService userService
|
||||
@inject ISnackbar snackbar
|
||||
@inject MesaFabApprovalAuthStateProvider authStateProvider
|
||||
@inject NavigationManager navigationManager
|
||||
|
||||
@code {
|
||||
private string? _jwt;
|
||||
private string? _refreshToken;
|
||||
private string? _redirectPath;
|
||||
|
||||
protected override async Task OnParametersSetAsync() {
|
||||
try {
|
||||
Uri uri = navigationManager.ToAbsoluteUri(navigationManager.Uri);
|
||||
|
||||
if (QueryHelpers.ParseQuery(uri.Query).TryGetValue("jwt", out var jwt)) {
|
||||
_jwt = System.Net.WebUtility.UrlDecode(jwt);
|
||||
}
|
||||
|
||||
if (QueryHelpers.ParseQuery(uri.Query).TryGetValue("refreshToken", out var refreshToken)) {
|
||||
_refreshToken = System.Net.WebUtility.UrlDecode(refreshToken);
|
||||
}
|
||||
|
||||
if (QueryHelpers.ParseQuery(uri.Query).TryGetValue("redirectPath", out var redirectPath)) {
|
||||
_redirectPath = redirectPath.ToString();
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(_jwt) && !string.IsNullOrWhiteSpace(_refreshToken)) {
|
||||
await authService.SetTokens(_jwt, _refreshToken);
|
||||
|
||||
ClaimsPrincipal principal = authService.GetClaimsPrincipalFromJwt(_jwt);
|
||||
|
||||
string loginId = userService.GetLoginIdFromClaimsPrincipal(principal);
|
||||
|
||||
await authService.ClearCurrentUser();
|
||||
await authService.ClearTokens();
|
||||
|
||||
await authService.SetLoginId(loginId);
|
||||
await authService.SetTokens(_jwt, _refreshToken);
|
||||
await authService.SetCurrentUser(null);
|
||||
|
||||
await authStateProvider.StateHasChanged(principal);
|
||||
}
|
||||
|
||||
if (authStateProvider.CurrentUser is not null && !string.IsNullOrWhiteSpace(_redirectPath)) {
|
||||
navigationManager.NavigateTo(_redirectPath);
|
||||
} else {
|
||||
await authStateProvider.Logout();
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(_redirectPath)) {
|
||||
navigationManager.NavigateTo($"login/{_redirectPath}");
|
||||
} else {
|
||||
navigationManager.NavigateTo("login");
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Exception ex) {
|
||||
snackbar.Add($"Redirect failed, because {ex.Message}", Severity.Error);
|
||||
navigationManager.NavigateTo("login");
|
||||
}
|
||||
}
|
||||
}
|
||||
@attribute [AllowAnonymous]
|
||||
77
MesaFabApproval.Client/Pages/AuthenticatedRedirect.razor.cs
Normal file
77
MesaFabApproval.Client/Pages/AuthenticatedRedirect.razor.cs
Normal file
@ -0,0 +1,77 @@
|
||||
using MesaFabApproval.Client.Services;
|
||||
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Microsoft.AspNetCore.WebUtilities;
|
||||
|
||||
using MudBlazor;
|
||||
|
||||
using System.Security.Claims;
|
||||
|
||||
namespace MesaFabApproval.Client.Pages;
|
||||
|
||||
public partial class AuthenticatedRedirect {
|
||||
[Inject] MesaFabApprovalAuthStateProvider authStateProvider { get; set; }
|
||||
[Inject] IAuthenticationService authService { get; set; }
|
||||
[Inject] IUserService userService { get; set; }
|
||||
[Inject] ISnackbar snackbar { get; set; }
|
||||
[Inject] NavigationManager navigationManager { get; set; }
|
||||
|
||||
private string? _jwt;
|
||||
private string? _refreshToken;
|
||||
private string? _redirectPath;
|
||||
|
||||
protected override async Task OnParametersSetAsync() {
|
||||
try {
|
||||
Uri uri = navigationManager.ToAbsoluteUri(navigationManager.Uri);
|
||||
|
||||
if (QueryHelpers.ParseQuery(uri.Query).TryGetValue("jwt", out var jwt)) {
|
||||
_jwt = System.Net.WebUtility.UrlDecode(jwt);
|
||||
}
|
||||
|
||||
if (QueryHelpers.ParseQuery(uri.Query).TryGetValue("refreshToken", out var refreshToken)) {
|
||||
_refreshToken = System.Net.WebUtility.UrlDecode(refreshToken);
|
||||
}
|
||||
|
||||
if (QueryHelpers.ParseQuery(uri.Query).TryGetValue("redirectPath", out var redirectPath)) {
|
||||
_redirectPath = redirectPath.ToString();
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(_jwt) && !string.IsNullOrWhiteSpace(_refreshToken)) {
|
||||
await authService.SetTokens(_jwt, _refreshToken);
|
||||
|
||||
ClaimsPrincipal principal = authService.GetClaimsPrincipalFromJwt(_jwt);
|
||||
|
||||
string loginId = userService.GetLoginIdFromClaimsPrincipal(principal);
|
||||
|
||||
await authService.ClearCurrentUser();
|
||||
await authService.ClearTokens();
|
||||
|
||||
await authService.SetLoginId(loginId);
|
||||
await authService.SetTokens(_jwt, _refreshToken);
|
||||
await authService.SetCurrentUser(null);
|
||||
|
||||
await authStateProvider.StateHasChanged(principal);
|
||||
}
|
||||
|
||||
if (authStateProvider.CurrentUser is not null && !string.IsNullOrWhiteSpace(_redirectPath)) {
|
||||
navigationManager.NavigateTo(_redirectPath);
|
||||
} else {
|
||||
await authStateProvider.Logout();
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(_redirectPath)) {
|
||||
navigationManager.NavigateTo($"login/{_redirectPath}");
|
||||
} else {
|
||||
navigationManager.NavigateTo("login");
|
||||
}
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
await authStateProvider.Logout();
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(_redirectPath)) {
|
||||
navigationManager.NavigateTo($"login/{_redirectPath}");
|
||||
} else {
|
||||
navigationManager.NavigateTo("login");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -215,9 +215,7 @@
|
||||
bool actionIsValid = mrbAction.Action.Equals("Block") || mrbAction.Action.Equals("Convert") ||
|
||||
mrbAction.Action.Equals("Other") || mrbAction.Action.Equals("Recall") || mrbAction.Action.Equals("Scrap") ||
|
||||
mrbAction.Action.Equals("Unblock") || mrbAction.Action.Equals("Waiver");
|
||||
actionIsValid = actionIsValid && !string.IsNullOrWhiteSpace(mrbAction.Customer) &&
|
||||
!string.IsNullOrWhiteSpace(mrbAction.PartNumber) &&
|
||||
!string.IsNullOrWhiteSpace(mrbAction.LotNumber);
|
||||
actionIsValid = actionIsValid && !string.IsNullOrWhiteSpace(mrbAction.LotNumber);
|
||||
actionIsValid = actionIsValid && mrbAction.Quantity > 0;
|
||||
|
||||
if (mrbAction.Action.Equals("Convert", StringComparison.InvariantCultureIgnoreCase)) {
|
||||
@ -225,6 +223,9 @@
|
||||
!string.IsNullOrWhiteSpace(convertFromPart) &&
|
||||
!string.IsNullOrWhiteSpace(convertToCustomer) &&
|
||||
!string.IsNullOrWhiteSpace(convertToPart);
|
||||
} else {
|
||||
actionIsValid = actionIsValid && !string.IsNullOrWhiteSpace(mrbAction.Customer) &&
|
||||
!string.IsNullOrWhiteSpace(mrbAction.PartNumber);
|
||||
}
|
||||
|
||||
if (mrbAction.Action.Equals("Scrap", StringComparison.InvariantCultureIgnoreCase))
|
||||
|
||||
@ -31,16 +31,16 @@
|
||||
Immediate
|
||||
AutoGrow />
|
||||
} else {
|
||||
<MudTextField @bind-Value="@document.ECNNumber"
|
||||
Required
|
||||
RequiredError="You must provide a valid ECN#"
|
||||
Clearable
|
||||
Variant="Variant.Outlined"
|
||||
InputType="@InputType.Number"
|
||||
Validation="@(new Func<int, Task<string>>(ECNNoIsValid))"
|
||||
Label="ECN#"
|
||||
Immediate
|
||||
AutoGrow />
|
||||
<MudAutocomplete @bind-Value="@document.ECNNumber"
|
||||
T="int"
|
||||
SearchFunc="Search"
|
||||
Required
|
||||
Clearable
|
||||
RequiredError="You must provide a valid ECN#"
|
||||
Variant="Variant.Outlined"
|
||||
Validation="@(new Func<int, Task<string>>(ECNNoIsValid))"
|
||||
Label="ECN#"
|
||||
Immediate />
|
||||
}
|
||||
<MudCheckBox Label="Complete"
|
||||
Color="Color.Tertiary"
|
||||
@ -79,6 +79,8 @@
|
||||
[Parameter]
|
||||
public required PCR3Document document { get; set; }
|
||||
|
||||
private IEnumerable<int> allEcnNumbers = new List<int>();
|
||||
|
||||
private string[] errors = { };
|
||||
|
||||
private bool complete = false;
|
||||
@ -89,6 +91,8 @@
|
||||
|
||||
protected override async Task OnParametersSetAsync() {
|
||||
complete = document.CompletedByID > 0;
|
||||
|
||||
allEcnNumbers = await ecnService.GetAllECNNumbers();
|
||||
}
|
||||
|
||||
private async Task Save() {
|
||||
@ -143,6 +147,8 @@
|
||||
document.DocNumbers.ToLower().Equals("n/a") ||
|
||||
document.DocNumbers.ToLower().Equals("n a") ||
|
||||
document.DocNumbers.ToLower().Equals("not applicable")) {
|
||||
if (string.IsNullOrWhiteSpace(document.Comment))
|
||||
document.Comment = "Not required";
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@ -155,4 +161,13 @@
|
||||
StateHasChanged();
|
||||
return result;
|
||||
}
|
||||
|
||||
private async Task<IEnumerable<int>> Search(string searchValue, CancellationToken token) {
|
||||
if (string.IsNullOrWhiteSpace(searchValue))
|
||||
return allEcnNumbers;
|
||||
|
||||
return allEcnNumbers
|
||||
.Where(x => x.ToString().StartsWith(searchValue, StringComparison.InvariantCultureIgnoreCase))
|
||||
.Order();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,16 +1,5 @@
|
||||
@page "/"
|
||||
@page "/Dashboard"
|
||||
@inject IConfiguration Configuration
|
||||
@inject MesaFabApprovalAuthStateProvider stateProvider
|
||||
@inject IApprovalService approvalService
|
||||
@inject IMemoryCache cache
|
||||
@inject NavigationManager navigationManager
|
||||
@inject ISnackbar snackbar
|
||||
@inject IMRBService mrbService
|
||||
@inject IPCRBService pcrbService
|
||||
@inject IECNService ecnService
|
||||
@inject ICAService caService
|
||||
@inject IJSRuntime jsRuntime
|
||||
|
||||
<PageTitle>Dashboard</PageTitle>
|
||||
|
||||
@ -226,138 +215,3 @@
|
||||
</MudTabPanel>
|
||||
</MudTabs>
|
||||
</MudPaper>
|
||||
|
||||
@code {
|
||||
private IEnumerable<Approval> approvalList = new List<Approval>();
|
||||
private IEnumerable<MRB> myMRBs = new List<MRB>();
|
||||
private IEnumerable<PCRB> myPCRBs = new List<PCRB>();
|
||||
|
||||
private IEnumerable<int> ecnNumbers = new HashSet<int>();
|
||||
private IEnumerable<int> caNumbers = new HashSet<int>();
|
||||
private IEnumerable<int> mrbNumbers = new HashSet<int>();
|
||||
private IEnumerable<int> pcrbNumbers = new HashSet<int>();
|
||||
|
||||
private bool myApprovalsProcessing = false;
|
||||
private bool myMrbsProcessing = false;
|
||||
private bool myPcrbsProcessing = false;
|
||||
|
||||
private string mrbSearchString = "";
|
||||
private string pcrbSearchString = "";
|
||||
|
||||
protected async override Task OnParametersSetAsync() {
|
||||
try {
|
||||
if (stateProvider.CurrentUser is not null) {
|
||||
myApprovalsProcessing = true;
|
||||
approvalList = (await approvalService.GetApprovalsForUserId(stateProvider.CurrentUser.UserID, true))
|
||||
.Where(a => a.CompletedDate > DateTime.Now && a.ItemStatus == 0)
|
||||
.ToList()
|
||||
.OrderByDescending(x => x.AssignedDate);
|
||||
myApprovalsProcessing = false;
|
||||
|
||||
myMrbsProcessing = true;
|
||||
myMRBs = (await mrbService.GetAllMRBs(false)).Where(m => m.OriginatorID == stateProvider.CurrentUser.UserID)
|
||||
.ToList()
|
||||
.OrderByDescending(x => x.SubmittedDate);
|
||||
myMrbsProcessing = false;
|
||||
|
||||
myPcrbsProcessing = true;
|
||||
myPCRBs = (await pcrbService.GetAllPCRBs(false)).Where(p => p.OwnerID == stateProvider.CurrentUser.UserID)
|
||||
.ToList()
|
||||
.OrderByDescending(p => p.InsertTimeStamp);
|
||||
myPcrbsProcessing = false;
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
myApprovalsProcessing = false;
|
||||
myMrbsProcessing = false;
|
||||
myPcrbsProcessing = false;
|
||||
snackbar.Add($"Unable to load the dashboard, because {ex.Message}", Severity.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private async Task FollowLink(int issueId) {
|
||||
HashSet<Task> tasks = new();
|
||||
|
||||
bool isEcn = false;
|
||||
bool isCa = false;
|
||||
bool isMrb = false;
|
||||
bool isPcrb = false;
|
||||
if (ecnNumbers.Contains(issueId))
|
||||
isEcn = true;
|
||||
if (caNumbers.Contains(issueId))
|
||||
isCa = true;
|
||||
if (mrbNumbers.Contains(issueId))
|
||||
isMrb = true;
|
||||
if (pcrbNumbers.Contains(issueId))
|
||||
isPcrb = true;
|
||||
|
||||
if (!isEcn && !isCa && !isMrb) {
|
||||
Task<bool> isEcnTask = ecnService.ECNNumberIsValid(issueId);
|
||||
tasks.Add(isEcnTask);
|
||||
|
||||
Task<bool> isCaTask = caService.CANumberIsValid(issueId);
|
||||
tasks.Add(isCaTask);
|
||||
|
||||
Task<bool> isMrbTask = mrbService.NumberIsValid(issueId);
|
||||
tasks.Add(isMrbTask);
|
||||
|
||||
Task<bool> isPcrbTask = pcrbService.IdIsValid(issueId);
|
||||
tasks.Add(isPcrbTask);
|
||||
|
||||
await Task.WhenAll(tasks);
|
||||
|
||||
if (isEcnTask.Result) {
|
||||
isEcn = true;
|
||||
} else if (isCaTask.Result) {
|
||||
isCa = true;
|
||||
} else if (isMrbTask.Result) {
|
||||
isMrb = true;
|
||||
} else if (isPcrbTask.Result) {
|
||||
isPcrb = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (isEcn) await GoToExternal($"{Configuration["OldFabApprovalUrl"]}/ECN/Edit?IssueID={issueId}", "");
|
||||
if (isCa) await GoToExternal($"{Configuration["OldFabApprovalUrl"]}/CorrectiveAction/Edit?IssueID={issueId}", "");
|
||||
if (isMrb) GoTo($"mrb/{issueId}");
|
||||
if (isPcrb) GoTo($"pcrb/{issueId}");
|
||||
}
|
||||
|
||||
private void GoTo(string page) {
|
||||
cache.Set("redirectUrl", page);
|
||||
navigationManager.NavigateTo("/" + page);
|
||||
}
|
||||
|
||||
private async Task GoToExternal(string url, string content) {
|
||||
IJSObjectReference windowModule = await jsRuntime.InvokeAsync<IJSObjectReference>("import", "./js/OpenInNewWindow.js");
|
||||
await windowModule.InvokeAsync<object>("OpenInNewWindow", url, content);
|
||||
}
|
||||
|
||||
private bool FilterFuncForMRBTable(MRB mrb) => MRBFilterFunc(mrb, mrbSearchString);
|
||||
|
||||
private bool MRBFilterFunc(MRB mrb, string searchString) {
|
||||
if (string.IsNullOrWhiteSpace(searchString))
|
||||
return true;
|
||||
if (mrb.Title.ToLower().Contains(searchString.Trim().ToLower()))
|
||||
return true;
|
||||
if (mrb.MRBNumber.ToString().Contains(searchString.Trim()))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
private bool FilterFuncForPCRBTable(PCRB pcrb) => PCRBFilterFunc(pcrb, pcrbSearchString);
|
||||
|
||||
private bool PCRBFilterFunc(PCRB pcrb, string searchString) {
|
||||
if (string.IsNullOrWhiteSpace(searchString))
|
||||
return true;
|
||||
if (pcrb.Title.ToLower().Contains(searchString.Trim().ToLower()))
|
||||
return true;
|
||||
if (pcrb.PlanNumber.ToString().Contains(searchString.Trim()))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
private string GetCurrentPCRBStep(int step) {
|
||||
if (step < 0 || step > (PCRB.Stages.Length - 1)) return string.Empty;
|
||||
else return PCRB.Stages[step];
|
||||
}
|
||||
}
|
||||
|
||||
157
MesaFabApproval.Client/Pages/Dashboard.razor.cs
Normal file
157
MesaFabApproval.Client/Pages/Dashboard.razor.cs
Normal file
@ -0,0 +1,157 @@
|
||||
using MesaFabApproval.Client.Services;
|
||||
using MesaFabApproval.Shared.Models;
|
||||
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
using Microsoft.JSInterop;
|
||||
|
||||
using MudBlazor;
|
||||
|
||||
namespace MesaFabApproval.Client.Pages;
|
||||
|
||||
public partial class Dashboard {
|
||||
[Inject] IConfiguration Configuration { get; set; }
|
||||
[Inject] MesaFabApprovalAuthStateProvider stateProvider { get; set; }
|
||||
[Inject] IApprovalService approvalService { get; set; }
|
||||
[Inject] IMemoryCache cache { get; set; }
|
||||
[Inject] NavigationManager navigationManager { get; set; }
|
||||
[Inject] ISnackbar snackbar { get; set; }
|
||||
[Inject] IMRBService mrbService { get; set; }
|
||||
[Inject] IPCRBService pcrbService { get; set; }
|
||||
[Inject] IECNService ecnService { get; set; }
|
||||
[Inject] ICAService caService { get; set; }
|
||||
[Inject] IJSRuntime jsRuntime { get; set; }
|
||||
|
||||
private IEnumerable<Approval> approvalList = new List<Approval>();
|
||||
private IEnumerable<MRB> myMRBs = new List<MRB>();
|
||||
private IEnumerable<PCRB> myPCRBs = new List<PCRB>();
|
||||
|
||||
private IEnumerable<int> ecnNumbers = new HashSet<int>();
|
||||
private IEnumerable<int> caNumbers = new HashSet<int>();
|
||||
private IEnumerable<int> mrbNumbers = new HashSet<int>();
|
||||
private IEnumerable<int> pcrbNumbers = new HashSet<int>();
|
||||
|
||||
private bool myApprovalsProcessing = false;
|
||||
private bool myMrbsProcessing = false;
|
||||
private bool myPcrbsProcessing = false;
|
||||
|
||||
private string mrbSearchString = "";
|
||||
private string pcrbSearchString = "";
|
||||
|
||||
protected async override Task OnParametersSetAsync() {
|
||||
try {
|
||||
if (stateProvider.CurrentUser is not null) {
|
||||
myApprovalsProcessing = true;
|
||||
approvalList = (await approvalService.GetApprovalsForUserId(stateProvider.CurrentUser.UserID, true))
|
||||
.Where(a => a.CompletedDate > DateTime.Now && a.ItemStatus == 0)
|
||||
.ToList()
|
||||
.OrderByDescending(x => x.AssignedDate);
|
||||
myApprovalsProcessing = false;
|
||||
|
||||
myMrbsProcessing = true;
|
||||
myMRBs = (await mrbService.GetAllMRBs(false)).Where(m => m.OriginatorID == stateProvider.CurrentUser.UserID)
|
||||
.ToList()
|
||||
.OrderByDescending(x => x.SubmittedDate);
|
||||
myMrbsProcessing = false;
|
||||
|
||||
myPcrbsProcessing = true;
|
||||
myPCRBs = (await pcrbService.GetAllPCRBs(false)).Where(p => p.OwnerID == stateProvider.CurrentUser.UserID)
|
||||
.ToList()
|
||||
.OrderByDescending(p => p.InsertTimeStamp);
|
||||
myPcrbsProcessing = false;
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
myApprovalsProcessing = false;
|
||||
myMrbsProcessing = false;
|
||||
myPcrbsProcessing = false;
|
||||
snackbar.Add(ex.Message, Severity.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private async Task FollowLink(int issueId) {
|
||||
HashSet<Task> tasks = new();
|
||||
|
||||
bool isEcn = false;
|
||||
bool isCa = false;
|
||||
bool isMrb = false;
|
||||
bool isPcrb = false;
|
||||
if (ecnNumbers.Contains(issueId))
|
||||
isEcn = true;
|
||||
if (caNumbers.Contains(issueId))
|
||||
isCa = true;
|
||||
if (mrbNumbers.Contains(issueId))
|
||||
isMrb = true;
|
||||
if (pcrbNumbers.Contains(issueId))
|
||||
isPcrb = true;
|
||||
|
||||
if (!isEcn && !isCa && !isMrb) {
|
||||
Task<bool> isEcnTask = ecnService.ECNNumberIsValid(issueId);
|
||||
tasks.Add(isEcnTask);
|
||||
|
||||
Task<bool> isCaTask = caService.CANumberIsValid(issueId);
|
||||
tasks.Add(isCaTask);
|
||||
|
||||
Task<bool> isMrbTask = mrbService.NumberIsValid(issueId);
|
||||
tasks.Add(isMrbTask);
|
||||
|
||||
Task<bool> isPcrbTask = pcrbService.IdIsValid(issueId);
|
||||
tasks.Add(isPcrbTask);
|
||||
|
||||
await Task.WhenAll(tasks);
|
||||
|
||||
if (isEcnTask.Result) {
|
||||
isEcn = true;
|
||||
} else if (isCaTask.Result) {
|
||||
isCa = true;
|
||||
} else if (isMrbTask.Result) {
|
||||
isMrb = true;
|
||||
} else if (isPcrbTask.Result) {
|
||||
isPcrb = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (isEcn) await GoToExternal($"{Configuration["OldFabApprovalUrl"]}/ECN/Edit?IssueID={issueId}", "");
|
||||
if (isCa) await GoToExternal($"{Configuration["OldFabApprovalUrl"]}/CorrectiveAction/Edit?IssueID={issueId}", "");
|
||||
if (isMrb) GoTo($"mrb/{issueId}");
|
||||
if (isPcrb) GoTo($"pcrb/{issueId}");
|
||||
}
|
||||
|
||||
private void GoTo(string page) {
|
||||
cache.Set("redirectUrl", page);
|
||||
navigationManager.NavigateTo("/" + page);
|
||||
}
|
||||
|
||||
private async Task GoToExternal(string url, string content) {
|
||||
IJSObjectReference windowModule = await jsRuntime.InvokeAsync<IJSObjectReference>("import", "./js/OpenInNewWindow.js");
|
||||
await windowModule.InvokeAsync<object>("OpenInNewWindow", url, content);
|
||||
}
|
||||
|
||||
private bool FilterFuncForMRBTable(MRB mrb) => MRBFilterFunc(mrb, mrbSearchString);
|
||||
|
||||
private bool MRBFilterFunc(MRB mrb, string searchString) {
|
||||
if (string.IsNullOrWhiteSpace(searchString))
|
||||
return true;
|
||||
if (mrb.Title.ToLower().Contains(searchString.Trim().ToLower()))
|
||||
return true;
|
||||
if (mrb.MRBNumber.ToString().Contains(searchString.Trim()))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
private bool FilterFuncForPCRBTable(PCRB pcrb) => PCRBFilterFunc(pcrb, pcrbSearchString);
|
||||
|
||||
private bool PCRBFilterFunc(PCRB pcrb, string searchString) {
|
||||
if (string.IsNullOrWhiteSpace(searchString))
|
||||
return true;
|
||||
if (pcrb.Title.ToLower().Contains(searchString.Trim().ToLower()))
|
||||
return true;
|
||||
if (pcrb.PlanNumber.ToString().Contains(searchString.Trim()))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
private string GetCurrentPCRBStep(int step) {
|
||||
if (step < 0 || step > (PCRB.Stages.Length - 1)) return string.Empty;
|
||||
else return PCRB.Stages[step];
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
1025
MesaFabApproval.Client/Pages/MRBSingle.razor.cs
Normal file
1025
MesaFabApproval.Client/Pages/MRBSingle.razor.cs
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
1139
MesaFabApproval.Client/Pages/PCRBSingle.razor.cs
Normal file
1139
MesaFabApproval.Client/Pages/PCRBSingle.razor.cs
Normal file
File diff suppressed because it is too large
Load Diff
@ -5,6 +5,7 @@ namespace MesaFabApproval.Client.Services;
|
||||
public interface IECNService {
|
||||
Task<string> ECNNumberIsValidStr(int ecnNumber);
|
||||
Task<bool> ECNNumberIsValid(int number);
|
||||
Task<IEnumerable<int>> GetAllECNNumbers();
|
||||
}
|
||||
|
||||
public class ECNService : IECNService {
|
||||
@ -49,4 +50,32 @@ public class ECNService : IECNService {
|
||||
throw new Exception($"Unable to determine if {number} is a valid ECN#, because {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<int>> GetAllECNNumbers() {
|
||||
try {
|
||||
HttpClient httpClient = _httpClientFactory.CreateClient("API");
|
||||
|
||||
HttpRequestMessage requestMessage = new(HttpMethod.Get, $"ecn/allNumbers");
|
||||
|
||||
HttpResponseMessage responseMessage = await httpClient.SendAsync(requestMessage);
|
||||
|
||||
if (responseMessage.IsSuccessStatusCode) {
|
||||
string responseContent = await responseMessage.Content.ReadAsStringAsync();
|
||||
|
||||
JsonSerializerOptions jsonSerializerOptions = new() {
|
||||
PropertyNameCaseInsensitive = true
|
||||
};
|
||||
|
||||
IEnumerable<int> allEcnNumbers =
|
||||
JsonSerializer.Deserialize<IEnumerable<int>>(responseContent, jsonSerializerOptions) ??
|
||||
new List<int>();
|
||||
|
||||
return allEcnNumbers;
|
||||
} else {
|
||||
throw new Exception(responseMessage.ReasonPhrase);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
throw new Exception($"Unable to get all ECN#s, because {ex.Message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
84
MesaFabApproval.Client/pipeline.yml
Normal file
84
MesaFabApproval.Client/pipeline.yml
Normal file
@ -0,0 +1,84 @@
|
||||
trigger:
|
||||
branches:
|
||||
include:
|
||||
- master
|
||||
paths:
|
||||
include:
|
||||
- MesaFabApproval.Client
|
||||
- MesaFabApproval.Shared
|
||||
|
||||
variables:
|
||||
buildConfiguration: "Release"
|
||||
|
||||
stages:
|
||||
- stage: Test
|
||||
displayName: "Test"
|
||||
pool:
|
||||
name: MesaFabApproval
|
||||
demands: Fab2ApprovalSystem-Dev
|
||||
jobs:
|
||||
- job: BuildPublish
|
||||
steps:
|
||||
- script: |
|
||||
echo build configuration: $(BuildConfiguration)
|
||||
displayName: "Echo Check"
|
||||
|
||||
- task: DotNetCoreCLI@2
|
||||
displayName: "Build"
|
||||
inputs:
|
||||
command: "build"
|
||||
configuration: $(BuildConfiguration)
|
||||
projects: MesaFabApproval.Client
|
||||
|
||||
- task: DotNetCoreCLI@2
|
||||
displayName: "Publish"
|
||||
inputs:
|
||||
command: "publish"
|
||||
publishWebProjects: false
|
||||
projects: MesaFabApproval.Client
|
||||
zipAfterPublish: true
|
||||
arguments: "-c $(BuildConfiguration) -o $(Build.ArtifactStagingDirectory) -r win-x64 --self-contained"
|
||||
|
||||
- task: CopyFiles@2
|
||||
displayName: "Copy Files"
|
||||
inputs:
|
||||
SourceFolder: "$(Build.ArtifactStagingDirectory)"
|
||||
TargetFolder: 'D:\$(Build.Repository.Name)\Client\$(Build.BuildId)\$(BuildConfiguration)'
|
||||
CleanTargetFolder: true
|
||||
retryCount: "3"
|
||||
|
||||
- stage: Prod
|
||||
displayName: "Prod"
|
||||
pool:
|
||||
name: MesaFabApproval
|
||||
demands: Fab2ApprovalSystem
|
||||
jobs:
|
||||
- job: BuildPublish
|
||||
steps:
|
||||
- script: |
|
||||
echo build configuration: $(BuildConfiguration)
|
||||
displayName: "Echo Check"
|
||||
|
||||
- task: DotNetCoreCLI@2
|
||||
displayName: "Build"
|
||||
inputs:
|
||||
command: "build"
|
||||
configuration: $(BuildConfiguration)
|
||||
projects: MesaFabApproval.Client
|
||||
|
||||
- task: DotNetCoreCLI@2
|
||||
displayName: "Publish"
|
||||
inputs:
|
||||
command: "publish"
|
||||
publishWebProjects: false
|
||||
projects: MesaFabApproval.Client
|
||||
zipAfterPublish: true
|
||||
arguments: "-c $(BuildConfiguration) -o $(Build.ArtifactStagingDirectory) -r win-x64 --self-contained"
|
||||
|
||||
- task: CopyFiles@2
|
||||
displayName: "Copy Files"
|
||||
inputs:
|
||||
SourceFolder: "$(Build.ArtifactStagingDirectory)"
|
||||
TargetFolder: 'D:\$(Build.Repository.Name)\Client\$(Build.BuildId)\$(BuildConfiguration)'
|
||||
CleanTargetFolder: true
|
||||
retryCount: "3"
|
||||
@ -25,7 +25,7 @@ stages:
|
||||
- stage: Development
|
||||
displayName: Development
|
||||
pool:
|
||||
name: Mesa-FabApproval
|
||||
name: MesaFabApproval
|
||||
demands: Fab2ApprovalSystem-Dev
|
||||
variables:
|
||||
ASPNETCORE_ENVIRONMENT: "Development"
|
||||
|
||||
Reference in New Issue
Block a user