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

refactor(thread-ticketing): move overview to under global settings subcommand group #378

Merged
merged 1 commit into from
Mar 16, 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
5 changes: 3 additions & 2 deletions apps/bot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"dev": "tsx watch --clear-screen=false --env-file=../../.env.bot.development.local .",
"start": "tsx .",
"lint": "eslint .",
"commands:deploy": "tsx --env-file=../../.env.bot.development.local ./src/deploy.ts",
"commands:deploy:development": "tsx --env-file=../../.env.bot.development.local ./src/deploy.ts",
"commands:deploy:production": "tsx ./src/deploy.ts",
"i18n": "typesafe-i18n"
},
"dependencies": {
Expand All @@ -21,6 +22,6 @@
},
"devDependencies": {
"@ticketer/eslint-config": "workspace:*",
"@types/node": "^20.11.25"
"@types/node": "^20.11.28"
}
}
24 changes: 10 additions & 14 deletions apps/bot/src/commands/staff/configuration-ticket-threads.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,11 +238,11 @@
.setMinValue(1)
.setMaxValue(255),
),
)
.addSubcommand((subcommand) =>
subcommand.setName('overview').setDescription('View the current global configuration of thread tickets.'),
),
)
.addSubcommand((subcommand) =>
subcommand.setName('overview').setDescription('View the current global configuration of thread tickets.'),
)
.addSubcommandGroup((group) =>
group
.setName('categories')
Expand Down Expand Up @@ -280,17 +280,10 @@
return this.categoriesGroup({ interaction });
}
default: {
switch (interaction.options.getSubcommand(true)) {
case 'overview': {
return this.overview({ interaction });
}
default: {
return interaction.reply({
embeds: [super.userEmbedError(interaction.user).setDescription('The subcommand could not be found.')],
ephemeral: true,
});
}
}
return interaction.reply({
embeds: [super.userEmbedError(interaction.user).setDescription('The subcommand group could not be found.')],
ephemeral: true,
});
}
}
}
Expand All @@ -316,6 +309,9 @@

