Aktivity „rwright-ruhealth“

recommendation: USE "this" with member variables with the same name to disambiguate between local variables and parameters and member variables that happen to have the same identifier name, which abp-suite generates automatically.

Liangshiwei; Steps to reproduce:

Create a cities table in a sql server database: script below.

/****** Object:  Table [dbo].[Cities]    Script Date: 11/4/2022 8:21:55 AM ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[Cities](
	[id] [uniqueidentifier] NOT NULL,
	[ci_city] [nvarchar](50) NULL,
	[ExtraProperties] [nvarchar](max) NULL,
	[ConcurrencyStamp] [nvarchar](40) NULL,
	[CreationTime] [datetime2](7) NOT NULL,
	[CreatorId] [uniqueidentifier] NULL,
	[LastModificationTime] [datetime2](7) NULL,
	[LastModifierId] [uniqueidentifier] NULL,
	[IsDeleted] [bit] NOT NULL,
	[DeleterId] [uniqueidentifier] NULL,
	[DeletionTime] [datetime2](7) NULL,
 CONSTRAINT [PK_Cities] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

ALTER TABLE [dbo].[Cities] ADD  CONSTRAINT [DF_Cities_uid]  DEFAULT (newsequentialid()) FOR [id]
GO

ALTER TABLE [dbo].[Cities] ADD  CONSTRAINT [DF__Cities__Creation__3DE82FB7]  DEFAULT (getdate()) FOR [CreationTime]
GO

ALTER TABLE [dbo].[Cities] ADD  CONSTRAINT [DF__Cities__IsDelete__3EDC53F0]  DEFAULT (CONVERT([bit],(0))) FOR [IsDeleted]
GO

Next, use abp-suite to load the entity from database and select only the ci_city property name. Uncheck all other fields. Choose primary key type of Guid. Set a menu icon of file-alt. Choose : Check the Create user interface; Create backend; Add migration; Uncheck Update database Check Create unit and integration tests. Rename the Name to City; Leave plural name as Cities, Database table/collection name is Cities Change namespace to CitiesNs Set Base Class to FullAuditedEntity and primary key to Guid. Save and Generate the entity. Examine the class generated by the Abp-suite generator in domain project. This is what I consistently get for all project entities created:

namespace ManytoMany.CitiesNs
{
    public class City : FullAuditedEntity<Guid>
    {
        [CanBeNull]
        public virtual string ci_city { get; set; }

        public City()
        {

        }

        public City(Guid id, string ci_city = null)
        {

            Id = id;
            Check.Length(ci_city, nameof(ci_city), CityConsts.ci_cityMaxLength, 0);
            ci_city = ci_city;
        }

    }

Notice there is no** this.ci_city** which causes the ci_city property to remain null when submitted to the database on the create method, because the class property is not assigned to. Instead the parameter property is being set to itself. When I correct the code to use:this.ci_city=ci_city, the data is properly saved on create. As you know, the this.ci_city refers to the class property and without the word this, it refers to the parameter. It is not an issue when the class property has a different case or name than the parameter, because there is no ambiguity. Also, my database fields are all lower case. The class produced by the abp suite is shown below.

namespace ManytoMany.CitiesNs
{
    public class City : FullAuditedEntity<Guid>
    {
        [CanBeNull]
        public virtual string ci_city { get; set; }

        public City()
        {

        }

        public City(Guid id, string ci_city = null)
        {

            Id = id;
            Check.Length(ci_city, nameof(ci_city), CityConsts.ci_cityMaxLength, 0);
            ci_city = ci_city;
        }

    }

Rick Wright Subject: [EXTERNAL] BUG: abp-suite 6.0.1 Entity generation (#3995) Answered by liangshiwei. — Hi, Could you provide the full steps to reproduce? we will check it out and yes we will refund your ticket if it's a problem.


You are receiving this because you are subscribed to this question. Do not reply to this email. Click here to view #3995 in browser.

Maliming,

I emailed you a link to server. Any word?

Maliming;

Removing WEBDAV from the IIS server via remove roles/features solved the delete issue we were experiencing.

We still are encountering pathing issues with inbuilt pieces of ABP commercial. When trying to change the profile picture, the upload xmlhttprequest is trying to POST to the root of the site and it does not include the virtual application path. Is there a document published by ABP that covers proper configuration for applications served from virtual application directories, i.e. https://mysite.org/myapp

SEE this post as well: https://support.abp.io/QA/Questions/4800/User-Image-Lost (DOES NOT WORK FOR ME)

The path being posted to is: Volo.Abp.Account.Public.Web.Pages.Account.ManageModel.B8A9BBA0EEE4D03117FA135C1ED22DE0.js?_v=638161345940120111:5

   POST https://www.somesite.org/api/account/profile-picture 404  The POST request should be https://www.somesite.org/myapp/api/account/profile-picture  This works locally, but not on production server.
   

The error is: SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON at JSON.parse (<anonymous>) at Object.getResponseData (Volo.Abp.Account.Public.Web.Pages.Account.ManageModel.B8A9BBA0EEE4D03117FA135C1ED22DE0.js?_v=638161345940120111:5:696191) at XMLHttpRequest.<anonymous> (Volo.Abp.Account.Public.Web.Pages.Account.ManageModel.B8A9BBA0EEE4D03117FA135C1ED22DE0.js?_v=638161345940120111:5:699320)

Thank you.

ABP: To solve the problem as a commercial user, I downloaded and modified the source code for File Manager and that seems to solve all problems. Thank you.

Not sure if this is a bug or something but I can't for the life of me find where I can change the text ("ProjectName") here. Logo I know how to change.

It does not appear to use AppName or anything else I've found in the code?    
   
public class TodoManagerBrandingProvider : DefaultBrandingProvider   
{   
    public override string AppName => "My new name here";   
}   

Anyone still alive in here?

hi, this is not a bug! To get help on this customization question, you can create a new ticket. this topic is only for bugs

If this is declared as not a bug, but trying the obvious doesn't' work, then it's a bug. Provide the work-around or fix the problem, please. Thanks ABP team. I know you are better than this smug reply to a real problem. Creating a ticket only to get a refund for not fixing what should work by design? Even the base class defaultbrandingprovider has these properties to override. Additionally, overriding in global css shouldn't have to be the solution when the defaultbrandingprovider exposes light logo dark logo and AppName

Thank you.

the tag <suite-custom-code-block-1>...</suite-custom-code-block-1> is never generated when I choose to generate the page without creating a new entity in the database. This is an existing project upgraded to the 7.4 rc-4. I am trying to get the suite-custom-code-block-# tags to generate in the existing page, which does get regenerated. However, the custom code block tags are not created in the page. If I create a new entity, the suite-custom-code-block-# tag comments are sprinkled throughout the .cshtml page. seems to be ignored when I regenerate code wrapped in this tag in a .cshtml page. I have checked the customizable checkbox in ABP Suite. The .cshtml page is recreated completely, wiping out any change wrapped in the custom code block tags for existing pages that I manually add these tags to, since APB SUITE does not add them when regenerated.

Hi, I have re-checked it again and it seems there is not any problem here. You should have added the code block as follows:

Correct ✅

@*//<suite-custom-code-block-1>*@ 
    <h1>customizated content</h1> 
