Browse Source

Merge pull request #15504 from abpframework/auto-merge/rel-7-0/1682

Merge branch dev with rel-7.0
pull/15506/head
Berkan Sasmaz 4 years ago
committed by GitHub
parent
commit
001a49d875
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 30
      docs/en/Tutorials/Part-3.md
  2. 2754
      npm/ng-packs/packages/core/src/lib/proxy/generate-proxy.json
  3. 30
      npm/ng-packs/packages/core/src/lib/proxy/pages/abp/multi-tenancy/abp-tenant.service.ts
  4. 23
      npm/ng-packs/packages/core/src/lib/proxy/volo/abp/asp-net-core/mvc/api-exploring/abp-api-definition.service.ts
  5. 16
      npm/ng-packs/packages/core/src/lib/proxy/volo/abp/asp-net-core/mvc/application-configurations/abp-application-configuration.service.ts
  6. 16
      npm/ng-packs/packages/core/src/lib/proxy/volo/abp/asp-net-core/mvc/application-configurations/abp-application-localization.service.ts
  7. 3
      npm/ng-packs/packages/core/src/lib/proxy/volo/abp/http/modeling/models.ts
  8. 2
      npm/ng-packs/packages/core/src/lib/proxy/volo/abp/localization/models.ts

30
docs/en/Tutorials/Part-3.md

