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,113 +1,113 @@
|
|
|
1
|
-
|
|
2
|
-
import { listMyGroups } from
|
|
3
|
-
|
|
4
|
-
function getElements() {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
return { eStatus, eList, eRefresh };
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
function setStatus(sMessage) {
|
|
13
|
-
|
|
14
|
-
if (eStatus) {
|
|
15
|
-
eStatus.textContent = sMessage;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function normalizeGroups(oResult) {
|
|
20
|
-
if (Array.isArray(oResult)) {
|
|
21
|
-
return oResult;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
if (oResult && Array.isArray(oResult.value)) {
|
|
25
|
-
return oResult.value;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
if (oResult && Array.isArray(oResult.data)) {
|
|
29
|
-
return oResult.data;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
if (oResult && Array.isArray(oResult.groups)) {
|
|
33
|
-
return oResult.groups;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
return [];
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
function getGroupName(oGroup) {
|
|
40
|
-
return oGroup.displayName || oGroup.name || oGroup.mailNickname || oGroup.id ||
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
function getGroupMeta(oGroup) {
|
|
44
|
-
|
|
45
|
-
oGroup.mail ||
|
|
46
|
-
oGroup.visibility ||
|
|
47
|
-
oGroup.description ||
|
|
48
|
-
].filter(Boolean);
|
|
49
|
-
|
|
50
|
-
return aParts.join(
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
function renderGroups(aGroups) {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
if (!eList) {
|
|
57
|
-
throw new Error(
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
eList.innerHTML =
|
|
61
|
-
|
|
62
|
-
if (!Array.isArray(aGroups) || aGroups.length === 0) {
|
|
63
|
-
|
|
64
|
-
eItem.textContent =
|
|
65
|
-
eList.appendChild(eItem);
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
aGroups.forEach((oGroup) => {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
eTitle.textContent = getGroupName(oGroup);
|
|
75
|
-
eItem.appendChild(eTitle);
|
|
76
|
-
|
|
77
|
-
if (sMeta) {
|
|
78
|
-
|
|
79
|
-
eMeta.textContent = sMeta;
|
|
80
|
-
eItem.appendChild(eMeta);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
eList.appendChild(eItem);
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
async function loadGroups() {
|
|
88
|
-
try {
|
|
89
|
-
setStatus(
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
renderGroups(aGroups);
|
|
94
|
-
setStatus(
|
|
95
|
-
} catch (oErr) {
|
|
96
|
-
renderGroups([]);
|
|
97
|
-
setStatus(
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
async function boot() {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
if (eRefresh) {
|
|
105
|
-
eRefresh.addEventListener(
|
|
106
|
-
loadGroups();
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
await loadGroups();
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
boot();
|
|
1
|
+
|
|
2
|
+
import { listMyGroups } from './codeapp.js';
|
|
3
|
+
|
|
4
|
+
function getElements() {
|
|
5
|
+
let eStatus = document.getElementById('groupsStatus');
|
|
6
|
+
let eList = document.getElementById('groupsList');
|
|
7
|
+
let eRefresh = document.getElementById('groupsRefresh');
|
|
8
|
+
|
|
9
|
+
return { eStatus, eList, eRefresh };
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function setStatus(sMessage) {
|
|
13
|
+
let { eStatus } = getElements();
|
|
14
|
+
if (eStatus) {
|
|
15
|
+
eStatus.textContent = sMessage;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function normalizeGroups(oResult) {
|
|
20
|
+
if (Array.isArray(oResult)) {
|
|
21
|
+
return oResult;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (oResult && Array.isArray(oResult.value)) {
|
|
25
|
+
return oResult.value;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (oResult && Array.isArray(oResult.data)) {
|
|
29
|
+
return oResult.data;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (oResult && Array.isArray(oResult.groups)) {
|
|
33
|
+
return oResult.groups;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return [];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function getGroupName(oGroup) {
|
|
40
|
+
return oGroup.displayName || oGroup.name || oGroup.mailNickname || oGroup.id || 'Unnamed group';
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function getGroupMeta(oGroup) {
|
|
44
|
+
let aParts = [
|
|
45
|
+
oGroup.mail || '',
|
|
46
|
+
oGroup.visibility || '',
|
|
47
|
+
oGroup.description || ''
|
|
48
|
+
].filter(Boolean);
|
|
49
|
+
|
|
50
|
+
return aParts.join(' \u2014 ');
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function renderGroups(aGroups) {
|
|
54
|
+
let { eList } = getElements();
|
|
55
|
+
|
|
56
|
+
if (!eList) {
|
|
57
|
+
throw new Error('Missing groups list element.');
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
eList.innerHTML = '';
|
|
61
|
+
|
|
62
|
+
if (!Array.isArray(aGroups) || aGroups.length === 0) {
|
|
63
|
+
let eItem = document.createElement('li');
|
|
64
|
+
eItem.textContent = 'No groups found.';
|
|
65
|
+
eList.appendChild(eItem);
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
aGroups.forEach((oGroup) => {
|
|
70
|
+
let eItem = document.createElement('li');
|
|
71
|
+
let eTitle = document.createElement('strong');
|
|
72
|
+
let sMeta = getGroupMeta(oGroup);
|
|
73
|
+
|
|
74
|
+
eTitle.textContent = getGroupName(oGroup);
|
|
75
|
+
eItem.appendChild(eTitle);
|
|
76
|
+
|
|
77
|
+
if (sMeta) {
|
|
78
|
+
let eMeta = document.createElement('div');
|
|
79
|
+
eMeta.textContent = sMeta;
|
|
80
|
+
eItem.appendChild(eMeta);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
eList.appendChild(eItem);
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
async function loadGroups() {
|
|
88
|
+
try {
|
|
89
|
+
setStatus('Loading groups...');
|
|
90
|
+
let oResult = await listMyGroups();
|
|
91
|
+
let aGroups = normalizeGroups(oResult);
|
|
92
|
+
|
|
93
|
+
renderGroups(aGroups);
|
|
94
|
+
setStatus('Loaded ' + aGroups.length + ' groups.');
|
|
95
|
+
} catch (oErr) {
|
|
96
|
+
renderGroups([]);
|
|
97
|
+
setStatus('Failed to load groups: ' + (oErr.message || oErr));
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
async function boot() {
|
|
102
|
+
let { eRefresh } = getElements();
|
|
103
|
+
|
|
104
|
+
if (eRefresh) {
|
|
105
|
+
eRefresh.addEventListener('click', () => {
|
|
106
|
+
loadGroups();
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
await loadGroups();
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
boot();
|