Skip to content

Commit 63bbbb6

Browse files
committed
Merge branch 'main' of github.com:devforth/adminforth-markdown
2 parents f8223b1 + f296cde commit 63bbbb6

File tree

7 files changed

+592
-137
lines changed

7 files changed

+592
-137
lines changed

.woodpecker/buildSlackNotify.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ set -x
44

55
COMMIT_SHORT_SHA=$(echo $CI_COMMIT_SHA | cut -c1-8)
66

7+
STATUS=${1}
78

8-
if [ "$CI_PREV_PIPELINE_STATUS" = "success" ]; then
9+
10+
if [ "$STATUS" = "success" ]; then
911
MESSAGE="Did a build without issues on \`$CI_REPO_NAME/$CI_COMMIT_BRANCH\`. Commit: _${CI_COMMIT_MESSAGE}_ (<$CI_COMMIT_URL|$COMMIT_SHORT_SHA>)"
1012

1113
curl -s -X POST -H "Content-Type: application/json" -d '{

.woodpecker/release.yml

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,42 @@ steps:
1616
commands:
1717
- infisical export --domain https://vault.devforth.io/api --format=dotenv-export --env="prod" > /woodpecker/deploy.vault.env
1818

19-
release:
19+
build:
2020
image: node:20
2121
when:
2222
- event: push
23-
volumes:
24-
- /var/run/docker.sock:/var/run/docker.sock
2523
commands:
2624
- apt update && apt install -y rsync
27-
- export $(cat /woodpecker/deploy.vault.env | xargs)
25+
- . /woodpecker/deploy.vault.env
2826
- npm clean-install
2927
- /bin/bash ./.woodpecker/buildRelease.sh
3028
- npm audit signatures
29+
30+
release:
31+
image: node:20
32+
when:
33+
- event:
34+
- push
35+
branch:
36+
- main
37+
commands:
38+
- . /woodpecker/deploy.vault.env
3139
- npx semantic-release
3240

3341
slack-on-failure:
42+
image: curlimages/curl
3443
when:
3544
- event: push
36-
status: [failure, success]
45+
status: [failure]
46+
commands:
47+
- . /woodpecker/deploy.vault.env
48+
- /bin/sh ./.woodpecker/buildSlackNotify.sh failure
49+
50+
slack-on-success:
3751
image: curlimages/curl
52+
when:
53+
- event: push
54+
status: [success]
3855
commands:
39-
- export $(cat /woodpecker/deploy.vault.env | xargs)
40-
- /bin/sh ./.woodpecker/buildSlackNotify.sh
41-
56+
- . /woodpecker/deploy.vault.env
57+
- /bin/sh ./.woodpecker/buildSlackNotify.sh success

custom/MarkdownEditor.vue