@ -50,13 +50,13 @@ This part is also recorded as a video tutorial and **<a href="https://www.youtub
In this section, you will learn how to create a new modal dialog form to create a new book. The modal dialog will look like the image below: In this section, you will learn how to create a new modal dialog form to create a new book. The modal dialog will look like the image below:
![bookstore-create-dialog](images/bookstore-create-dialog-3.png) ![bookstore-create-dialog](./images/bookstore-create-dialog-3.png)
### Create the Modal Form ### Create the Modal Form
Create a new razor page named `CreateModal.cshtml` under the `Pages/Books` folder of the `Acme.BookStore.Web` project. Create a new razor page named `CreateModal.cshtml` under the `Pages/Books` folder of the `Acme.BookStore.Web` project.
![bookstore-add-create-dialog](images/bookstore-add-create-dialog-v2.png) ![bookstore-add-create-dialog](./images/bookstore-add-create-dialog-v2.png)
#### CreateModal.cshtml.cs #### CreateModal.cshtml.cs
@ -188,7 +188,7 @@ The final content of `Index.cshtml` is shown below:
This adds a new button called **New book** to the **top-right** of the table: This adds a new button called **New book** to the **top-right** of the table:
![bookstore-new-book-button](images/bookstore-new-book-button-3.png) ![bookstore-new-book-button](./images/bookstore-new-book-button-3.png)
Open the `Pages/Books/Index.js` file and add the following code right after the `Datatable` configuration: Open the `Pages/Books/Index.js` file and add the following code right after the `Datatable` configuration:
@ -271,7 +271,7 @@ Now, you can **run the application** and add some new books using the new modal
Create a new razor page, named `EditModal.cshtml` under the `Pages/Books` folder of the `Acme.BookStore.Web` project: Create a new razor page, named `EditModal.cshtml` under the `Pages/Books` folder of the `Acme.BookStore.Web` project:
![bookstore-add-edit-dialog](images/bookstore-add-edit-dialog.png) ![bookstore-add-edit-dialog](./images/bookstore-add-edit-dialog.png)
### EditModal.cshtml.cs ### EditModal.cshtml.cs
@ -460,7 +460,7 @@ You can run the application and edit any book by selecting the edit action on a
The final UI looks as below: The final UI looks as below:
![bookstore-books-table-actions](images/bookstore-edit-button-3.png) ![bookstore-books-table-actions](./images/bookstore-edit-button-3.png)
> Notice that you don't see the "Actions" button in the figure below. Instead, you see an "Edit" button. ABP is smart enough to show a single simple button instead of a actions dropdown button when the dropdown has only a single item. After the next section, it will turn to a drop down button. > Notice that you don't see the "Actions" button in the figure below. Instead, you see an "Edit" button. ABP is smart enough to show a single simple button instead of a actions dropdown button when the dropdown has only a single item. After the next section, it will turn to a drop down button.
@ -687,7 +687,7 @@ Open `/src/app/book/book.component.html` and make the following changes:
You can open your browser and click the **New book** button to see the new modal. You can open your browser and click the **New book** button to see the new modal.
![Empty modal for new book](images/bookstore-empty-new-book-modal-2.png) ![Empty modal for new book](./images/bookstore-empty-new-book-modal-2.png)
### Create a Reactive Form ### Create a Reactive Form
@ -924,7 +924,7 @@ export class BookComponent implements OnInit {
Now, you can open your browser to see the changes: Now, you can open your browser to see the changes:
![Save button to the modal](images/bookstore-new-book-form-v3.png) ![Save button to the modal](./images/bookstore-new-book-form-v3.png)
## Updating a Book ## Updating a Book
@ -1052,7 +1052,7 @@ Open `/src/app/book/book.component.html`  and add the following `ngx-datatable-
Added an "Actions" dropdown as the first column of the table that is shown below: Added an "Actions" dropdown as the first column of the table that is shown below:
![Action buttons](images/bookstore-actions-buttons-2.png) ![Action buttons](./images/bookstore-actions-buttons-2.png)
Also, change the `ng-template #abpHeader` section as shown below: Also, change the `ng-template #abpHeader` section as shown below:
@ -1116,11 +1116,11 @@ Open `/src/app/book/book.component.html` and modify the `ngbDropdownMenu` to add
The final actions dropdown UI looks like below: The final actions dropdown UI looks like below:
![bookstore-final-actions-dropdown](images/bookstore-final-actions-dropdown-2.png) ![bookstore-final-actions-dropdown](./images/bookstore-final-actions-dropdown-2.png)
Clicking the "Delete" action calls the `delete` method which then shows a confirmation popup as shown below: Clicking the "Delete" action calls the `delete` method which then shows a confirmation popup as shown below:
![bookstore-confirmation-popup](images/bookstore-confirmation-popup-2.png) ![bookstore-confirmation-popup](./images/bookstore-confirmation-popup-2.png)
{{end}} {{end}}
@ -1150,7 +1150,7 @@ Open the `Books.razor` and replace the `<CardHeader>` section with the following
This will change the card header by adding a "New book" button to the right side: This will change the card header by adding a "New book" button to the right side:
![blazor-add-book-button](images/blazor-add-book-button-2.png) ![blazor-add-book-button](./images/blazor-add-book-button-2.png)
Now, we can add a modal that will be opened when we click the button. Now, we can add a modal that will be opened when we click the button.
@ -1224,7 +1224,7 @@ This code requires a service; Inject the `AbpBlazorMessageLocalizerHelper<T>` at
That's all. Run the application and try to add a new book: That's all. Run the application and try to add a new book:
![blazor-new-book-modal](images/blazor-new-book-modal-2.png) ![blazor-new-book-modal](./images/blazor-new-book-modal-2.png)
## Updating a Book ## Updating a Book
@ -1250,7 +1250,7 @@ Open the `Books.razor` and add the following `DataGridEntityActionsColumn` secti
The `DataGridEntityActionsColumn` component is used to show an "Actions" dropdown for each row in the `DataGrid`. The `DataGridEntityActionsColumn` shows a **single button** instead of a dropdown if there is only one available action inside it: The `DataGridEntityActionsColumn` component is used to show an "Actions" dropdown for each row in the `DataGrid`. The `DataGridEntityActionsColumn` shows a **single button** instead of a dropdown if there is only one available action inside it:
![blazor-edit-book-action](images/blazor-edit-book-action-3.png) ![blazor-edit-book-action](./images/blazor-edit-book-action-3.png)
### Edit Modal ### Edit Modal
@ -1338,7 +1338,7 @@ public class BookStoreBlazorAutoMapperProfile : Profile
You can now run the application and try to edit a book. You can now run the application and try to edit a book.
![blazor-edit-book-modal](images/blazor-edit-book-modal-2.png) ![blazor-edit-book-modal](./images/blazor-edit-book-modal-2.png)
> Tip: Try to leave the *Name* field empty and submit the form to show the validation error message. > Tip: Try to leave the *Name* field empty and submit the form to show the validation error message.
@ -1359,7 +1359,7 @@ Open the `Books.razor` page and add the following `EntityAction` code under the
The "Actions" button becomes a dropdown since it has two actions now: The "Actions" button becomes a dropdown since it has two actions now:
![blazor-delete-book-action](images/blazor-delete-book-action-2.png) ![blazor-delete-book-action](./images/blazor-delete-book-action-2.png)
Run the application and try to delete a book. Run the application and try to delete a book.

2754
npm/ng-packs/packages/core/src/lib/proxy/generate-proxy.json

File diff suppressed because it is too large

30
npm/ng-packs/packages/core/src/lib/proxy/pages/abp/multi-tenancy/abp-tenant.service.ts

@ -7,20 +7,24 @@ import type { FindTenantResultDto } from '../../../volo/abp/asp-net-core/mvc/mul
}) })
export class AbpTenantService { export class AbpTenantService {
apiName = 'abp'; apiName = 'abp';
findTenantById = (id: string) => findTenantById = (id: string) =>
this.restService.request<any, FindTenantResultDto>({ this.restService.request<any, FindTenantResultDto>(
method: 'GET', {
url: `/api/abp/multi-tenancy/tenants/by-id/${id}`, method: 'GET',
}, url: `/api/abp/multi-tenancy/tenants/by-id/${id}`,
{ apiName: this.apiName }); },
{ apiName: this.apiName },
);
findTenantByName = (name: string) => findTenantByName = (name: string) =>
this.restService.request<any, FindTenantResultDto>({ this.restService.request<any, FindTenantResultDto>(
method: 'GET', {
url: `/api/abp/multi-tenancy/tenants/by-name/${name}`, method: 'GET',
}, url: `/api/abp/multi-tenancy/tenants/by-name/${name}`,
{ apiName: this.apiName }); },
{ apiName: this.apiName },
);
constructor(private restService: RestService) { } constructor(private restService: RestService) {}
} }

