Skip to content
This repository has been archived by the owner on Nov 6, 2023. It is now read-only.

Vendor #383

Merged
merged 11 commits into from
Nov 2, 2023
Merged
3 changes: 1 addition & 2 deletions packages/api-plugin-template.erxes/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -718,5 +718,4 @@ async function startServer() {

startServer();


// conflict test
// conflict test
15 changes: 0 additions & 15 deletions packages/core-ui/public/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2103,46 +2103,31 @@
"Last update": "Last update",
"based": "based",
"Add a value": "Add a value",
"Client portal": "Client portal",
"Client Portal": "Client Portal",
"Add New Client Portal": "Add New Client Portal",
"New Client Portal": "New Client Portal",
"Business portal": "Business portal",
"Business Portal": "Business Portal",
"Vendor Portal": "Vendor Portal",
"Add New Vendor Portal": "Add New Vendor Portal",
"Add New Business Portal": "Add New Business Portal",
"New Business Portal": "New Business Portal",
"There is no client portal": "There is no client portal",
"Getting Started with Client Portal": "Getting Started with Client Portal",
"Client Portal Name": "Client Portal Name",
"Getting Started with Business Portal": "Getting Started with Business Portal",
"Business Portal Name": "Business Portal Name",
"Vendor Portal Name": "Vendor Portal Name",
"Displayed in the header area": "Displayed in the header area",
"Redirect URL to the main website": "Redirect URL to the main website",
"Features": "Features",
"Knowledge Base Name": "Knowledge Base Name",
"Shown name on menu": "Shown name on menu",
"Knowledge base topic in Client Portal": "Knowledge base topic in Client Portal",
"Knowledge base topic in Business Portal": "Knowledge base topic in Business Portal",
"Knowledge base topic in Vendor Portal": "Knowledge base topic in Vendor Portal",
"Please enter a label for Ticket": "Please enter a label for Ticket",
"Please enter a label for Task": "Please enter a label for Task",
"Select a knowledge base topic": "Select a knowledge base topic",
"Task public pipeline": "Task public pipeline",
"Task public board": "Task public board",
"Public task pipeline": "Public task pipeline",
"Public task board": "Public task board",
"Show in Client Portal": "Show in Client Portal",
"Show in Vendor Portal": "Show in Vendor Portal",
"Show in Business Portal": "Show in Business Portal",
"Logo and favicon": "Logo and favicon",
"Main Logo": "Main Logo",
"Favicon": "Favicon",
"Client portal main logo PNG": "Client portal main logo PNG",
"Business portal main logo PNG": "Business portal main logo PNG",
"Vendpr portal main logo PNG": "Vendor portal main logo PNG",
"16x16px transparent PNG": "16x16px transparent PNG",
"Main colors": "Main colors",
"Background color": "Background color",
Expand Down
16 changes: 8 additions & 8 deletions packages/core-ui/public/locales/mn.json
Original file line number Diff line number Diff line change
Expand Up @@ -2212,31 +2212,31 @@
"Last updated by": "Хамгийн сүүлд шинэчилсэн",
"Last update": "Хамгийн сүүлийн өөрчлөлт",
"based": "тулгуурласан",
"Client portal": "Үйлчлүүлэгчийн портал",
"Client Portal": "Үйлчлүүлэгчийн портал",
"Business portal": "Бизнес портал",
"Business Portal": "Бизнес портал",
"Add New Client Portal": "Шинэ Үйлчлүүлэгчийн портал нэмэх",
"New Client Portal": "Шинэ Үйлчлүүлэгчийн портал",
"New Business Portal": "Шинэ Үйлчлүүлэгчийн портал",
"There is no client portal": "Үйлчлүүлэгчийн портал одоогоор алга байна",
"Getting Started with Client Portal": "Үйлчлүүлэгчийн портал эхлүүлэх",
"Client Portal Name": "Үйлчлүүлэгчийн портал нэр",
"Getting Started with Business Portal": "Үйлчлүүлэгчийн портал эхлүүлэх",
"Business Portal Name": "Үйлчлүүлэгчийн портал нэр",
"Displayed in the header area": "Толгой хэсэгт харагдана",
"Redirect URL to the main website": "Үндсэн вэбсайт руу үсрэх",
"Features": "Онцлогууд",
"Knowledge Base Name": "Мэдлэгийн баазын нэр",
"Shown name on menu": "Цэсэнд харагдах нэр",
"Knowledge base topic in Client Portal": "Үйлчлүүлэгч портал дахь мэдлэгийн баазын сэдэв",
"Knowledge base topic in Business Portal": "Үйлчлүүлэгч портал дахь мэдлэгийн баазын сэдэв",
"Please enter a label for Ticket": "Тасалбарын шошгыг оруулна уу",
"Please enter a label for Task": "Даалгаврын шошгыг оруулна уу",
"Select a knowledge base topic": "Мэдлэгийн баазын сэдвийг сонго",
"Task public pipeline": "Олон нийтийн даалгаварын хоолой",
"Task public board": "Олон нийтийн даалгаварын самбар",
"Public task pipeline": "Олон нийтийн даалгаварын хоолой",
"Public task board": "Олон нийтийн даалгаварын самбар",
"Show in Client Portal": "Үйлчлүүлэгчийн портал дээр харуулах",
"Show in Business Portal": "Үйлчлүүлэгчийн портал дээр харуулах",
"Logo and favicon": "Лого болон фавикон",
"Main Logo": "Үндсэн лого",
"Favicon": "Фавикон",
"Client portal main logo PNG": "Үйлчлүүлэгч порталын үндсэн лого PNG",
"Business portal main logo PNG": "Үйлчлүүлэгч порталын үндсэн лого PNG",
"16x16px transparent PNG": "16x16px ил тод PNG",
"Main colors": "Үндсэн өнгө",
"Background color": "Дэвсгэр өнгө",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ import PortableItems from '@erxes/ui-cards/src/boards/components/portable/Items'
import { List } from '../../styles';
import { IClientPortalUser } from '../../types';
import options from '@erxes/ui-cards/src/tickets/options';
import CardItems from '../../containers/CardItems';

type Props = {
clientPortalUser: IClientPortalUser;
cards: any[];
cardType: string;
};

export default class RightSidebar extends React.Component<Props> {
Expand All @@ -32,10 +33,16 @@ export default class RightSidebar extends React.Component<Props> {
</List>
</Box>

<CardItems userId={clientPortalUser._id} type="ticket" />
<CardItems userId={clientPortalUser._id} type="deal" />
<CardItems userId={clientPortalUser._id} type="task" />
<CardItems userId={clientPortalUser._id} type="purchase" />
<PortableItems
data={{
options: { ...options, title: 'test' }
}}
hideQuickButtons={true}
items={[]}
onChangeItem={() => {
console.log('onChangeItem');
}}
/>
</Sidebar>
);
}
Expand Down
76 changes: 1 addition & 75 deletions packages/plugin-clientportal-ui/src/graphql/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,76 +300,6 @@ query ClientPortalCardUsers($contentType: String!, $contentTypeId: String!, $use
}
`;

const cardFields = `
_id
companies {
_id
primaryName
primaryEmail
primaryPhone
}
assignedUsers {
_id
details {
avatar
firstName
fullName
lastName
shortName
}
email
username
}
customers {
_id
firstName
lastName
middleName
primaryEmail
primaryPhone
}
name
boardId
stageId
status
pipeline {
_id
}
createdAt
`;

const tasksOfUser = `
query ClientPortalUserTasks($userId: String) {
clientPortalUserTasks(userId: $userId) {
${cardFields}
}
}
`;

const dealsOfUser = `
query ClientPortalUserDeals($userId: String) {
clientPortalUserDeals(userId: $userId) {
${cardFields}
}
}
`;

const ticketsOfUser = `
query ClientPortalUserTickets($userId: String) {
clientPortalUserTickets(userId: $userId) {
${cardFields}
}
}
`;

const purchasesOfUser = `
query ClientPortalUserPurchases($userId: String) {
clientPortalUserPurchases(userId: $userId) {
${cardFields}
}
}
`;

export default {
getConfig,
getConfigs,
Expand All @@ -381,9 +311,5 @@ export default {
clientPortalUserCounts,
clientPortalComments,
fieldConfig,
usersOfCard,
tasksOfUser,
dealsOfUser,
ticketsOfUser,
purchasesOfUser
usersOfCard
};
2 changes: 1 addition & 1 deletion packages/plugin-forum-ui/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const postUsername = ({ post, typeKey, crmKey, cpKey }) => {
if (post[typeKey] === 'CP') {
return (
(post[cpKey]?.username || post[cpKey]?.email || post[cpKey]?._id) +
' (Client Portal)'
' (Business Portal)'
);
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const getOwnerTypes = () => {

if (isEnabled('clientportal')) {
ownerTypes.push({
label: 'Client Portal User',
label: 'Business Portal User',
name: 'cpUser'
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class ScoreForm extends React.Component<Props, State> {
if (isEnabled('clientportal') && ownerType === 'cpUser') {
return (
<SelectClientPortalUser
label="Client Portal User"
label="Business Portal User"
name="ownerId"
multi={false}
initialValue={ownerId}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ class BoardItemCreate extends React.Component<IActivityLogItemProps> {
userName = renderUserFullName(createdByDetail.content);
}

if (createdByDetail && createdByDetail.type === 'clientPortalUser') {
userName = getCPUserName(createdByDetail.content);
console.log(userName);
}

const body = (
<Link
to={`/${contentType}/board?_id=${activity._id}&itemId=${contentTypeDetail._id}`}
Expand Down
Loading