@*//</suite-custom-code-block-1>*@ 

Wrong ❌

@*<suite-custom-code-block-1>*@ 
    <h1>Custom Code</h1> 
@*</suite-custom-code-block-1>*@ 

Our placeholder is //<suite-custom-code-block-n>, please try with this placeholder and you will see that it's working as expected.

I disagree with your answer: The custom-code-block-1 will not work in your example because the html you show will be placed in the @section styles { ... } section which gets placed in the <head> ... ..</head> tag when you regenerate the page in ABP SUITE, losing all changes. It seems these custom-code-block tags are expected to be used in specific locations in the page beyond the user's control.

I will give an example. I have placed the following custom code blocks in a page. just above the starting abp-card tag and below the last @section content_toolbar { section } in books tutorial books index page .cshtml file:

@//<suite-custom-code-block-1>@ <h1>custom block 1</h1> @//</suite-custom-code-block-1>@ @//<suite-custom-code-block-2>@ <h2>custom block 2</h2> @//</suite-custom-code-block-2>@ @//<suite-custom-code-block-3>@ <h3>custom block 3</h3> @//</suite-custom-code-block-3>@ @//<suite-custom-code-block-4>@ <h4>custom block 4</h4> @//</suite-custom-code-block-4>@ @//<suite-custom-code-block-5>@ <h5>custom block 5</h5> @//</suite-custom-code-block-5>@ @//<suite-custom-code-block-6>@ <h6>custom block 6</h6> @//</suite-custom-code-block-6>@