23
npm/ng-packs/packages/core/src/lib/proxy/volo/abp/asp-net-core/mvc/api-exploring/abp-api-definition.service.ts

@ -1,20 +1,25 @@
import { RestService } from '../../../../../../services/rest.service'; import { RestService } from '../../../../../../services/rest.service';
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import type { ApplicationApiDescriptionModel, ApplicationApiDescriptionModelRequestDto } from '../../../http/modeling/models'; import type {
ApplicationApiDescriptionModel,
ApplicationApiDescriptionModelRequestDto,
} from '../../../http/modeling/models';
@Injectable({ @Injectable({
providedIn: 'root', providedIn: 'root',
}) })
export class AbpApiDefinitionService { export class AbpApiDefinitionService {
apiName = 'abp'; apiName = 'abp';
getByModel = (model: ApplicationApiDescriptionModelRequestDto) => getByModel = (model: ApplicationApiDescriptionModelRequestDto) =>
this.restService.request<any, ApplicationApiDescriptionModel>({ this.restService.request<any, ApplicationApiDescriptionModel>(
method: 'GET', {
url: '/api/abp/api-definition', method: 'GET',
params: { includeTypes: model.includeTypes }, url: '/api/abp/api-definition',
}, params: { includeTypes: model.includeTypes },
{ apiName: this.apiName }); },
{ apiName: this.apiName },
);
constructor(private restService: RestService) { } constructor(private restService: RestService) {}
} }

