@skillcdn/console 0.4.3 → 0.4.4
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/README.md +4 -4
- package/dist/api.d.ts +3 -3
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +3 -3
- package/dist/api.js.map +1 -1
- package/dist/cli/cli.d.ts.map +1 -1
- package/dist/cli/cli.js +95 -20
- package/dist/cli/cli.js.map +1 -1
- package/dist/cli/format.d.ts +4 -2
- package/dist/cli/format.d.ts.map +1 -1
- package/dist/cli/format.js +32 -9
- package/dist/cli/format.js.map +1 -1
- package/dist/cli/help.d.ts.map +1 -1
- package/dist/cli/help.js +17 -14
- package/dist/cli/help.js.map +1 -1
- package/dist/cli/plugin-check.d.ts +5 -1
- package/dist/cli/plugin-check.d.ts.map +1 -1
- package/dist/cli/plugin-check.js +23 -4
- package/dist/cli/plugin-check.js.map +1 -1
- package/dist/cli/plugin-cli.d.ts.map +1 -1
- package/dist/cli/plugin-cli.js +10 -1
- package/dist/cli/plugin-cli.js.map +1 -1
- package/dist/cli/plugin-init.d.ts +2 -0
- package/dist/cli/plugin-init.d.ts.map +1 -1
- package/dist/cli/plugin-init.js +6 -0
- package/dist/cli/plugin-init.js.map +1 -1
- package/dist/client.d.ts +4 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +2 -0
- package/dist/client.js.map +1 -1
- package/dist/compat.js +1 -1
- package/dist/components/board.d.ts +8 -0
- package/dist/components/board.d.ts.map +1 -1
- package/dist/components/board.js +3 -3
- package/dist/components/board.js.map +1 -1
- package/dist/components/decision-form.d.ts +6 -0
- package/dist/components/decision-form.d.ts.map +1 -1
- package/dist/components/decision-form.js +23 -5
- package/dist/components/decision-form.js.map +1 -1
- package/dist/components/decision-list.d.ts +5 -1
- package/dist/components/decision-list.d.ts.map +1 -1
- package/dist/components/decision-list.js +25 -5
- package/dist/components/decision-list.js.map +1 -1
- package/dist/components/event-feed.d.ts.map +1 -1
- package/dist/components/event-feed.js +7 -1
- package/dist/components/event-feed.js.map +1 -1
- package/dist/components/goals.d.ts.map +1 -1
- package/dist/components/goals.js +2 -2
- package/dist/components/goals.js.map +1 -1
- package/dist/components/home.d.ts +35 -0
- package/dist/components/home.d.ts.map +1 -0
- package/dist/components/home.js +326 -0
- package/dist/components/home.js.map +1 -0
- package/dist/components/pack-connect.d.ts.map +1 -1
- package/dist/components/pack-connect.js +5 -4
- package/dist/components/pack-connect.js.map +1 -1
- package/dist/components/people.d.ts +2 -0
- package/dist/components/people.d.ts.map +1 -1
- package/dist/components/people.js +15 -2
- package/dist/components/people.js.map +1 -1
- package/dist/components/plugin-frame.d.ts +3 -12
- package/dist/components/plugin-frame.d.ts.map +1 -1
- package/dist/components/plugin-frame.js +53 -20
- package/dist/components/plugin-frame.js.map +1 -1
- package/dist/components/plugin-settings.d.ts.map +1 -1
- package/dist/components/plugin-settings.js +151 -26
- package/dist/components/plugin-settings.js.map +1 -1
- package/dist/components/projects.d.ts +0 -8
- package/dist/components/projects.d.ts.map +1 -1
- package/dist/components/projects.js +1 -13
- package/dist/components/projects.js.map +1 -1
- package/dist/components/task-view.d.ts.map +1 -1
- package/dist/components/task-view.js +2 -1
- package/dist/components/task-view.js.map +1 -1
- package/dist/components/ui.d.ts.map +1 -1
- package/dist/components/ui.js +5 -2
- package/dist/components/ui.js.map +1 -1
- package/dist/connect-page.d.ts.map +1 -1
- package/dist/connect-page.js +5 -6
- package/dist/connect-page.js.map +1 -1
- package/dist/console.css +761 -191
- package/dist/console.d.ts +10 -3
- package/dist/console.d.ts.map +1 -1
- package/dist/console.js +33 -13
- package/dist/console.js.map +1 -1
- package/dist/data.d.ts +4 -2
- package/dist/data.d.ts.map +1 -1
- package/dist/data.js +5 -0
- package/dist/data.js.map +1 -1
- package/dist/docs-page.d.ts.map +1 -1
- package/dist/docs-page.js +6 -5
- package/dist/docs-page.js.map +1 -1
- package/dist/home-tiles.d.ts +92 -0
- package/dist/home-tiles.d.ts.map +1 -0
- package/dist/home-tiles.js +294 -0
- package/dist/home-tiles.js.map +1 -0
- package/dist/i18n/en.d.ts +174 -0
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +175 -1
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/index.d.ts +4 -2
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/i18n/index.js +10 -11
- package/dist/i18n/index.js.map +1 -1
- package/dist/i18n/ko.d.ts.map +1 -1
- package/dist/i18n/ko.js +170 -3
- package/dist/i18n/ko.js.map +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/limits.d.ts +6 -0
- package/dist/limits.d.ts.map +1 -1
- package/dist/limits.js +6 -0
- package/dist/limits.js.map +1 -1
- package/dist/plugin/bridge.d.ts +44 -3
- package/dist/plugin/bridge.d.ts.map +1 -1
- package/dist/plugin/bridge.js +26 -0
- package/dist/plugin/bridge.js.map +1 -1
- package/dist/plugin/capabilities.d.ts +7 -1
- package/dist/plugin/capabilities.d.ts.map +1 -1
- package/dist/plugin/capabilities.js +14 -1
- package/dist/plugin/capabilities.js.map +1 -1
- package/dist/plugin/context.d.ts +18 -1
- package/dist/plugin/context.d.ts.map +1 -1
- package/dist/plugin/define.d.ts +1 -0
- package/dist/plugin/define.d.ts.map +1 -1
- package/dist/plugin/define.js +1 -1
- package/dist/plugin/define.js.map +1 -1
- package/dist/plugin/limits.d.ts +5 -2
- package/dist/plugin/limits.d.ts.map +1 -1
- package/dist/plugin/limits.js +5 -2
- package/dist/plugin/limits.js.map +1 -1
- package/dist/plugin/manifest.d.ts +83 -6
- package/dist/plugin/manifest.d.ts.map +1 -1
- package/dist/plugin/manifest.js +111 -7
- package/dist/plugin/manifest.js.map +1 -1
- package/dist/plugin/rest-schemas.d.ts +76 -0
- package/dist/plugin/rest-schemas.d.ts.map +1 -1
- package/dist/plugin/rest-schemas.js +23 -2
- package/dist/plugin/rest-schemas.js.map +1 -1
- package/dist/plugin/sandbox.d.ts +4 -3
- package/dist/plugin/sandbox.d.ts.map +1 -1
- package/dist/plugin/sandbox.js +33 -6
- package/dist/plugin/sandbox.js.map +1 -1
- package/dist/plugin/semver.d.ts +26 -0
- package/dist/plugin/semver.d.ts.map +1 -0
- package/dist/plugin/semver.js +76 -0
- package/dist/plugin/semver.js.map +1 -0
- package/dist/plugin/testing.d.ts.map +1 -1
- package/dist/plugin/testing.js +2 -1
- package/dist/plugin/testing.js.map +1 -1
- package/dist/plugin/web.d.ts +10 -1
- package/dist/plugin/web.d.ts.map +1 -1
- package/dist/plugin/web.js +34 -0
- package/dist/plugin/web.js.map +1 -1
- package/dist/plugin.d.ts +3 -2
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +3 -2
- package/dist/plugin.js.map +1 -1
- package/dist/rules.d.ts +2 -2
- package/dist/rules.js +3 -3
- package/dist/schemas.d.ts +497 -2
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +96 -9
- package/dist/schemas.js.map +1 -1
- package/dist/use-action.d.ts +8 -2
- package/dist/use-action.d.ts.map +1 -1
- package/dist/use-action.js +13 -6
- package/dist/use-action.js.map +1 -1
- package/dist/vocabulary.d.ts +3 -1
- package/dist/vocabulary.d.ts.map +1 -1
- package/dist/vocabulary.js +3 -0
- package/dist/vocabulary.js.map +1 -1
- package/docs/specs/cli.md +4 -3
- package/docs/specs/plugins.md +46 -33
- package/docs/specs/rest.md +16 -15
- package/package.json +1 -1
- package/skills/building-a-plugin/SKILL.md +8 -7
- package/skills/planning-the-board/references/setting-up.md +2 -1
- package/skills/working-the-board/SKILL.md +3 -3
- package/src/api.ts +6 -0
- package/src/cli/cli.ts +124 -19
- package/src/cli/format.ts +42 -9
- package/src/cli/help.ts +17 -13
- package/src/cli/plugin-check.ts +41 -2
- package/src/cli/plugin-cli.ts +10 -1
- package/src/cli/plugin-init.ts +8 -0
- package/src/client.ts +8 -0
- package/src/compat.ts +1 -1
- package/src/components/board.tsx +3 -3
- package/src/components/decision-form.tsx +75 -19
- package/src/components/decision-list.tsx +45 -13
- package/src/components/event-feed.tsx +7 -1
- package/src/components/goals.tsx +4 -1
- package/src/components/home.tsx +615 -0
- package/src/components/pack-connect.tsx +5 -4
- package/src/components/people.tsx +136 -54
- package/src/components/plugin-frame.tsx +62 -63
- package/src/components/plugin-settings.tsx +428 -87
- package/src/components/projects.tsx +0 -55
- package/src/components/task-view.tsx +7 -0
- package/src/components/ui.tsx +6 -2
- package/src/connect-page.tsx +5 -6
- package/src/console.tsx +80 -30
- package/src/data.ts +9 -2
- package/src/docs-page.tsx +6 -5
- package/src/home-tiles.ts +438 -0
- package/src/i18n/en.ts +178 -0
- package/src/i18n/index.ts +17 -14
- package/src/i18n/ko.ts +174 -3
- package/src/index.ts +7 -5
- package/src/limits.ts +6 -0
- package/src/plugin/bridge.ts +77 -1
- package/src/plugin/capabilities.ts +17 -1
- package/src/plugin/context.ts +18 -1
- package/src/plugin/define.ts +4 -1
- package/src/plugin/limits.ts +5 -2
- package/src/plugin/manifest.ts +154 -10
- package/src/plugin/rest-schemas.ts +27 -1
- package/src/plugin/sandbox.ts +36 -8
- package/src/plugin/semver.ts +89 -0
- package/src/plugin/testing.ts +2 -1
- package/src/plugin/web.ts +49 -0
- package/src/plugin.ts +18 -0
- package/src/rules.ts +3 -3
- package/src/schemas.ts +118 -10
- package/src/styles/console.css +761 -191
- package/src/use-action.ts +16 -7
- package/src/vocabulary.ts +4 -0
- package/template/plugin/console-plugin.json +3 -1
package/dist/console.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { type ComponentType, type ReactNode } from "react";
|
|
2
|
-
import { type ConsoleClient, type RestProject } from "./api.js";
|
|
2
|
+
import { type ConsoleClient, type RestMe, type RestProject } from "./api.js";
|
|
3
3
|
import { type BoardProps } from "./components/board.js";
|
|
4
4
|
import { type CalendarProps } from "./components/calendar.js";
|
|
5
5
|
import { type CategoryListProps } from "./components/categories.js";
|
|
6
6
|
import { type DecisionListProps } from "./components/decision-list.js";
|
|
7
7
|
import { type EventFeedProps } from "./components/event-feed.js";
|
|
8
8
|
import { type GoalListProps } from "./components/goals.js";
|
|
9
|
+
import { type HomeGridProps } from "./components/home.js";
|
|
9
10
|
import { type PeopleListProps } from "./components/people.js";
|
|
10
|
-
import { type MemberListProps
|
|
11
|
+
import { type MemberListProps } from "./components/projects.js";
|
|
11
12
|
import { type Brand, type ShellProps } from "./components/shell.js";
|
|
12
13
|
import { type SignInProps } from "./components/sign-in.js";
|
|
13
14
|
import { type SkillListProps } from "./components/skills.js";
|
|
@@ -28,7 +29,7 @@ export interface ConsoleComponents {
|
|
|
28
29
|
readonly TokenList: ComponentType<TokenListProps>;
|
|
29
30
|
readonly PeopleList: ComponentType<PeopleListProps>;
|
|
30
31
|
readonly SkillList: ComponentType<SkillListProps>;
|
|
31
|
-
readonly
|
|
32
|
+
readonly HomeGrid: ComponentType<HomeGridProps>;
|
|
32
33
|
readonly MemberList: ComponentType<MemberListProps>;
|
|
33
34
|
readonly Calendar: ComponentType<CalendarProps>;
|
|
34
35
|
readonly GoalList: ComponentType<GoalListProps>;
|
|
@@ -91,6 +92,12 @@ export interface ConsoleApp {
|
|
|
91
92
|
/** Renders the console into `container`. Returns the way to take it down again. */
|
|
92
93
|
mount(container: Element): () => void;
|
|
93
94
|
}
|
|
95
|
+
/**
|
|
96
|
+
* The language to keep for a person the pages see for the first time (ADR-0065): the one their
|
|
97
|
+
* browser asks for, so that a plugin or an agent can write for them while they are away. Nothing
|
|
98
|
+
* for a person who has a language, for nobody, and where the pages only fall back on a language.
|
|
99
|
+
*/
|
|
100
|
+
export declare function languageToKeep(me: RestMe | undefined, browser: readonly string[], packs: readonly LanguagePack[]): string | undefined;
|
|
94
101
|
/**
|
|
95
102
|
* The pages a console that holds a token does not offer: the tokens themselves, and the
|
|
96
103
|
* approval of an agent's connection, which makes one; a person's own doing on the console's
|
package/dist/console.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"console.d.ts","sourceRoot":"","sources":["../src/console.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,SAAS,EAMf,MAAM,OAAO,CAAC;AAEf,OAAO,EAEL,KAAK,aAAa,
|
|
1
|
+
{"version":3,"file":"console.d.ts","sourceRoot":"","sources":["../src/console.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,SAAS,EAMf,MAAM,OAAO,CAAC;AAEf,OAAO,EAEL,KAAK,aAAa,EAYlB,KAAK,MAAM,EAGX,KAAK,WAAW,EAcjB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAuB,KAAK,UAAU,EAAsB,MAAM,uBAAuB,CAAC;AACjG,OAAO,EAAY,KAAK,aAAa,EAAY,MAAM,0BAA0B,CAAC;AAClF,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAGlF,OAAO,EAA8B,KAAK,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AACnG,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5E,OAAO,EAAsB,KAAK,aAAa,EAAuB,MAAM,uBAAuB,CAAC;AACpG,OAAO,EAAY,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAIpE,OAAO,EAA2B,KAAK,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAGvF,OAAO,EAEL,KAAK,eAAe,EAGrB,MAAM,0BAA0B,CAAC;AAIlC,OAAO,EACL,KAAK,KAAK,EAIV,KAAK,UAAU,EAChB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAGxE,OAAO,EAAY,KAAK,aAAa,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAkC,KAAK,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0D;IAC1D,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,GAAG,SAAS,CAAC;IAC7D,4HAA4H;IAC5H,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,YAAY,EAAE,GAAG,SAAS,CAAC;IACzD,wGAAwG;IACxG,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,GAAG,SAAS,CAAC;IACnC,2FAA2F;IAC3F,QAAQ,CAAC,MAAM,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IAC5C,mEAAmE;IACnE,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,UAAU,EAAE,GAAG,SAAS,CAAC;CACpD;AAED,MAAM,WAAW,UAAU;IACzB,sEAAsE;IACtE,QAAQ,CAAC,GAAG,EAAE,aAAa,CAAC;QAAE,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,CAAC,CAAC;IAC3E,mFAAmF;IACnF,KAAK,CAAC,SAAS,EAAE,OAAO,GAAG,MAAM,IAAI,CAAC;CACvC;AAqID;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,EAAE,EAAE,MAAM,GAAG,SAAS,EACtB,OAAO,EAAE,SAAS,MAAM,EAAE,EAC1B,KAAK,EAAE,SAAS,YAAY,EAAE,GAC7B,MAAM,GAAG,SAAS,CAIpB;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAOpD;AAqpED,wBAAgB,aAAa,CAAC,MAAM,GAAE,aAAkB,GAAG,UAAU,CAwXpE"}
|
package/dist/console.js
CHANGED
|
@@ -10,13 +10,14 @@ import { DecisionForm } from "./components/decision-form.js";
|
|
|
10
10
|
import { DecisionCard, DecisionList } from "./components/decision-list.js";
|
|
11
11
|
import { EventFeed } from "./components/event-feed.js";
|
|
12
12
|
import { GoalForm, GoalList, GoalView, goalMonth } from "./components/goals.js";
|
|
13
|
+
import { HomeGrid } from "./components/home.js";
|
|
13
14
|
import { MyDecisions } from "./components/my-decisions.js";
|
|
14
15
|
import { PackTokenWays } from "./components/pack-token.js";
|
|
15
16
|
import { PAGE_SIZE } from "./components/paged.js";
|
|
16
17
|
import { ListingForm, PeopleList } from "./components/people.js";
|
|
17
|
-
import { PluginFrame
|
|
18
|
+
import { PluginFrame } from "./components/plugin-frame.js";
|
|
18
19
|
import { PluginSettingsList, PluginSettingsView } from "./components/plugin-settings.js";
|
|
19
|
-
import { MemberList, ProjectForm,
|
|
20
|
+
import { MemberList, ProjectForm, ProjectMark, } from "./components/projects.js";
|
|
20
21
|
import { RemotePicturesContext } from "./components/remote-pictures.js";
|
|
21
22
|
import { GoalTimeline } from "./components/roadmap.js";
|
|
22
23
|
import { RulesForm, RulesView } from "./components/rules.js";
|
|
@@ -34,7 +35,7 @@ import { ConnectPage } from "./connect-page.js";
|
|
|
34
35
|
import { useConsoleData } from "./data.js";
|
|
35
36
|
import { monthOf, today } from "./dates.js";
|
|
36
37
|
import { DocsPage } from "./docs-page.js";
|
|
37
|
-
import { chooseLanguage, DEFAULT_LANGUAGES, LanguageContext, useWords, } from "./i18n/index.js";
|
|
38
|
+
import { browserPack, chooseLanguage, DEFAULT_LANGUAGES, LanguageContext, useWords, } from "./i18n/index.js";
|
|
38
39
|
import { pluginNavItems, pluginPagesAt, pluginWordOf } from "./plugin-nav.js";
|
|
39
40
|
import { boardHref, calendarHref, customPageHref, decisionHref, decisionsHref, docHref, goalHref, matchRoute, newDecisionHref, newGoalHref, newTaskHref, PATHS, personAgentsHref, personWorkHref, pluginHref, pluginSettingsHref, projectHref, projectSettingsHref, roadmapHref, settingsHref, signInFailureOf, taskHref, withoutSignInParam, workHref, } from "./router.js";
|
|
40
41
|
import { projectPath } from "./routes.js";
|
|
@@ -49,7 +50,7 @@ export const DEFAULT_COMPONENTS = {
|
|
|
49
50
|
TokenList,
|
|
50
51
|
PeopleList,
|
|
51
52
|
SkillList,
|
|
52
|
-
|
|
53
|
+
HomeGrid,
|
|
53
54
|
MemberList,
|
|
54
55
|
Calendar,
|
|
55
56
|
GoalList,
|
|
@@ -184,6 +185,16 @@ function Ground(props) {
|
|
|
184
185
|
function holdsToken(data) {
|
|
185
186
|
return data.me !== undefined && data.me.agent !== null;
|
|
186
187
|
}
|
|
188
|
+
/**
|
|
189
|
+
* The language to keep for a person the pages see for the first time (ADR-0065): the one their
|
|
190
|
+
* browser asks for, so that a plugin or an agent can write for them while they are away. Nothing
|
|
191
|
+
* for a person who has a language, for nobody, and where the pages only fall back on a language.
|
|
192
|
+
*/
|
|
193
|
+
export function languageToKeep(me, browser, packs) {
|
|
194
|
+
return me?.person !== null && me?.person !== undefined && me.language === null
|
|
195
|
+
? browserPack(browser, packs)?.tag
|
|
196
|
+
: undefined;
|
|
197
|
+
}
|
|
187
198
|
/**
|
|
188
199
|
* The pages a console that holds a token does not offer: the tokens themselves, and the
|
|
189
200
|
* approval of an agent's connection, which makes one; a person's own doing on the console's
|
|
@@ -201,20 +212,21 @@ function NotWithToken() {
|
|
|
201
212
|
}
|
|
202
213
|
function ProjectsPage(props) {
|
|
203
214
|
const words = useWords().projects;
|
|
215
|
+
const homeWords = useWords().home;
|
|
204
216
|
const { data, components, navigation, client, language } = props;
|
|
205
217
|
const me = data.me;
|
|
206
|
-
|
|
207
|
-
const
|
|
218
|
+
// The person arranges the page (ADR-0061): the projects and the widgets, tiles on one grid.
|
|
219
|
+
const [arranging, setArranging] = useState(false);
|
|
208
220
|
const { busy, error, act } = useAction();
|
|
209
221
|
const href = (project) => projectHref(project.key);
|
|
210
222
|
// A project is made by an administrator (ADR-0045): a member sees the list alone, the form's
|
|
211
223
|
// address included.
|
|
212
224
|
const administrator = data.me?.person?.role === "admin";
|
|
213
225
|
const making = props.making && administrator;
|
|
214
|
-
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "sc-page-head", children: [_jsx("h1", { className: "sc-page-title", children: words.title }), administrator && !making && (_jsx(LinkButton, { href: PATHS.newProject, variant: "primary", children: words.newProject }))] }), error !== undefined && _jsx(Callout, { tone: "danger", children: error }),
|
|
226
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "sc-page-head", children: [_jsx("h1", { className: "sc-page-title", children: words.title }), !arranging && (_jsxs("div", { className: "sc-page-actions", children: [me !== undefined && me.person !== null && (_jsx(Button, { size: "sm", variant: "ghost", onClick: () => setArranging(true), children: homeWords.edit })), administrator && !making && (_jsx(LinkButton, { href: PATHS.newProject, variant: "primary", children: words.newProject }))] }))] }), error !== undefined && _jsx(Callout, { tone: "danger", children: error }), making && (_jsx("section", { className: "sc-panel sc-panel-form", "aria-label": words.form.aria, children: _jsx(ProjectForm, { busy: busy, skillsSource: data.me?.workspace.skills.source, organizationAddress: data.me?.workspace.skills.address ?? null, onSubmit: (input, icon) => void act(async () => {
|
|
215
227
|
const made = await data.actions.createProject(input, icon instanceof File ? uploadOf(icon) : undefined);
|
|
216
228
|
navigation.replace(projectHref(made.key));
|
|
217
|
-
}), onCancel: () => navigation.back(PATHS.projects) }) })), _jsx(components.
|
|
229
|
+
}), onCancel: () => navigation.back(PATHS.projects) }) })), _jsx(components.HomeGrid, { projects: data.projects, plugins: data.plugins, home: me?.home, editing: arranging, onSave: (home) => data.actions.updateMe({ home }), onDone: () => setArranging(false), projectHref: href, onOpen: (project) => navigation.go(href(project)), nameOf: (name) => pluginWordOf(name, language), renderWidget: (tile, size) => me === undefined ? null : (_jsx(PluginFrame, { plugin: tile.plugin, widget: tile.widget.key, size: size, me: me, language: language, client: client, navigation: navigation, title: pluginWordOf(tile.widget.name, language) })), empty: _jsx(EmptyState, { title: words.empty.title, body: administrator ? words.empty.body : words.empty.bodyMember, action: administrator ? (_jsx(LinkButton, { href: PATHS.newProject, children: words.newProject })) : undefined }) })] }));
|
|
218
230
|
}
|
|
219
231
|
/**
|
|
220
232
|
* A plugin's page (ADR-0054): the sub-tabs of its pages at the level, where it has several, above
|
|
@@ -233,7 +245,7 @@ function PluginPage(props) {
|
|
|
233
245
|
return _jsx(EmptyState, { title: words.plugins.noPage.title, body: words.plugins.noPage.body });
|
|
234
246
|
}
|
|
235
247
|
const projectKey = route.level === "project" ? route.project : undefined;
|
|
236
|
-
return (_jsxs(_Fragment, { children: [pages.length > 1 && (_jsx("nav", { className: "sc-
|
|
248
|
+
return (_jsxs(_Fragment, { children: [pages.length > 1 && (_jsx("nav", { className: "sc-page-tabs", "aria-label": pluginWordOf(plugin.name, language), children: pages.map((candidate) => (_jsx("a", { href: pluginHref(plugin.key, candidate.key, projectKey), className: candidate.key === page.key ? "sc-tab sc-tab-current" : "sc-tab", "aria-current": candidate.key === page.key ? "page" : undefined, children: pluginWordOf(candidate.name, language) }, candidate.key))) })), _jsx(PluginFrame, { plugin: plugin, page: page.key, project: project, path: route.rest, me: data.me, language: language, client: client, navigation: navigation, events: project === undefined ? undefined : data.events, title: words.plugins.frame(pluginWordOf(page.name, language)) }, `${plugin.key}:${page.key}:${projectKey ?? ""}`)] }));
|
|
237
249
|
}
|
|
238
250
|
/**
|
|
239
251
|
* The plugins' settings (docs/specs/plugins.md, "The settings pages"): the list, or one plugin
|
|
@@ -256,9 +268,9 @@ function PluginSettingsPage(props) {
|
|
|
256
268
|
setFailure(undefined);
|
|
257
269
|
}
|
|
258
270
|
catch (error) {
|
|
259
|
-
setFailure(error
|
|
271
|
+
setFailure(errorWords(error, words.common.somethingWentWrong, words));
|
|
260
272
|
}
|
|
261
|
-
}, [client, key, words
|
|
273
|
+
}, [client, key, words]);
|
|
262
274
|
useEffect(() => {
|
|
263
275
|
setDetail(undefined);
|
|
264
276
|
void read();
|
|
@@ -955,6 +967,8 @@ function WorkspacePage(props) {
|
|
|
955
967
|
? (person, role) => void act(() => data.actions.updatePerson(person.id, { role }))
|
|
956
968
|
: undefined, onChangeStatus: administrator
|
|
957
969
|
? (person, status) => void act(() => data.actions.updatePerson(person.id, { status }))
|
|
970
|
+
: undefined, onChangeManager: administrator
|
|
971
|
+
? (person, managerId) => void act(() => data.actions.updatePerson(person.id, { managerId }))
|
|
958
972
|
: undefined, onUnlist: administrator
|
|
959
973
|
? (listing) => void act(() => data.actions.removeListing(listing.id))
|
|
960
974
|
: undefined, workHref: oversees ? (person) => personWorkHref(person.id) : undefined, agentsHref: administrator ? (person) => personAgentsHref(person.id) : undefined })] }));
|
|
@@ -994,10 +1008,16 @@ export function createConsole(config = {}) {
|
|
|
994
1008
|
const failure = signInFailureOf(location.search);
|
|
995
1009
|
const title = data.me?.workspace.name ?? fallbackTitle;
|
|
996
1010
|
const viaToken = holdsToken(data);
|
|
997
|
-
// The language: the person's
|
|
1011
|
+
// The language: the person's own, else the browser's, else the first the console speaks.
|
|
998
1012
|
const chosen = data.me?.language;
|
|
999
1013
|
const pack = useMemo(() => chooseLanguage(chosen, typeof navigator === "undefined" ? [] : navigator.languages, languages), [chosen]);
|
|
1000
1014
|
const words = pack.messages;
|
|
1015
|
+
const toKeep = languageToKeep(data.me, typeof navigator === "undefined" ? [] : navigator.languages, languages);
|
|
1016
|
+
useEffect(() => {
|
|
1017
|
+
if (toKeep !== undefined) {
|
|
1018
|
+
void data.actions.updateMe({ language: toKeep }).catch(() => undefined);
|
|
1019
|
+
}
|
|
1020
|
+
}, [toKeep, data.actions]);
|
|
1001
1021
|
// An address that moved is shown at its new one, in its place.
|
|
1002
1022
|
useEffect(() => {
|
|
1003
1023
|
if (route.name === "moved") {
|
|
@@ -1012,7 +1032,7 @@ export function createConsole(config = {}) {
|
|
|
1012
1032
|
}, [title, data.project, pack.tag]);
|
|
1013
1033
|
let content;
|
|
1014
1034
|
if (data.me === undefined) {
|
|
1015
|
-
content = (_jsx(Ground, { children: _jsx("div", { className: "sc-loading", children: data.error === undefined ? (_jsx(Spinner, { label: words.common.loading })) : (_jsx(Callout, { tone: "danger", title: words.common.couldNotReach, action: _jsx(Button, { onClick: data.reload, children: words.common.tryAgain }), children: data.error })) }) }));
|
|
1035
|
+
content = (_jsx(Ground, { children: _jsx("div", { className: "sc-loading", children: data.error === undefined ? (_jsx(Spinner, { label: words.common.loading })) : (_jsx(Callout, { tone: "danger", title: words.common.couldNotReach, action: _jsx(Button, { onClick: data.reload, children: words.common.tryAgain }), children: errorWords(data.failure, data.error, words) })) }) }));
|
|
1016
1036
|
}
|
|
1017
1037
|
else if (data.me.person === null) {
|
|
1018
1038
|
content = (_jsx(Ground, { children: _jsx(components.SignIn, { title: title, brand: config.brand, providers: data.me.signIn, returnTo: withoutSignInParam(location.pathname, location.search), failure: failure }) }));
|