querysub 0.254.0 → 0.255.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -8,6 +8,7 @@ import { formatTime } from "socket-function/src/formatting/format";
|
|
|
8
8
|
import { formatTimeJSX } from "../../misc/formatJSX";
|
|
9
9
|
import { MachineController } from "../machineController";
|
|
10
10
|
import { closeAllModals } from "../../5-diagnostics/Modal";
|
|
11
|
+
import { unique } from "../../misc";
|
|
11
12
|
|
|
12
13
|
module.hotreload = true;
|
|
13
14
|
|
|
@@ -26,7 +27,9 @@ export class RenderGitRefInfo extends qreact.Component<{
|
|
|
26
27
|
useQuerysub: this.props.isQuerysub,
|
|
27
28
|
});
|
|
28
29
|
if (!gitRefInfo) return undefined;
|
|
29
|
-
return <div className={css.fontWeight("normal")}>
|
|
30
|
+
return <div className={css.fontWeight("normal")}>
|
|
31
|
+
{formatTimeJSX(gitRefInfo.time)} AGO <span className={css.hsl(0, 0, 80).pad2(5, 2).italic}>{gitRefInfo.description}</span>
|
|
32
|
+
</div>;
|
|
30
33
|
}
|
|
31
34
|
}
|
|
32
35
|
|
|
@@ -43,7 +46,7 @@ export class UpdateButtons extends qreact.Component<{
|
|
|
43
46
|
let { gitRef, repoUrl } = service.parameters;
|
|
44
47
|
return repoUrl === gitInfo?.repoUrl && gitRef !== gitInfo?.latestRef;
|
|
45
48
|
});
|
|
46
|
-
let outdatedRefs = outdatedServices.map(service => service.parameters.gitRef);
|
|
49
|
+
let outdatedRefs = unique(outdatedServices.map(service => service.parameters.gitRef));
|
|
47
50
|
|
|
48
51
|
return <>
|
|
49
52
|
{!!gitInfo?.querysubUncommitted.length && <button
|
|
@@ -79,7 +82,10 @@ export class UpdateButtons extends qreact.Component<{
|
|
|
79
82
|
{bigEmoji("📚", -5)}
|
|
80
83
|
Publish & Commit & Push Querysub & Update Package.json ({gitInfo?.querysubUncommitted.length} Files Changed)
|
|
81
84
|
</div>
|
|
82
|
-
<
|
|
85
|
+
<div className={css.hbox(5)}>
|
|
86
|
+
<b>Current</b>
|
|
87
|
+
<RenderGitRefInfo gitRef={gitInfo.querysubRef} isQuerysub />
|
|
88
|
+
</div>
|
|
83
89
|
</button>}
|
|
84
90
|
{!!gitInfo?.uncommitted.length && <button
|
|
85
91
|
className={buttonStyle.hsl(210, 40, 50)}
|
package/src/misc/formatJSX.tsx
CHANGED
|
@@ -2,5 +2,5 @@ import { qreact } from "../4-dom/qreact";
|
|
|
2
2
|
import { formatTime, formatVeryNiceDateTime } from "socket-function/src/formatting/format";
|
|
3
3
|
|
|
4
4
|
export function formatTimeJSX(time: number) {
|
|
5
|
-
return <span title={formatVeryNiceDateTime(time)}>
|
|
5
|
+
return <span title={formatVeryNiceDateTime(time)}>{formatTime(Date.now() - time)}</span>;
|
|
6
6
|
}
|
package/src/misc.ts
CHANGED
|
@@ -49,4 +49,8 @@ export function joinVNodes(vNodes: preact.ComponentChild[], delimitter: preact.C
|
|
|
49
49
|
|
|
50
50
|
export function clamp(value: number, min: number, max: number) {
|
|
51
51
|
return Math.max(min, Math.min(max, value));
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function unique<T>(array: T[]): T[] {
|
|
55
|
+
return Array.from(new Set(array));
|
|
52
56
|
}
|