Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VCST-2357: Add OrganizationId #129

Merged
merged 8 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public class QuoteRequestSearchCriteria : SearchCriteriaBase
public string NumberKeyword { get; set; }

public string CustomerId { get; set; }
public string[] OrganizationIds { get; set; }
artem-dudarev marked this conversation as resolved.
Show resolved Hide resolved
public string StoreId { get; set; }
public DateTime? StartDate { get; set; }
public DateTime? EndDate { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,11 @@ protected virtual IQueryable<QuoteRequestEntity> BuildQuery(IQuoteRepository rep
query = query.Where(x => x.CustomerId == criteria.CustomerId);
}

if (!criteria.OrganizationIds.IsNullOrEmpty())
{
query = query.Where(x => criteria.OrganizationIds.Contains(x.OrganizationId));
}

if (criteria.StoreId != null)
{
query = query.Where(x => x.StoreId == criteria.StoreId);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
using System.Collections.Generic;
using GraphQL;
using GraphQL.Types;
using VirtoCommerce.Xapi.Core.BaseQueries;
using VirtoCommerce.QuoteModule.ExperienceApi.Aggregates;
using VirtoCommerce.Xapi.Core.BaseQueries;

namespace VirtoCommerce.QuoteModule.ExperienceApi.Queries;

public class QuotesQuery : SearchQuery<QuoteAggregateSearchResult>
{
public string StoreId { get; set; }
public string UserId { get; set; }
public string OrganizationId { get; set; }
public string CurrencyCode { get; set; }
public string CultureName { get; set; }
public string Filter { get; set; }
Expand All @@ -26,6 +27,7 @@ public override IEnumerable<QueryArgument> GetArguments()
yield return Argument<StringGraphType>(nameof(CurrencyCode));
yield return Argument<StringGraphType>(nameof(CultureName));
yield return Argument<StringGraphType>(nameof(Filter));
yield return Argument<StringGraphType>(nameof(OrganizationId));
}

public override void Map(IResolveFieldContext context)
Expand All @@ -37,5 +39,6 @@ public override void Map(IResolveFieldContext context)
CurrencyCode = context.GetArgument<string>(nameof(CurrencyCode));
CultureName = context.GetArgument<string>(nameof(CultureName));
Filter = context.GetArgument<string>(nameof(Filter));
OrganizationId = context.GetArgument<string>(nameof(OrganizationId));
artem-dudarev marked this conversation as resolved.
Show resolved Hide resolved
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using VirtoCommerce.Xapi.Core.Index;
using VirtoCommerce.Xapi.Core.Infrastructure;
using VirtoCommerce.Platform.Core.Common;
using VirtoCommerce.QuoteModule.Core.Models;
using VirtoCommerce.QuoteModule.Core.Services;
using VirtoCommerce.QuoteModule.ExperienceApi.Aggregates;
using VirtoCommerce.SearchModule.Core.Model;
using VirtoCommerce.SearchModule.Core.Services;
using VirtoCommerce.Xapi.Core.Index;
using VirtoCommerce.Xapi.Core.Infrastructure;

namespace VirtoCommerce.QuoteModule.ExperienceApi.Queries;

Expand Down Expand Up @@ -48,6 +48,7 @@ protected virtual QuoteRequestSearchCriteria GetSearchCriteria(QuotesQuery reque
criteria.CustomerId = request.UserId;
criteria.Currency = request.CurrencyCode;
criteria.LanguageCode = request.CultureName;
criteria.OrganizationIds = [request.OrganizationId];

// parse Filter argument
if (string.IsNullOrEmpty(request.Filter))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"rfq-from": "Anfrage von",
"reminder-date": "Erinnerungsdatum",
"general-comment": "Allgemeiner Kommentar",
"internal-comment": "Interner Kommentar"
"internal-comment": "Interner Kommentar",
"not-defined": "Nicht definiert"
},
"placeholders": {
"status": "Auswählen...",
Expand Down Expand Up @@ -188,4 +189,4 @@
"description": "Angebotsanfragen (RFQs) exportieren oder importieren"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"rfq-from": "RFQ from",
"reminder-date": "Reminder date",
"general-comment": "General comment",
"internal-comment": "Internal comment"
"internal-comment": "Internal comment",
"not-defined": "Not defined"
},
"placeholders": {
"status": "Select...",
Expand Down Expand Up @@ -192,4 +193,4 @@
"description": "Export or import quote requests (RFQs)"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"rfq-from": "Solicitud de cotización de",
"reminder-date": "Fecha de recordatorio",
"general-comment": "Comentario general",
"internal-comment": "Comentario interno"
"internal-comment": "Comentario interno",
"not-defined": "No definido"
},
"placeholders": {
"status": "Seleccionar...",
Expand Down Expand Up @@ -188,4 +189,4 @@
"description": "Exportar o importar solicitudes de cotización (RFQ)"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"rfq-from": "Demande de devis de",
"reminder-date": "Date de rappel",
"general-comment": "Commentaire général",
"internal-comment": "Commentaire interne"
"internal-comment": "Commentaire interne",
"not-defined": "Non défini"
},
"placeholders": {
"status": "Sélectionner...",
Expand Down Expand Up @@ -188,4 +189,4 @@
"description": "Exporter ou importer des demandes de devis (RFQ)"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"rfq-from": "RFQ da",
"reminder-date": "Data promemoria",
"general-comment": "Commento generale",
"internal-comment": "Commento interno"
"internal-comment": "Commento interno",
"not-defined": "Non definito"
},
"placeholders": {
"status": "Seleziona...",
Expand Down Expand Up @@ -188,4 +189,4 @@
"description": "Esporta o importa richieste di preventivo (RFQ)"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"rfq-from": "見積依頼元",
"reminder-date": "リマインダー日",
"general-comment": "一般コメント",
"internal-comment": "内部コメント"
"internal-comment": "内部コメント",
"not-defined": "未定義"
},
"placeholders": {
"status": "選択...",
Expand Down Expand Up @@ -188,4 +189,4 @@
"description": "見積依頼(RFQ)をエクスポートまたはインポート"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"rfq-from": "Zapytanie ofertowe od",
"reminder-date": "Data przypomnienia",
"general-comment": "Komentarz ogólny",
"internal-comment": "Komentarz wewnętrzny"
"internal-comment": "Komentarz wewnętrzny".
"not-defined": "Nieokreślony"
},
"placeholders": {
"status": "Wybierz...",
Expand Down Expand Up @@ -188,4 +189,4 @@
"description": "Eksportuj lub importuj zapytania ofertowe (RFQ)"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"rfq-from": "RFQ de",
"reminder-date": "Data de lembrete",
"general-comment": "Comentário geral",
"internal-comment": "Comentário interno"
"internal-comment": "Comentário interno",
"not-defined": "Não definido"
},
"placeholders": {
"status": "Selecionar...",
Expand Down Expand Up @@ -188,4 +189,4 @@
"description": "Exportar ou importar solicitações de cotação (RFQs)"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"rfq-from": "Запрос от",
"reminder-date": "Дата напоминания",
"general-comment": "Общий комментарий",
"internal-comment": "Внутренний комментарий"
"internal-comment": "Внутренний комментарий",
"not-defined": "Не определено"
},
"placeholders": {
"status": "Выбрать...",
Expand Down Expand Up @@ -188,4 +189,4 @@
"description": "Экспорт или импорт запросов на коммерческие предложения (RFQ)"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"rfq-from": "询价来源",
"reminder-date": "提醒日期",
"general-comment": "一般评论",
"internal-comment": "内部评论"
"internal-comment": "内部评论",
"not-defined": "未定义"
},
"placeholders": {
"status": "选择...",
Expand Down Expand Up @@ -188,4 +189,4 @@
"description": "导出或导入报价请求(RFQ)"
}
}
}
}
40 changes: 40 additions & 0 deletions src/VirtoCommerce.QuoteModule.Web/Scripts/blades/quote-detail.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,46 @@ angular.module('virtoCommerce.quoteModule')
return members.search(criteria);
};

