Skip to content
This repository was archived by the owner on Feb 26, 2025. It is now read-only.

Commit 5d45520

Browse files
authored
v1.9.2
Develop v1.9.2
2 parents 37dba1d + 3335301 commit 5d45520

File tree

25 files changed

+941
-167
lines changed

25 files changed

+941
-167
lines changed

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"start": "NODE_ENV=development DEBUG=* webpack --mode development --config-name server && node dist/server.js",
1212
"build": "NODE_ENV=production NODE_OPTIONS=--max_old_space_size=8192 webpack --mode production",
1313
"test": "jest",
14-
"test:watch": "jest --watch",
14+
"test:watch": "jest --watch --maxWorkers=4",
1515
"cy:open": "cypress open",
1616
"cy:run": "cypress run",
1717
"test-ui": "API_ENDPOINT=http://test start-server-and-test start http://localhost:8000 cy:run",
@@ -211,7 +211,10 @@
211211
],
212212
"globals": {
213213
"FUSION_VERSION": "1.0.0",
214-
"COMMIT_HASH": "9013fa343"
214+
"COMMIT_HASH": "9013fa343",
215+
"ts-jest": {
216+
"isolatedModules": true
217+
}
215218
},
216219
"watchPathIgnorePatterns": [
217220
"node_modules"

src/shared/App.less

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -236,22 +236,34 @@
236236
align-items: center;
237237
justify-content: center;
238238
gap: 10px;
239+
239240
span {
240241
color: @fusion-blue-8;
241242
}
243+
242244
.full-screen-switch {
243-
border-color: #2e76bf !important;
244-
background: linear-gradient(
245-
0deg,
246-
rgba(0, 58, 140, 0.3),
247-
rgba(0, 58, 140, 0.3)
248-
),
245+
border: 1px solid #2e76bf !important;
246+
background: white;
247+
248+
.ant-switch-handle {
249+
top: 1px;
250+
251+
&::before {
252+
background: @fusion-blue-8;
253+
}
254+
}
255+
}
256+
257+
.full-screen-switch.ant-switch-checked {
258+
border: 1px solid #2e76bf !important;
259+
background: linear-gradient(0deg, @fusion-blue-8, @fusion-blue-8),
249260
linear-gradient(0deg, rgba(46, 118, 191, 0.2), rgba(46, 118, 191, 0.2));
250-
border: 1px solid #003a8c4d;
261+
251262
.ant-switch-handle {
252263
top: 1px;
264+
253265
&::before {
254-
background: @fusion-daybreak-10;
266+
background: white;
255267
}
256268
}
257269
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import { SVGProps } from 'react';
2+
3+
const LeftSpeedArrow = (props: SVGProps<SVGSVGElement>) => {
4+
return (
5+
<svg
6+
xmlns="http://www.w3.org/2000/svg"
7+
width="1em"
8+
height="1em"
9+
viewBox="0 0 24 24"
10+
{...props}
11+
>
12+
<path
13+
fill="currentColor"
14+
d="M11.92 19.92L4 12l7.92-7.92l1.41 1.42l-5.5 5.5H22v2H7.83l5.51 5.5l-1.42 1.42M4 12V2H2v20h2V12Z"
15+
></path>
16+
</svg>
17+
);
18+
};
19+
const LeftArrow = (props: SVGProps<SVGSVGElement>) => {
20+
return (
21+
<svg
22+
xmlns="http://www.w3.org/2000/svg"
23+
width="1em"
24+
height="1em"
25+
viewBox="0 0 24 24"
26+
{...props}
27+
>
28+
<path
29+
fill="currentColor"
30+
d="M20 11H7.83l5.59-5.59L12 4l-8 8l8 8l1.41-1.41L7.83 13H20v-2z"
31+
></path>
32+
</svg>
33+
);
34+
};
35+
export { LeftArrow };
36+
export default LeftSpeedArrow;
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import { SVGProps } from 'react';
2+
3+
const RightSpeedArrow = (props: SVGProps<SVGSVGElement>) => {
4+
return (
5+
<svg
6+
xmlns="http://www.w3.org/2000/svg"
7+
width="1em"
8+
height="1em"
9+
viewBox="0 0 24 24"
10+
{...props}
11+
>
12+
<path
13+
fill="currentColor"
14+
d="M12.08 4.08L20 12l-7.92 7.92l-1.41-1.42l5.5-5.5H2v-2h14.17l-5.5-5.5l1.41-1.42M20 12v10h2V2h-2v10Z"
15+
></path>
16+
</svg>
17+
);
18+
};
19+
20+
const RightArrow = (props: SVGProps<SVGSVGElement>) => {
21+
return (
22+
<svg
23+
xmlns="http://www.w3.org/2000/svg"
24+
width="1em"
25+
height="1em"
26+
viewBox="0 0 24 24"
27+
{...props}
28+
>
29+
<path
30+
fill="currentColor"
31+
d="m12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8l-8-8z"
32+
></path>
33+
</svg>
34+
);
35+
};
36+
export { RightArrow };
37+
export default RightSpeedArrow;

src/shared/components/ResourceEditor/CodeEditor.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ const CodeEditor = forwardRef<codemiror.Editor | undefined, TCodeEditor>(
3838
foldCode: true,
3939
indentUnit: INDENT_UNIT,
4040
gutters: ['CodeMirror-linenumbers', 'CodeMirror-foldgutter'],
41+
lineWiseCopyCut: true,
4142
extraKeys: {
4243
'Ctrl-Q': keyFoldCode,
4344
},

src/shared/components/ResourceEditor/ResourceEditor.less

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,29 @@
6161
color: @error-color;
6262
}
6363

64+
.CodeMirror-url-copy {
65+
cursor: pointer !important;
66+
display: flex;
67+
align-items: center;
68+
justify-content: center;
69+
z-index: 999 !important;
70+
width: 25px !important;
71+
height: 25px !important;
72+
border-radius: 4px !important;
73+
padding: 0px !important;
74+
background-color: #fff !important;
75+
border: 1px solid rgba(#333, 0.12) !important;
76+
box-shadow: 0 2px 12px 0 rgba(#333, 0.12) !important;
77+
&.copied {
78+
width: max-content !important;
79+
padding: 2px 4px !important;
80+
}
81+
.copied {
82+
color: #333 !important;
83+
margin-left: 3px;
84+
}
85+
}
86+
6487
.code-mirror-editor {
6588
.cm-fusion-resource-link:not(.cm-property) {
6689
color: #0974ca !important;
@@ -205,7 +228,9 @@
205228
height: 24px;
206229
margin-left: 10px;
207230
color: @fusion-primary-color;
231+
cursor: pointer;
208232
}
233+
209234
.key-binding {
210235
margin-left: 10px;
211236
color: @fusion-primary-color;
@@ -220,3 +245,48 @@
220245
gap: 20px;
221246
width: 100%;
222247
}
248+
249+
kbd {
250+
background-color: #eee;
251+
border-radius: 3px;
252+
border: 1px solid #b4b4b4;
253+
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2),
254+
0 2px 0 0 rgba(255, 255, 255, 0.7) inset;
255+
color: #333;
256+
display: inline-block;
257+
font-size: 0.85em;
258+
font-weight: 700;
259+
line-height: 1;
260+
padding: 2px 4px;
261+
white-space: nowrap;
262+
}
263+
264+
.CodeMirror-hover-tooltip-warning {
265+
.warning-text {
266+
background-color: rgba(red, 0.12);
267+
margin-top: -4px;
268+
padding: 5px 10px;
269+
border-top-left-radius: 4px;
270+
border-top-right-radius: 4px;
271+
font-weight: 600;
272+
}
273+
274+
.warning-info {
275+
padding: 4px 10px;
276+
font-size: 13px;
277+
line-height: 18px;
278+
color: #0974ca;
279+
display: flex;
280+
align-items: flex-start;
281+
justify-content: flex-start;
282+
gap: 5px;
283+
border-bottom: 1px solid #f0efef;
284+
margin-bottom: 5px;
285+
.warning-info-icon {
286+
margin-top: 3px;
287+
width: 16px;
288+
height: 16px;
289+
object-fit: cover;
290+
}
291+
}
292+
}

src/shared/components/ResourceEditor/editorUtils.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export type TEditorPopoverResolvedData = {
3131
left: number;
3232
results?: TDELink | TDELink[];
3333
resolvedAs: TEditorPopoverResolvedAs;
34+
resolver?: 'resolver-api' | 'search-api';
3435
error?: any;
3536
};
3637
type TDeltaError = Error & {
@@ -48,6 +49,7 @@ type TReturnedResolvedData = Omit<
4849
export const LINE_HEIGHT = 15;
4950
export const INDENT_UNIT = 4;
5051
export const CODEMIRROR_HOVER_CLASS = 'CodeMirror-hover-tooltip';
52+
export const CODEMIRROR_COPY_URL_CLASS = 'CodeMirror-url-copy';
5153
export const CODEMIRROR_LINK_CLASS = 'fusion-resource-link';
5254
const NEAR_BY = [0, 0, 0, 5, 0, -5, 5, 0, -5, 0];
5355
const isDownloadableLink = (resource: Resource) => {
@@ -104,6 +106,7 @@ export function getTokenAndPosAt(e: MouseEvent, current: CodeMirror.Editor) {
104106
if (token && url === text) {
105107
return {
106108
url,
109+
pos,
107110
coords: {
108111
left: editorRect.left,
109112
top: coords.top + LINE_HEIGHT,
@@ -187,6 +190,7 @@ export async function editorLinkResolutionHandler({
187190
// next-action: open resource editor
188191
return {
189192
resolvedAs: 'resource',
193+
resolver: 'resolver-api',
190194
results: {
191195
isDownloadable,
192196
_self: details._self,
@@ -217,6 +221,7 @@ export async function editorLinkResolutionHandler({
217221
const entity = getOrgAndProjectFromResourceObject(result);
218222
return {
219223
resolvedAs: 'resource',
224+
resolver: 'search-api',
220225
results: {
221226
isDownloadable,
222227
_self: result._self,
@@ -233,6 +238,7 @@ export async function editorLinkResolutionHandler({
233238
// next-action: open resources list in the popover
234239
return {
235240
resolvedAs: 'resources',
241+
resolver: 'search-api',
236242
results: details._results.map((item: Resource) => {
237243
const isDownloadable = isDownloadableLink(item);
238244
const entity = getOrgAndProjectFromResourceObject(item);

0 commit comments

Comments
 (0)