return interaction.editReply({ embeds: [embed] });
}
case 'overview': {
return this.overview({ interaction });
}
default: {
return interaction.editReply({
embeds: [super.userEmbedError(interaction.user).setDescription('The subcommand could not be found.')],
Expand Down Expand Up @@ -464,7 +460,7 @@

if (id === undefined) return;

// TODO: When the MariaDB driver gets released, change the query to use the RETURNING clause.

Check warning on line 463 in apps/bot/src/commands/staff/configuration-ticket-threads.ts

View workflow job for this annotation

GitHub Actions / build (21)

Unexpected 'todo' comment: 'TODO: When the MariaDB driver gets...'

Check warning on line 463 in apps/bot/src/commands/staff/configuration-ticket-threads.ts

View workflow job for this annotation

GitHub Actions / build (21)

Unexpected 'todo' comment: 'TODO: When the MariaDB driver gets...'
const query = await database
.delete(ticketThreadsCategories)
.where(sql`${ticketThreadsCategories.id} = ${id} RETURNING ${ticketThreadsCategories.categoryTitle}`);
Expand Down
2 changes: 1 addition & 1 deletion apps/bot/src/utils/thread-ticketing/categoryList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export async function categoryList({ filterManagerIds, guildId }: CategoryListOp
.select()
.from(ticketThreadsCategories)
.where(eq(ticketThreadsCategories.guildId, guildId))
// Limited at 25 because that iss the maximum amount of select menu options.
// Limited at 25 because that is the maximum amount of select menu options.
.limit(25);

return filterManagerIds && filterManagerIds.length > 0
Expand Down
12 changes: 6 additions & 6 deletions apps/website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@
"@vercel/analytics": "^1.2.2",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.0",
"lucide-react": "^0.354.0",
"lucide-react": "^0.358.0",
"next": "14.1.3",
"next-themes": "^0.2.1",
"next-themes": "^0.3.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"tailwind-merge": "^2.2.1",
"tailwind-merge": "^2.2.2",
"tailwindcss-animate": "^1.0.7"
},
"devDependencies": {
"@ticketer/eslint-config": "workspace:*",
"@types/node": "^20.11.25",
"@types/react": "^18.2.64",
"@types/react-dom": "^18.2.21",
"@types/node": "^20.11.28",
"@types/react": "^18.2.66",
"@types/react-dom": "^18.2.22",
"autoprefixer": "^10.4.18",
"eslint": "^8.57.0",
"eslint-config-next": "14.1.3",
Expand Down
4 changes: 2 additions & 2 deletions apps/website/src/app/docs/self-hosting/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,10 @@ export default function Page() {
</span>
</CodeBlock>
<Paragraph>To deploy the application commands of the bot, run the following line:</Paragraph>
<CodeBlock clipboardText='docker exec ticketer-bot sh -c "cd /src/apps/bot && pnpm commands:deploy"'>
<CodeBlock clipboardText='docker exec ticketer-bot sh -c "cd /src/apps/bot && pnpm commands:deploy:production"'>
<span>
<span className="text-green-500">docker </span>
<span>exec ticketer-bot sh -c &quot;cd /src/apps/bot && pnpm commands:deploy&quot;</span>
<span>exec ticketer-bot sh -c &quot;cd /src/apps/bot && pnpm commands:deploy:production&quot;</span>
</span>
</CodeBlock>
<Paragraph>
Expand Down
2 changes: 1 addition & 1 deletion apps/website/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { DM_Sans } from 'next/font/google';
import type { Metadata } from 'next';
import Navbar from '@/components/Navbar';
import type { PropsWithChildren } from 'react';
import ThemeProvider from '@/components/ThemeProvider';
import { ThemeProvider } from 'next-themes';
import { cn } from '@/lib/utils';

const font = DM_Sans({ subsets: ['latin'], variable: '--font-sans' });
Expand Down
8 changes: 0 additions & 8 deletions apps/website/src/components/ThemeProvider.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ name: 'ticketer'
# docker compose --env-file ./.env.database.production.local --env-file ./.env.bot.production.local -f compose.yaml up -d

# Run this to deploy the commands:
# docker exec ticketer-bot sh -c "cd /src/apps/bot && pnpm commands:deploy"
# docker exec ticketer-bot sh -c "cd /src/apps/bot && pnpm commands:deploy:production"

# Run this to rebuild the images from scratch (useful after changes from the codebase):
# docker compose build --no-cache
Expand Down
2 changes: 1 addition & 1 deletion packages/database/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
"dependencies": {
"@ticketer/env": "workspace:*",
"drizzle-orm": "^0.30.1",
"drizzle-orm": "^0.30.2",
"mysql2": "^3.9.2"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/djs-framework/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"devDependencies": {
"@ticketer/eslint-config": "workspace:*",
"@types/node": "^20.11.25",
"@types/node": "^20.11.28",
"tsx": "^4.7.1"
}
}
2 changes: 1 addition & 1 deletion packages/env/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
},
"devDependencies": {
"@ticketer/eslint-config": "workspace:*",
"@types/node": "^20.11.25"
"@types/node": "^20.11.28"
}
}
6 changes: 3 additions & 3 deletions packages/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
"private": true,
"main": "index.cjs",
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^7.1.1",
"@typescript-eslint/parser": "^7.1.1",
"@typescript-eslint/eslint-plugin": "^7.2.0",
"@typescript-eslint/parser": "^7.2.0",
"eslint-config-next": "^14.1.3",
"eslint-config-prettier": "^9.1.0",
"eslint-config-turbo": "^1.12.5",
"eslint-plugin-drizzle": "^0.2.3",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react": "^7.34.0",
"eslint-plugin-react": "^7.34.1",
"eslint-plugin-unicorn": "^51.0.1"
}
}
Loading
Loading