function showCustomerDetailBlade(member) {
artem-dudarev marked this conversation as resolved.
Show resolved Hide resolved
var foundTemplate = memberTypesResolverService.resolve(member.memberType);
if (foundTemplate) {
var newBlade = angular.copy(foundTemplate.detailBlade);
newBlade.currentEntity = member;
bladeNavigationService.showBlade(newBlade, blade);
} else {
dialogService.showNotificationDialog({
id: "error",
title: "quote.dialogs.unknown-member-type.title",
message: "quote.dialogs.unknown-member-type.message",
messageValues: { memberType: member.memberType }
});
}
}

blade.openCustomerDetails = function () {
if (blade.currentEntity.customerId) {
members.getByUserId({ userId: blade.currentEntity.customerId }, function (member) {
if (member && member.id) {
showCustomerDetailBlade(member);
}
});
}
};

blade.openOrganizationDetails = function () {
if (blade.currentEntity.organizationId) {
members.get({ id: blade.currentEntity.organizationId }, function (member) {
if (member && member.id) {
showCustomerDetailBlade(member);
}
});
}
};

blade.translate = function(key) {
return $translate.instant(key);
}

function initShipmentMethod() {
if (blade.currentEntity && blade.currentEntity.shipmentMethod && blade.shippingMethods.$resolved) {
blade.currentEntity.shipmentMethod = _.findWhere(blade.shippingMethods, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
<ul class="list __info">
<li class="list-item">
<div class="list-t">{{ 'quotes.blades.quote-detail.labels.customer' | translate }}</div>
<div class="list-descr">{{blade.currentEntity.customerName}}</div>
<div class="list-descr">
<label class="form-label" style="height:27px;">
<a href="" ng-click="blade.openCustomerDetails()">{{ blade.currentEntity.customerName }}</a>
</label>
</div>
</li>
</ul>
</div>
Expand All @@ -28,10 +32,14 @@
<div class="clearfix">
<div class="column">
<ul class="list __info">
<li class="list-item">
<div class="list-t">{{ 'quotes.blades.quote-detail.labels.customer-organization' | translate }}</div>
<div class="list-descr">{{blade.currentEntity.organizationName?blade.currentEntity.organizationName:'Not defined'}}</div>
</li>
<li class="list-item">
<div class="list-t">{{ 'quotes.blades.quote-detail.labels.customer-organization' | translate }}</div>
<div class="list-descr">
<label class="form-label" style="height:27px;">
<a href="" ng-click="blade.openOrganizationDetails()">{{ blade.currentEntity.organizationName ? blade.currentEntity.organizationName : blade.translate('quotes.blades.quoteDetail.labels.not-defined') }}</a>
</label>
</div>
</li>
</ul>
</div>
<div class="column">
Expand Down
Loading