When I use ABP Suite to regenerate the page (using a simple books tutorial book page this is what I get:

@section styles { @//<suite-custom-code-block-1>@ <h1>custom block 1</h1> @//</suite-custom-code-block-1>@ }

@section scripts { <abp-script src="/Pages/Books/index.js" /> @//<suite-custom-code-block-2>@ <h2>custom block 2</h2> @//</suite-custom-code-block-2>@ }

@section content_toolbar { <abp-button id="ExportToExcelButton" text="@L["ExportToExcel"].Value" icon="download" size="Small" button-type="Primary" /> @if (await Authorization.IsGrantedAsync(GranTrakPermissions.Books.Create)) { <abp-button id="NewBookButton" text="@L["NewBook"].Value" icon="plus" size="Small" button-type="Primary" /> } @//<suite-custom-code-block-3>@ <h3>custom block 3</h3> @//</suite-custom-code-block-3>@ }

@//<suite-custom-code-block-4>@ <h4>custom block 4</h4> @//</suite-custom-code-block-4>@

<abp-card> <abp-card-body> <abp-row class="mb-3"> <abp-column size-md="_12"> <form id="SearchForm" autocomplete="off"> <div class="input-group"> <input class="form-control page-search-filter-text" id="FilterText" placeholder="@L["Search"]"/> <abp-button button-type="Primary" type="submit" icon="search"/> </div> </form> </abp-column> <abp-column size-md="_12" class="mt-3"> <a href="javascript:;" id="AdvancedFilterSectionToggler" class="text-decoration-none">@L["SeeAdvancedFilters"]</a> </abp-column> </abp-row>

    &lt;abp-row id=&quot;AdvancedFilterSection&quot; style=&quot;display: none;&quot;&gt;
        &lt;abp-column size=&quot;_3&quot;&gt;
            &lt;abp-input asp-for=&quot;TitleFilter&quot; label=&quot;@L[&quot;Title&quot;].Value&quot; /&gt;
        &lt;/abp-column&gt;
        &lt;abp-column size=&quot;_3&quot;&gt;
            &lt;abp-input asp-for=&quot;AuthorNameFilter&quot; label=&quot;@L[&quot;AuthorName&quot;].Value&quot; /&gt;
        &lt;/abp-column&gt;

@//<suite-custom-code-block-5>@ <h5>custom block 5</h5> @//</suite-custom-code-block-5>@ </abp-row>

    &lt;abp-table striped-rows=&quot;true&quot; id=&quot;BooksTable&quot;&gt;
        &lt;thead&gt;
			&lt;tr&gt;
				&lt;th&gt;@L["Actions"]&lt;/th&gt;
				&lt;th&gt;@L["Title"]&lt;/th&gt;
				&lt;th&gt;@L["AuthorName"]&lt;/th&gt;

@//<suite-custom-code-block-6>@ <h6>custom block 6</h6> @//</suite-custom-code-block-6>@ </tr> </thead> </abp-table> </abp-card-body> </abp-card>

Not what I was expecting. Is this expected behavior? It appears to me the custom code blocks place themselves at certain points in the page and the user has no control over where these blocks are placed. So, at this point we seem to be stuck with using the code block points as and if they are generated by ABP Suite.

At the very least, I have figured out how to the get the code blocks to stay when I create them in existing pages. My steps are: Create all 6 code custom code block points, as above using VSCode or Visual Studio to edit the .cshtml page. After editing save the page. Then use abp-suite to regenerate the items, etc and ABP Suite will move all of the code blocks to where it expects to find them. ABP Suite will not, however add items 2-6 for example, if you only put @//<suite-custom-code-block-1>@ @//</suite-custom-code-block-1>@ ABP Suite will only create this block and it places item 1 in the @ section styles { ... }

The same thing will happen if you just put code block 6 only in your razor page @//<suite-custom-code-block-6>@ @//</suite-custom-code-block-6>@ custom code block 6 will get moved to below the thead/tr/th columns and above the closing thead/tr tag custom code blocks 1-5 will not get added.

Finding this stuff out by trial and error as there is no documentation. Thank you.

Thank you for your followup. I will await documentation. Meanwhile, I will also wxplore templates as well.

Hello rwright-ruhealth,

could you please check this link https://learn.microsoft.com/en-us/answers/questions/1246334/drop-down-in-razor-that-can-let-you-type-the-value?page=1

Here instead of controller you need to add code in code behind i.e. *.cshtml.cs or Model.

please do let me know if it helps you

Thank you, Anjali

Good day; I did something similar after researching documentation using the select2 combo and razor pages. The problem I ran into is my custom code gets clobbered by ABP suite when I regenerate the page. I was thinking there must be an ABP way to do it that I wasn't aware of. Now that I upgraded to version 7.4 rc5 I am going to try again using the custom code blocks comment tags to see if I can keep my changes. I figured out some of the tricks to working with the custom code blocks so far. See my write up in this support question. [Question #5892](https://support.abp.io/QA/Questions/5892/14629-THE-custom-code-tag-suite-custom-code-block-n-is-ignored-by-ABP-Suite-Custom-code-is-wiped-out)

Zobrazených 1 až 10 z 12 záznamov
Made with ❤️ on ABP v8.2.0-preview Updated on marca 25, 2024, 15:11