@things-factory/worklist 10.0.19 → 10.1.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/dist-client/activity-cells.d.ts +21 -0
- package/dist-client/activity-cells.js +117 -0
- package/dist-client/activity-cells.js.map +1 -0
- package/dist-client/activity-summary-generator.js +57 -11
- package/dist-client/activity-summary-generator.js.map +1 -1
- package/dist-client/approval-progress.d.ts +18 -0
- package/dist-client/approval-progress.js +31 -0
- package/dist-client/approval-progress.js.map +1 -0
- package/dist-client/bootstrap.js +6 -11
- package/dist-client/bootstrap.js.map +1 -1
- package/dist-client/chip-filters.d.ts +53 -0
- package/dist-client/chip-filters.js +60 -0
- package/dist-client/chip-filters.js.map +1 -0
- package/dist-client/components/activity-approval-ribon.d.ts +19 -0
- package/dist-client/components/activity-approval-ribon.js +50 -126
- package/dist-client/components/activity-approval-ribon.js.map +1 -1
- package/dist-client/components/activity-fields.d.ts +50 -0
- package/dist-client/components/activity-fields.js +393 -0
- package/dist-client/components/activity-fields.js.map +1 -0
- package/dist-client/components/activity-instance-ribon.d.ts +19 -0
- package/dist-client/components/activity-instance-ribon.js +55 -122
- package/dist-client/components/activity-instance-ribon.js.map +1 -1
- package/dist-client/components/activity-thread-ribon.d.ts +25 -0
- package/dist-client/components/activity-thread-ribon.js +64 -121
- package/dist-client/components/activity-thread-ribon.js.map +1 -1
- package/dist-client/components/activity-thread-timeline.d.ts +14 -2
- package/dist-client/components/activity-thread-timeline.js +234 -104
- package/dist-client/components/activity-thread-timeline.js.map +1 -1
- package/dist-client/components/state-ribon.d.ts +40 -0
- package/dist-client/components/state-ribon.js +200 -0
- package/dist-client/components/state-ribon.js.map +1 -0
- package/dist-client/due.d.ts +16 -0
- package/dist-client/due.js +78 -0
- package/dist-client/due.js.map +1 -0
- package/dist-client/pages/activity/activity-list-page.js +4 -6
- package/dist-client/pages/activity/activity-list-page.js.map +1 -1
- package/dist-client/pages/activity-approval/activity-approval-list-page.js +2 -1
- package/dist-client/pages/activity-approval/activity-approval-list-page.js.map +1 -1
- package/dist-client/pages/activity-approval/activity-approval-page.d.ts +52 -5
- package/dist-client/pages/activity-approval/activity-approval-page.js +265 -118
- package/dist-client/pages/activity-approval/activity-approval-page.js.map +1 -1
- package/dist-client/pages/activity-instance/activity-instance-list-page.d.ts +0 -1
- package/dist-client/pages/activity-instance/activity-instance-list-page.js +8 -24
- package/dist-client/pages/activity-instance/activity-instance-list-page.js.map +1 -1
- package/dist-client/pages/activity-instance/activity-instance-start-page.d.ts +1 -0
- package/dist-client/pages/activity-instance/activity-instance-start-page.js +7 -0
- package/dist-client/pages/activity-instance/activity-instance-start-page.js.map +1 -1
- package/dist-client/pages/activity-instance/activity-instance-view.js +1 -1
- package/dist-client/pages/activity-instance/activity-instance-view.js.map +1 -1
- package/dist-client/pages/activity-stats/activity-stats-list-page.js +2 -1
- package/dist-client/pages/activity-stats/activity-stats-list-page.js.map +1 -1
- package/dist-client/pages/activity-thread/activity-thread-page.d.ts +30 -4
- package/dist-client/pages/activity-thread/activity-thread-page.js +142 -66
- package/dist-client/pages/activity-thread/activity-thread-page.js.map +1 -1
- package/dist-client/pages/activity-thread/activity-thread-view-page.d.ts +17 -6
- package/dist-client/pages/activity-thread/activity-thread-view-page.js +118 -65
- package/dist-client/pages/activity-thread/activity-thread-view-page.js.map +1 -1
- package/dist-client/pages/activity-thread/activity-thread-view.d.ts +24 -7
- package/dist-client/pages/activity-thread/activity-thread-view.js +84 -308
- package/dist-client/pages/activity-thread/activity-thread-view.js.map +1 -1
- package/dist-client/pages/installable-activity/installable-activity-list-page.d.ts +1 -1
- package/dist-client/pages/installable-activity/installable-activity-list-page.js +13 -9
- package/dist-client/pages/installable-activity/installable-activity-list-page.js.map +1 -1
- package/dist-client/pages/todo/approval-done-list-page.d.ts +1 -0
- package/dist-client/pages/todo/approval-done-list-page.js +111 -58
- package/dist-client/pages/todo/approval-done-list-page.js.map +1 -1
- package/dist-client/pages/todo/approval-pending-list-page.d.ts +32 -1
- package/dist-client/pages/todo/approval-pending-list-page.js +485 -130
- package/dist-client/pages/todo/approval-pending-list-page.js.map +1 -1
- package/dist-client/pages/todo/done-list-calendar-page.d.ts +2 -0
- package/dist-client/pages/todo/done-list-calendar-page.js +213 -29
- package/dist-client/pages/todo/done-list-calendar-page.js.map +1 -1
- package/dist-client/pages/todo/done-list-page.d.ts +1 -0
- package/dist-client/pages/todo/done-list-page.js +126 -62
- package/dist-client/pages/todo/done-list-page.js.map +1 -1
- package/dist-client/pages/todo/draft-list-page.d.ts +1 -0
- package/dist-client/pages/todo/draft-list-page.js +82 -34
- package/dist-client/pages/todo/draft-list-page.js.map +1 -1
- package/dist-client/pages/todo/pickable-list-page.js +6 -10
- package/dist-client/pages/todo/pickable-list-page.js.map +1 -1
- package/dist-client/pages/todo/todo-list-page.d.ts +1 -1
- package/dist-client/pages/todo/todo-list-page.js +102 -78
- package/dist-client/pages/todo/todo-list-page.js.map +1 -1
- package/dist-client/route.d.ts +1 -1
- package/dist-client/route.js +0 -6
- package/dist-client/route.js.map +1 -1
- package/dist-client/templates/activity-approval-context-template.js +60 -138
- package/dist-client/templates/activity-approval-context-template.js.map +1 -1
- package/dist-client/templates/activity-instance-context-template.js +13 -172
- package/dist-client/templates/activity-instance-context-template.js.map +1 -1
- package/dist-client/templates/activity-thread-context-template.js +39 -131
- package/dist-client/templates/activity-thread-context-template.js.map +1 -1
- package/dist-client/templates/context-panel.d.ts +26 -0
- package/dist-client/templates/context-panel.js +182 -0
- package/dist-client/templates/context-panel.js.map +1 -0
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-client/when.d.ts +4 -0
- package/dist-client/when.js +72 -0
- package/dist-client/when.js.map +1 -0
- package/dist-server/controllers/activity-approval/_abort.js +2 -1
- package/dist-server/controllers/activity-approval/_abort.js.map +1 -1
- package/dist-server/controllers/activity-approval/approval-line.d.ts +106 -0
- package/dist-server/controllers/activity-approval/approval-line.js +151 -0
- package/dist-server/controllers/activity-approval/approval-line.js.map +1 -0
- package/dist-server/controllers/activity-approval/approve.js +61 -51
- package/dist-server/controllers/activity-approval/approve.js.map +1 -1
- package/dist-server/controllers/activity-approval/claim.d.ts +42 -0
- package/dist-server/controllers/activity-approval/claim.js +77 -0
- package/dist-server/controllers/activity-approval/claim.js.map +1 -0
- package/dist-server/controllers/activity-approval/create-approval.d.ts +41 -0
- package/dist-server/controllers/activity-approval/create-approval.js +78 -0
- package/dist-server/controllers/activity-approval/create-approval.js.map +1 -0
- package/dist-server/controllers/activity-approval/delegate.d.ts +16 -0
- package/dist-server/controllers/activity-approval/delegate.js +43 -7
- package/dist-server/controllers/activity-approval/delegate.js.map +1 -1
- package/dist-server/controllers/activity-approval/opinion.d.ts +10 -0
- package/dist-server/controllers/activity-approval/opinion.js +43 -0
- package/dist-server/controllers/activity-approval/opinion.js.map +1 -0
- package/dist-server/controllers/activity-approval/reject.js +21 -1
- package/dist-server/controllers/activity-approval/reject.js.map +1 -1
- package/dist-server/controllers/activity-approval/save.js +26 -2
- package/dist-server/controllers/activity-approval/save.js.map +1 -1
- package/dist-server/controllers/activity-installation/activity-installation-controller.d.ts +26 -0
- package/dist-server/controllers/activity-installation/activity-installation-controller.js +45 -0
- package/dist-server/controllers/activity-installation/activity-installation-controller.js.map +1 -1
- package/dist-server/controllers/activity-instance/approval-expectation.d.ts +34 -0
- package/dist-server/controllers/activity-instance/approval-expectation.js +18 -0
- package/dist-server/controllers/activity-instance/approval-expectation.js.map +1 -0
- package/dist-server/controllers/activity-instance/issue.js +32 -0
- package/dist-server/controllers/activity-instance/issue.js.map +1 -1
- package/dist-server/controllers/activity-thread/restart.js +17 -1
- package/dist-server/controllers/activity-thread/restart.js.map +1 -1
- package/dist-server/controllers/activity-thread/submit.js +23 -43
- package/dist-server/controllers/activity-thread/submit.js.map +1 -1
- package/dist-server/controllers/common.js +46 -0
- package/dist-server/controllers/common.js.map +1 -1
- package/dist-server/controllers/index.d.ts +1 -0
- package/dist-server/controllers/index.js +8 -0
- package/dist-server/controllers/index.js.map +1 -1
- package/dist-server/service/activity/activity-mutation.js +25 -5
- package/dist-server/service/activity/activity-mutation.js.map +1 -1
- package/dist-server/service/activity/activity-type.d.ts +14 -0
- package/dist-server/service/activity/activity-type.js +8 -0
- package/dist-server/service/activity/activity-type.js.map +1 -1
- package/dist-server/service/activity/activity.d.ts +18 -0
- package/dist-server/service/activity/activity.js +5 -0
- package/dist-server/service/activity/activity.js.map +1 -1
- package/dist-server/service/activity-approval/activity-approval-mutation.js +3 -2
- package/dist-server/service/activity-approval/activity-approval-mutation.js.map +1 -1
- package/dist-server/service/activity-approval/activity-approval-query.d.ts +19 -1
- package/dist-server/service/activity-approval/activity-approval-query.js +186 -56
- package/dist-server/service/activity-approval/activity-approval-query.js.map +1 -1
- package/dist-server/service/activity-approval/activity-approval.d.ts +29 -1
- package/dist-server/service/activity-approval/activity-approval.js +19 -0
- package/dist-server/service/activity-approval/activity-approval.js.map +1 -1
- package/dist-server/service/activity-approval/my-pending-approvals.d.ts +21 -0
- package/dist-server/service/activity-approval/my-pending-approvals.js +40 -0
- package/dist-server/service/activity-approval/my-pending-approvals.js.map +1 -0
- package/dist-server/service/activity-instance/activity-instance-type.d.ts +20 -0
- package/dist-server/service/activity-instance/activity-instance-type.js +11 -0
- package/dist-server/service/activity-instance/activity-instance-type.js.map +1 -1
- package/dist-server/service/activity-instance/activity-instance.d.ts +6 -0
- package/dist-server/service/activity-instance/activity-instance.js +5 -0
- package/dist-server/service/activity-instance/activity-instance.js.map +1 -1
- package/dist-server/service/activity-stats/activity-stats-query.d.ts +5 -0
- package/dist-server/service/activity-stats/activity-stats-query.js +149 -11
- package/dist-server/service/activity-stats/activity-stats-query.js.map +1 -1
- package/dist-server/service/activity-stats/activity-stats-type.d.ts +19 -6
- package/dist-server/service/activity-stats/activity-stats-type.js +37 -10
- package/dist-server/service/activity-stats/activity-stats-type.js.map +1 -1
- package/dist-server/service/activity-stats/event-placement.d.ts +55 -0
- package/dist-server/service/activity-stats/event-placement.js +82 -0
- package/dist-server/service/activity-stats/event-placement.js.map +1 -0
- package/dist-server/service/activity-thread/activity-thread-query.js +48 -24
- package/dist-server/service/activity-thread/activity-thread-query.js.map +1 -1
- package/dist-server/service/activity-thread/my-open-threads.d.ts +15 -0
- package/dist-server/service/activity-thread/my-open-threads.js +40 -0
- package/dist-server/service/activity-thread/my-open-threads.js.map +1 -0
- package/dist-server/service/activity-thread/todo-order.d.ts +49 -0
- package/dist-server/service/activity-thread/todo-order.js +70 -0
- package/dist-server/service/activity-thread/todo-order.js.map +1 -0
- package/dist-server/service/installable-activity/installable-activity-mutation.d.ts +6 -0
- package/dist-server/service/installable-activity/installable-activity-mutation.js +7 -24
- package/dist-server/service/installable-activity/installable-activity-mutation.js.map +1 -1
- package/dist-server/service/nulls-last.d.ts +30 -0
- package/dist-server/service/nulls-last.js +37 -0
- package/dist-server/service/nulls-last.js.map +1 -0
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/helps/dataset/activity-instance-search-page.ko.md +5 -0
- package/helps/dataset/activity-instance-search-page.md +13 -0
- package/helps/worklist/activity-approval.ko.md +5 -0
- package/helps/worklist/activity-approval.md +14 -0
- package/helps/worklist/activity-bank-page.ko.md +5 -0
- package/helps/worklist/activity-bank-page.md +13 -0
- package/helps/worklist/activity-reporter-list.ko.md +5 -0
- package/helps/worklist/activity-reporter-list.md +13 -0
- package/helps/worklist/activity-store.ko.md +5 -0
- package/helps/worklist/activity-store.md +13 -0
- package/helps/worklist/activity-template.ko.md +5 -0
- package/helps/worklist/activity-template.md +13 -0
- package/helps/worklist/installable-activity.ko.md +5 -0
- package/helps/worklist/installable-activity.md +13 -0
- package/package.json +13 -12
- package/things-factory.config.js +0 -5
- package/translations/en.json +129 -51
- package/translations/ja.json +130 -52
- package/translations/ko.json +82 -4
- package/translations/ms.json +129 -51
- package/translations/zh.json +132 -54
- package/dist-client/pages/dashboard/dashboard-home.d.ts +0 -1
- package/dist-client/pages/dashboard/dashboard-home.js +0 -22
- package/dist-client/pages/dashboard/dashboard-home.js.map +0 -1
- package/dist-client/pages/worklist-home.d.ts +0 -1
- package/dist-client/pages/worklist-home.js +0 -17
- package/dist-client/pages/worklist-home.js.map +0 -1
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { Activity } from '../activity/activity.js';
|
|
2
2
|
export declare class InstallableActivityMutation {
|
|
3
|
+
/**
|
|
4
|
+
* 양식을 이 도메인에 세운다.
|
|
5
|
+
*
|
|
6
|
+
* 세우는 방법은 `installActivity` 한 벌만 갖는다 — 화면에서 누르는 것과 앱이 기동할 때 세우는 것이
|
|
7
|
+
* 서로 다른 코드를 타면 언젠가 갈라지고, 그때 「화면으로 세운 것만 되는」 결함이 된다.
|
|
8
|
+
*/
|
|
3
9
|
activateInstallableActivity(name: string, context: ResolverContext): Promise<Activity>;
|
|
4
10
|
deactivateInstallableActivity(name: string, context: ResolverContext): Promise<Activity>;
|
|
5
11
|
}
|
|
@@ -7,32 +7,15 @@ const activity_installation_controller_js_1 = require("../../controllers/activit
|
|
|
7
7
|
const activity_js_1 = require("../activity/activity.js");
|
|
8
8
|
const installable_activity_js_1 = require("./installable-activity.js");
|
|
9
9
|
let InstallableActivityMutation = class InstallableActivityMutation {
|
|
10
|
+
/**
|
|
11
|
+
* 양식을 이 도메인에 세운다.
|
|
12
|
+
*
|
|
13
|
+
* 세우는 방법은 `installActivity` 한 벌만 갖는다 — 화면에서 누르는 것과 앱이 기동할 때 세우는 것이
|
|
14
|
+
* 서로 다른 코드를 타면 언젠가 갈라지고, 그때 「화면으로 세운 것만 되는」 결함이 된다.
|
|
15
|
+
*/
|
|
10
16
|
async activateInstallableActivity(name, context) {
|
|
11
17
|
const { domain, user, tx } = context.state;
|
|
12
|
-
|
|
13
|
-
const repository = tx.getRepository(activity_js_1.Activity);
|
|
14
|
-
const activity = await repository.findOneBy({
|
|
15
|
-
domain: { id: domain.id },
|
|
16
|
-
name
|
|
17
|
-
});
|
|
18
|
-
if (!activity) {
|
|
19
|
-
return await repository.save({
|
|
20
|
-
...installableActivity,
|
|
21
|
-
state: activity_js_1.ActivityStatus.Released,
|
|
22
|
-
domain,
|
|
23
|
-
creator: user,
|
|
24
|
-
updater: user
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
return await repository.save({
|
|
29
|
-
...activity,
|
|
30
|
-
...installableActivity,
|
|
31
|
-
state: activity_js_1.ActivityStatus.Released,
|
|
32
|
-
domain,
|
|
33
|
-
updater: user
|
|
34
|
-
});
|
|
35
|
-
}
|
|
18
|
+
return await (0, activity_installation_controller_js_1.installActivity)(name, domain, { manager: tx, user });
|
|
36
19
|
}
|
|
37
20
|
async deactivateInstallableActivity(name, context) {
|
|
38
21
|
const { domain, user, tx } = context.state;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installable-activity-mutation.js","sourceRoot":"","sources":["../../../server/service/installable-activity/installable-activity-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AAEtE,
|
|
1
|
+
{"version":3,"file":"installable-activity-mutation.js","sourceRoot":"","sources":["../../../server/service/installable-activity/installable-activity-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AAEtE,qIAA6G;AAC7G,yDAAkE;AAClE,uEAA+D;AAGxD,IAAM,2BAA2B,GAAjC,MAAM,2BAA2B;IACtC;;;;;OAKG;IAGG,AAAN,KAAK,CAAC,2BAA2B,CAAc,IAAY,EAAS,OAAwB;QAC1F,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,OAAO,MAAM,IAAA,qDAAe,EAAC,IAAI,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAA;IACnE,CAAC;IAIK,AAAN,KAAK,CAAC,6BAA6B,CAAc,IAAY,EAAS,OAAwB;QAC5F,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAC1C,MAAM,UAAU,GAAG,EAAE,CAAC,aAAa,CAAC,sBAAQ,CAAC,CAAA;QAE7C,MAAM,QAAQ,GAAG,MAAM,UAAU,CAAC,SAAS,CAAC;YAC1C,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE;YACzB,IAAI;SACL,CAAC,CAAA;QAEF,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,OAAM;QACR,CAAC;QAED,OAAO,MAAM,UAAU,CAAC,IAAI,CAAC;YAC3B,GAAG,QAAQ;YACX,KAAK,EAAE,4BAAc,CAAC,UAAU;YAChC,OAAO,EAAE,IAAI;SACd,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AApCY,kEAA2B;AAShC;IAFL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,sBAAQ,EAAE,EAAE,WAAW,EAAE,8DAA8D,EAAE,CAAC;IAC5E,mBAAA,IAAA,kBAAG,EAAC,MAAM,CAAC,CAAA;IAAgB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;8EAIlE;AAIK;IAFL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,sBAAQ,EAAE,EAAE,WAAW,EAAE,gEAAgE,EAAE,CAAC;IAC5E,mBAAA,IAAA,kBAAG,EAAC,MAAM,CAAC,CAAA;IAAgB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;gFAkBpE;sCAnCU,2BAA2B;IADvC,IAAA,uBAAQ,EAAC,6CAAmB,CAAC;GACjB,2BAA2B,CAoCvC","sourcesContent":["import { Arg, Ctx, Directive, Mutation, Resolver } from 'type-graphql'\n\nimport { installActivity } from '../../controllers/activity-installation/activity-installation-controller.js'\nimport { Activity, ActivityStatus } from '../activity/activity.js'\nimport { InstallableActivity } from './installable-activity.js'\n\n@Resolver(InstallableActivity)\nexport class InstallableActivityMutation {\n /**\n * 양식을 이 도메인에 세운다.\n *\n * 세우는 방법은 `installActivity` 한 벌만 갖는다 — 화면에서 누르는 것과 앱이 기동할 때 세우는 것이\n * 서로 다른 코드를 타면 언젠가 갈라지고, 그때 「화면으로 세운 것만 되는」 결함이 된다.\n */\n @Directive('@transaction')\n @Mutation(returns => Activity, { description: 'To activate installable activity to Activity on given domain' })\n async activateInstallableActivity(@Arg('name') name: string, @Ctx() context: ResolverContext): Promise<Activity> {\n const { domain, user, tx } = context.state\n\n return await installActivity(name, domain, { manager: tx, user })\n }\n\n @Directive('@transaction')\n @Mutation(returns => Activity, { description: 'To deactivate installable activity to Activity on given domain' })\n async deactivateInstallableActivity(@Arg('name') name: string, @Ctx() context: ResolverContext): Promise<Activity> {\n const { domain, user, tx } = context.state\n const repository = tx.getRepository(Activity)\n\n const activity = await repository.findOneBy({\n domain: { id: domain.id },\n name\n })\n\n if (!activity) {\n return\n }\n\n return await repository.save({\n ...activity,\n state: ActivityStatus.Deprecated,\n updater: user\n })\n }\n}\n"]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sorting a column where a missing value means "not yet", not "smallest".
|
|
3
|
+
*
|
|
4
|
+
* Where NULL lands is decided by the database: sqlite puts it first ascending, postgres last. Left
|
|
5
|
+
* alone, the same code orders one way in development and another in production. And on a due-date
|
|
6
|
+
* column the database's answer is wrong either way — a task with no deadline is not the most urgent
|
|
7
|
+
* one.
|
|
8
|
+
*
|
|
9
|
+
* ORDER BY ... NULLS LAST would say it directly, but it is postgres and oracle syntax; mysql and
|
|
10
|
+
* mssql raise a syntax error, and this framework has to run on five drivers. TypeORM's third
|
|
11
|
+
* orderBy argument is no help either — SelectQueryBuilder appends "ASC NULLS LAST" without checking
|
|
12
|
+
* the driver.
|
|
13
|
+
*
|
|
14
|
+
* CASE WHEN ... IS NULL THEN 1 ELSE 0 END is standard SQL and behaves the same on all five.
|
|
15
|
+
*
|
|
16
|
+
* The expression cannot go straight into orderBy: TypeORM reads everything up to the first dot as
|
|
17
|
+
* an alias, and the field reference inside contains one — `"CASE WHEN "at"" alias was not found`.
|
|
18
|
+
* So it is added to the select under a name, and the ordering is done by that name.
|
|
19
|
+
*/
|
|
20
|
+
/** The select name the rank is added under. No dots, so TypeORM passes it through untouched. */
|
|
21
|
+
export declare const NULL_RANK_ALIAS = "nulls_last_rank";
|
|
22
|
+
/**
|
|
23
|
+
* Rank rows so the ones with no value sort last.
|
|
24
|
+
*
|
|
25
|
+
* `field` is a fully quoted column reference, resolved by the caller from TypeORM metadata — this
|
|
26
|
+
* module never spells a column name itself. The rank is always ordered ascending, in either
|
|
27
|
+
* direction of the sort it accompanies: an empty deadline belongs at the bottom whichever way the
|
|
28
|
+
* dated rows are pointing.
|
|
29
|
+
*/
|
|
30
|
+
export declare function nullsLastSelect(field: string): string;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Sorting a column where a missing value means "not yet", not "smallest".
|
|
4
|
+
*
|
|
5
|
+
* Where NULL lands is decided by the database: sqlite puts it first ascending, postgres last. Left
|
|
6
|
+
* alone, the same code orders one way in development and another in production. And on a due-date
|
|
7
|
+
* column the database's answer is wrong either way — a task with no deadline is not the most urgent
|
|
8
|
+
* one.
|
|
9
|
+
*
|
|
10
|
+
* ORDER BY ... NULLS LAST would say it directly, but it is postgres and oracle syntax; mysql and
|
|
11
|
+
* mssql raise a syntax error, and this framework has to run on five drivers. TypeORM's third
|
|
12
|
+
* orderBy argument is no help either — SelectQueryBuilder appends "ASC NULLS LAST" without checking
|
|
13
|
+
* the driver.
|
|
14
|
+
*
|
|
15
|
+
* CASE WHEN ... IS NULL THEN 1 ELSE 0 END is standard SQL and behaves the same on all five.
|
|
16
|
+
*
|
|
17
|
+
* The expression cannot go straight into orderBy: TypeORM reads everything up to the first dot as
|
|
18
|
+
* an alias, and the field reference inside contains one — `"CASE WHEN "at"" alias was not found`.
|
|
19
|
+
* So it is added to the select under a name, and the ordering is done by that name.
|
|
20
|
+
*/
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.NULL_RANK_ALIAS = void 0;
|
|
23
|
+
exports.nullsLastSelect = nullsLastSelect;
|
|
24
|
+
/** The select name the rank is added under. No dots, so TypeORM passes it through untouched. */
|
|
25
|
+
exports.NULL_RANK_ALIAS = 'nulls_last_rank';
|
|
26
|
+
/**
|
|
27
|
+
* Rank rows so the ones with no value sort last.
|
|
28
|
+
*
|
|
29
|
+
* `field` is a fully quoted column reference, resolved by the caller from TypeORM metadata — this
|
|
30
|
+
* module never spells a column name itself. The rank is always ordered ascending, in either
|
|
31
|
+
* direction of the sort it accompanies: an empty deadline belongs at the bottom whichever way the
|
|
32
|
+
* dated rows are pointing.
|
|
33
|
+
*/
|
|
34
|
+
function nullsLastSelect(field) {
|
|
35
|
+
return `CASE WHEN ${field} IS NULL THEN 1 ELSE 0 END`;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=nulls-last.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nulls-last.js","sourceRoot":"","sources":["../../server/service/nulls-last.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;GAkBG;;;AAaH,0CAEC;AAbD,gGAAgG;AACnF,QAAA,eAAe,GAAG,iBAAiB,CAAA;AAEhD;;;;;;;GAOG;AACH,SAAgB,eAAe,CAAC,KAAa;IAC3C,OAAO,aAAa,KAAK,4BAA4B,CAAA;AACvD,CAAC","sourcesContent":["/**\n * Sorting a column where a missing value means \"not yet\", not \"smallest\".\n *\n * Where NULL lands is decided by the database: sqlite puts it first ascending, postgres last. Left\n * alone, the same code orders one way in development and another in production. And on a due-date\n * column the database's answer is wrong either way — a task with no deadline is not the most urgent\n * one.\n *\n * ORDER BY ... NULLS LAST would say it directly, but it is postgres and oracle syntax; mysql and\n * mssql raise a syntax error, and this framework has to run on five drivers. TypeORM's third\n * orderBy argument is no help either — SelectQueryBuilder appends \"ASC NULLS LAST\" without checking\n * the driver.\n *\n * CASE WHEN ... IS NULL THEN 1 ELSE 0 END is standard SQL and behaves the same on all five.\n *\n * The expression cannot go straight into orderBy: TypeORM reads everything up to the first dot as\n * an alias, and the field reference inside contains one — `\"CASE WHEN \"at\"\" alias was not found`.\n * So it is added to the select under a name, and the ordering is done by that name.\n */\n\n/** The select name the rank is added under. No dots, so TypeORM passes it through untouched. */\nexport const NULL_RANK_ALIAS = 'nulls_last_rank'\n\n/**\n * Rank rows so the ones with no value sort last.\n *\n * `field` is a fully quoted column reference, resolved by the caller from TypeORM metadata — this\n * module never spells a column name itself. The rank is always ordered ascending, in either\n * direction of the sort it accompanies: an empty deadline belongs at the bottom whichever way the\n * dated rows are pointing.\n */\nexport function nullsLastSelect(field: string): string {\n return `CASE WHEN ${field} IS NULL THEN 1 ELSE 0 END`\n}\n"]}
|