Skip to content

Commit 7e25477

Browse files
authored
Merge branch 'master' into rbac
2 parents 9e17c52 + 83f1bd3 commit 7e25477

14 files changed

+598
-40
lines changed

Dockerfile

Lines changed: 18 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,41 @@
1-
FROM node:18-alpine AS base
2-
3-
RUN apk update
4-
RUN apk --no-cache add git
5-
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
6-
RUN apk add --no-cache libc6-compat
7-
8-
# Install dependencies only when needed
9-
FROM base AS deps
10-
WORKDIR /app
11-
12-
# Install dependencies based on the preferred package manager
13-
COPY package.json package-lock.json ./
14-
RUN npm ci
15-
RUN npm run install-idl
16-
17-
1+
FROM node:18-bookworm-slim AS base
182

193
FROM base AS dev
20-
4+
# Install git + CA bundle so git https can verify TLS
5+
RUN apt-get update \
6+
&& apt-get install -y --no-install-recommends git ca-certificates \
7+
&& rm -rf /var/lib/apt/lists/*
218
WORKDIR /app
22-
COPY --from=deps /app/node_modules ./node_modules
239
COPY . .
2410

2511

26-
2712
# Rebuild the source code only when needed
2813
FROM base AS builder
2914
WORKDIR /app
30-
COPY --from=deps /app/node_modules ./node_modules
15+
RUN apt-get update \
16+
&& apt-get install -y --no-install-recommends git ca-certificates \
17+
&& rm -rf /var/lib/apt/lists/*
18+
COPY package.json package-lock.json ./
19+
RUN npm ci
20+
RUN npm run install-idl
3121
COPY . .
3222

33-
# Next.js collects completely anonymous telemetry data about general usage.
23+
# Disable Next.js telemetry from collecting general usage data.
3424
# Learn more here: https://nextjs.org/telemetry
35-
# Uncomment the following line in case you want to disable telemetry during the build.
36-
ENV NEXT_TELEMETRY_DISABLED 1
37-
# optimize Build size by including only required resources
25+
ENV NEXT_TELEMETRY_DISABLED=1
26+
3827

3928
RUN npm run generate:idl
40-
RUN npm run build
4129
RUN npm run build-standalone
4230
RUN npm run post-build-standalone
4331

44-
# Production image, copy all the files and run next
32+
# Production image, copy necessary files and run next
4533
FROM base AS runner
4634
WORKDIR /app
4735

48-
ENV NODE_ENV production
36+
ENV NODE_ENV=production
4937
# Uncomment the following line in case you want to disable telemetry during runtime.
50-
ENV NEXT_TELEMETRY_DISABLED 1
38+
ENV NEXT_TELEMETRY_DISABLED=1
5139

5240
RUN addgroup --system --gid 1001 nodejs
5341
RUN adduser --system --uid 1001 nextjs
@@ -61,7 +49,7 @@ RUN chown nextjs:nodejs .next
6149

6250
# Automatically leverage output traces to reduce image size
6351
# https://nextjs.org/docs/advanced-features/output-file-tracing
64-
COPY --from=builder --chown=nextjs:nodejs /app/src/__generated__/ ./src/__generated__/
52+
COPY --from=builder --chown=nextjs:nodejs /app/src/__generated__/ ./src/__generated__/
6553
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
6654
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
6755

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
"cadence_idl_version": "ac43ecefe36469b88f4efd41e2a067fdcf7a8506"
66
},
77
"scripts": {
8-
"dev": "next dev -p ${CADENCE_WEB_PORT:-8088} -H ${CADENCE_WEB_HOSTNAME:-0.0.0.0} | pino-pretty --messageKey message",
8+
"dev": "CADENCE_WEB_PORT=${CADENCE_WEB_PORT:-8088} next dev -p ${CADENCE_WEB_PORT:-8088} -H ${CADENCE_WEB_HOSTNAME:-0.0.0.0} | pino-pretty --messageKey message",
99
"build": "NODE_ENV=production next build",
1010
"build-standalone": "NODE_ENV=production NEXT_CONFIG_BUILD_OUTPUT=standalone next build",
1111
"post-build-standalone": "tsx scripts/update-server-host.ts",
12-
"start": "next start -p ${CADENCE_WEB_PORT:-8088} -H ${CADENCE_WEB_HOSTNAME:-0.0.0.0}",
12+
"start": "CADENCE_WEB_PORT=${CADENCE_WEB_PORT:-8088} next start -p ${CADENCE_WEB_PORT:-8088} -H ${CADENCE_WEB_HOSTNAME:-0.0.0.0}",
1313
"lint": "next lint",
1414
"typecheck": "tsc --noemit",
1515
"install-idl": "mkdir -p node_modules && cd node_modules && npx --yes github:Assem-Uber/tiged#release/v3.0.0-rc.01 https://github.com/cadence-workflow/cadence-idl#$npm_package_config_cadence_idl_version cadence-idl --force",
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import React from 'react';
2+
3+
import { type DomainPageTabContentProps } from '@/views/domain-page/domain-page-content/domain-page-content.types';
4+
5+
export default function DomainBatchActions(_props: DomainPageTabContentProps) {
6+
return <div>Batch actions</div>;
7+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { MdOutlinePlayArrow, MdPlaylistPlay } from 'react-icons/md';
2+
3+
import type { DomainPageActionConfig } from '../domain-page-actions-dropdown/domain-page-actions-dropdown.types';
4+
5+
export const startWorkflowDomainAction: DomainPageActionConfig = {
6+
id: 'start-workflow',
7+
label: 'Start new workflow',
8+
icon: MdOutlinePlayArrow,
9+
};
10+
11+
export const batchWorkflowDomainAction: DomainPageActionConfig = {
12+
id: 'batch-workflow-actions',
13+
label: 'Batch workflow actions',
14+
icon: MdPlaylistPlay,
15+
};
16+
17+
const domainPageActionsConfig = [
18+
startWorkflowDomainAction,
19+
batchWorkflowDomainAction,
20+
] as const satisfies DomainPageActionConfig[];
21+
22+
export default domainPageActionsConfig;

src/views/domain-page/config/domain-page-tabs.config.ts

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,32 @@
11
import {
22
MdArchive,
33
MdListAlt,
4+
MdPlaylistPlay,
45
MdSettings,
56
MdSort,
67
MdSyncAlt,
78
MdSchedule,
89
} from 'react-icons/md';
910

11+
import DomainBatchActions from '@/views/domain-batch-actions/domain-batch-actions';
1012
import DomainCronList from '@/views/domain-cron-list/domain-cron-list';
1113
import DomainWorkflows from '@/views/domain-workflows/domain-workflows';
1214
import DomainWorkflowsArchival from '@/views/domain-workflows-archival/domain-workflows-archival';
1315

16+
import DomainPageBatchActionsBadge from '../domain-page-batch-actions-badge/domain-page-batch-actions-badge';
1417
import DomainPageFailovers from '../domain-page-failovers/domain-page-failovers';
1518
import DomainPageMetadata from '../domain-page-metadata/domain-page-metadata';
1619
import DomainPageSettings from '../domain-page-settings/domain-page-settings';
1720
import type { DomainPageTabsConfig } from '../domain-page-tabs/domain-page-tabs.types';
1821

1922
const domainPageTabsConfig: DomainPageTabsConfig<
20-
'workflows' | 'cron-list' | 'metadata' | 'failovers' | 'settings' | 'archival'
23+
| 'workflows'
24+
| 'cron-list'
25+
| 'metadata'
26+
| 'failovers'
27+
| 'settings'
28+
| 'archival'
29+
| 'batch-actions'
2130
> = {
2231
workflows: {
2332
title: 'Workflows',
@@ -73,6 +82,16 @@ const domainPageTabsConfig: DomainPageTabsConfig<
7382
actions: [{ kind: 'retry', label: 'Retry' }],
7483
}),
7584
},
85+
'batch-actions': {
86+
title: 'Batch actions',
87+
artwork: MdPlaylistPlay,
88+
endEnhancer: DomainPageBatchActionsBadge,
89+
content: DomainBatchActions,
90+
getErrorConfig: () => ({
91+
message: 'Failed to load batch actions',
92+
actions: [{ kind: 'retry', label: 'Retry' }],
93+
}),
94+
},
7695
} as const;
7796

7897
export default domainPageTabsConfig;

0 commit comments

Comments
 (0)