Skip to content

Commit

Permalink
Merge branch 'master' into jimmfly/1030/fix-cmdk
Browse files Browse the repository at this point in the history
  • Loading branch information
JimmFly committed Oct 31, 2023
2 parents 363090f + 17afe21 commit e8e8fa1
Show file tree
Hide file tree
Showing 51 changed files with 172 additions and 98 deletions.
4 changes: 4 additions & 0 deletions .github/actions/deploy/deploy.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ const {
GCLOUD_CLOUD_SQL_INTERNAL_ENDPOINT,
REDIS_HOST,
REDIS_PASSWORD,
STRIPE_API_KEY,
STRIPE_WEBHOOK_KEY,
} = process.env;

// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
Expand Down Expand Up @@ -96,6 +98,8 @@ const createHelmCommand = ({ isDryRun }) => {
`--set-string graphql.app.oauth.google.enabled=true`,
`--set-string graphql.app.oauth.google.clientId="${AFFINE_GOOGLE_CLIENT_ID}"`,
`--set-string graphql.app.oauth.google.clientSecret="${AFFINE_GOOGLE_CLIENT_SECRET}"`,
`--set-string graphql.app.payment.stripe.apiKey="${STRIPE_API_KEY}"`,
`--set-string graphql.app.payment.stripe.webhookKey="${STRIPE_WEBHOOK_KEY}"`,
`--set graphql.app.experimental.enableJwstCodec=true`,
`--set sync.replicaCount=${syncReplicaCount}`,
`--set-string sync.image.tag="${imageTag}"`,
Expand Down
10 changes: 10 additions & 0 deletions .github/helm/affine/charts/graphql/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,16 @@ spec:
secretKeyRef:
name: "{{ .Values.app.oauth.email.secretName }}"
key: password
- name: STRIPE_API_KEY
valueFrom:
secretKeyRef:
name: "{{ .Values.app.payment.stripe.secretName }}"
key: stripeAPIKey
- name: STRIPE_WEBHOOK_KEY
valueFrom:
secretKeyRef:
name: "{{ .Values.app.payment.stripe.secretName }}"
key: stripeWebhookKey
- name: DOC_MERGE_INTERVAL
value: "{{ .Values.app.doc.mergeInterval }}"
{{ if .Values.app.experimental.enableJwstCodec }}
Expand Down
8 changes: 8 additions & 0 deletions .github/helm/affine/charts/graphql/templates/payment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: v1
kind: Secret
metadata:
name: "{{ .Values.app.payment.stripe.secretName }}"
type: Opaque
data:
stripeAPIKey: "{{ .Values.app.payment.stripe.apiKey | b64enc }}"
stripeWebhookKey: "{{ .Values.app.payment.stripe.webhookKey | b64enc }}"
5 changes: 5 additions & 0 deletions .github/helm/affine/charts/graphql/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ app:
secretName: oauth-github
clientId: ''
clientSecret: ''
payment:
stripe:
secretName: 'stripe'
apiKey: ''
webhookKey: ''

serviceAccount:
create: true
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
workflow_dispatch:
inputs:
flavor:
description: 'Build type (canary, beta, internal or stable)'
description: 'Build type (canary, beta, or stable)'
type: string
default: canary

Expand Down Expand Up @@ -40,7 +40,6 @@ jobs:
build-core:
name: Build @affine/core
runs-on: ubuntu-latest
environment: production

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -68,7 +67,6 @@ jobs:
build-storage:
name: Build Storage
runs-on: ubuntu-latest
environment: ${{ github.event.inputs.flavor }}

steps:
- uses: actions/checkout@v4
Expand All @@ -90,7 +88,6 @@ jobs:
build-storage-arm64:
name: Build Storage arm64
runs-on: ubuntu-latest
environment: ${{ github.event.inputs.flavor }}

steps:
- uses: actions/checkout@v4
Expand All @@ -112,7 +109,6 @@ jobs:
build-docker:
name: Build Docker
runs-on: ubuntu-latest
environment: ${{ github.event.inputs.flavor }}
needs:
- build-server
- build-core
Expand Down Expand Up @@ -247,3 +243,5 @@ jobs:
REDIS_HOST: ${{ secrets.REDIS_HOST }}
REDIS_PASSWORD: ${{ secrets.REDIS_PASSWORD }}
CLOUD_SQL_IAM_ACCOUNT: ${{ secrets.CLOUD_SQL_IAM_ACCOUNT }}
STRIPE_API_KEY: ${{ secrets.STRIPE_API_KEY }}
STRIPE_WEBHOOK_KEY: ${{ secrets.STRIPE_WEBHOOK_KEY }}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@affine/monorepo",
"version": "0.10.0-canary.3",
"version": "0.10.0-canary.4",
"private": true,
"author": "toeverything",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/server/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@affine/server",
"private": true,
"version": "0.10.0-canary.3",
"version": "0.10.0-canary.4",
"description": "Affine Node.js server",
"type": "module",
"bin": {
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/storage/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@affine/storage",
"version": "0.10.0-canary.3",
"version": "0.10.0-canary.4",
"engines": {
"node": ">= 10.16.0 < 11 || >= 11.8.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/common/cmdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
"react": "18.2.0",
"react-dom": "18.2.0"
},
"version": "0.10.0-canary.3"
"version": "0.10.0-canary.4"
}
2 changes: 1 addition & 1 deletion packages/common/debug/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
"@types/debug": "^4.1.9",
"vitest": "0.34.6"
},
"version": "0.10.0-canary.3"
"version": "0.10.0-canary.4"
}
2 changes: 1 addition & 1 deletion packages/common/env/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@
"dependencies": {
"lit": "^2.8.0"
},
"version": "0.10.0-canary.3"
"version": "0.10.0-canary.4"
}
2 changes: 1 addition & 1 deletion packages/common/infra/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,5 @@
"optional": true
}
},
"version": "0.10.0-canary.3"
"version": "0.10.0-canary.4"
}
2 changes: 1 addition & 1 deletion packages/common/sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@affine/sdk",
"version": "0.10.0-canary.3",
"version": "0.10.0-canary.4",
"type": "module",
"scripts": {
"build": "vite build",
Expand Down
2 changes: 1 addition & 1 deletion packages/common/y-indexeddb/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@toeverything/y-indexeddb",
"type": "module",
"version": "0.10.0-canary.3",
"version": "0.10.0-canary.4",
"description": "IndexedDB database adapter for Yjs",
"repository": "toeverything/AFFiNE",
"author": "toeverything",
Expand Down
2 changes: 1 addition & 1 deletion packages/common/y-provider/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "y-provider",
"type": "module",
"version": "0.10.0-canary.3",
"version": "0.10.0-canary.4",
"description": "Yjs provider protocol for multi document support",
"exports": {
".": "./src/index.ts"
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/component/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,5 @@
"vitest": "0.34.6",
"yjs": "^13.6.8"
},
"version": "0.10.0-canary.3"
"version": "0.10.0-canary.4"
}
Original file line number Diff line number Diff line change
Expand Up @@ -90,19 +90,20 @@ export const CreateCollection = ({
return (
<div>
<div className={styles.content}>
<div className={styles.label}>Name</div>
<div className={styles.label}>
{t['com.affine.editCollectionName.name']()}
</div>
<Input
autoFocus
value={value}
data-testid="input-collection-title"
placeholder="Collection Name"
placeholder={t['com.affine.editCollectionName.name.placeholder']()}
onChange={useCallback((value: string) => onChange(value), [onChange])}
onEnter={save}
></Input>
{showTips ? (
<div className={styles.createTips}>
Collection is a smart folder where you can manually add pages or
automatically add pages through rules.
{t['com.affine.editCollectionName.createTips']()}
</div>
) : null}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ const RulesMode = ({
);
}, [open, updateCollection, collection]);
const [expandInclude, setExpandInclude] = useState(false);
const count = allowListPages.length + rulesPages.length;
return (
<>
<div className={clsx(styles.rulesTitle, styles.ellipsis)}>
Expand Down Expand Up @@ -334,16 +335,20 @@ const RulesMode = ({
) : (
<PageIcon style={{ width: 16, height: 16 }} />
)}
Page
{t[
'com.affine.editCollection.rules.include.page'
]()}
</div>
<div className={styles.includeItemContentIs}>
{t['com.affine.editCollection.rules.include.is']()}
</div>
<div className={styles.includeItemContentIs}>is</div>
<div
className={clsx(
styles.includeItemTitle,
styles.ellipsis
)}
>
{page?.title || 'Untitled'}
{page?.title || t['Untitled']()}
</div>
</div>
<CloseIcon
Expand All @@ -368,7 +373,7 @@ const RulesMode = ({
<div
style={{ color: 'var(--affine-text-secondary-color)' }}
>
Add include page
{t['com.affine.editCollection.rules.include.add']()}
</div>
</div>
</div>
Expand Down Expand Up @@ -396,7 +401,7 @@ const RulesMode = ({
justifyContent: 'space-between',
}}
>
<div>HELP INFO</div>
<div>{t['com.affine.collection.helpInfo']()}</div>
<CloseIcon
color="var(--affine-icon-color)"
onClick={hideTips}
Expand All @@ -405,14 +410,9 @@ const RulesMode = ({
/>
</div>
<div style={{ marginBottom: 10, fontWeight: 600 }}>
What is &quot;Include&quot;?
</div>
<div>
&quot;Include&quot; refers to manually adding pages rather
than automatically adding them through rule matching. You can
manually add pages through the &quot;Add pages&quot; option or
by dragging and dropping (coming soon).
{t['com.affine.editCollection.rules.include.tipsTitle']()}
</div>
<div>{t['com.affine.editCollection.rules.include.tips']()}</div>
</div>
) : null}
</div>
Expand Down Expand Up @@ -463,20 +463,29 @@ const RulesMode = ({
setShowPreview(!showPreview);
}}
>
Preview
{t['com.affine.editCollection.rules.preview']()}
</div>
<div
className={clsx(styles.button, styles.bottomButton)}
onClick={reset}
>
Reset
{t['com.affine.editCollection.rules.reset']()}
</div>
<div className={styles.previewCountTips}>
After searching, there are currently{' '}
<span className={styles.previewCountTipsHighlight}>
{allowListPages.length + rulesPages.length}
</span>{' '}
pages.
<Trans
i18nKey={
count === 0
? 'com.affine.editCollection.rules.countTips.zero'
: count === 1
? 'com.affine.editCollection.rules.countTips.one'
: 'com.affine.editCollection.rules.countTips.more'
}
values={{ count: count }}
>
After searching, there are currently
<span className={styles.previewCountTipsHighlight}>count</span>
pages.
</Trans>
</div>
</div>
<div style={{ display: 'flex', alignItems: 'center' }}>{buttons}</div>
Expand Down Expand Up @@ -622,7 +631,7 @@ const PagesMode = ({
<div className={styles.pagesBottom}>
<div className={styles.pagesBottomLeft}>
<div className={styles.selectedCountTips}>
Selected
{t['com.affine.selectPage.selected']()}
<span
style={{ marginLeft: 7 }}
className={styles.previewCountTipsHighlight}
Expand Down Expand Up @@ -683,7 +692,7 @@ const SelectPage = ({
<div className={styles.pagesTab}>
<div className={styles.pagesTabContent}>
<div style={{ fontSize: 12, lineHeight: '20px', fontWeight: 600 }}>
Add include page
{t['com.affine.selectPage.title']()}
</div>
{!showFilter && filters.length === 0 ? (
<Menu
Expand Down Expand Up @@ -743,7 +752,7 @@ const SelectPage = ({
<div className={styles.pagesBottom}>
<div className={styles.pagesBottomLeft}>
<div className={styles.selectedCountTips}>
Selected
{t['com.affine.selectPage.selected']()}
<span
style={{ marginLeft: 7 }}
className={styles.previewCountTipsHighlight}
Expand All @@ -770,7 +779,7 @@ const SelectPage = ({
type="primary"
onClick={confirm}
>
Confirm
{t['Confirm']()}
</Button>
</div>
</div>
Expand Down Expand Up @@ -874,6 +883,7 @@ const useSearch = (list: PageMeta[]) => {
};
};
const EmptyList = ({ search }: { search?: string }) => {
const t = useAFFiNEI18N();
return (
<div
style={{
Expand All @@ -893,19 +903,21 @@ const EmptyList = ({ search }: { search?: string }) => {
fontWeight: 600,
}}
>
Empty
{t['com.affine.selectPage.empty']()}
</div>
{search ? (
<div
className={styles.ellipsis}
style={{ maxWidth: 300, fontSize: 15, lineHeight: '24px' }}
>
No page titles contain{' '}
<span
style={{ fontWeight: 600, color: 'var(--affine-primary-color)' }}
>
{search}
</span>
<Trans i18nKey="com.affine.selectPage.empty.tips" values={{ search }}>
No page titles contain
<span
style={{ fontWeight: 600, color: 'var(--affine-primary-color)' }}
>
search
</span>
</Trans>
</div>
) : null}
</div>
Expand Down

0 comments on commit e8e8fa1

Please sign in to comment.