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

inline #303

Merged
merged 9 commits into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 3 additions & 3 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
build:
runs-on: ubuntu-latest
runs-on: self-hosted
steps:
- name: Get current time
uses: 1466587594/get-current-time@v2
Expand All @@ -33,7 +33,7 @@ jobs:
- name: Build and push
uses: docker/build-push-action@v2
with:
platforms: linux/amd64,linux/arm64,linux/arm
platforms: linux/amd64,linux/arm64
push: true
tags: |
pepperlabs/peppermint:dev
pepperlabs/peppermint:nightly
43 changes: 43 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Main Client Build

on:
push:
branches:
- master

jobs:
build:
runs-on: self-hosted
steps:
- name: Get current time
uses: 1466587594/get-current-time@v2
id: current-time
with:
format: YYYY-MM-DD--HH

- name: Checkout code
uses: actions/checkout@v2

# Install QEMU-based emulator
- name: Install QEMU
run: apt-get update && apt-get install -y qemu-user-static

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Build and push
uses: docker/build-push-action@v2
with:
platforms: linux/amd64,linux/arm64
push: true
tags: |
pepperlabs/peppermint:latest
36 changes: 2 additions & 34 deletions apps/api/src/lib/imap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,38 +14,6 @@ const year = date.getFullYear();
//@ts-ignore
const d = new Date([year, month, today]);

function parseEmailContent(emailText: any) {
const lines = emailText.split("\n");
const parsedData = {
name: "",
email: "",
phoneNumbers: [],
addresses: [],
companyDetails: "",
};

let inAddressSection = false;

lines.forEach((line: any) => {
if (line.includes("@")) {
parsedData.email = line.trim();
} else if (line.includes("US:") || line.includes("UK:")) {
//@ts-ignore
parsedData.phoneNumbers.push(line.trim());
} else if (line.includes("ISO")) {
parsedData.companyDetails = line.trim();
} else if (line.trim() === "North America:" || line.trim() === "Europe:") {
inAddressSection = true;
//@ts-ignore
} else if (inAddressSection && line.trim() !== "") {
//@ts-ignore
parsedData.addresses.push(line.trim());
}
});

return parsedData;
}

export const getEmails = async () => {
try {
const queues = await client.emailQueue.findMany({});
Expand Down Expand Up @@ -87,7 +55,7 @@ export const getEmails = async () => {

console.log("from", from);

const parsedData = parseEmailContent(textAsHtml);
// const parsedData = parseEmailContent(textAsHtml);

if (subject !== undefined && subject.includes("Re:")) {
return await client.comment.create({
Expand Down Expand Up @@ -116,7 +84,7 @@ export const getEmails = async () => {
isComplete: Boolean(false),
priority: "Low",
fromImap: Boolean(true),
detail: html,
detail: html ? html : textAsHtml,
},
});

Expand Down
2 changes: 1 addition & 1 deletion apps/client/layouts/newLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -952,7 +952,7 @@ export default function NewLayout({ children }: any) {
{user.isAdmin && (
<Link href="https://github.com/Peppermint-Lab/peppermint/releases">
<span className="inline-flex items-center rounded-md bg-green-700/10 px-3 py-2 text-xs font-medium text-green-600 ring-1 ring-inset ring-green-500/20">
Version 0.4.6
Version 0.4.7
</span>
</Link>
)}
Expand Down
31 changes: 13 additions & 18 deletions apps/client/pages/new.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Link, RichTextEditor } from "@mantine/tiptap";
import Placeholder from '@tiptap/extension-placeholder';
import Highlight from "@tiptap/extension-highlight";
import Placeholder from "@tiptap/extension-placeholder";
import Underline from "@tiptap/extension-underline";
import { useEditor } from "@tiptap/react";
import StarterKit from "@tiptap/starter-kit";
Expand Down Expand Up @@ -55,7 +55,7 @@ export default function CreateTicket() {
Superscript,
SubScript,
Highlight,
Placeholder.configure({ placeholder: t("ticket_extra_details") })
Placeholder.configure({ placeholder: t("ticket_extra_details") }),
// TextAlign.configure({ types: ['heading', 'paragraph'] }),
],
content: issue,
Expand Down Expand Up @@ -378,6 +378,17 @@ export default function CreateTicket() {
</div>
<div className="flex flex-col xl:flex-row h-full w-full">
<div className="w-full xl:w-2/3 order-2 xl:order-2">
<div className="px-4 border-b border-gray-700">
<input
type="text"
name="title"
placeholder={t("ticket_details")}
maxLength={64}
autoComplete="off"
onChange={(e) => setTitle(e.target.value)}
className="w-full pl-0 pr-0 sm:text-xl border-none dark:bg-[#0A090C] dark:text-white focus:outline-none focus:shadow-none focus:ring-0 focus:border-none"
/>
</div>
<RichTextEditor
editor={editor}
placeholder={t("ticket_extra_details")}
Expand Down Expand Up @@ -428,22 +439,6 @@ export default function CreateTicket() {
</div>
<div className="w-full xl:w-1/6 p-3 flex flex-col dark:bg-[#0A090C] dark:text-white border-b-[1px] xl:border-b-0 xl:border-r-[1px] order-1 xl:order-1">
<div className="flex flex-col">
<div>
<label>
<span className="block text-sm font-medium text-gray-700 dark:text-white">
Title
</span>
</label>
<input
type="text"
name="title"
placeholder={t("ticket_details")}
maxLength={64}
autoComplete="off"
onChange={(e) => setTitle(e.target.value)}
className="w-full pl-0 pr-0 sm:text-xl border-none dark:bg-[#0A090C] dark:text-white focus:outline-none focus:shadow-none focus:ring-0 focus:border-none"
/>
</div>
<div>
<label>
<span className="block text-sm font-medium text-gray-700 dark:text-white">
Expand Down
Loading