hi lian you are not responding to my question you didn't read my question how can i ignore environment file and use config file if i let it within environment so when anybody take this build will not change the localhost to his what should i do ??
any body here ?
hi when i make publish from angular application and upload it to IIS server and my partner trying to open it he has another localhost for example my localhost is 44388 and his local is 44255 so application will not run he must open the source code and change localhost within environment file and this file will be not editable to change the port when production so what i did is 1- creating new Config.json file and put the Url 2- create a service to use this config 3- use this Url into all my APIs so if i changed this Url on my local Machin no API will work that is exactly what happen when production so i created this file into assets folder to allow any one has this publish to just change the Url within Config.json file to his localhost and it will work very well so where is the problem ?? the problem within environment file which deleted when production and this file includes my Machin localhost so if any one take this publish will not work because he hasn't environment file so i want to make all code into environment file to be within config.json file.
1- when i publish my project it will remove environment file which includes outh login page 2- i want to make this logic within config.json file to make my partner just change localhost to his localhost 3- then i will remove environment files it will not affect on project because it will be useless
-- images will include 1- config.json 2- service to use it 3- example for API 4- environment file
thanks for efforts it works well thank you again
Please Still Has the same Issue that The Database Connection String Tab not exist on the custom tenant screen, although i already have licenses but i cant get the source of this Page "/Saas/Host/Tenants/CreateModal" from github Please could you provide me the original source code of this Page.
appreciate your Quick response.
sorry i noticed that where is Database Connection strings tab ??
wow it works thank you lian :)
hi i followed the document but nothing changes 1- source code of tenant page doesn't have tabs despite the view has 2 tabs ( Basic info && Database Connection String)
2- section (Completely Overriding a Razor Page) into document i found there is no need to inherit just use AbpPageModel if i create all logic in cs file here is my final code:=>
public class MyCreateModalModel : AbpPageModel
{
protected ITenantAppService TenantAppService { get; }
public MyCreateModalModel(ITenantAppService tenantAppService) //: base(tenantAppService)
{
TenantAppService = tenantAppService;
}
[BindProperty]
public TenantInfoModel Tenant { get; set; }
public virtual Task<IActionResult> OnGetAsync()
{
Tenant = new TenantInfoModel();
return Task.FromResult<IActionResult>(Page());
}
public virtual async Task<IActionResult> OnPostAsync()
{
ValidateModel();
var input = ObjectMapper.Map<TenantInfoModel, TenantCreateDto>(Tenant);
await TenantAppService.CreateAsync(input);
return NoContent();
}
public class TenantInfoModel : ExtensibleObject
{
[Required]
[DynamicStringLength(typeof(TenantConsts), nameof(TenantConsts.MaxNameLength))]
[Display(Name = "DisplayName:TenantName")]
public string Name { get; set; }
[Required]
[EmailAddress]
[DynamicStringLength(typeof(TenantConsts), nameof(TenantConsts.MaxAdminEmailAddressLength))]
public string AdminEmailAddress { get; set; }
[Required]
[DataType(DataType.Password)]
[DynamicStringLength(typeof(TenantConsts), nameof(TenantConsts.MaxPasswordLength))]
public string AdminPassword { get; set; }
}
}
and this is my html code: =>
@using Microsoft.Extensions.Localization
@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal
@using Volo.Abp.Localization
@using Volo.Abp.ObjectExtending
@using Volo.Abp.TenantManagement.Localization
@model Horizon.HorizonERP.Web.Pages.TenantManagement.Tenants.MyCreateModalModel
@using Volo.Abp.Data
@using Volo.Abp.TenantManagement;
@inject IHtmlLocalizer<AbpTenantManagementResource> L
@inject IStringLocalizerFactory StringLocalizerFactory
@{
Layout = null;
}
<form method="post" asp-page="/TenantManagement/Tenants/MyCreateModal">
<abp-modal>
<abp-modal-header title="@L["NewTenant"].Value"></abp-modal-header>
<abp-modal-body>
<abp-tabs>
<abp-tab title="Main Info">
<abp-input asp-for="Tenant.Name" />
<abp-input asp-for="Tenant.AdminEmailAddress" />
<div class="mb-3">
<label class="form-label">@L["DisplayName:AdminPassword"].Value</label>
<span> * </span>
<div class="input-group">
<input type="password" class="form-control" maxlength="@TenantConsts.MaxPasswordLength" asp-for="Tenant.AdminPassword" />
<button class="btn btn-secondary" type="button" id="PasswordVisibilityButton">
<i class="fa fa-eye-slash" aria-hidden="true"></i>
</button>
</div>
<span asp-validation-for="Tenant.AdminPassword"></span>
</div>
</abp-tab>
<abp-tab title="Extra">
@foreach (var propertyInfo in ObjectExtensionManager.Instance.GetProperties<MyCreateModalModel.TenantInfoModel>())
{
if (!propertyInfo.Name.EndsWith("_Text"))
{
if (propertyInfo.Type.IsEnum || !propertyInfo.Lookup.Url.IsNullOrEmpty())
{
if (propertyInfo.Type.IsEnum)
{
Model.Tenant.ExtraProperties.ToEnum(propertyInfo.Name, propertyInfo.Type);
}
<abp-select asp-for="Tenant.ExtraProperties[propertyInfo.Name]"
label="@propertyInfo.GetLocalizedDisplayName(StringLocalizerFactory)"
autocomplete-api-url="@propertyInfo.Lookup.Url"
autocomplete-selected-item-name="@Model.Tenant.GetProperty(propertyInfo.Name+"_Text")"
autocomplete-selected-item-value="@Model.Tenant.GetProperty(propertyInfo.Name)"
autocomplete-filter-param-name="@propertyInfo.Lookup.FilterParamName"
autocomplete-items-property-name="@propertyInfo.Lookup.ResultListPropertyName"
autocomplete-display-property-name="@propertyInfo.Lookup.DisplayPropertyName"
autocomplete-value-property-name="@propertyInfo.Lookup.ValuePropertyName"></abp-select>
}
else
{
<abp-input type="@propertyInfo.GetInputType()"
asp-for="Tenant.ExtraProperties[propertyInfo.Name]"
label="@propertyInfo.GetLocalizedDisplayName(StringLocalizerFactory)"
asp-format="@propertyInfo.GetInputFormatOrNull()"
value="@propertyInfo.GetInputValueOrNull(Model.Tenant.GetProperty(propertyInfo.Name))" />
}
}
}
</abp-tab>
</abp-tabs>
</abp-modal-body>
<abp-modal-footer buttons="@(AbpModalButtons.Cancel|AbpModalButtons.Save)"></abp-modal-footer>
</abp-modal>
</form>
but final result is the same nothing changed so did i miss logic or registration or code line i must put anything ??
Thank you for your response, and i want mention that i can't reach this tenantRepository because i want to use it in seeder in domain application and when i add reference for tenant management, show error that is not compatible with netstandard 2.0 ,so i use public async Task HandleEventAsync(EntityCreatedEventData<Tenant> eventData) {} as you mention before but i change argument to be EntityCreatedEventData<Tenant> and it works fine Thank you again