codeapp-js 0.1.1 → 0.2.2
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 +552 -78
- package/codeApp/dist/power-apps-data.js +2531 -2531
- package/dev files/outlook.js +218 -9
- package/examples/combined demo/dist/codeapp.js +1098 -0
- package/examples/combined demo/dist/index.js +69 -114
- package/examples/combined demo/dist/power-apps-data.js +646 -170
- package/examples/combined demo/power.config.json +42 -42
- package/examples/dataverse Demo/dist/codeapp.js +1085 -0
- package/examples/dataverse Demo/dist/index.html +54 -54
- package/examples/dataverse Demo/dist/index.js +82 -70
- package/examples/dataverse Demo/dist/power-apps-data.js +551 -170
- package/examples/dataverse Demo/power.config.json +34 -34
- package/examples/dataverse Demo/readme.md +79 -79
- package/examples/groups Demo/dist/codeapp.js +1085 -0
- package/examples/groups Demo/dist/index.js +27 -27
- package/examples/groups Demo/dist/power-apps-data.js +551 -170
- package/examples/kanban/dist/dataverse.js +94 -94
- package/examples/kanban/dist/environmentVar.js +55 -55
- package/examples/kanban/dist/office365groups.js +97 -97
- package/examples/kanban/dist/office365users.js +169 -169
- package/examples/kanban/dist/outlook.js +162 -162
- package/examples/kanban/dist/power-apps-data.js +560 -138
- package/examples/kanban/dist/sharepoint.js +339 -339
- package/examples/myProfile/dist/index.html +184 -184
- package/examples/myProfile/dist/index.js +141 -141
- package/examples/myProfile/dist/office365users.js +169 -169
- package/examples/myProfile/dist/power-apps-data.js +560 -138
- package/examples/myProfile/power.config.json +22 -22
- package/examples/myProfile/readme.md +79 -79
- package/examples/outlook Demo/dist/codeapp.js +1085 -0
- package/examples/outlook Demo/dist/index.html +35 -35
- package/examples/outlook Demo/dist/index.js +170 -166
- package/examples/outlook Demo/dist/outlook.js +121 -121
- package/examples/outlook Demo/dist/power-apps-data.js +551 -170
- package/examples/outlook Demo/dist/styles.css +84 -84
- package/examples/outlook Demo/readme.md +82 -82
- package/examples/outlook Demo2/OutlookDemo_1_0_0_1.zip +0 -0
- package/examples/outlook Demo2/agent/decision-log.md +7 -0
- package/examples/outlook Demo2/dist/codeapp.js +1334 -0
- package/examples/outlook Demo2/dist/icon-512.png +0 -0
- package/examples/outlook Demo2/dist/index.html +98 -0
- package/examples/outlook Demo2/dist/index.js +346 -0
- package/examples/outlook Demo2/dist/power-apps-data.js +3007 -0
- package/examples/outlook Demo2/dist/styles.css +639 -0
- package/examples/outlook Demo2/power.config.json +23 -0
- package/examples/outlook Demo2/src/generated/index.ts +14 -0
- package/examples/outlook Demo2/src/generated/models/Office365GroupsModel.ts +363 -0
- package/examples/outlook Demo2/src/generated/models/Office365OutlookModel.ts +2046 -0
- package/examples/outlook Demo2/src/generated/models/Office365UsersModel.ts +254 -0
- package/examples/outlook Demo2/src/generated/services/Office365GroupsService.ts +326 -0
- package/examples/outlook Demo2/src/generated/services/Office365OutlookService.ts +2476 -0
- package/examples/outlook Demo2/src/generated/services/Office365UsersService.ts +358 -0
- package/examples/planning Poker/.vscode/settings.json +4 -4
- package/examples/planning Poker/additional files/customizations (tables).xml +6428 -6428
- package/examples/planning Poker/additional files/dataverse-tables.json +165 -165
- package/examples/planning Poker/additional files/readme.md +122 -122
- package/examples/planning Poker/dist/dataverse.js +78 -78
- package/examples/planning Poker/dist/index.html +198 -198
- package/examples/planning Poker/dist/index.js +954 -954
- package/examples/planning Poker/dist/power-apps-data.js +560 -138
- package/examples/planning Poker/dist/styles.css +815 -815
- package/examples/sharePoint Demo/agent/decision-log.md +5 -5
- package/examples/sharePoint Demo/dist/codeapp.js +1085 -0
- package/examples/sharePoint Demo/dist/index.js +44 -51
- package/examples/sharePoint Demo/dist/power-apps-data.js +551 -170
- package/examples/sharePoint Demo/power.config.json +22 -22
- 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/dataverse.js +64 -64
- package/examples/todo/dist/index.html +75 -75
- package/examples/todo/dist/index.js +8 -8
- package/examples/todo/dist/power-apps-data.js +560 -138
- package/examples/todo/dist/renderer.js +375 -375
- package/examples/todo/dist/styles.css +691 -691
- package/examples/todo/power.config.json +34 -34
- package/package.json +1 -8
- package/docs-mockups/atelier/index.html +0 -120
- package/docs-mockups/atelier/script.js +0 -23
- package/docs-mockups/atelier/styles.css +0 -361
- package/docs-mockups/field-guide/index.html +0 -112
- package/docs-mockups/field-guide/script.js +0 -20
- package/docs-mockups/field-guide/styles.css +0 -272
- package/docs-mockups/index.html +0 -80
- package/docs-mockups/maker-hub/index.html +0 -178
- package/docs-mockups/maker-hub/script.js +0 -20
- package/docs-mockups/maker-hub/styles.css +0 -404
- package/docs-mockups/script.js +0 -26
- package/docs-mockups/signal/index.html +0 -146
- package/docs-mockups/signal/script.js +0 -20
- package/docs-mockups/signal/styles.css +0 -314
- package/docs-mockups/styles.css +0 -287
- 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
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
|
|
2
|
-
import { getItemsByName, getItems, listTables } from './
|
|
2
|
+
import { getItemsByName, getItems, listTables } from './codeapp.js';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
let sSiteUrl = '<SITE_URL>';
|
|
5
|
+
let sListName = '<LIST_NAME>';
|
|
6
|
+
let iTopRows = 20;
|
|
7
7
|
|
|
8
8
|
function getElementById(sId) {
|
|
9
9
|
return document.getElementById(sId);
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
function setStatus(sMessage, bIsError = false) {
|
|
13
|
-
|
|
13
|
+
let eStatusBar = getElementById('statusBar');
|
|
14
14
|
|
|
15
15
|
if (!eStatusBar) {
|
|
16
16
|
return;
|
|
@@ -22,7 +22,7 @@ function setStatus(sMessage, bIsError = false) {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
function hideStatus() {
|
|
25
|
-
|
|
25
|
+
let eStatusBar = getElementById('statusBar');
|
|
26
26
|
|
|
27
27
|
if (!eStatusBar) {
|
|
28
28
|
return;
|
|
@@ -32,20 +32,20 @@ function hideStatus() {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
function setMetaLabels(iRowCount) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
let eSiteLabel = getElementById('siteLabel');
|
|
36
|
+
let eListLabel = getElementById('listLabel');
|
|
37
|
+
let eCountLabel = getElementById('countLabel');
|
|
38
38
|
|
|
39
39
|
if (eSiteLabel) {
|
|
40
|
-
eSiteLabel.textContent =
|
|
40
|
+
eSiteLabel.textContent = 'Site: ' + sSiteUrl;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
if (eListLabel) {
|
|
44
|
-
eListLabel.textContent =
|
|
44
|
+
eListLabel.textContent = 'List: ' + sListName;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
if (eCountLabel) {
|
|
48
|
-
eCountLabel.textContent =
|
|
48
|
+
eCountLabel.textContent = 'Rows: ' + iRowCount;
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
|
|
@@ -74,7 +74,7 @@ function isRenderableValue(value) {
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
function getVisibleColumns(aRows) {
|
|
77
|
-
|
|
77
|
+
let aIgnoredColumns = [
|
|
78
78
|
'@odata.etag',
|
|
79
79
|
'Attachments',
|
|
80
80
|
'ContentTypeId',
|
|
@@ -83,11 +83,11 @@ function getVisibleColumns(aRows) {
|
|
|
83
83
|
'odata.editLink'
|
|
84
84
|
];
|
|
85
85
|
|
|
86
|
-
|
|
86
|
+
let aColumns = [];
|
|
87
87
|
|
|
88
88
|
aRows.forEach((oRow) => {
|
|
89
89
|
Object.keys(oRow || {}).forEach((sKey) => {
|
|
90
|
-
|
|
90
|
+
let bIgnored =
|
|
91
91
|
aIgnoredColumns.includes(sKey) ||
|
|
92
92
|
sKey.indexOf('@odata') === 0 ||
|
|
93
93
|
sKey.indexOf('_') === 0;
|
|
@@ -107,7 +107,7 @@ function getVisibleColumns(aRows) {
|
|
|
107
107
|
|
|
108
108
|
function formatCellValue(value) {
|
|
109
109
|
if (value === null || value === undefined || value === '') {
|
|
110
|
-
return '
|
|
110
|
+
return '\u2014';
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
if (typeof value === 'boolean') {
|
|
@@ -118,10 +118,10 @@ function formatCellValue(value) {
|
|
|
118
118
|
}
|
|
119
119
|
|
|
120
120
|
function renderTable(aRows) {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
121
|
+
let eTable = getElementById('listTable');
|
|
122
|
+
let eTableHead = getElementById('tableHead');
|
|
123
|
+
let eTableBody = getElementById('tableBody');
|
|
124
|
+
let eEmptyState = getElementById('emptyState');
|
|
125
125
|
|
|
126
126
|
if (!eTable || !eTableHead || !eTableBody || !eEmptyState) {
|
|
127
127
|
return;
|
|
@@ -136,7 +136,7 @@ function renderTable(aRows) {
|
|
|
136
136
|
return;
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
-
|
|
139
|
+
let aColumns = getVisibleColumns(aRows);
|
|
140
140
|
|
|
141
141
|
if (!aColumns.length) {
|
|
142
142
|
eTable.hidden = true;
|
|
@@ -145,10 +145,10 @@ function renderTable(aRows) {
|
|
|
145
145
|
return;
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
-
|
|
148
|
+
let eHeaderRow = document.createElement('tr');
|
|
149
149
|
|
|
150
150
|
aColumns.forEach((sColumn) => {
|
|
151
|
-
|
|
151
|
+
let eHeaderCell = document.createElement('th');
|
|
152
152
|
eHeaderCell.textContent = sColumn;
|
|
153
153
|
eHeaderRow.appendChild(eHeaderCell);
|
|
154
154
|
});
|
|
@@ -156,10 +156,10 @@ function renderTable(aRows) {
|
|
|
156
156
|
eTableHead.appendChild(eHeaderRow);
|
|
157
157
|
|
|
158
158
|
aRows.forEach((oRow) => {
|
|
159
|
-
|
|
159
|
+
let eBodyRow = document.createElement('tr');
|
|
160
160
|
|
|
161
161
|
aColumns.forEach((sColumn) => {
|
|
162
|
-
|
|
162
|
+
let eBodyCell = document.createElement('td');
|
|
163
163
|
eBodyCell.textContent = formatCellValue(oRow[sColumn]);
|
|
164
164
|
eBodyRow.appendChild(eBodyCell);
|
|
165
165
|
});
|
|
@@ -176,26 +176,19 @@ function normalizeText(value) {
|
|
|
176
176
|
}
|
|
177
177
|
|
|
178
178
|
function getListIdentifier(oList) {
|
|
179
|
-
return
|
|
180
|
-
|
|
181
|
-
oList?.name ||
|
|
182
|
-
oList?.Id ||
|
|
183
|
-
oList?.id ||
|
|
184
|
-
oList?.TableName ||
|
|
185
|
-
oList?.tableName ||
|
|
186
|
-
''
|
|
187
|
-
);
|
|
179
|
+
if (!oList) return '';
|
|
180
|
+
return oList.Name || oList.name || oList.Id || oList.id || oList.TableName || oList.tableName || '';
|
|
188
181
|
}
|
|
189
182
|
|
|
190
183
|
function matchesListName(oList) {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
oList
|
|
194
|
-
oList
|
|
195
|
-
oList
|
|
196
|
-
oList
|
|
197
|
-
oList
|
|
198
|
-
oList
|
|
184
|
+
let sTarget = normalizeText(sListName);
|
|
185
|
+
let aCandidates = [
|
|
186
|
+
oList ? oList.DisplayName : null,
|
|
187
|
+
oList ? oList.displayName : null,
|
|
188
|
+
oList ? oList.Title : null,
|
|
189
|
+
oList ? oList.title : null,
|
|
190
|
+
oList ? oList.Name : null,
|
|
191
|
+
oList ? oList.name : null
|
|
199
192
|
]
|
|
200
193
|
.filter(Boolean)
|
|
201
194
|
.map((value) => normalizeText(value));
|
|
@@ -204,28 +197,28 @@ function matchesListName(oList) {
|
|
|
204
197
|
}
|
|
205
198
|
|
|
206
199
|
async function loadRowsByListName() {
|
|
207
|
-
|
|
200
|
+
let oResult = await getItemsByName(sSiteUrl, sListName, { top: iTopRows });
|
|
208
201
|
return normalizeResultArray(oResult).slice(0, iTopRows);
|
|
209
202
|
}
|
|
210
203
|
|
|
211
204
|
async function loadRowsByResolvedListId() {
|
|
212
205
|
setStatus('List name lookup failed. Trying connector table lookup...');
|
|
213
206
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
207
|
+
let oTablesResult = await listTables(sSiteUrl);
|
|
208
|
+
let aLists = normalizeResultArray(oTablesResult);
|
|
209
|
+
let oMatchedList = aLists.find((oList) => matchesListName(oList));
|
|
210
|
+
let sResolvedListId = getListIdentifier(oMatchedList);
|
|
218
211
|
|
|
219
212
|
if (!sResolvedListId) {
|
|
220
|
-
throw new Error(
|
|
213
|
+
throw new Error('List \'' + sListName + '\' was not found in connector metadata.');
|
|
221
214
|
}
|
|
222
215
|
|
|
223
|
-
|
|
216
|
+
let oItemsResult = await getItems(sSiteUrl, sResolvedListId, { top: iTopRows });
|
|
224
217
|
return normalizeResultArray(oItemsResult).slice(0, iTopRows);
|
|
225
218
|
}
|
|
226
219
|
|
|
227
220
|
function shouldTryFallback(oError) {
|
|
228
|
-
|
|
221
|
+
let sMessage = oError && oError.message ? oError.message : String(oError);
|
|
229
222
|
return sMessage.indexOf('404') >= 0 || sMessage.indexOf('Resource not found') >= 0;
|
|
230
223
|
}
|
|
231
224
|
|
|
@@ -261,7 +254,7 @@ async function boot() {
|
|
|
261
254
|
try {
|
|
262
255
|
await loadSharePointRows();
|
|
263
256
|
} catch (oErr) {
|
|
264
|
-
|
|
257
|
+
let sMessage = oErr && oErr.message ? oErr.message : String(oErr);
|
|
265
258
|
setStatus('SharePoint: ' + sMessage, true);
|
|
266
259
|
}
|
|
267
260
|
}
|