Lines changed: 80 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { Editor } from '@milkdown/core';
1515
import { Crepe } from '@milkdown/crepe';
1616
import type { AdminForthColumn } from '@/types/Common';
1717
import '@milkdown/crepe/theme/common/style.css';
18-
import '@milkdown/crepe/theme/frame-dark.css';
18+
import '@milkdown/crepe/theme/frame.css';
1919
2020
const props = defineProps<{
2121
column: AdminForthColumn,
@@ -200,9 +200,9 @@ onBeforeUnmount(() => {
200200
});
201201
</script>
202202

203-
<style>
203+
<style lang="scss">
204204
#editor [contenteditable="true"] {
205-
@apply bg-transparent outline-none border-none shadow-none transition-none min-h-10 p-2 bg-gray-700 dark:placeholder-gray-400;
205+
@apply bg-transparent outline-none border-none shadow-none transition-none min-h-10 p-2;
206206
}
207207
208208
#editor [contenteditable="true"].is-focused {
@@ -238,4 +238,81 @@ onBeforeUnmount(() => {
238238
}
239239
240240
241+
.editor, .milkdown {
242+
border-radius: 6px;
243+
}
244+
245+
.ProseMirror [data-placeholder]::before {
246+
color: #6b7280;
247+
}
248+
249+
.milkdown milkdown-block-handle .operation-item:hover {
250+
@apply bg-gray-200 dark:bg-gray-600;
251+
}
252+
253+
.milkdown milkdown-slash-menu .tab-group ul li:hover {
254+
@apply bg-gray-200 dark:bg-gray-600;
255+
}
256+
257+
.milkdown milkdown-toolbar {
258+
@apply bg-gray-50 border border-gray-300 text-gray-900 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white;
259+
}
260+
261+
.milkdown milkdown-toolbar .toolbar-item:hover {
262+
@apply bg-gray-200 dark:bg-gray-600;
263+
}
264+
265+
.milkdown milkdown-latex-inline-edit {
266+
@apply bg-gray-200
267+
}
268+
269+
.milkdown milkdown-latex-inline-edit .container button:hover {
270+
@apply bg-gray-300 dark:bg-gray-500;
271+
}
272+
273+
.milkdown milkdown-link-edit > .link-edit {
274+
@apply bg-gray-50 border border-gray-300 text-gray-900 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white;
275+
}
276+
277+
.milkdown milkdown-code-block .cm-editor {
278+
@apply bg-gray-50 border border-gray-300 text-gray-900 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white;
279+
}
280+
281+
.ͼo .cm-activeLineGutter {
282+
@apply bg-gray-200 dark:bg-gray-600;
283+
}
284+
285+
.ͼo .cm-activeLine {
286+
@apply bg-gray-200 dark:bg-gray-600;
287+
}
288+
289+
.cm-content {
290+
padding-left: 0px !important;
291+
padding-right: 0px !important;
292+
}
293+
294+
.milkdown milkdown-code-block .list-wrapper {
295+
@apply bg-gray-50 border border-gray-300 text-gray-900 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white;
296+
}
297+
298+
.milkdown milkdown-code-block .language-list-item:hover {
299+
@apply bg-gray-200 dark:bg-gray-600;
300+
}
301+
302+
.milkdown milkdown-code-block .tools .language-button {
303+
@apply bg-gray-50 border border-gray-300 text-gray-900 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white;
304+
}
305+
306+
.milkdown milkdown-code-block .tools .language-button:hover {
307+
@apply bg-gray-200 dark:bg-gray-600;
308+
}
309+
310+
.milkdown::selection {
311+
background-color: #6b7280;
312+
}
313+
314+
.ͼ4 .cm-line ::selection, .ͼ4 .cm-line::selection {
315+
background-color: #6b7280 !important;
316+
}
317+
241318
</style>

custom/tsconfig.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
{
22
"compilerOptions": {
3-
"baseUrl": ".", // This should point to your project root
3+
"baseUrl": ".",
44
"paths": {
55
"@/*": [
6-
// "node_modules/adminforth/dist/spa/src/*"
76
"../../../adminforth/spa/src/*"
87
],
98
"*": [
10-
// "node_modules/adminforth/dist/spa/node_modules/*"
119
"../../../adminforth/spa/node_modules/*"
1210
],
1311
"@@/*": [
14-
// "node_modules/adminforth/dist/spa/src/*"
1512
"."
1613
]
1714
}

index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export default class MarkdownPlugin extends AdminForthPlugin {
6767
Please configure adapter in such way that it will store objects publicly (e.g. for S3 use 'public-read' ACL).
6868
`);
6969
}
70-
this.uploadPlugin = plugin;
70+
this.uploadPlugin = plugin as AdminForthPlugin;
7171
}
7272

7373
column.components.show = {
@@ -139,7 +139,8 @@ export default class MarkdownPlugin extends AdminForthPlugin {
139139
[options.attachments.attachmentRecordIdFieldName]: recordId,
140140
[options.attachments.attachmentResourceIdFieldName]: resourceConfig.resourceId,
141141
},
142-
adminUser
142+
adminUser,
143+
response: {} as any
143144
}
144145
);
145146
console.log('Successfully created record for:', s3Path);
@@ -169,6 +170,7 @@ export default class MarkdownPlugin extends AdminForthPlugin {
169170
recordId: a[attachmentPrimaryKeyField.name],
170171
adminUser,
171172
record: a,
173+
response: {} as any
172174
}
173175
)
174176
}))

0 commit comments

Comments
 (0)