codeapp-js 0.1.0 → 0.2.1
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/codeApp/dist/codeapp.js +326 -72
- package/codeApp/dist/icon-512.png +0 -0
- package/codeApp/dist/index.html +1 -0
- package/codeApp/dist/index.js +1 -1
- package/codeApp/dist/power-apps-data.js +2952 -2531
- package/codeApp/power.config.json +1 -1
- package/dev files/customConnector.js +98 -0
- package/dev files/dataverse.js +33 -7
- package/dev files/environmentVar.js +1 -1
- package/dev files/office365groups.js +1 -1
- package/dev files/office365users.js +1 -1
- package/dev files/outlook.js +1 -1
- package/dev files/power-apps-data.js +2952 -0
- package/dev files/sharepoint.js +1 -1
- package/examples/combined demo/dist/codeapp.js +1098 -0
- package/examples/combined demo/dist/index.js +470 -515
- package/examples/combined demo/dist/power-apps-data.js +3007 -2531
- package/examples/dataverse Demo/dist/codeapp.js +1085 -0
- package/examples/dataverse Demo/dist/index.js +38 -26
- package/examples/dataverse Demo/dist/power-apps-data.js +2912 -2531
- package/examples/groups Demo/dist/codeapp.js +1085 -0
- package/examples/groups Demo/dist/index.js +113 -113
- package/examples/groups Demo/dist/power-apps-data.js +2912 -2531
- package/examples/groups Demo/power.config.json +3 -2
- package/examples/kanban/dist/power-apps-data.js +2953 -2531
- package/examples/myProfile/dist/power-apps-data.js +2953 -2531
- package/examples/outlook Demo/dist/codeapp.js +1085 -0
- package/examples/outlook Demo/dist/index.js +39 -35
- package/examples/outlook Demo/dist/power-apps-data.js +2912 -2531
- package/examples/planning Poker/dist/power-apps-data.js +2953 -2531
- package/examples/sharePoint Demo/dist/codeapp.js +1085 -0
- package/examples/sharePoint Demo/dist/index.js +262 -269
- package/examples/sharePoint Demo/dist/power-apps-data.js +2912 -2531
- package/examples/solution explorer/agent/decision-log.md +27 -0
- package/examples/solution explorer/agent/mockup-01-swiss-grid.html +452 -0
- package/examples/solution explorer/agent/mockup-02-dark-glass.html +496 -0
- package/examples/solution explorer/agent/mockup-03-paper-console.html +510 -0
- package/examples/solution explorer/agent/mockup-04-neon-noir.html +546 -0
- package/examples/solution explorer/agent/mockup-05-zen-garden.html +534 -0
- package/examples/solution explorer/dist/codeapp.js +1098 -0
- package/examples/solution explorer/dist/icon-512.png +0 -0
- package/examples/solution explorer/dist/index.html +80 -0
- package/examples/solution explorer/dist/index.js +735 -0
- package/examples/solution explorer/dist/power-apps-data.js +3007 -0
- package/examples/solution explorer/dist/styles.css +571 -0
- package/examples/solution explorer/power.config.json +151 -0
- package/examples/todo/dist/power-apps-data.js +2953 -2531
- package/package.json +1 -8
- package/.github/instructions/wyattdave.instructions.md +0 -39
- package/examples/combined demo/dist/dataverse.js +0 -86
- package/examples/combined demo/dist/environmentVar.js +0 -55
- package/examples/combined demo/dist/office365groups.js +0 -97
- package/examples/combined demo/dist/office365users.js +0 -169
- package/examples/combined demo/dist/outlook.js +0 -162
- package/examples/combined demo/dist/sharepoint.js +0 -339
- package/examples/dataverse Demo/dist/dataverse.js +0 -86
- package/examples/groups Demo/dist/dataverse.js +0 -86
- package/examples/groups Demo/dist/environmentVar.js +0 -55
- package/examples/groups Demo/dist/office365groups.js +0 -97
- package/examples/groups Demo/dist/office365users.js +0 -169
- package/examples/groups Demo/dist/outlook.js +0 -162
- package/examples/groups Demo/dist/sharepoint.js +0 -339
- package/examples/sharePoint Demo/dist/dataverse.js +0 -94
- package/examples/sharePoint Demo/dist/environmentVar.js +0 -55
- package/examples/sharePoint Demo/dist/office365groups.js +0 -97
- package/examples/sharePoint Demo/dist/office365users.js +0 -169
- package/examples/sharePoint Demo/dist/outlook.js +0 -162
- package/examples/sharePoint Demo/dist/sharepoint.js +0 -339
- package/scripts/build-power-sdk.mjs +0 -69
|
@@ -1,38 +1,50 @@
|
|
|
1
|
-
import { createItem, listItems } from
|
|
1
|
+
import { initDataSources, createItem, listItems } from './codeapp.js';
|
|
2
2
|
|
|
3
|
-
const TABLE =
|
|
4
|
-
const PK =
|
|
3
|
+
const TABLE = 'tasks';
|
|
4
|
+
const PK = 'activityid';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
function dsEntry(sPrimaryKey) {
|
|
7
|
+
return { tableId: '', version: '', primaryKey: sPrimaryKey, dataSourceType: 'Dataverse', apis: {} };
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
initDataSources({
|
|
11
|
+
tasks: dsEntry('activityid')
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const taskBody = document.getElementById('task-body');
|
|
15
|
+
const taskInput = document.getElementById('task-input');
|
|
16
|
+
const btnAdd = document.getElementById('btn-add');
|
|
17
|
+
const status = document.getElementById('status');
|
|
10
18
|
|
|
11
19
|
function renderRows(records) {
|
|
12
20
|
if (!records || records.length === 0) {
|
|
13
|
-
taskBody.innerHTML =
|
|
21
|
+
taskBody.innerHTML = '<tr><td colspan="3">No tasks found.</td></tr>';
|
|
14
22
|
return;
|
|
15
23
|
}
|
|
16
24
|
taskBody.innerHTML = records
|
|
17
25
|
.map((r) => {
|
|
18
|
-
const subject = r.subject ||
|
|
19
|
-
const state = r.statecode === 0 ?
|
|
26
|
+
const subject = r.subject || '—';
|
|
27
|
+
const state = r.statecode === 0 ? 'Open' : 'Completed';
|
|
20
28
|
const created = r.createdon
|
|
21
29
|
? new Date(r.createdon).toLocaleDateString()
|
|
22
|
-
:
|
|
23
|
-
return
|
|
30
|
+
: '—';
|
|
31
|
+
return '<tr><td>' + escapeHtml(subject) + '</td><td>' + state + '</td><td>' + created + '</td></tr>';
|
|
24
32
|
})
|
|
25
|
-
.join(
|
|
33
|
+
.join('');
|
|
26
34
|
}
|
|
27
35
|
|
|
28
|
-
function escapeHtml(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
36
|
+
function escapeHtml(sText) {
|
|
37
|
+
let sStr = String(sText == null ? '' : sText);
|
|
38
|
+
return sStr
|
|
39
|
+
.replace(new RegExp('&', 'g'), '&')
|
|
40
|
+
.replace(new RegExp('<', 'g'), '<')
|
|
41
|
+
.replace(new RegExp('>', 'g'), '>')
|
|
42
|
+
.replace(new RegExp('"', 'g'), '"')
|
|
43
|
+
.replace(new RegExp("'", 'g'), ''');
|
|
32
44
|
}
|
|
33
45
|
|
|
34
46
|
async function loadTasks() {
|
|
35
|
-
status.textContent =
|
|
47
|
+
status.textContent = 'Loading tasks…';
|
|
36
48
|
try {
|
|
37
49
|
const result = await listItems(TABLE, PK, {
|
|
38
50
|
select: ["subject", "statecode", "createdon"],
|
|
@@ -40,9 +52,9 @@ async function loadTasks() {
|
|
|
40
52
|
top: 5,
|
|
41
53
|
});
|
|
42
54
|
renderRows(result.entities ?? []);
|
|
43
|
-
status.textContent =
|
|
55
|
+
status.textContent = '';
|
|
44
56
|
} catch (err) {
|
|
45
|
-
status.textContent =
|
|
57
|
+
status.textContent = 'Error loading tasks: ' + err.message;
|
|
46
58
|
}
|
|
47
59
|
}
|
|
48
60
|
|
|
@@ -51,21 +63,21 @@ async function addTask() {
|
|
|
51
63
|
if (!subject) return;
|
|
52
64
|
|
|
53
65
|
btnAdd.disabled = true;
|
|
54
|
-
status.textContent =
|
|
66
|
+
status.textContent = 'Creating task…';
|
|
55
67
|
try {
|
|
56
68
|
await createItem(TABLE, PK, { subject });
|
|
57
|
-
taskInput.value =
|
|
69
|
+
taskInput.value = '';
|
|
58
70
|
await loadTasks();
|
|
59
71
|
} catch (err) {
|
|
60
|
-
status.textContent =
|
|
72
|
+
status.textContent = 'Error creating task: ' + err.message;
|
|
61
73
|
} finally {
|
|
62
74
|
btnAdd.disabled = false;
|
|
63
75
|
}
|
|
64
76
|
}
|
|
65
77
|
|
|
66
|
-
btnAdd.addEventListener(
|
|
67
|
-
taskInput.addEventListener(
|
|
68
|
-
if (e.key ===
|
|
78
|
+
btnAdd.addEventListener('click', addTask);
|
|
79
|
+
taskInput.addEventListener('keydown', (e) => {
|
|
80
|
+
if (e.key === 'Enter') addTask();
|
|
69
81
|
});
|
|
70
82
|
|
|
71
83
|
loadTasks();
|