16
npm/ng-packs/packages/core/src/lib/proxy/volo/abp/asp-net-core/mvc/application-configurations/abp-application-configuration.service.ts

@ -7,14 +7,16 @@ import { Injectable } from '@angular/core';
}) })
export class AbpApplicationConfigurationService { export class AbpApplicationConfigurationService {
apiName = 'abp'; apiName = 'abp';
get = (options: ApplicationConfigurationRequestOptions) => get = (options: ApplicationConfigurationRequestOptions) =>
this.restService.request<any, ApplicationConfigurationDto>({ this.restService.request<any, ApplicationConfigurationDto>(
method: 'GET', {
url: '/api/abp/application-configuration', method: 'GET',
params: { includeLocalizationResources: options.includeLocalizationResources }, url: '/api/abp/application-configuration',
}, params: { includeLocalizationResources: options.includeLocalizationResources },
{ apiName: this.apiName }); },
{ apiName: this.apiName },
);
constructor(private restService: RestService) {} constructor(private restService: RestService) {}
} }

16
npm/ng-packs/packages/core/src/lib/proxy/volo/abp/asp-net-core/mvc/application-configurations/abp-application-localization.service.ts

@ -1,6 +1,6 @@
import type { ApplicationLocalizationDto, ApplicationLocalizationRequestDto } from './models'; import type { ApplicationLocalizationDto, ApplicationLocalizationRequestDto } from './models';
import { Injectable } from '@angular/core';
import { RestService } from '../../../../../../services/rest.service'; import { RestService } from '../../../../../../services/rest.service';
import { Injectable } from '@angular/core';
@Injectable({ @Injectable({
providedIn: 'root', providedIn: 'root',
@ -9,12 +9,14 @@ export class AbpApplicationLocalizationService {
apiName = 'abp'; apiName = 'abp';
get = (input: ApplicationLocalizationRequestDto) => get = (input: ApplicationLocalizationRequestDto) =>
this.restService.request<any, ApplicationLocalizationDto>({ this.restService.request<any, ApplicationLocalizationDto>(
method: 'GET', {
url: '/api/abp/application-localization', method: 'GET',
params: { cultureName: input.cultureName, onlyDynamics: input.onlyDynamics }, url: '/api/abp/application-localization',
}, params: { cultureName: input.cultureName, onlyDynamics: input.onlyDynamics },
{ apiName: this.apiName }); },
{ apiName: this.apiName },
);
constructor(private restService: RestService) {} constructor(private restService: RestService) {}
} }

3
npm/ng-packs/packages/core/src/lib/proxy/volo/abp/http/modeling/models.ts

@ -1,4 +1,3 @@
export interface ActionApiDescriptionModel { export interface ActionApiDescriptionModel {
uniqueName?: string; uniqueName?: string;
name?: string; name?: string;
@ -25,7 +24,7 @@ export interface ControllerApiDescriptionModel {
controllerName?: string; controllerName?: string;
controllerGroupName?: string; controllerGroupName?: string;
isRemoteService: boolean; isRemoteService: boolean;
integrationService: boolean; isIntegrationService: boolean;
apiVersion?: string; apiVersion?: string;
type?: string; type?: string;
interfaces: ControllerInterfaceApiDescriptionModel[]; interfaces: ControllerInterfaceApiDescriptionModel[];

2
npm/ng-packs/packages/core/src/lib/proxy/volo/abp/localization/models.ts

@ -1,7 +1,7 @@
export interface LanguageInfo { export interface LanguageInfo {
cultureName?: string; cultureName?: string;
uiCultureName?: string; uiCultureName?: string;
displayName?: string; displayName?: string;
twoLetterISOLanguageName?: string;
flagIcon?: string; flagIcon?: string;
} }

Loading…
Cancel
Save