From a70c610e50d16eb01fb4fc8465c512546334537a Mon Sep 17 00:00:00 2001 From: Eduardo Peredo Date: Tue, 31 Mar 2026 18:34:35 -0500 Subject: [PATCH 1/6] update d2-api types and new sharing permission object --- jest.config.js | 2 +- package.json | 2 +- .../tasks/03.add-role-mer-approver.ts | 4 +- src/models/Config.ts | 5 +- src/models/CountryDashboard.ts | 4 +- src/models/Dashboard.ts | 9 +- src/models/ProjectDashboard.ts | 10 +- src/models/ProjectDb.ts | 12 +- src/models/ProjectNotification.ts | 23 +- src/models/ProjectSharing.ts | 44 +- src/models/ProjectsList.ts | 5 +- src/models/ProjectsListDashboard.ts | 16 +- src/models/Sharing.ts | 55 +- src/models/__tests__/Project.spec.ts | 18 +- src/models/__tests__/ProjectDb.spec.ts | 7 +- .../__tests__/data/awardNumber-metadata.json | 53 +- .../__tests__/data/country-metadata.json | 53 +- .../__tests__/data/project-db-metadata.json | 2420 ++++++++++------- .../__tests__/data/project-metadata.json | 46 +- src/models/__tests__/mer-data.ts | 4 +- src/types/d2-api.ts | 7 +- src/utils/tests.ts | 11 +- yarn.lock | 309 +-- 23 files changed, 1741 insertions(+), 1378 deletions(-) diff --git a/jest.config.js b/jest.config.js index 273511fa..25c22017 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,7 +1,7 @@ module.exports = { collectCoverageFrom: ["src/**/*.js"], testPathIgnorePatterns: ["/node_modules/", "/cypress"], - transformIgnorePatterns: ["/node_modules/(?!@eyeseetea/d2-ui-components)"], + transformIgnorePatterns: ["node_modules/(?!@eyeseetea/d2-ui-components|@eyeseetea/d2-api|axios)"], modulePaths: ["src"], moduleDirectories: ["node_modules"], moduleNameMapper: { diff --git a/package.json b/package.json index 2111ca69..f6981dbd 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "@dhis2/d2-ui-forms": "^6.5.3", "@dhis2/ui": "6.12.0", "@dhis2/ui-core": "^4.8.0", - "@eyeseetea/d2-api": "1.16.0-beta.13", + "@eyeseetea/d2-api": "1.21.0-beta.5", "@eyeseetea/d2-ui-components": "2.7.0", "@eyeseetea/feedback-component": "0.1.2", "@krakenjs/post-robot": "^11.0.0", diff --git a/src/migrations/tasks/03.add-role-mer-approver.ts b/src/migrations/tasks/03.add-role-mer-approver.ts index fb43ace5..d04bfa71 100644 --- a/src/migrations/tasks/03.add-role-mer-approver.ts +++ b/src/migrations/tasks/03.add-role-mer-approver.ts @@ -1,4 +1,4 @@ -import { D2Api, D2UserAuthorityGroup } from "../../types/d2-api"; +import { D2Api, D2UserRole } from "../../types/d2-api"; import { Debug, Migration } from "../types"; import { getUid } from "../../utils/dhis2"; import { post } from "./common"; @@ -11,7 +11,7 @@ class AddRoleMerApproverMigration { } async createUserRole() { - const role: Partial = { + const role: Partial = { id: getUid("userRole", "mer-approver"), name: "MER Approver", authorities: [ diff --git a/src/models/Config.ts b/src/models/Config.ts index c7f42947..b7f24dd2 100644 --- a/src/models/Config.ts +++ b/src/models/Config.ts @@ -320,7 +320,7 @@ class ConfigLoader { const metadata: Metadata = await this.api.metadata.get(metadataParams).getData(); const d2CurrentUser = await this.getCurrentUser(); const { funders, locations } = getFundersAndLocations(metadata); - const { userRoles, username } = d2CurrentUser.userCredentials; + const { userRoles, username } = d2CurrentUser; const currentUser: Config["currentUser"] = { ...d2CurrentUser, userRoles, username }; const dataElementsMetadata = await this.getDataElementsMetadata(currentUser, metadata); const categoryCombos = indexObjects(metadata, "categoryCombos"); @@ -370,7 +370,8 @@ class ConfigLoader { fields: { id: true, displayName: true, - userCredentials: { username: true, userRoles: { name: true } }, + username: true, + userRoles: { name: true }, organisationUnits: { id: true, displayName: true, level: true }, authorities: true, }, diff --git a/src/models/CountryDashboard.ts b/src/models/CountryDashboard.ts index a6958ee5..32ca2d10 100644 --- a/src/models/CountryDashboard.ts +++ b/src/models/CountryDashboard.ts @@ -125,7 +125,7 @@ export default class CountryDashboard { id: getUid("country-dashboard", country.id), name: country.name, dashboardItems: positionItems(items, positionItemsOptions), - ...this.getSharing(), + sharing: this.getSharing(), }; const countryUpdated = addAttributeValueToObj(d2Country, { @@ -243,7 +243,7 @@ export default class CountryDashboard { getSharing(): Partial { return { - publicAccess: getD2Access({ meta: { read: true, write: true } }), + public: getD2Access({ meta: { read: true, write: true } }), }; } } diff --git a/src/models/Dashboard.ts b/src/models/Dashboard.ts index 87732c97..dd4e8b92 100644 --- a/src/models/Dashboard.ts +++ b/src/models/Dashboard.ts @@ -90,12 +90,11 @@ export function getD2Visualization(visualization: Visualization): MaybeD2Visuali type: visualization.type === "table" ? "PIVOT_TABLE" : visualization.chartType || "COLUMN", name: visualization.name, numberType: "VALUE", - legendDisplayStyle: "FILL", rowSubTotals: true, showDimensionLabels: true, showData: true, aggregationType: "DEFAULT", - legendDisplayStrategy: "FIXED", + legend: { strategy: "FIXED", style: "FILL", showKey: false }, rowTotals: visualization.rowTotals ?? true, digitGroupSeparator: "SPACE", dataDimensionItems, @@ -109,7 +108,7 @@ export function getD2Visualization(visualization: Visualization): MaybeD2Visuali rows: visualization.rows, rowDimensions: visualization.rows.map(dimension => dimension.id), categoryDimensions: getCategoryDimensions(categoryDimensions), - ...visualization.sharing, + sharing: visualization.sharing, }; return _.merge({}, d2Table, visualization.extra || {}); @@ -135,7 +134,7 @@ export function getReportTableItem( if (!reportTable) return null; return { id: getUid("dashboardItem", reportTable.id), - type: "REPORT_TABLE" as const, + type: "VISUALIZATION" as const, visualization: { id: reportTable.id }, ...(dashboardItemAttributes || {}), }; @@ -148,7 +147,7 @@ export function getChartDashboardItem( if (!chart) return null; return { id: getUid("dashboardItem", chart.id), - type: "CHART" as const, + type: "VISUALIZATION" as const, visualization: { id: chart.id }, ...(dashboardItemAttributes || {}), }; diff --git a/src/models/ProjectDashboard.ts b/src/models/ProjectDashboard.ts index 8dff4270..327c72a1 100644 --- a/src/models/ProjectDashboard.ts +++ b/src/models/ProjectDashboard.ts @@ -125,7 +125,7 @@ export default class ProjectDashboard { id: getUid("dashboard", projectsListDashboard.id), name: projectsListDashboard.name, dashboardItems: positionItems(items, positionItemsOptions), - ...new ProjectSharing(config, projectsListDashboard).getSharingAttributesForDashboard(), + sharing: new ProjectSharing(config, projectsListDashboard).getSharingAttributesForDashboard(), }; return { dashboards: [dashboard], visualizations }; @@ -643,7 +643,7 @@ export default class ProjectDashboard { filters: [dimensions.orgUnit], columns: [dimensions.period], rows: [dimensions.data], - extra: { legendSet: config.legendSets.achieved }, + extra: { legend: { set: config.legendSets.achieved } }, ...options, }); } @@ -660,7 +660,7 @@ export default class ProjectDashboard { filters: [dimensions.orgUnit], columns: [dimensions.period], rows: [dimensions.data], - extra: { legendSet: config.legendSets.achieved }, + extra: { legend: { set: config.legendSets.achieved } }, rowTotals: false, }); } @@ -678,7 +678,7 @@ export default class ProjectDashboard { filters: [dimensions.orgUnit, dimensions.period], columns: [this.categoryOnlyNew], rows: [dimensions.data], - extra: { legendSet: config.legendSets.achieved }, + extra: { legend: { set: config.legendSets.achieved } }, rowTotals: false, ...options, }); @@ -701,7 +701,7 @@ export default class ProjectDashboard { filters: [dimensions.orgUnit, dimensions.period], columns: [this.categoryOnlyNew], rows: [dimensions.data], - extra: { legendSet: config.legendSets.achieved }, + extra: { legend: { set: config.legendSets.achieved } }, rowTotals: false, }); } diff --git a/src/models/ProjectDb.ts b/src/models/ProjectDb.ts index d26b054e..fb67fbb9 100644 --- a/src/models/ProjectDb.ts +++ b/src/models/ProjectDb.ts @@ -469,7 +469,7 @@ export default class ProjectDb { const dataSetAttrs = { ...dbDataSet, ...attrs, id: dbDataSet.id }; const res = await this.api.models.dataSets.put(dataSetAttrs).getData(); - if (res.status !== "OK") throw new Error("Error saving data set"); + if (res.errorReports && res.errorReports.length > 0) throw new Error("Error saving data set"); } } @@ -586,7 +586,7 @@ export default class ProjectDb { const res = await api.models.dataSets.put(dataSetUpdated).getData(); - if (res.status !== "OK") console.error("Error saving data set"); + if (res.errorReports && res.errorReports.length > 0) console.error("Error saving data set"); } } @@ -663,7 +663,7 @@ export default class ProjectDb { sections: sections.map(section => ({ id: section.id, code: section.code })), dataSetElements, code: `${orgUnit.id}_${baseDataSet.code}`, - ...projectSharing.getSharingAttributesForDataSets(), + sharing: projectSharing.getSharingAttributesForDataSets(), }; return { dataSets: [dataSet], sections }; @@ -1244,8 +1244,6 @@ export const dataSetFields = { sections: { code: true, dataElements: { id: true } }, openFuturePeriods: true, expiryDays: true, - publicAccess: true, - externalAccess: true, - userAccesses: { id: true, displayName: true, access: true }, - userGroupAccesses: { id: true, displayName: true, access: true }, + sharing: { public: true, external: true, users: true, userGroups: true }, + access: { read: true, write: true, data: true }, } as const; diff --git a/src/models/ProjectNotification.ts b/src/models/ProjectNotification.ts index b3916b9a..5400986c 100644 --- a/src/models/ProjectNotification.ts +++ b/src/models/ProjectNotification.ts @@ -26,14 +26,14 @@ export class ProjectNotification { const { users: usersInGroup } = await api.metadata .get({ users: { - fields: { email: true, userCredentials: { disabled: true } }, + fields: { email: true, disabled: true }, filter: { "userGroups.code": { eq: groupCode } }, }, }) .getData(); const users = _(usersInGroup) - .reject(user => user.userCredentials.disabled) + .reject(user => user.disabled) .value(); return _(appConfig.app.notifyEmailOnProjectSave) @@ -63,7 +63,7 @@ export class ProjectNotification { users: { email: true, id: true, - userCredentials: { disabled: true }, + disabled: true, userGroups: { id: true, name: true, @@ -75,11 +75,7 @@ export class ProjectNotification { dataSets: { fields: { id: true, - userGroupAccesses: { - id: true, - displayName: true, - }, - userAccesses: { id: true }, + sharing: { public: true, external: true, users: true, userGroups: true }, }, filter: { id: { in: [id] } }, }, @@ -104,20 +100,21 @@ export class ProjectNotification { const users = _(res.userRoles) .flatMap(userRole => userRole.users) - .reject(user => user.userCredentials.disabled) + .reject(user => user.disabled) .value(); + const sharingUsers = dataSet.sharing.users || {}; + const sharingUserGroups = dataSet.sharing.userGroups || {}; + const userAccessEmails = users .filter(user => { - return dataSet.userAccesses.some(userAccess => { - return userAccess.id === user.id; - }); + return sharingUsers[user.id] !== undefined; }) .map(user => user.email); const userGroupEmails = users .filter(user => { - return dataSet.userGroupAccesses + return Object.values(sharingUserGroups) .filter(ug => ug.displayName.includes("Country Admin")) .some(userGroupAccess => { return user.userGroups.some(userGroup => { diff --git a/src/models/ProjectSharing.ts b/src/models/ProjectSharing.ts index 8ce3c165..635cd118 100644 --- a/src/models/ProjectSharing.ts +++ b/src/models/ProjectSharing.ts @@ -8,7 +8,7 @@ import { D2SharingUpdate, mergeSharing, D2Sharing, - getD2EntitiesAccess, + getD2SharingMap, fullAccess, fullMetadataAccess, getEntitiesAccess, @@ -63,10 +63,10 @@ export default class ProjectSharing { const { userAccesses, userGroupAccesses } = this.project.sharing; return { - publicAccess: "--------", - externalAccess: false, - userAccesses: getD2EntitiesAccess(userAccesses, fullAccess), - userGroupAccesses: getD2EntitiesAccess(userGroupAccesses, fullAccess), + public: "--------", + external: false, + users: getD2SharingMap(userAccesses, fullAccess), + userGroups: getD2SharingMap(userGroupAccesses, fullAccess), }; } @@ -74,10 +74,10 @@ export default class ProjectSharing { const { userAccesses, userGroupAccesses } = this.project.sharing; return { - publicAccess: "--------", - externalAccess: false, - userAccesses: getD2EntitiesAccess(userAccesses, fullMetadataAccess), - userGroupAccesses: getD2EntitiesAccess(userGroupAccesses, fullMetadataAccess), + public: "--------", + external: false, + users: getD2SharingMap(userAccesses, fullMetadataAccess), + userGroups: getD2SharingMap(userGroupAccesses, fullMetadataAccess), }; } @@ -91,13 +91,15 @@ export default class ProjectSharing { }, object: { id: project.id, - publicAccess: "--------", - externalAccess: false, - userAccesses: getD2EntitiesAccess(project.sharing.userAccesses, fullAccess), - userGroupAccesses: getD2EntitiesAccess( - project.sharing.userGroupAccesses, - fullAccess - ), + sharing: { + public: "--------", + external: false, + users: getD2SharingMap(project.sharing.userAccesses, fullAccess), + userGroups: getD2SharingMap( + project.sharing.userGroupAccesses, + fullAccess + ), + }, }, }; } @@ -149,11 +151,13 @@ export default class ProjectSharing { } } -type D2DataSetAccess = D2DataSetSchema["fields"]["access"] & { - data?: { read: boolean; write: boolean }; // Currently not in d2-api, add manually -}; +interface D2DataSetAccessFields { + read: boolean; + write: boolean; + data?: { read: boolean; write: boolean }; +} -export function hasCurrentUserFullAccessToDataSet(shareable: { access: D2DataSetAccess }): boolean { +export function hasCurrentUserFullAccessToDataSet(shareable: { access: D2DataSetAccessFields }): boolean { const { access } = shareable; const metadataAccess = access.read && access.write; const dataAccess = access.data ? access.data.read && access.data.write : true; diff --git a/src/models/ProjectsList.ts b/src/models/ProjectsList.ts index 2a7d5466..2d79c79d 100644 --- a/src/models/ProjectsList.ts +++ b/src/models/ProjectsList.ts @@ -103,9 +103,8 @@ export default class ProjectsList { fields: { code: true, sections: { code: true }, - userAccesses: { id: true, displayName: true, access: true }, - userGroupAccesses: { id: true, displayName: true, access: true }, - access: true, + sharing: { public: true, external: true, users: true, userGroups: true }, + access: { read: true, write: true, data: true }, attributeValues: { attribute: { id: true }, value: true }, }, // When there are many projects, this results in a 414 error, filter on the response. diff --git a/src/models/ProjectsListDashboard.ts b/src/models/ProjectsListDashboard.ts index 84a8ba69..cb686302 100644 --- a/src/models/ProjectsListDashboard.ts +++ b/src/models/ProjectsListDashboard.ts @@ -60,10 +60,7 @@ const query = { id: true, code: true, dataInputPeriods: { period: { id: true } }, - publicAccess: true, - externalAccess: true, - userAccesses: { id: true, access: true, displayName: true }, - userGroupAccesses: { id: true, access: true, displayName: true }, + sharing: { public: true, external: true, users: true, userGroups: true }, dataSetElements: { dataElement: { id: true, @@ -189,13 +186,14 @@ async function getMetadata(api: D2Api, condition: Condition): Promise { + // TODO: Further research on "ghosts users" + // there're some references to non-existing users in some dataSets + // sharing.users may contain ids of users that don't exist but without displayName. + // As a temporal fix we're filtering out those users. + const filteredUsers = _.pickBy(d2DataSet.sharing.users, user => user.displayName); return { ...d2DataSet, - // TODO: Further research on "ghosts users" - // there're some references to non-existing users in some dataSets - // userAccesses is returning ids of users that don't exist but without displayName. - // As a temporal fix we're filtering out those users. - userAccesses: d2DataSet.userAccesses.filter(userAccess => userAccess.displayName), + sharing: { ...d2DataSet.sharing, users: filteredUsers }, }; }), }; diff --git a/src/models/Sharing.ts b/src/models/Sharing.ts index 2d0034b4..ae7a0a14 100644 --- a/src/models/Sharing.ts +++ b/src/models/Sharing.ts @@ -2,21 +2,26 @@ import _ from "lodash"; export type D2Access = string; -export interface D2Sharing { - publicAccess: D2Access; - externalAccess: boolean; - userAccesses: D2EntityAccess[]; - userGroupAccesses: D2EntityAccess[]; -} - -export type D2SharingUpdate = Partial; - export interface D2EntityAccess { access: D2Access; displayName: string; id: string; } +export type D2SharingMap = Record; + +export interface D2Sharing { + public: D2Access; + external: boolean; + users: D2SharingMap; + userGroups: D2SharingMap; +} + +export type D2SharingUpdate = Partial<{ + userAccesses: D2EntityAccess[]; + userGroupAccesses: D2EntityAccess[]; +}>; + export interface Sharing { userAccesses: EntityAccess[]; userGroupAccesses: EntityAccess[]; @@ -46,15 +51,19 @@ export const emptySharing: Sharing = { userGroupAccesses: [], }; -export function getD2EntitiesAccess( +export function getD2SharingMap( entitySharings: EntityAccess[], access: Access -): D2EntityAccess[] { - return entitySharings.map(entitySharing => ({ - id: entitySharing.id, - displayName: entitySharing.name, - access: getD2Access(access), - })); +): D2SharingMap { + const result: D2SharingMap = {}; + entitySharings.forEach(entitySharing => { + result[entitySharing.id] = { + id: entitySharing.id, + displayName: entitySharing.name, + access: getD2Access(access), + }; + }); + return result; } export function getD2Access(d2Access: Access): D2Access { @@ -74,9 +83,17 @@ export function getEntitiesAccess(d2EntitySharings: D2EntityAccess[]): EntityAcc })); } -export function getSharing(object: Partial): Sharing { - const userAccesses = getEntitiesAccess(object.userAccesses || []); - const userGroupAccesses = getEntitiesAccess(object.userGroupAccesses || []); +export function getEntitiesAccessFromMap(d2SharingMap: D2SharingMap): EntityAccess[] { + return Object.values(d2SharingMap).map(ref => ({ + id: ref.id, + name: ref.displayName, + })); +} + +export function getSharing(object: { sharing?: Partial }): Sharing { + const sharing = object.sharing || {}; + const userAccesses = getEntitiesAccessFromMap(sharing.users || {}); + const userGroupAccesses = getEntitiesAccessFromMap(sharing.userGroups || {}); return { userAccesses, userGroupAccesses }; } diff --git a/src/models/__tests__/Project.spec.ts b/src/models/__tests__/Project.spec.ts index f1aace4c..16f2baf0 100644 --- a/src/models/__tests__/Project.spec.ts +++ b/src/models/__tests__/Project.spec.ts @@ -442,7 +442,7 @@ describe("Project", () => { mock.onGet("/metadata", { params: { "dataSets:fields": - "access,attributeValues[attribute[id],value],code,sections[code],userAccesses[access,displayName,id],userGroupAccesses[access,displayName,id]", + "access[data,read,write],attributeValues[attribute[id],value],code,sections[code],sharing[external,public,userGroups,users]", "dataSets:filter": ["code:like$:_ACTUAL"], "organisationUnitGroupSets:fields": "id,organisationUnitGroups[id,organisationUnits[id]]", @@ -457,6 +457,7 @@ describe("Project", () => { { code: "SECTOR_AGRICULTURE_ds3", dataElements: [{ id: "de1" }] }, ], access: fullAccess, + sharing: { public: "--------", external: false, users: {}, userGroups: {} }, attributeValues: [], }, { @@ -466,6 +467,7 @@ describe("Project", () => { { code: "SECTOR_AGRICULTURE_ds5", dataElements: [{ id: "de2" }] }, ], access: metadataAccess, + sharing: { public: "--------", external: false, users: {}, userGroups: {} }, attributeValues: [], }, ], @@ -564,10 +566,8 @@ const metadataForGet = { { code: "R3rGhxWbAI9_ACTUAL", id: "imYbEtdoQZx", - publicAccess: "--------", - externalAccess: false, - userAccesses: [], - userGroupAccesses: [], + sharing: { public: "--------", external: false, users: {}, userGroups: {} }, + access: { read: true, write: true, data: { read: true, write: true } }, dataSetElements: [ { categoryCombo: { @@ -619,10 +619,8 @@ const metadataForGet = { { code: "R3rGhxWbAI9_TARGET", id: "KC6gi00Jm6H", - publicAccess: "--------", - externalAccess: false, - userAccesses: [], - userGroupAccesses: [], + sharing: { public: "--------", external: false, users: {}, userGroups: {} }, + access: { read: true, write: true, data: { read: true, write: true } }, dataSetElements: [ { categoryCombo: { @@ -683,7 +681,7 @@ async function getProject(): Promise { "attributeValues[attribute[id],value],closedDate,code,created,description,displayName,id,name,openingDate,organisationUnitGroups[attributeValues[attribute[id],value],groupSets[id],id,name],parent[attributeValues[attribute[id],value],displayName,id,name,path],path", "organisationUnits:filter": ["id:eq:R3rGhxWbAI9"], "dataSets:fields": - "code,dataInputPeriods[closingDate,openingDate,period],dataSetElements[categoryCombo[categoryOptionCombos[id],id],dataElement[id]],expiryDays,externalAccess,id,openFuturePeriods,publicAccess,sections[code,dataElements[id]],userAccesses[access,displayName,id],userGroupAccesses[access,displayName,id]", + "access[data,read,write],code,dataInputPeriods[closingDate,openingDate,period],dataSetElements[categoryCombo[categoryOptionCombos[id],id],dataElement[id]],expiryDays,id,openFuturePeriods,sections[code,dataElements[id]],sharing[external,public,userGroups,users]", "dataSets:filter": ["code:$like:R3rGhxWbAI9"], }, }).replyOnce(200, metadataForGet); diff --git a/src/models/__tests__/ProjectDb.spec.ts b/src/models/__tests__/ProjectDb.spec.ts index 1aaa1799..bd205328 100644 --- a/src/models/__tests__/ProjectDb.spec.ts +++ b/src/models/__tests__/ProjectDb.spec.ts @@ -12,6 +12,7 @@ const { api, mock } = getMockApi(); const metadataResponse = { status: "OK", stats: { created: 0, updated: 0, deleted: 0, ignored: 0, total: 0 }, + typeReports: [], }; const dataStoreUpdateResponse = { @@ -54,7 +55,7 @@ describe("ProjectDb", () => { "organisationUnits:fields": "children[id,name,parent],id,name,parent", "organisationUnits:filter": ["id:eq:WGC0DJ0YSis"], "dataSets:fields": - "code,dataInputPeriods[period[id]],dataSetElements[dataElement[attributeValues[attribute[id],value],code,dataElementGroups[code],id,name]],externalAccess,id,publicAccess,userAccesses[access,displayName,id],userGroupAccesses[access,displayName,id]", + "code,dataInputPeriods[period[id]],dataSetElements[dataElement[attributeValues[attribute[id],value],code,dataElementGroups[code],id,name]],id,sharing[external,public,userGroups,users]", "dataSets:filter": [ "code:like$:_ACTUAL", "organisationUnits.path:like:WGC0DJ0YSis", @@ -69,7 +70,7 @@ describe("ProjectDb", () => { "organisationUnits:fields": "children[id,name,parent],id,name,parent", "organisationUnits:filter": ["id:eq:eu2XF73JOzl"], "dataSets:fields": - "code,dataInputPeriods[period[id]],dataSetElements[dataElement[attributeValues[attribute[id],value],code,dataElementGroups[code],id,name]],externalAccess,id,publicAccess,userAccesses[access,displayName,id],userGroupAccesses[access,displayName,id]", + "code,dataInputPeriods[period[id]],dataSetElements[dataElement[attributeValues[attribute[id],value],code,dataElementGroups[code],id,name]],id,sharing[external,public,userGroups,users]", "dataSets:filter": [ "code:like$:_ACTUAL", "organisationUnits.path:like:eu2XF73JOzl", @@ -84,7 +85,7 @@ describe("ProjectDb", () => { "organisationUnits:fields": "children[id,name,parent],id,name,parent", "organisationUnits:filter": ["code:$like:12345"], "dataSets:fields": - "code,dataInputPeriods[period[id]],dataSetElements[dataElement[attributeValues[attribute[id],value],code,dataElementGroups[code],id,name]],externalAccess,id,publicAccess,userAccesses[access,displayName,id],userGroupAccesses[access,displayName,id]", + "code,dataInputPeriods[period[id]],dataSetElements[dataElement[attributeValues[attribute[id],value],code,dataElementGroups[code],id,name]],id,sharing[external,public,userGroups,users]", "dataSets:filter": ["code:like$:_ACTUAL", "organisationUnits.code:$like:12345"], }, }).replyOnce(200, awardNumberMetadataResponse); diff --git a/src/models/__tests__/data/awardNumber-metadata.json b/src/models/__tests__/data/awardNumber-metadata.json index ed96ed05..f8e6f448 100644 --- a/src/models/__tests__/data/awardNumber-metadata.json +++ b/src/models/__tests__/data/awardNumber-metadata.json @@ -15,27 +15,6 @@ { "code": "cqZ9zQfePzQ_ACTUAL", "id": "yAOSOqcfHsi", - "publicAccess": "--------", - "externalAccess": false, - "userAccesses": [ - { - "id": "M5zQapPyTZI", - "displayName": "admin admin", - "access": "rwrw----" - } - ], - "userGroupAccesses": [ - { - "id": "ywuI2WspUUG", - "displayName": "System Admin", - "access": "rwrw----" - }, - { - "id": "mKKNXzeIAJs", - "displayName": "Data Management Admin", - "access": "rwrw----" - } - ], "dataSetElements": [ { "dataElement": { @@ -193,7 +172,30 @@ "closingDate": "2020-10-01T00:00:00.000", "openingDate": "2020-07-01T00:00:00.000" } - ] + ], + "sharing": { + "public": "--------", + "external": false, + "users": { + "M5zQapPyTZI": { + "id": "M5zQapPyTZI", + "displayName": "admin admin", + "access": "rwrw----" + } + }, + "userGroups": { + "ywuI2WspUUG": { + "id": "ywuI2WspUUG", + "displayName": "System Admin", + "access": "rwrw----" + }, + "mKKNXzeIAJs": { + "id": "mKKNXzeIAJs", + "displayName": "Data Management Admin", + "access": "rwrw----" + } + } + } }, { "code": "TvSmIyYcRnd_ACTUAL", @@ -408,7 +410,12 @@ "openingDate": "2020-09-01T00:00:00.000" } ], - "userAccesses": [] + "sharing": { + "public": "--------", + "external": false, + "users": {}, + "userGroups": {} + } } ] } diff --git a/src/models/__tests__/data/country-metadata.json b/src/models/__tests__/data/country-metadata.json index fce55073..6a57b315 100644 --- a/src/models/__tests__/data/country-metadata.json +++ b/src/models/__tests__/data/country-metadata.json @@ -20,27 +20,6 @@ { "code": "cqZ9zQfePzQ_ACTUAL", "id": "yAOSOqcfHsi", - "publicAccess": "--------", - "externalAccess": false, - "userAccesses": [ - { - "id": "M5zQapPyTZI", - "displayName": "admin admin", - "access": "rwrw----" - } - ], - "userGroupAccesses": [ - { - "id": "ywuI2WspUUG", - "displayName": "System Admin", - "access": "rwrw----" - }, - { - "id": "mKKNXzeIAJs", - "displayName": "Data Management Admin", - "access": "rwrw----" - } - ], "dataSetElements": [ { "dataElement": { @@ -198,7 +177,30 @@ "closingDate": "2020-10-01T00:00:00.000", "openingDate": "2020-07-01T00:00:00.000" } - ] + ], + "sharing": { + "public": "--------", + "external": false, + "users": { + "M5zQapPyTZI": { + "id": "M5zQapPyTZI", + "displayName": "admin admin", + "access": "rwrw----" + } + }, + "userGroups": { + "ywuI2WspUUG": { + "id": "ywuI2WspUUG", + "displayName": "System Admin", + "access": "rwrw----" + }, + "mKKNXzeIAJs": { + "id": "mKKNXzeIAJs", + "displayName": "Data Management Admin", + "access": "rwrw----" + } + } + } }, { "code": "TvSmIyYcRnd_ACTUAL", @@ -413,7 +415,12 @@ "openingDate": "2020-09-01T00:00:00.000" } ], - "userAccesses": [] + "sharing": { + "public": "--------", + "external": false, + "users": {}, + "userGroups": {} + } } ] } diff --git a/src/models/__tests__/data/project-db-metadata.json b/src/models/__tests__/data/project-db-metadata.json index 04872870..83ab3bb8 100644 --- a/src/models/__tests__/data/project-db-metadata.json +++ b/src/models/__tests__/data/project-db-metadata.json @@ -546,27 +546,29 @@ } } ], - "publicAccess": "--------", - "externalAccess": false, - "userAccesses": [ - { - "id": "M5zQapPyTZI", - "displayName": "admin admin", - "access": "rwrw----" - } - ], - "userGroupAccesses": [ - { - "id": "ywuI2WspUUG", - "displayName": "System Admin", - "access": "rwrw----" + "sharing": { + "public": "--------", + "external": false, + "users": { + "M5zQapPyTZI": { + "id": "M5zQapPyTZI", + "displayName": "admin admin", + "access": "rwrw----" + } }, - { - "id": "mKKNXzeIAJs", - "displayName": "Data Management Admin", - "access": "rwrw----" + "userGroups": { + "ywuI2WspUUG": { + "id": "ywuI2WspUUG", + "displayName": "System Admin", + "access": "rwrw----" + }, + "mKKNXzeIAJs": { + "id": "mKKNXzeIAJs", + "displayName": "Data Management Admin", + "access": "rwrw----" + } } - ] + } }, { "id": "CwUxT9UIX3z", @@ -967,27 +969,29 @@ } } ], - "publicAccess": "--------", - "externalAccess": false, - "userAccesses": [ - { - "id": "M5zQapPyTZI", - "displayName": "admin admin", - "access": "rwrw----" - } - ], - "userGroupAccesses": [ - { - "id": "ywuI2WspUUG", - "displayName": "System Admin", - "access": "rwrw----" + "sharing": { + "public": "--------", + "external": false, + "users": { + "M5zQapPyTZI": { + "id": "M5zQapPyTZI", + "displayName": "admin admin", + "access": "rwrw----" + } }, - { - "id": "mKKNXzeIAJs", - "displayName": "Data Management Admin", - "access": "rwrw----" + "userGroups": { + "ywuI2WspUUG": { + "id": "ywuI2WspUUG", + "displayName": "System Admin", + "access": "rwrw----" + }, + "mKKNXzeIAJs": { + "id": "mKKNXzeIAJs", + "displayName": "Data Management Admin", + "access": "rwrw----" + } } - ] + } } ], "dashboards": [ @@ -997,7 +1001,7 @@ "dashboardItems": [ { "id": "uOsjh5OmILO", - "type": "CHART", + "type": "VISUALIZATION", "visualization": { "id": "ywQZlYBN4nN" }, @@ -1008,7 +1012,7 @@ }, { "id": "mouU4wUzbJ3", - "type": "CHART", + "type": "VISUALIZATION", "visualization": { "id": "q0Arl96SxH5" }, @@ -1019,7 +1023,7 @@ }, { "id": "WQwlyfCElo8", - "type": "CHART", + "type": "VISUALIZATION", "visualization": { "id": "yWq2ZBWiK8T" }, @@ -1030,7 +1034,7 @@ }, { "id": "imK8xQLwwYX", - "type": "CHART", + "type": "VISUALIZATION", "visualization": { "id": "uYWdSMZQ1LH" }, @@ -1041,7 +1045,7 @@ }, { "id": "Ka4yijY2Vhl", - "type": "REPORT_TABLE", + "type": "VISUALIZATION", "visualization": { "id": "i07AWJAND8a" }, @@ -1052,7 +1056,7 @@ }, { "id": "yWGKgz9vaOh", - "type": "REPORT_TABLE", + "type": "VISUALIZATION", "visualization": { "id": "iqqgnCj9DQj" }, @@ -1063,7 +1067,7 @@ }, { "id": "i66m5HwnH6v", - "type": "CHART", + "type": "VISUALIZATION", "visualization": { "id": "a46jcQ65Axt" }, @@ -1074,7 +1078,7 @@ }, { "id": "a4GacNVWHLX", - "type": "CHART", + "type": "VISUALIZATION", "visualization": { "id": "GA87u7JwgSK" }, @@ -1085,7 +1089,7 @@ }, { "id": "KYcDaXAZa1q", - "type": "CHART", + "type": "VISUALIZATION", "visualization": { "id": "KiUTxsMMYde" }, @@ -1096,7 +1100,7 @@ }, { "id": "a6cSVlR6bSj", - "type": "CHART", + "type": "VISUALIZATION", "visualization": { "id": "GkoTRBEmIQt" }, @@ -1107,7 +1111,7 @@ }, { "id": "W4DOghdXUmp", - "type": "CHART", + "type": "VISUALIZATION", "visualization": { "id": "S2kJHgM41El" }, @@ -1118,7 +1122,7 @@ }, { "id": "OgO4mL6ovvU", - "type": "CHART", + "type": "VISUALIZATION", "visualization": { "id": "KasxZ8vT1n0" }, @@ -1129,7 +1133,7 @@ }, { "id": "K2amO1SBZFm", - "type": "CHART", + "type": "VISUALIZATION", "visualization": { "id": "W2SCFrHCiEm" }, @@ -1140,7 +1144,7 @@ }, { "id": "GW6MALzFIVR", - "type": "CHART", + "type": "VISUALIZATION", "visualization": { "id": "OuKm5zK7l53" }, @@ -1151,7 +1155,7 @@ }, { "id": "m4LaU9HizHi", - "type": "REPORT_TABLE", + "type": "VISUALIZATION", "visualization": { "id": "iOk52Z42bjp" }, @@ -1162,7 +1166,7 @@ }, { "id": "uyoJujQVRjE", - "type": "REPORT_TABLE", + "type": "VISUALIZATION", "visualization": { "id": "GM6SxObVwI3" }, @@ -1173,7 +1177,7 @@ }, { "id": "KI0C90Ol10x", - "type": "CHART", + "type": "VISUALIZATION", "visualization": { "id": "qmsj4FqnVPX" }, @@ -1184,7 +1188,7 @@ }, { "id": "uYY7v977Ubm", - "type": "CHART", + "type": "VISUALIZATION", "visualization": { "id": "uiyYMLiDaK2" }, @@ -1195,7 +1199,7 @@ }, { "id": "qUqsDmtiBLF", - "type": "CHART", + "type": "VISUALIZATION", "visualization": { "id": "u6Sin4Fy1Wt" }, @@ -1206,7 +1210,7 @@ }, { "id": "mwMpIdPdu8H", - "type": "CHART", + "type": "VISUALIZATION", "visualization": { "id": "ukewRkZsyCI" }, @@ -1216,27 +1220,29 @@ "y": 180 } ], - "publicAccess": "--------", - "externalAccess": false, - "userAccesses": [ - { - "id": "M5zQapPyTZI", - "displayName": "admin admin", - "access": "rw------" - } - ], - "userGroupAccesses": [ - { - "id": "ywuI2WspUUG", - "displayName": "System Admin", - "access": "rw------" + "sharing": { + "public": "--------", + "external": false, + "users": { + "M5zQapPyTZI": { + "id": "M5zQapPyTZI", + "displayName": "admin admin", + "access": "rw------" + } }, - { - "id": "mKKNXzeIAJs", - "displayName": "Data Management Admin", - "access": "rw------" + "userGroups": { + "ywuI2WspUUG": { + "id": "ywuI2WspUUG", + "displayName": "System Admin", + "access": "rw------" + }, + "mKKNXzeIAJs": { + "id": "mKKNXzeIAJs", + "displayName": "Data Management Admin", + "access": "rw------" + } } - ] + } }, { "id": "qyG6foGIKEx", @@ -1244,7 +1250,7 @@ "dashboardItems": [ { "id": "e6UAresDcfM", - "type": "CHART", + "type": "VISUALIZATION", "visualization": { "id": "GqYJDh6asM8" }, @@ -1255,7 +1261,7 @@ }, { "id": "CQuufxhy672", - "type": "CHART", + "type": "VISUALIZATION", "visualization": { "id": "me6p7L8VHXl" }, @@ -1266,7 +1272,7 @@ }, { "id": "eUSMAePgCN9", - "type": "REPORT_TABLE", + "type": "VISUALIZATION", "visualization": { "id": "KOiGcdA4JjD" }, @@ -1277,7 +1283,7 @@ }, { "id": "GWKMgoU2E38", - "type": "REPORT_TABLE", + "type": "VISUALIZATION", "visualization": { "id": "CS7csnUtibF" }, @@ -1287,7 +1293,9 @@ "y": 90 } ], - "publicAccess": "rw------" + "sharing": { + "public": "rw------" + } }, { "id": "OiCmorbkHNf", @@ -1295,7 +1303,7 @@ "dashboardItems": [ { "id": "CSL3EN6eJwx", - "type": "REPORT_TABLE", + "type": "VISUALIZATION", "visualization": { "id": "CAEdMM5XM5T" }, @@ -1306,7 +1314,7 @@ }, { "id": "iYkPSnM7m4E", - "type": "CHART", + "type": "VISUALIZATION", "visualization": { "id": "GiUz1pZI2Rq" }, @@ -1317,7 +1325,7 @@ }, { "id": "yI8WlxGRfXU", - "type": "REPORT_TABLE", + "type": "VISUALIZATION", "visualization": { "id": "uwoFl2upiOM" }, @@ -1328,7 +1336,7 @@ }, { "id": "aCiqCXWYZ9P", - "type": "CHART", + "type": "VISUALIZATION", "visualization": { "id": "ui6nUS98GBM" }, @@ -1339,7 +1347,7 @@ }, { "id": "KEy2fuNrALy", - "type": "REPORT_TABLE", + "type": "VISUALIZATION", "visualization": { "id": "mUCwcWSsa9T" }, @@ -1350,7 +1358,7 @@ }, { "id": "O0uabsxLqGS", - "type": "REPORT_TABLE", + "type": "VISUALIZATION", "visualization": { "id": "ew6e1j5HwkE" }, @@ -1361,7 +1369,7 @@ }, { "id": "GCm9PNnLAgP", - "type": "REPORT_TABLE", + "type": "VISUALIZATION", "visualization": { "id": "OS2K2s8VIIq" }, @@ -1372,7 +1380,7 @@ }, { "id": "W4EN8esNyGQ", - "type": "REPORT_TABLE", + "type": "VISUALIZATION", "visualization": { "id": "uqMTlezGj0I" }, @@ -1383,7 +1391,7 @@ }, { "id": "OuQLaEe9G9v", - "type": "REPORT_TABLE", + "type": "VISUALIZATION", "visualization": { "id": "i8TrzIkXGrG" }, @@ -1394,7 +1402,7 @@ }, { "id": "i60k7CBbyJZ", - "type": "REPORT_TABLE", + "type": "VISUALIZATION", "visualization": { "id": "aGYruOfBtaD" }, @@ -1405,7 +1413,7 @@ }, { "id": "qeWaohT6Mgt", - "type": "REPORT_TABLE", + "type": "VISUALIZATION", "visualization": { "id": "KoIzyX81ZVL" }, @@ -1416,7 +1424,7 @@ }, { "id": "y84WQGCtWxT", - "type": "CHART", + "type": "VISUALIZATION", "visualization": { "id": "WikhmLU9agJ" }, @@ -1427,7 +1435,7 @@ }, { "id": "eCWMTNjreWb", - "type": "REPORT_TABLE", + "type": "VISUALIZATION", "visualization": { "id": "yamOXKh6Vok" }, @@ -1438,7 +1446,7 @@ }, { "id": "eUcnQVKRn34", - "type": "CHART", + "type": "VISUALIZATION", "visualization": { "id": "yaQ772dtmLb" }, @@ -1448,27 +1456,29 @@ "y": 120 } ], - "publicAccess": "--------", - "externalAccess": false, - "userAccesses": [ - { - "id": "M5zQapPyTZI", - "displayName": "admin admin", - "access": "rw------" - } - ], - "userGroupAccesses": [ - { - "id": "ywuI2WspUUG", - "displayName": "System Admin", - "access": "rw------" + "sharing": { + "public": "--------", + "external": false, + "users": { + "M5zQapPyTZI": { + "id": "M5zQapPyTZI", + "displayName": "admin admin", + "access": "rw------" + } }, - { - "id": "mKKNXzeIAJs", - "displayName": "Data Management Admin", - "access": "rw------" + "userGroups": { + "ywuI2WspUUG": { + "id": "ywuI2WspUUG", + "displayName": "System Admin", + "access": "rw------" + }, + "mKKNXzeIAJs": { + "id": "mKKNXzeIAJs", + "displayName": "Data Management Admin", + "access": "rw------" + } } - ] + } } ], "visualizations": [ @@ -1477,12 +1487,15 @@ "type": "COLUMN", "name": "12345en - MyProject - Target vs Actual - Benefits - Column Chart", "numberType": "VALUE", - "legendDisplayStyle": "FILL", "rowSubTotals": true, "showDimensionLabels": true, "showData": true, "aggregationType": "DEFAULT", - "legendDisplayStrategy": "FIXED", + "legend": { + "strategy": "FIXED", + "style": "FILL", + "showKey": false + }, "rowTotals": true, "digitGroupSeparator": "SPACE", "dataDimensionItems": [ @@ -1541,7 +1554,9 @@ ] } ], - "columnDimensions": ["GIIHAr9BzzO"], + "columnDimensions": [ + "GIIHAr9BzzO" + ], "filters": [ { "id": "dx" @@ -1550,13 +1565,18 @@ "id": "ou" } ], - "filterDimensions": ["dx", "ou"], + "filterDimensions": [ + "dx", + "ou" + ], "rows": [ { "id": "pe" } ], - "rowDimensions": ["pe"], + "rowDimensions": [ + "pe" + ], "categoryDimensions": [ { "category": { @@ -1572,39 +1592,44 @@ ] } ], - "publicAccess": "--------", - "externalAccess": false, - "userAccesses": [ - { - "id": "M5zQapPyTZI", - "displayName": "admin admin", - "access": "rw------" - } - ], - "userGroupAccesses": [ - { - "id": "ywuI2WspUUG", - "displayName": "System Admin", - "access": "rw------" + "sharing": { + "public": "--------", + "external": false, + "users": { + "M5zQapPyTZI": { + "id": "M5zQapPyTZI", + "displayName": "admin admin", + "access": "rw------" + } }, - { - "id": "mKKNXzeIAJs", - "displayName": "Data Management Admin", - "access": "rw------" + "userGroups": { + "ywuI2WspUUG": { + "id": "ywuI2WspUUG", + "displayName": "System Admin", + "access": "rw------" + }, + "mKKNXzeIAJs": { + "id": "mKKNXzeIAJs", + "displayName": "Data Management Admin", + "access": "rw------" + } } - ] + } }, { "id": "q0Arl96SxH5", "type": "COLUMN", "name": "12345en - MyProject - Target vs Actual - People - Column Chart", "numberType": "VALUE", - "legendDisplayStyle": "FILL", "rowSubTotals": true, "showDimensionLabels": true, "showData": true, "aggregationType": "DEFAULT", - "legendDisplayStrategy": "FIXED", + "legend": { + "strategy": "FIXED", + "style": "FILL", + "showKey": false + }, "rowTotals": true, "digitGroupSeparator": "SPACE", "dataDimensionItems": [ @@ -1669,7 +1694,9 @@ ] } ], - "columnDimensions": ["GIIHAr9BzzO"], + "columnDimensions": [ + "GIIHAr9BzzO" + ], "filters": [ { "id": "dx" @@ -1708,13 +1735,20 @@ ] } ], - "filterDimensions": ["dx", "ou", "Kyg1O6YEGa9", "uSMHdwhxFSV"], + "filterDimensions": [ + "dx", + "ou", + "Kyg1O6YEGa9", + "uSMHdwhxFSV" + ], "rows": [ { "id": "pe" } ], - "rowDimensions": ["pe"], + "rowDimensions": [ + "pe" + ], "categoryDimensions": [ { "category": { @@ -1756,39 +1790,44 @@ ] } ], - "publicAccess": "--------", - "externalAccess": false, - "userAccesses": [ - { - "id": "M5zQapPyTZI", - "displayName": "admin admin", - "access": "rw------" - } - ], - "userGroupAccesses": [ - { - "id": "ywuI2WspUUG", - "displayName": "System Admin", - "access": "rw------" + "sharing": { + "public": "--------", + "external": false, + "users": { + "M5zQapPyTZI": { + "id": "M5zQapPyTZI", + "displayName": "admin admin", + "access": "rw------" + } }, - { - "id": "mKKNXzeIAJs", - "displayName": "Data Management Admin", - "access": "rw------" + "userGroups": { + "ywuI2WspUUG": { + "id": "ywuI2WspUUG", + "displayName": "System Admin", + "access": "rw------" + }, + "mKKNXzeIAJs": { + "id": "mKKNXzeIAJs", + "displayName": "Data Management Admin", + "access": "rw------" + } } - ] + } }, { "id": "yWq2ZBWiK8T", "type": "COLUMN", "name": "12345en - MyProject - MER - Target vs Actual - Benefits - Column Chart", "numberType": "VALUE", - "legendDisplayStyle": "FILL", "rowSubTotals": true, "showDimensionLabels": true, "showData": true, "aggregationType": "DEFAULT", - "legendDisplayStrategy": "FIXED", + "legend": { + "strategy": "FIXED", + "style": "FILL", + "showKey": false + }, "rowTotals": true, "digitGroupSeparator": "SPACE", "dataDimensionItems": [ @@ -1841,19 +1880,25 @@ ] } ], - "columnDimensions": ["GIIHAr9BzzO"], + "columnDimensions": [ + "GIIHAr9BzzO" + ], "filters": [ { "id": "ou" } ], - "filterDimensions": ["ou"], + "filterDimensions": [ + "ou" + ], "rows": [ { "id": "pe" } ], - "rowDimensions": ["pe"], + "rowDimensions": [ + "pe" + ], "categoryDimensions": [ { "category": { @@ -1869,39 +1914,44 @@ ] } ], - "publicAccess": "--------", - "externalAccess": false, - "userAccesses": [ - { - "id": "M5zQapPyTZI", - "displayName": "admin admin", - "access": "rw------" - } - ], - "userGroupAccesses": [ - { - "id": "ywuI2WspUUG", - "displayName": "System Admin", - "access": "rw------" + "sharing": { + "public": "--------", + "external": false, + "users": { + "M5zQapPyTZI": { + "id": "M5zQapPyTZI", + "displayName": "admin admin", + "access": "rw------" + } }, - { - "id": "mKKNXzeIAJs", - "displayName": "Data Management Admin", - "access": "rw------" + "userGroups": { + "ywuI2WspUUG": { + "id": "ywuI2WspUUG", + "displayName": "System Admin", + "access": "rw------" + }, + "mKKNXzeIAJs": { + "id": "mKKNXzeIAJs", + "displayName": "Data Management Admin", + "access": "rw------" + } } - ] + } }, { "id": "uYWdSMZQ1LH", "type": "COLUMN", "name": "12345en - MyProject - MER - Target vs Actual - People - Column Chart", "numberType": "VALUE", - "legendDisplayStyle": "FILL", "rowSubTotals": true, "showDimensionLabels": true, "showData": true, "aggregationType": "DEFAULT", - "legendDisplayStrategy": "FIXED", + "legend": { + "strategy": "FIXED", + "style": "FILL", + "showKey": false + }, "rowTotals": true, "digitGroupSeparator": "SPACE", "dataDimensionItems": [ @@ -1954,7 +2004,9 @@ ] } ], - "columnDimensions": ["GIIHAr9BzzO"], + "columnDimensions": [ + "GIIHAr9BzzO" + ], "filters": [ { "id": "dx" @@ -1993,13 +2045,20 @@ ] } ], - "filterDimensions": ["dx", "ou", "Kyg1O6YEGa9", "uSMHdwhxFSV"], + "filterDimensions": [ + "dx", + "ou", + "Kyg1O6YEGa9", + "uSMHdwhxFSV" + ], "rows": [ { "id": "pe" } ], - "rowDimensions": ["pe"], + "rowDimensions": [ + "pe" + ], "categoryDimensions": [ { "category": { @@ -2041,39 +2100,44 @@ ] } ], - "publicAccess": "--------", - "externalAccess": false, - "userAccesses": [ - { - "id": "M5zQapPyTZI", - "displayName": "admin admin", - "access": "rw------" - } - ], - "userGroupAccesses": [ - { - "id": "ywuI2WspUUG", - "displayName": "System Admin", - "access": "rw------" + "sharing": { + "public": "--------", + "external": false, + "users": { + "M5zQapPyTZI": { + "id": "M5zQapPyTZI", + "displayName": "admin admin", + "access": "rw------" + } }, - { - "id": "mKKNXzeIAJs", - "displayName": "Data Management Admin", - "access": "rw------" + "userGroups": { + "ywuI2WspUUG": { + "id": "ywuI2WspUUG", + "displayName": "System Admin", + "access": "rw------" + }, + "mKKNXzeIAJs": { + "id": "mKKNXzeIAJs", + "displayName": "Data Management Admin", + "access": "rw------" + } } - ] + } }, { "id": "i07AWJAND8a", "type": "PIVOT_TABLE", "name": "12345en - MyProject - Target vs Actual - Benefits", "numberType": "VALUE", - "legendDisplayStyle": "FILL", "rowSubTotals": true, "showDimensionLabels": true, "showData": true, "aggregationType": "DEFAULT", - "legendDisplayStrategy": "FIXED", + "legend": { + "strategy": "FIXED", + "style": "FILL", + "showKey": false + }, "rowTotals": true, "digitGroupSeparator": "SPACE", "dataDimensionItems": [ @@ -2120,13 +2184,17 @@ "id": "pe" } ], - "columnDimensions": ["pe"], + "columnDimensions": [ + "pe" + ], "filters": [ { "id": "ou" } ], - "filterDimensions": ["ou"], + "filterDimensions": [ + "ou" + ], "rows": [ { "id": "dx" @@ -2147,7 +2215,10 @@ ] } ], - "rowDimensions": ["dx", "GIIHAr9BzzO"], + "rowDimensions": [ + "dx", + "GIIHAr9BzzO" + ], "categoryDimensions": [ { "category": { @@ -2163,39 +2234,44 @@ ] } ], - "publicAccess": "--------", - "externalAccess": false, - "userAccesses": [ - { - "id": "M5zQapPyTZI", - "displayName": "admin admin", - "access": "rw------" - } - ], - "userGroupAccesses": [ - { - "id": "ywuI2WspUUG", - "displayName": "System Admin", - "access": "rw------" + "sharing": { + "public": "--------", + "external": false, + "users": { + "M5zQapPyTZI": { + "id": "M5zQapPyTZI", + "displayName": "admin admin", + "access": "rw------" + } }, - { - "id": "mKKNXzeIAJs", - "displayName": "Data Management Admin", - "access": "rw------" + "userGroups": { + "ywuI2WspUUG": { + "id": "ywuI2WspUUG", + "displayName": "System Admin", + "access": "rw------" + }, + "mKKNXzeIAJs": { + "id": "mKKNXzeIAJs", + "displayName": "Data Management Admin", + "access": "rw------" + } } - ] + } }, { "id": "iqqgnCj9DQj", "type": "PIVOT_TABLE", "name": "12345en - MyProject - Target vs Actual - People", "numberType": "VALUE", - "legendDisplayStyle": "FILL", "rowSubTotals": true, "showDimensionLabels": true, "showData": true, "aggregationType": "DEFAULT", - "legendDisplayStrategy": "FIXED", + "legend": { + "strategy": "FIXED", + "style": "FILL", + "showKey": false + }, "rowTotals": true, "digitGroupSeparator": "SPACE", "dataDimensionItems": [ @@ -2263,13 +2339,18 @@ ] } ], - "columnDimensions": ["pe", "Kyg1O6YEGa9"], + "columnDimensions": [ + "pe", + "Kyg1O6YEGa9" + ], "filters": [ { "id": "ou" } ], - "filterDimensions": ["ou"], + "filterDimensions": [ + "ou" + ], "rows": [ { "id": "dx" @@ -2305,7 +2386,11 @@ ] } ], - "rowDimensions": ["dx", "GIIHAr9BzzO", "uSMHdwhxFSV"], + "rowDimensions": [ + "dx", + "GIIHAr9BzzO", + "uSMHdwhxFSV" + ], "categoryDimensions": [ { "category": { @@ -2347,39 +2432,44 @@ ] } ], - "publicAccess": "--------", - "externalAccess": false, - "userAccesses": [ - { - "id": "M5zQapPyTZI", - "displayName": "admin admin", - "access": "rw------" - } - ], - "userGroupAccesses": [ - { - "id": "ywuI2WspUUG", - "displayName": "System Admin", - "access": "rw------" + "sharing": { + "public": "--------", + "external": false, + "users": { + "M5zQapPyTZI": { + "id": "M5zQapPyTZI", + "displayName": "admin admin", + "access": "rw------" + } }, - { - "id": "mKKNXzeIAJs", - "displayName": "Data Management Admin", - "access": "rw------" + "userGroups": { + "ywuI2WspUUG": { + "id": "ywuI2WspUUG", + "displayName": "System Admin", + "access": "rw------" + }, + "mKKNXzeIAJs": { + "id": "mKKNXzeIAJs", + "displayName": "Data Management Admin", + "access": "rw------" + } } - ] + } }, { "id": "a46jcQ65Axt", "type": "COLUMN", "name": "12345en - MyProject - Target vs Actual - Benefits - Column Chart Disaggregated By Indicator", "numberType": "VALUE", - "legendDisplayStyle": "FILL", "rowSubTotals": true, "showDimensionLabels": true, "showData": true, "aggregationType": "DEFAULT", - "legendDisplayStrategy": "FIXED", + "legend": { + "strategy": "FIXED", + "style": "FILL", + "showKey": false + }, "rowTotals": true, "digitGroupSeparator": "SPACE", "dataDimensionItems": [ @@ -2426,13 +2516,17 @@ "id": "dx" } ], - "columnDimensions": ["dx"], + "columnDimensions": [ + "dx" + ], "filters": [ { "id": "ou" } ], - "filterDimensions": ["ou"], + "filterDimensions": [ + "ou" + ], "rows": [ { "id": "pe" @@ -2453,7 +2547,10 @@ ] } ], - "rowDimensions": ["pe", "GIIHAr9BzzO"], + "rowDimensions": [ + "pe", + "GIIHAr9BzzO" + ], "categoryDimensions": [ { "category": { @@ -2469,39 +2566,44 @@ ] } ], - "publicAccess": "--------", - "externalAccess": false, - "userAccesses": [ - { - "id": "M5zQapPyTZI", - "displayName": "admin admin", - "access": "rw------" - } - ], - "userGroupAccesses": [ - { - "id": "ywuI2WspUUG", - "displayName": "System Admin", - "access": "rw------" + "sharing": { + "public": "--------", + "external": false, + "users": { + "M5zQapPyTZI": { + "id": "M5zQapPyTZI", + "displayName": "admin admin", + "access": "rw------" + } }, - { - "id": "mKKNXzeIAJs", - "displayName": "Data Management Admin", - "access": "rw------" + "userGroups": { + "ywuI2WspUUG": { + "id": "ywuI2WspUUG", + "displayName": "System Admin", + "access": "rw------" + }, + "mKKNXzeIAJs": { + "id": "mKKNXzeIAJs", + "displayName": "Data Management Admin", + "access": "rw------" + } } - ] + } }, { "id": "GA87u7JwgSK", "type": "COLUMN", "name": "12345en - MyProject - Target vs Actual - People - Column Chart Disaggregated By Indicator", "numberType": "VALUE", - "legendDisplayStyle": "FILL", "rowSubTotals": true, "showDimensionLabels": true, "showData": true, "aggregationType": "DEFAULT", - "legendDisplayStrategy": "FIXED", + "legend": { + "strategy": "FIXED", + "style": "FILL", + "showKey": false + }, "rowTotals": true, "digitGroupSeparator": "SPACE", "dataDimensionItems": [ @@ -2554,7 +2656,9 @@ "id": "dx" } ], - "columnDimensions": ["dx"], + "columnDimensions": [ + "dx" + ], "filters": [ { "id": "ou" @@ -2590,7 +2694,11 @@ ] } ], - "filterDimensions": ["ou", "Kyg1O6YEGa9", "uSMHdwhxFSV"], + "filterDimensions": [ + "ou", + "Kyg1O6YEGa9", + "uSMHdwhxFSV" + ], "rows": [ { "id": "pe" @@ -2611,7 +2719,10 @@ ] } ], - "rowDimensions": ["pe", "GIIHAr9BzzO"], + "rowDimensions": [ + "pe", + "GIIHAr9BzzO" + ], "categoryDimensions": [ { "category": { @@ -2653,39 +2764,44 @@ ] } ], - "publicAccess": "--------", - "externalAccess": false, - "userAccesses": [ - { - "id": "M5zQapPyTZI", - "displayName": "admin admin", - "access": "rw------" - } - ], - "userGroupAccesses": [ - { - "id": "ywuI2WspUUG", - "displayName": "System Admin", - "access": "rw------" + "sharing": { + "public": "--------", + "external": false, + "users": { + "M5zQapPyTZI": { + "id": "M5zQapPyTZI", + "displayName": "admin admin", + "access": "rw------" + } }, - { - "id": "mKKNXzeIAJs", - "displayName": "Data Management Admin", - "access": "rw------" + "userGroups": { + "ywuI2WspUUG": { + "id": "ywuI2WspUUG", + "displayName": "System Admin", + "access": "rw------" + }, + "mKKNXzeIAJs": { + "id": "mKKNXzeIAJs", + "displayName": "Data Management Admin", + "access": "rw------" + } } - ] + } }, { "id": "KiUTxsMMYde", "type": "LINE", "name": "12345en - MyProject - Target vs Actual - Benefits - Line Chart", "numberType": "VALUE", - "legendDisplayStyle": "FILL", "rowSubTotals": true, "showDimensionLabels": true, "showData": true, "aggregationType": "DEFAULT", - "legendDisplayStrategy": "FIXED", + "legend": { + "strategy": "FIXED", + "style": "FILL", + "showKey": false + }, "rowTotals": true, "digitGroupSeparator": "SPACE", "dataDimensionItems": [ @@ -2744,13 +2860,17 @@ ] } ], - "columnDimensions": ["GIIHAr9BzzO"], + "columnDimensions": [ + "GIIHAr9BzzO" + ], "filters": [ { "id": "ou" } ], - "filterDimensions": ["ou"], + "filterDimensions": [ + "ou" + ], "rows": [ { "id": "dx" @@ -2759,7 +2879,10 @@ "id": "pe" } ], - "rowDimensions": ["dx", "pe"], + "rowDimensions": [ + "dx", + "pe" + ], "categoryDimensions": [ { "category": { @@ -2775,39 +2898,44 @@ ] } ], - "publicAccess": "--------", - "externalAccess": false, - "userAccesses": [ - { - "id": "M5zQapPyTZI", - "displayName": "admin admin", - "access": "rw------" - } - ], - "userGroupAccesses": [ - { - "id": "ywuI2WspUUG", - "displayName": "System Admin", - "access": "rw------" + "sharing": { + "public": "--------", + "external": false, + "users": { + "M5zQapPyTZI": { + "id": "M5zQapPyTZI", + "displayName": "admin admin", + "access": "rw------" + } }, - { - "id": "mKKNXzeIAJs", - "displayName": "Data Management Admin", - "access": "rw------" + "userGroups": { + "ywuI2WspUUG": { + "id": "ywuI2WspUUG", + "displayName": "System Admin", + "access": "rw------" + }, + "mKKNXzeIAJs": { + "id": "mKKNXzeIAJs", + "displayName": "Data Management Admin", + "access": "rw------" + } } - ] + } }, { "id": "GkoTRBEmIQt", "type": "LINE", "name": "12345en - MyProject - Target vs Actual - People - Line Chart", "numberType": "VALUE", - "legendDisplayStyle": "FILL", "rowSubTotals": true, "showDimensionLabels": true, "showData": true, "aggregationType": "DEFAULT", - "legendDisplayStrategy": "FIXED", + "legend": { + "strategy": "FIXED", + "style": "FILL", + "showKey": false + }, "rowTotals": true, "digitGroupSeparator": "SPACE", "dataDimensionItems": [ @@ -2872,7 +3000,9 @@ ] } ], - "columnDimensions": ["GIIHAr9BzzO"], + "columnDimensions": [ + "GIIHAr9BzzO" + ], "filters": [ { "id": "ou" @@ -2908,7 +3038,11 @@ ] } ], - "filterDimensions": ["ou", "Kyg1O6YEGa9", "uSMHdwhxFSV"], + "filterDimensions": [ + "ou", + "Kyg1O6YEGa9", + "uSMHdwhxFSV" + ], "rows": [ { "id": "dx" @@ -2917,7 +3051,10 @@ "id": "pe" } ], - "rowDimensions": ["dx", "pe"], + "rowDimensions": [ + "dx", + "pe" + ], "categoryDimensions": [ { "category": { @@ -2959,39 +3096,44 @@ ] } ], - "publicAccess": "--------", - "externalAccess": false, - "userAccesses": [ - { - "id": "M5zQapPyTZI", - "displayName": "admin admin", - "access": "rw------" - } - ], - "userGroupAccesses": [ - { - "id": "ywuI2WspUUG", - "displayName": "System Admin", - "access": "rw------" + "sharing": { + "public": "--------", + "external": false, + "users": { + "M5zQapPyTZI": { + "id": "M5zQapPyTZI", + "displayName": "admin admin", + "access": "rw------" + } }, - { - "id": "mKKNXzeIAJs", - "displayName": "Data Management Admin", - "access": "rw------" + "userGroups": { + "ywuI2WspUUG": { + "id": "ywuI2WspUUG", + "displayName": "System Admin", + "access": "rw------" + }, + "mKKNXzeIAJs": { + "id": "mKKNXzeIAJs", + "displayName": "Data Management Admin", + "access": "rw------" + } } - ] + } }, { "id": "S2kJHgM41El", "type": "LINE", "name": "12345en - MyProject - Target vs Actual - People - Line Chart - Male Only", "numberType": "VALUE", - "legendDisplayStyle": "FILL", "rowSubTotals": true, "showDimensionLabels": true, "showData": true, "aggregationType": "DEFAULT", - "legendDisplayStrategy": "FIXED", + "legend": { + "strategy": "FIXED", + "style": "FILL", + "showKey": false + }, "rowTotals": true, "digitGroupSeparator": "SPACE", "dataDimensionItems": [ @@ -3056,7 +3198,9 @@ ] } ], - "columnDimensions": ["GIIHAr9BzzO"], + "columnDimensions": [ + "GIIHAr9BzzO" + ], "filters": [ { "id": "ou" @@ -3085,7 +3229,11 @@ ] } ], - "filterDimensions": ["ou", "Kyg1O6YEGa9", "uSMHdwhxFSV"], + "filterDimensions": [ + "ou", + "Kyg1O6YEGa9", + "uSMHdwhxFSV" + ], "rows": [ { "id": "dx" @@ -3094,7 +3242,10 @@ "id": "pe" } ], - "rowDimensions": ["dx", "pe"], + "rowDimensions": [ + "dx", + "pe" + ], "categoryDimensions": [ { "category": { @@ -3133,39 +3284,44 @@ ] } ], - "publicAccess": "--------", - "externalAccess": false, - "userAccesses": [ - { - "id": "M5zQapPyTZI", - "displayName": "admin admin", - "access": "rw------" - } - ], - "userGroupAccesses": [ - { - "id": "ywuI2WspUUG", - "displayName": "System Admin", - "access": "rw------" + "sharing": { + "public": "--------", + "external": false, + "users": { + "M5zQapPyTZI": { + "id": "M5zQapPyTZI", + "displayName": "admin admin", + "access": "rw------" + } }, - { - "id": "mKKNXzeIAJs", - "displayName": "Data Management Admin", - "access": "rw------" + "userGroups": { + "ywuI2WspUUG": { + "id": "ywuI2WspUUG", + "displayName": "System Admin", + "access": "rw------" + }, + "mKKNXzeIAJs": { + "id": "mKKNXzeIAJs", + "displayName": "Data Management Admin", + "access": "rw------" + } } - ] + } }, { "id": "KasxZ8vT1n0", "type": "LINE", "name": "12345en - MyProject - Target vs Actual - People - Line Chart - Female Only", "numberType": "VALUE", - "legendDisplayStyle": "FILL", "rowSubTotals": true, "showDimensionLabels": true, "showData": true, "aggregationType": "DEFAULT", - "legendDisplayStrategy": "FIXED", + "legend": { + "strategy": "FIXED", + "style": "FILL", + "showKey": false + }, "rowTotals": true, "digitGroupSeparator": "SPACE", "dataDimensionItems": [ @@ -3230,7 +3386,9 @@ ] } ], - "columnDimensions": ["GIIHAr9BzzO"], + "columnDimensions": [ + "GIIHAr9BzzO" + ], "filters": [ { "id": "ou" @@ -3259,7 +3417,11 @@ ] } ], - "filterDimensions": ["ou", "Kyg1O6YEGa9", "uSMHdwhxFSV"], + "filterDimensions": [ + "ou", + "Kyg1O6YEGa9", + "uSMHdwhxFSV" + ], "rows": [ { "id": "dx" @@ -3268,7 +3430,10 @@ "id": "pe" } ], - "rowDimensions": ["dx", "pe"], + "rowDimensions": [ + "dx", + "pe" + ], "categoryDimensions": [ { "category": { @@ -3307,39 +3472,44 @@ ] } ], - "publicAccess": "--------", - "externalAccess": false, - "userAccesses": [ - { - "id": "M5zQapPyTZI", - "displayName": "admin admin", - "access": "rw------" - } - ], - "userGroupAccesses": [ - { - "id": "ywuI2WspUUG", - "displayName": "System Admin", - "access": "rw------" + "sharing": { + "public": "--------", + "external": false, + "users": { + "M5zQapPyTZI": { + "id": "M5zQapPyTZI", + "displayName": "admin admin", + "access": "rw------" + } }, - { - "id": "mKKNXzeIAJs", - "displayName": "Data Management Admin", - "access": "rw------" + "userGroups": { + "ywuI2WspUUG": { + "id": "ywuI2WspUUG", + "displayName": "System Admin", + "access": "rw------" + }, + "mKKNXzeIAJs": { + "id": "mKKNXzeIAJs", + "displayName": "Data Management Admin", + "access": "rw------" + } } - ] + } }, { "id": "W2SCFrHCiEm", "type": "LINE", "name": "12345en - MyProject - Target vs Actual - People - Line/Column Chart - Male Only", "numberType": "VALUE", - "legendDisplayStyle": "FILL", "rowSubTotals": true, "showDimensionLabels": true, "showData": true, "aggregationType": "DEFAULT", - "legendDisplayStrategy": "FIXED", + "legend": { + "strategy": "FIXED", + "style": "FILL", + "showKey": false + }, "rowTotals": true, "digitGroupSeparator": "SPACE", "dataDimensionItems": [ @@ -3404,7 +3574,9 @@ ] } ], - "columnDimensions": ["GIIHAr9BzzO"], + "columnDimensions": [ + "GIIHAr9BzzO" + ], "filters": [ { "id": "ou" @@ -3433,7 +3605,11 @@ ] } ], - "filterDimensions": ["ou", "Kyg1O6YEGa9", "uSMHdwhxFSV"], + "filterDimensions": [ + "ou", + "Kyg1O6YEGa9", + "uSMHdwhxFSV" + ], "rows": [ { "id": "dx" @@ -3442,7 +3618,10 @@ "id": "pe" } ], - "rowDimensions": ["dx", "pe"], + "rowDimensions": [ + "dx", + "pe" + ], "categoryDimensions": [ { "category": { @@ -3481,27 +3660,29 @@ ] } ], - "publicAccess": "--------", - "externalAccess": false, - "userAccesses": [ - { - "id": "M5zQapPyTZI", - "displayName": "admin admin", - "access": "rw------" - } - ], - "userGroupAccesses": [ - { - "id": "ywuI2WspUUG", - "displayName": "System Admin", - "access": "rw------" + "sharing": { + "public": "--------", + "external": false, + "users": { + "M5zQapPyTZI": { + "id": "M5zQapPyTZI", + "displayName": "admin admin", + "access": "rw------" + } }, - { - "id": "mKKNXzeIAJs", - "displayName": "Data Management Admin", - "access": "rw------" + "userGroups": { + "ywuI2WspUUG": { + "id": "ywuI2WspUUG", + "displayName": "System Admin", + "access": "rw------" + }, + "mKKNXzeIAJs": { + "id": "mKKNXzeIAJs", + "displayName": "Data Management Admin", + "access": "rw------" + } } - ], + }, "series": [ { "dimensionItem": "imyqCWQ229K", @@ -3519,12 +3700,15 @@ "type": "LINE", "name": "12345en - MyProject - Target vs Actual - People - Line/Column Chart - Female Only", "numberType": "VALUE", - "legendDisplayStyle": "FILL", "rowSubTotals": true, "showDimensionLabels": true, "showData": true, "aggregationType": "DEFAULT", - "legendDisplayStrategy": "FIXED", + "legend": { + "strategy": "FIXED", + "style": "FILL", + "showKey": false + }, "rowTotals": true, "digitGroupSeparator": "SPACE", "dataDimensionItems": [ @@ -3589,7 +3773,9 @@ ] } ], - "columnDimensions": ["GIIHAr9BzzO"], + "columnDimensions": [ + "GIIHAr9BzzO" + ], "filters": [ { "id": "ou" @@ -3618,7 +3804,11 @@ ] } ], - "filterDimensions": ["ou", "Kyg1O6YEGa9", "uSMHdwhxFSV"], + "filterDimensions": [ + "ou", + "Kyg1O6YEGa9", + "uSMHdwhxFSV" + ], "rows": [ { "id": "dx" @@ -3627,7 +3817,10 @@ "id": "pe" } ], - "rowDimensions": ["dx", "pe"], + "rowDimensions": [ + "dx", + "pe" + ], "categoryDimensions": [ { "category": { @@ -3666,27 +3859,29 @@ ] } ], - "publicAccess": "--------", - "externalAccess": false, - "userAccesses": [ - { - "id": "M5zQapPyTZI", - "displayName": "admin admin", - "access": "rw------" - } - ], - "userGroupAccesses": [ - { - "id": "ywuI2WspUUG", - "displayName": "System Admin", - "access": "rw------" + "sharing": { + "public": "--------", + "external": false, + "users": { + "M5zQapPyTZI": { + "id": "M5zQapPyTZI", + "displayName": "admin admin", + "access": "rw------" + } }, - { - "id": "mKKNXzeIAJs", - "displayName": "Data Management Admin", - "access": "rw------" + "userGroups": { + "ywuI2WspUUG": { + "id": "ywuI2WspUUG", + "displayName": "System Admin", + "access": "rw------" + }, + "mKKNXzeIAJs": { + "id": "mKKNXzeIAJs", + "displayName": "Data Management Admin", + "access": "rw------" + } } - ], + }, "series": [ { "dimensionItem": "imyqCWQ229K", @@ -3704,12 +3899,16 @@ "type": "PIVOT_TABLE", "name": "12345en - MyProject - Achieved to date (%) - Benefits", "numberType": "VALUE", - "legendDisplayStyle": "FILL", "rowSubTotals": true, "showDimensionLabels": true, "showData": true, "aggregationType": "DEFAULT", - "legendDisplayStrategy": "FIXED", + "legend": { + "set": { + "code": "ACTUAL_TARGET_ACHIEVED", + "id": "yoAt108kUFm" + } + }, "rowTotals": true, "digitGroupSeparator": "SPACE", "dataDimensionItems": [ @@ -3756,44 +3955,48 @@ "id": "pe" } ], - "columnDimensions": ["pe"], + "columnDimensions": [ + "pe" + ], "filters": [ { "id": "ou" } ], - "filterDimensions": ["ou"], + "filterDimensions": [ + "ou" + ], "rows": [ { "id": "dx" } ], - "rowDimensions": ["dx"], - "categoryDimensions": [], - "publicAccess": "--------", - "externalAccess": false, - "userAccesses": [ - { - "id": "M5zQapPyTZI", - "displayName": "admin admin", - "access": "rw------" - } + "rowDimensions": [ + "dx" ], - "userGroupAccesses": [ - { - "id": "ywuI2WspUUG", - "displayName": "System Admin", - "access": "rw------" + "categoryDimensions": [], + "sharing": { + "public": "--------", + "external": false, + "users": { + "M5zQapPyTZI": { + "id": "M5zQapPyTZI", + "displayName": "admin admin", + "access": "rw------" + } }, - { - "id": "mKKNXzeIAJs", - "displayName": "Data Management Admin", - "access": "rw------" + "userGroups": { + "ywuI2WspUUG": { + "id": "ywuI2WspUUG", + "displayName": "System Admin", + "access": "rw------" + }, + "mKKNXzeIAJs": { + "id": "mKKNXzeIAJs", + "displayName": "Data Management Admin", + "access": "rw------" + } } - ], - "legendSet": { - "code": "ACTUAL_TARGET_ACHIEVED", - "id": "yoAt108kUFm" } }, { @@ -3801,12 +4004,16 @@ "type": "PIVOT_TABLE", "name": "12345en - MyProject - Achieved to date (%) - People", "numberType": "VALUE", - "legendDisplayStyle": "FILL", "rowSubTotals": true, "showDimensionLabels": true, "showData": true, "aggregationType": "DEFAULT", - "legendDisplayStrategy": "FIXED", + "legend": { + "set": { + "code": "ACTUAL_TARGET_ACHIEVED", + "id": "yoAt108kUFm" + } + }, "rowTotals": false, "digitGroupSeparator": "SPACE", "dataDimensionItems": [ @@ -3859,44 +4066,48 @@ "id": "pe" } ], - "columnDimensions": ["pe"], + "columnDimensions": [ + "pe" + ], "filters": [ { "id": "ou" } ], - "filterDimensions": ["ou"], + "filterDimensions": [ + "ou" + ], "rows": [ { "id": "dx" } ], - "rowDimensions": ["dx"], - "categoryDimensions": [], - "publicAccess": "--------", - "externalAccess": false, - "userAccesses": [ - { - "id": "M5zQapPyTZI", - "displayName": "admin admin", - "access": "rw------" - } + "rowDimensions": [ + "dx" ], - "userGroupAccesses": [ - { - "id": "ywuI2WspUUG", - "displayName": "System Admin", - "access": "rw------" + "categoryDimensions": [], + "sharing": { + "public": "--------", + "external": false, + "users": { + "M5zQapPyTZI": { + "id": "M5zQapPyTZI", + "displayName": "admin admin", + "access": "rw------" + } }, - { - "id": "mKKNXzeIAJs", - "displayName": "Data Management Admin", - "access": "rw------" + "userGroups": { + "ywuI2WspUUG": { + "id": "ywuI2WspUUG", + "displayName": "System Admin", + "access": "rw------" + }, + "mKKNXzeIAJs": { + "id": "mKKNXzeIAJs", + "displayName": "Data Management Admin", + "access": "rw------" + } } - ], - "legendSet": { - "code": "ACTUAL_TARGET_ACHIEVED", - "id": "yoAt108kUFm" } }, { @@ -3904,12 +4115,15 @@ "type": "COLUMN", "name": "12345en - MyProject - Achieved Benefit (%)", "numberType": "VALUE", - "legendDisplayStyle": "FILL", "rowSubTotals": true, "showDimensionLabels": true, "showData": true, "aggregationType": "DEFAULT", - "legendDisplayStrategy": "FIXED", + "legend": { + "strategy": "FIXED", + "style": "FILL", + "showKey": false + }, "rowTotals": true, "digitGroupSeparator": "SPACE", "dataDimensionItems": [ @@ -3956,53 +4170,64 @@ "id": "ou" } ], - "columnDimensions": ["ou"], + "columnDimensions": [ + "ou" + ], "filters": [ { "id": "pe" } ], - "filterDimensions": ["pe"], + "filterDimensions": [ + "pe" + ], "rows": [ { "id": "dx" } ], - "rowDimensions": ["dx"], - "categoryDimensions": [], - "publicAccess": "--------", - "externalAccess": false, - "userAccesses": [ - { - "id": "M5zQapPyTZI", - "displayName": "admin admin", - "access": "rw------" - } + "rowDimensions": [ + "dx" ], - "userGroupAccesses": [ - { - "id": "ywuI2WspUUG", - "displayName": "System Admin", - "access": "rw------" + "categoryDimensions": [], + "sharing": { + "public": "--------", + "external": false, + "users": { + "M5zQapPyTZI": { + "id": "M5zQapPyTZI", + "displayName": "admin admin", + "access": "rw------" + } }, - { - "id": "mKKNXzeIAJs", - "displayName": "Data Management Admin", - "access": "rw------" + "userGroups": { + "ywuI2WspUUG": { + "id": "ywuI2WspUUG", + "displayName": "System Admin", + "access": "rw------" + }, + "mKKNXzeIAJs": { + "id": "mKKNXzeIAJs", + "displayName": "Data Management Admin", + "access": "rw------" + } } - ] + } }, { "id": "uiyYMLiDaK2", "type": "COLUMN", "name": "12345en - MyProject - Achieved People (%)", "numberType": "VALUE", - "legendDisplayStyle": "FILL", "rowSubTotals": true, "showDimensionLabels": true, "showData": true, "aggregationType": "DEFAULT", - "legendDisplayStrategy": "FIXED", + "legend": { + "strategy": "FIXED", + "style": "FILL", + "showKey": false + }, "rowTotals": true, "digitGroupSeparator": "SPACE", "dataDimensionItems": [ @@ -4055,7 +4280,9 @@ "id": "ou" } ], - "columnDimensions": ["ou"], + "columnDimensions": [ + "ou" + ], "filters": [ { "id": "pe" @@ -4069,13 +4296,18 @@ ] } ], - "filterDimensions": ["pe", "uSMHdwhxFSV"], + "filterDimensions": [ + "pe", + "uSMHdwhxFSV" + ], "rows": [ { "id": "dx" } ], - "rowDimensions": ["dx"], + "rowDimensions": [ + "dx" + ], "categoryDimensions": [ { "category": { @@ -4088,39 +4320,44 @@ ] } ], - "publicAccess": "--------", - "externalAccess": false, - "userAccesses": [ - { - "id": "M5zQapPyTZI", - "displayName": "admin admin", - "access": "rw------" - } - ], - "userGroupAccesses": [ - { - "id": "ywuI2WspUUG", - "displayName": "System Admin", - "access": "rw------" + "sharing": { + "public": "--------", + "external": false, + "users": { + "M5zQapPyTZI": { + "id": "M5zQapPyTZI", + "displayName": "admin admin", + "access": "rw------" + } }, - { - "id": "mKKNXzeIAJs", - "displayName": "Data Management Admin", - "access": "rw------" + "userGroups": { + "ywuI2WspUUG": { + "id": "ywuI2WspUUG", + "displayName": "System Admin", + "access": "rw------" + }, + "mKKNXzeIAJs": { + "id": "mKKNXzeIAJs", + "displayName": "Data Management Admin", + "access": "rw------" + } } - ] + } }, { "id": "u6Sin4Fy1Wt", "type": "COLUMN", "name": "12345en - MyProject - Achieved by gender (%)", "numberType": "VALUE", - "legendDisplayStyle": "FILL", "rowSubTotals": true, "showDimensionLabels": true, "showData": true, "aggregationType": "DEFAULT", - "legendDisplayStrategy": "FIXED", + "legend": { + "strategy": "FIXED", + "style": "FILL", + "showKey": false + }, "rowTotals": true, "digitGroupSeparator": "SPACE", "dataDimensionItems": [ @@ -4185,7 +4422,9 @@ ] } ], - "columnDimensions": ["Kyg1O6YEGa9"], + "columnDimensions": [ + "Kyg1O6YEGa9" + ], "filters": [ { "id": "ou" @@ -4202,13 +4441,19 @@ ] } ], - "filterDimensions": ["ou", "pe", "uSMHdwhxFSV"], + "filterDimensions": [ + "ou", + "pe", + "uSMHdwhxFSV" + ], "rows": [ { "id": "dx" } ], - "rowDimensions": ["dx"], + "rowDimensions": [ + "dx" + ], "categoryDimensions": [ { "category": { @@ -4234,39 +4479,44 @@ ] } ], - "publicAccess": "--------", - "externalAccess": false, - "userAccesses": [ - { - "id": "M5zQapPyTZI", - "displayName": "admin admin", - "access": "rw------" - } - ], - "userGroupAccesses": [ - { - "id": "ywuI2WspUUG", - "displayName": "System Admin", - "access": "rw------" + "sharing": { + "public": "--------", + "external": false, + "users": { + "M5zQapPyTZI": { + "id": "M5zQapPyTZI", + "displayName": "admin admin", + "access": "rw------" + } }, - { - "id": "mKKNXzeIAJs", - "displayName": "Data Management Admin", - "access": "rw------" + "userGroups": { + "ywuI2WspUUG": { + "id": "ywuI2WspUUG", + "displayName": "System Admin", + "access": "rw------" + }, + "mKKNXzeIAJs": { + "id": "mKKNXzeIAJs", + "displayName": "Data Management Admin", + "access": "rw------" + } } - ] + } }, { "id": "ukewRkZsyCI", "type": "COLUMN", "name": "12345en - MyProject - Benefits Per Person", "numberType": "VALUE", - "legendDisplayStyle": "FILL", "rowSubTotals": true, "showDimensionLabels": true, "showData": true, "aggregationType": "DEFAULT", - "legendDisplayStrategy": "FIXED", + "legend": { + "strategy": "FIXED", + "style": "FILL", + "showKey": false + }, "rowTotals": true, "digitGroupSeparator": "SPACE", "dataDimensionItems": [ @@ -4307,53 +4557,64 @@ "id": "ou" } ], - "columnDimensions": ["ou"], + "columnDimensions": [ + "ou" + ], "filters": [ { "id": "pe" } ], - "filterDimensions": ["pe"], + "filterDimensions": [ + "pe" + ], "rows": [ { "id": "dx" } ], - "rowDimensions": ["dx"], - "categoryDimensions": [], - "publicAccess": "--------", - "externalAccess": false, - "userAccesses": [ - { - "id": "M5zQapPyTZI", - "displayName": "admin admin", - "access": "rw------" - } + "rowDimensions": [ + "dx" ], - "userGroupAccesses": [ - { - "id": "ywuI2WspUUG", - "displayName": "System Admin", - "access": "rw------" + "categoryDimensions": [], + "sharing": { + "public": "--------", + "external": false, + "users": { + "M5zQapPyTZI": { + "id": "M5zQapPyTZI", + "displayName": "admin admin", + "access": "rw------" + } }, - { - "id": "mKKNXzeIAJs", - "displayName": "Data Management Admin", - "access": "rw------" + "userGroups": { + "ywuI2WspUUG": { + "id": "ywuI2WspUUG", + "displayName": "System Admin", + "access": "rw------" + }, + "mKKNXzeIAJs": { + "id": "mKKNXzeIAJs", + "displayName": "Data Management Admin", + "access": "rw------" + } } - ] + } }, { "id": "KOiGcdA4JjD", "type": "PIVOT_TABLE", "name": "[Bahamas] Projects - People", "numberType": "VALUE", - "legendDisplayStyle": "FILL", "rowSubTotals": true, "showDimensionLabels": true, "showData": true, "aggregationType": "DEFAULT", - "legendDisplayStrategy": "FIXED", + "legend": { + "strategy": "FIXED", + "style": "FILL", + "showKey": false + }, "rowTotals": true, "digitGroupSeparator": "SPACE", "dataDimensionItems": [ @@ -4444,7 +4705,9 @@ "id": "dx" } ], - "columnDimensions": ["dx"], + "columnDimensions": [ + "dx" + ], "filters": [ { "id": "pe" @@ -4466,13 +4729,19 @@ ] } ], - "filterDimensions": ["pe", "uSMHdwhxFSV", "GIIHAr9BzzO"], + "filterDimensions": [ + "pe", + "uSMHdwhxFSV", + "GIIHAr9BzzO" + ], "rows": [ { "id": "ou" } ], - "rowDimensions": ["ou"], + "rowDimensions": [ + "ou" + ], "categoryDimensions": [ { "category": { @@ -4495,19 +4764,24 @@ ] } ], - "publicAccess": "rw------" + "sharing": { + "public": "rw------" + } }, { "id": "CS7csnUtibF", "type": "PIVOT_TABLE", "name": "[Bahamas] Projects - Benefit", "numberType": "VALUE", - "legendDisplayStyle": "FILL", "rowSubTotals": true, "showDimensionLabels": true, "showData": true, "aggregationType": "DEFAULT", - "legendDisplayStrategy": "FIXED", + "legend": { + "strategy": "FIXED", + "style": "FILL", + "showKey": false + }, "rowTotals": true, "digitGroupSeparator": "SPACE", "dataDimensionItems": [ @@ -4580,7 +4854,9 @@ "id": "dx" } ], - "columnDimensions": ["dx"], + "columnDimensions": [ + "dx" + ], "filters": [ { "id": "pe" @@ -4594,13 +4870,18 @@ ] } ], - "filterDimensions": ["pe", "GIIHAr9BzzO"], + "filterDimensions": [ + "pe", + "GIIHAr9BzzO" + ], "rows": [ { "id": "ou" } ], - "rowDimensions": ["ou"], + "rowDimensions": [ + "ou" + ], "categoryDimensions": [ { "category": { @@ -4613,19 +4894,24 @@ ] } ], - "publicAccess": "rw------" + "sharing": { + "public": "rw------" + } }, { "id": "GqYJDh6asM8", "type": "COLUMN", "name": "[Bahamas] Aggregated Actual Values - People", "numberType": "VALUE", - "legendDisplayStyle": "FILL", "rowSubTotals": true, "showDimensionLabels": true, "showData": true, "aggregationType": "DEFAULT", - "legendDisplayStrategy": "FIXED", + "legend": { + "strategy": "FIXED", + "style": "FILL", + "showKey": false + }, "rowTotals": true, "digitGroupSeparator": "SPACE", "dataDimensionItems": [ @@ -4710,7 +4996,9 @@ "id": "dx" } ], - "columnDimensions": ["dx"], + "columnDimensions": [ + "dx" + ], "filters": [ { "id": "ou" @@ -4732,13 +5020,19 @@ ] } ], - "filterDimensions": ["ou", "uSMHdwhxFSV", "GIIHAr9BzzO"], + "filterDimensions": [ + "ou", + "uSMHdwhxFSV", + "GIIHAr9BzzO" + ], "rows": [ { "id": "pe" } ], - "rowDimensions": ["pe"], + "rowDimensions": [ + "pe" + ], "categoryDimensions": [ { "category": { @@ -4761,19 +5055,24 @@ ] } ], - "publicAccess": "rw------" + "sharing": { + "public": "rw------" + } }, { "id": "me6p7L8VHXl", "type": "COLUMN", "name": "[Bahamas] Aggregated Actual Values - Benefit", "numberType": "VALUE", - "legendDisplayStyle": "FILL", "rowSubTotals": true, "showDimensionLabels": true, "showData": true, "aggregationType": "DEFAULT", - "legendDisplayStrategy": "FIXED", + "legend": { + "strategy": "FIXED", + "style": "FILL", + "showKey": false + }, "rowTotals": true, "digitGroupSeparator": "SPACE", "dataDimensionItems": [ @@ -4840,7 +5139,9 @@ "id": "dx" } ], - "columnDimensions": ["dx"], + "columnDimensions": [ + "dx" + ], "filters": [ { "id": "ou" @@ -4854,13 +5155,18 @@ ] } ], - "filterDimensions": ["ou", "GIIHAr9BzzO"], + "filterDimensions": [ + "ou", + "GIIHAr9BzzO" + ], "rows": [ { "id": "pe" } ], - "rowDimensions": ["pe"], + "rowDimensions": [ + "pe" + ], "categoryDimensions": [ { "category": { @@ -4873,19 +5179,24 @@ ] } ], - "publicAccess": "rw------" + "sharing": { + "public": "rw------" + } }, { "id": "CAEdMM5XM5T", "type": "PIVOT_TABLE", "name": "Award Number 12345 - Target vs Actual - People - Pivot Table", "numberType": "VALUE", - "legendDisplayStyle": "FILL", "rowSubTotals": true, "showDimensionLabels": true, "showData": true, "aggregationType": "DEFAULT", - "legendDisplayStrategy": "FIXED", + "legend": { + "strategy": "FIXED", + "style": "FILL", + "showKey": false + }, "rowTotals": true, "digitGroupSeparator": "SPACE", "dataDimensionItems": [ @@ -4983,13 +5294,17 @@ "id": "pe" } ], - "columnDimensions": ["pe"], + "columnDimensions": [ + "pe" + ], "filters": [ { "id": "ou" } ], - "filterDimensions": ["ou"], + "filterDimensions": [ + "ou" + ], "rows": [ { "id": "dx" @@ -5025,7 +5340,11 @@ ] } ], - "rowDimensions": ["dx", "GIIHAr9BzzO", "uSMHdwhxFSV"], + "rowDimensions": [ + "dx", + "GIIHAr9BzzO", + "uSMHdwhxFSV" + ], "categoryDimensions": [ { "category": { @@ -5054,39 +5373,44 @@ ] } ], - "publicAccess": "--------", - "externalAccess": false, - "userAccesses": [ - { - "id": "M5zQapPyTZI", - "displayName": "admin admin", - "access": "rw------" - } - ], - "userGroupAccesses": [ - { - "id": "ywuI2WspUUG", - "displayName": "System Admin", - "access": "rw------" + "sharing": { + "public": "--------", + "external": false, + "users": { + "M5zQapPyTZI": { + "id": "M5zQapPyTZI", + "displayName": "admin admin", + "access": "rw------" + } }, - { - "id": "mKKNXzeIAJs", - "displayName": "Data Management Admin", - "access": "rw------" + "userGroups": { + "ywuI2WspUUG": { + "id": "ywuI2WspUUG", + "displayName": "System Admin", + "access": "rw------" + }, + "mKKNXzeIAJs": { + "id": "mKKNXzeIAJs", + "displayName": "Data Management Admin", + "access": "rw------" + } } - ] + } }, { "id": "GiUz1pZI2Rq", "type": "COLUMN", "name": "Award Number 12345 - Target vs Actual - People - Column Chart", "numberType": "VALUE", - "legendDisplayStyle": "FILL", "rowSubTotals": true, "showDimensionLabels": true, "showData": true, "aggregationType": "DEFAULT", - "legendDisplayStrategy": "FIXED", + "legend": { + "strategy": "FIXED", + "style": "FILL", + "showKey": false + }, "rowTotals": true, "digitGroupSeparator": "SPACE", "dataDimensionItems": [ @@ -5184,7 +5508,9 @@ "id": "dx" } ], - "columnDimensions": ["dx"], + "columnDimensions": [ + "dx" + ], "filters": [ { "id": "ou" @@ -5220,7 +5546,11 @@ ] } ], - "filterDimensions": ["ou", "Kyg1O6YEGa9", "uSMHdwhxFSV"], + "filterDimensions": [ + "ou", + "Kyg1O6YEGa9", + "uSMHdwhxFSV" + ], "rows": [ { "code": "ACTUAL_TARGET", @@ -5241,7 +5571,10 @@ "id": "pe" } ], - "rowDimensions": ["GIIHAr9BzzO", "pe"], + "rowDimensions": [ + "GIIHAr9BzzO", + "pe" + ], "categoryDimensions": [ { "category": { @@ -5283,39 +5616,44 @@ ] } ], - "publicAccess": "--------", - "externalAccess": false, - "userAccesses": [ - { - "id": "M5zQapPyTZI", - "displayName": "admin admin", - "access": "rw------" - } - ], - "userGroupAccesses": [ - { - "id": "ywuI2WspUUG", - "displayName": "System Admin", - "access": "rw------" + "sharing": { + "public": "--------", + "external": false, + "users": { + "M5zQapPyTZI": { + "id": "M5zQapPyTZI", + "displayName": "admin admin", + "access": "rw------" + } }, - { - "id": "mKKNXzeIAJs", - "displayName": "Data Management Admin", - "access": "rw------" + "userGroups": { + "ywuI2WspUUG": { + "id": "ywuI2WspUUG", + "displayName": "System Admin", + "access": "rw------" + }, + "mKKNXzeIAJs": { + "id": "mKKNXzeIAJs", + "displayName": "Data Management Admin", + "access": "rw------" + } } - ] + } }, { "id": "uwoFl2upiOM", "type": "PIVOT_TABLE", "name": "Award Number 12345 - Target vs Actual - Benefits - Pivot Table", "numberType": "VALUE", - "legendDisplayStyle": "FILL", "rowSubTotals": true, "showDimensionLabels": true, "showData": true, "aggregationType": "DEFAULT", - "legendDisplayStrategy": "FIXED", + "legend": { + "strategy": "FIXED", + "style": "FILL", + "showKey": false + }, "rowTotals": true, "digitGroupSeparator": "SPACE", "dataDimensionItems": [ @@ -5395,13 +5733,17 @@ "id": "pe" } ], - "columnDimensions": ["pe"], + "columnDimensions": [ + "pe" + ], "filters": [ { "id": "ou" } ], - "filterDimensions": ["ou"], + "filterDimensions": [ + "ou" + ], "rows": [ { "id": "dx" @@ -5422,7 +5764,10 @@ ] } ], - "rowDimensions": ["dx", "GIIHAr9BzzO"], + "rowDimensions": [ + "dx", + "GIIHAr9BzzO" + ], "categoryDimensions": [ { "category": { @@ -5438,39 +5783,44 @@ ] } ], - "publicAccess": "--------", - "externalAccess": false, - "userAccesses": [ - { - "id": "M5zQapPyTZI", - "displayName": "admin admin", - "access": "rw------" - } - ], - "userGroupAccesses": [ - { - "id": "ywuI2WspUUG", - "displayName": "System Admin", - "access": "rw------" + "sharing": { + "public": "--------", + "external": false, + "users": { + "M5zQapPyTZI": { + "id": "M5zQapPyTZI", + "displayName": "admin admin", + "access": "rw------" + } }, - { - "id": "mKKNXzeIAJs", - "displayName": "Data Management Admin", - "access": "rw------" + "userGroups": { + "ywuI2WspUUG": { + "id": "ywuI2WspUUG", + "displayName": "System Admin", + "access": "rw------" + }, + "mKKNXzeIAJs": { + "id": "mKKNXzeIAJs", + "displayName": "Data Management Admin", + "access": "rw------" + } } - ] + } }, { "id": "ui6nUS98GBM", "type": "COLUMN", "name": "Award Number 12345 - Target vs Actual - Benefits - Column Chart", "numberType": "VALUE", - "legendDisplayStyle": "FILL", "rowSubTotals": true, "showDimensionLabels": true, "showData": true, "aggregationType": "DEFAULT", - "legendDisplayStrategy": "FIXED", + "legend": { + "strategy": "FIXED", + "style": "FILL", + "showKey": false + }, "rowTotals": true, "digitGroupSeparator": "SPACE", "dataDimensionItems": [ @@ -5550,13 +5900,17 @@ "id": "dx" } ], - "columnDimensions": ["dx"], + "columnDimensions": [ + "dx" + ], "filters": [ { "id": "ou" } ], - "filterDimensions": ["ou"], + "filterDimensions": [ + "ou" + ], "rows": [ { "code": "ACTUAL_TARGET", @@ -5577,7 +5931,10 @@ "id": "pe" } ], - "rowDimensions": ["GIIHAr9BzzO", "pe"], + "rowDimensions": [ + "GIIHAr9BzzO", + "pe" + ], "categoryDimensions": [ { "category": { @@ -5593,39 +5950,45 @@ ] } ], - "publicAccess": "--------", - "externalAccess": false, - "userAccesses": [ - { - "id": "M5zQapPyTZI", - "displayName": "admin admin", - "access": "rw------" - } - ], - "userGroupAccesses": [ - { - "id": "ywuI2WspUUG", - "displayName": "System Admin", - "access": "rw------" + "sharing": { + "public": "--------", + "external": false, + "users": { + "M5zQapPyTZI": { + "id": "M5zQapPyTZI", + "displayName": "admin admin", + "access": "rw------" + } }, - { - "id": "mKKNXzeIAJs", - "displayName": "Data Management Admin", - "access": "rw------" + "userGroups": { + "ywuI2WspUUG": { + "id": "ywuI2WspUUG", + "displayName": "System Admin", + "access": "rw------" + }, + "mKKNXzeIAJs": { + "id": "mKKNXzeIAJs", + "displayName": "Data Management Admin", + "access": "rw------" + } } - ] + } }, { "id": "mUCwcWSsa9T", "type": "PIVOT_TABLE", "name": "Award Number 12345 - Achieved total to date (%) - People", "numberType": "VALUE", - "legendDisplayStyle": "FILL", "rowSubTotals": true, "showDimensionLabels": true, "showData": true, "aggregationType": "DEFAULT", - "legendDisplayStrategy": "FIXED", + "legend": { + "set": { + "code": "ACTUAL_TARGET_ACHIEVED", + "id": "yoAt108kUFm" + } + }, "rowTotals": false, "digitGroupSeparator": "SPACE", "dataDimensionItems": [ @@ -5794,7 +6157,9 @@ ] } ], - "columnDimensions": ["uSMHdwhxFSV"], + "columnDimensions": [ + "uSMHdwhxFSV" + ], "filters": [ { "id": "ou" @@ -5803,13 +6168,18 @@ "id": "pe" } ], - "filterDimensions": ["ou", "pe"], + "filterDimensions": [ + "ou", + "pe" + ], "rows": [ { "id": "dx" } ], - "rowDimensions": ["dx"], + "rowDimensions": [ + "dx" + ], "categoryDimensions": [ { "category": { @@ -5822,30 +6192,28 @@ ] } ], - "publicAccess": "--------", - "externalAccess": false, - "userAccesses": [ - { - "id": "M5zQapPyTZI", - "displayName": "admin admin", - "access": "rw------" - } - ], - "userGroupAccesses": [ - { - "id": "ywuI2WspUUG", - "displayName": "System Admin", - "access": "rw------" + "sharing": { + "public": "--------", + "external": false, + "users": { + "M5zQapPyTZI": { + "id": "M5zQapPyTZI", + "displayName": "admin admin", + "access": "rw------" + } }, - { - "id": "mKKNXzeIAJs", - "displayName": "Data Management Admin", - "access": "rw------" + "userGroups": { + "ywuI2WspUUG": { + "id": "ywuI2WspUUG", + "displayName": "System Admin", + "access": "rw------" + }, + "mKKNXzeIAJs": { + "id": "mKKNXzeIAJs", + "displayName": "Data Management Admin", + "access": "rw------" + } } - ], - "legendSet": { - "code": "ACTUAL_TARGET_ACHIEVED", - "id": "yoAt108kUFm" } }, { @@ -5853,12 +6221,16 @@ "type": "PIVOT_TABLE", "name": "Award Number 12345 - Achieved to date (%) - Benefits", "numberType": "VALUE", - "legendDisplayStyle": "FILL", "rowSubTotals": true, "showDimensionLabels": true, "showData": true, "aggregationType": "DEFAULT", - "legendDisplayStrategy": "FIXED", + "legend": { + "set": { + "code": "ACTUAL_TARGET_ACHIEVED", + "id": "yoAt108kUFm" + } + }, "rowTotals": true, "digitGroupSeparator": "SPACE", "dataDimensionItems": [ @@ -6004,44 +6376,48 @@ "id": "pe" } ], - "columnDimensions": ["pe"], + "columnDimensions": [ + "pe" + ], "filters": [ { "id": "ou" } ], - "filterDimensions": ["ou"], + "filterDimensions": [ + "ou" + ], "rows": [ { "id": "dx" } ], - "rowDimensions": ["dx"], - "categoryDimensions": [], - "publicAccess": "--------", - "externalAccess": false, - "userAccesses": [ - { - "id": "M5zQapPyTZI", - "displayName": "admin admin", - "access": "rw------" - } + "rowDimensions": [ + "dx" ], - "userGroupAccesses": [ - { - "id": "ywuI2WspUUG", - "displayName": "System Admin", - "access": "rw------" + "categoryDimensions": [], + "sharing": { + "public": "--------", + "external": false, + "users": { + "M5zQapPyTZI": { + "id": "M5zQapPyTZI", + "displayName": "admin admin", + "access": "rw------" + } }, - { - "id": "mKKNXzeIAJs", - "displayName": "Data Management Admin", - "access": "rw------" + "userGroups": { + "ywuI2WspUUG": { + "id": "ywuI2WspUUG", + "displayName": "System Admin", + "access": "rw------" + }, + "mKKNXzeIAJs": { + "id": "mKKNXzeIAJs", + "displayName": "Data Management Admin", + "access": "rw------" + } } - ], - "legendSet": { - "code": "ACTUAL_TARGET_ACHIEVED", - "id": "yoAt108kUFm" } }, { @@ -6049,12 +6425,15 @@ "type": "PIVOT_TABLE", "name": "Award Number 12345 - Target vs Actual - People", "numberType": "VALUE", - "legendDisplayStyle": "FILL", "rowSubTotals": true, "showDimensionLabels": true, "showData": true, "aggregationType": "DEFAULT", - "legendDisplayStrategy": "FIXED", + "legend": { + "strategy": "FIXED", + "style": "FILL", + "showKey": false + }, "rowTotals": true, "digitGroupSeparator": "SPACE", "dataDimensionItems": [ @@ -6233,13 +6612,18 @@ ] } ], - "columnDimensions": ["pe", "Kyg1O6YEGa9"], + "columnDimensions": [ + "pe", + "Kyg1O6YEGa9" + ], "filters": [ { "id": "ou" } ], - "filterDimensions": ["ou"], + "filterDimensions": [ + "ou" + ], "rows": [ { "id": "dx" @@ -6275,7 +6659,11 @@ ] } ], - "rowDimensions": ["dx", "GIIHAr9BzzO", "uSMHdwhxFSV"], + "rowDimensions": [ + "dx", + "GIIHAr9BzzO", + "uSMHdwhxFSV" + ], "categoryDimensions": [ { "category": { @@ -6317,39 +6705,44 @@ ] } ], - "publicAccess": "--------", - "externalAccess": false, - "userAccesses": [ - { - "id": "M5zQapPyTZI", - "displayName": "admin admin", - "access": "rw------" - } - ], - "userGroupAccesses": [ - { - "id": "ywuI2WspUUG", - "displayName": "System Admin", - "access": "rw------" + "sharing": { + "public": "--------", + "external": false, + "users": { + "M5zQapPyTZI": { + "id": "M5zQapPyTZI", + "displayName": "admin admin", + "access": "rw------" + } }, - { - "id": "mKKNXzeIAJs", - "displayName": "Data Management Admin", - "access": "rw------" + "userGroups": { + "ywuI2WspUUG": { + "id": "ywuI2WspUUG", + "displayName": "System Admin", + "access": "rw------" + }, + "mKKNXzeIAJs": { + "id": "mKKNXzeIAJs", + "displayName": "Data Management Admin", + "access": "rw------" + } } - ] + } }, { "id": "uqMTlezGj0I", "type": "PIVOT_TABLE", "name": "Award Number 12345 - Target vs Actual - Benefits", "numberType": "VALUE", - "legendDisplayStyle": "FILL", "rowSubTotals": true, "showDimensionLabels": true, "showData": true, "aggregationType": "DEFAULT", - "legendDisplayStrategy": "FIXED", + "legend": { + "strategy": "FIXED", + "style": "FILL", + "showKey": false + }, "rowTotals": true, "digitGroupSeparator": "SPACE", "dataDimensionItems": [ @@ -6495,13 +6888,17 @@ "id": "pe" } ], - "columnDimensions": ["pe"], + "columnDimensions": [ + "pe" + ], "filters": [ { "id": "ou" } ], - "filterDimensions": ["ou"], + "filterDimensions": [ + "ou" + ], "rows": [ { "id": "dx" @@ -6522,7 +6919,10 @@ ] } ], - "rowDimensions": ["dx", "GIIHAr9BzzO"], + "rowDimensions": [ + "dx", + "GIIHAr9BzzO" + ], "categoryDimensions": [ { "category": { @@ -6538,39 +6938,44 @@ ] } ], - "publicAccess": "--------", - "externalAccess": false, - "userAccesses": [ - { - "id": "M5zQapPyTZI", - "displayName": "admin admin", - "access": "rw------" - } - ], - "userGroupAccesses": [ - { - "id": "ywuI2WspUUG", - "displayName": "System Admin", - "access": "rw------" + "sharing": { + "public": "--------", + "external": false, + "users": { + "M5zQapPyTZI": { + "id": "M5zQapPyTZI", + "displayName": "admin admin", + "access": "rw------" + } }, - { - "id": "mKKNXzeIAJs", - "displayName": "Data Management Admin", - "access": "rw------" + "userGroups": { + "ywuI2WspUUG": { + "id": "ywuI2WspUUG", + "displayName": "System Admin", + "access": "rw------" + }, + "mKKNXzeIAJs": { + "id": "mKKNXzeIAJs", + "displayName": "Data Management Admin", + "access": "rw------" + } } - ] + } }, { "id": "i8TrzIkXGrG", "type": "PIVOT_TABLE", "name": "Award Number 12345 - Target vs Actual - People - Month by Month", "numberType": "VALUE", - "legendDisplayStyle": "FILL", "rowSubTotals": true, "showDimensionLabels": true, "showData": true, "aggregationType": "DEFAULT", - "legendDisplayStrategy": "FIXED", + "legend": { + "strategy": "FIXED", + "style": "FILL", + "showKey": false + }, "rowTotals": true, "digitGroupSeparator": "SPACE", "dataDimensionItems": [ @@ -6734,7 +7139,9 @@ "id": "pe" } ], - "columnDimensions": ["pe"], + "columnDimensions": [ + "pe" + ], "filters": [ { "id": "ou" @@ -6770,7 +7177,11 @@ ] } ], - "filterDimensions": ["ou", "Kyg1O6YEGa9", "uSMHdwhxFSV"], + "filterDimensions": [ + "ou", + "Kyg1O6YEGa9", + "uSMHdwhxFSV" + ], "rows": [ { "id": "dx" @@ -6791,7 +7202,10 @@ ] } ], - "rowDimensions": ["dx", "GIIHAr9BzzO"], + "rowDimensions": [ + "dx", + "GIIHAr9BzzO" + ], "categoryDimensions": [ { "category": { @@ -6833,39 +7247,44 @@ ] } ], - "publicAccess": "--------", - "externalAccess": false, - "userAccesses": [ - { - "id": "M5zQapPyTZI", - "displayName": "admin admin", - "access": "rw------" - } - ], - "userGroupAccesses": [ - { - "id": "ywuI2WspUUG", - "displayName": "System Admin", - "access": "rw------" + "sharing": { + "public": "--------", + "external": false, + "users": { + "M5zQapPyTZI": { + "id": "M5zQapPyTZI", + "displayName": "admin admin", + "access": "rw------" + } }, - { - "id": "mKKNXzeIAJs", - "displayName": "Data Management Admin", - "access": "rw------" + "userGroups": { + "ywuI2WspUUG": { + "id": "ywuI2WspUUG", + "displayName": "System Admin", + "access": "rw------" + }, + "mKKNXzeIAJs": { + "id": "mKKNXzeIAJs", + "displayName": "Data Management Admin", + "access": "rw------" + } } - ] + } }, { "id": "aGYruOfBtaD", "type": "PIVOT_TABLE", "name": "Award Number 12345 - Target vs Actual - Benefits - Month by Month", "numberType": "VALUE", - "legendDisplayStyle": "FILL", "rowSubTotals": true, "showDimensionLabels": true, "showData": true, "aggregationType": "DEFAULT", - "legendDisplayStrategy": "FIXED", + "legend": { + "strategy": "FIXED", + "style": "FILL", + "showKey": false + }, "rowTotals": true, "digitGroupSeparator": "SPACE", "dataDimensionItems": [ @@ -7011,13 +7430,17 @@ "id": "pe" } ], - "columnDimensions": ["pe"], + "columnDimensions": [ + "pe" + ], "filters": [ { "id": "ou" } ], - "filterDimensions": ["ou"], + "filterDimensions": [ + "ou" + ], "rows": [ { "id": "dx" @@ -7038,7 +7461,10 @@ ] } ], - "rowDimensions": ["dx", "GIIHAr9BzzO"], + "rowDimensions": [ + "dx", + "GIIHAr9BzzO" + ], "categoryDimensions": [ { "category": { @@ -7054,39 +7480,44 @@ ] } ], - "publicAccess": "--------", - "externalAccess": false, - "userAccesses": [ - { - "id": "M5zQapPyTZI", - "displayName": "admin admin", - "access": "rw------" - } - ], - "userGroupAccesses": [ - { - "id": "ywuI2WspUUG", - "displayName": "System Admin", - "access": "rw------" + "sharing": { + "public": "--------", + "external": false, + "users": { + "M5zQapPyTZI": { + "id": "M5zQapPyTZI", + "displayName": "admin admin", + "access": "rw------" + } }, - { - "id": "mKKNXzeIAJs", - "displayName": "Data Management Admin", - "access": "rw------" + "userGroups": { + "ywuI2WspUUG": { + "id": "ywuI2WspUUG", + "displayName": "System Admin", + "access": "rw------" + }, + "mKKNXzeIAJs": { + "id": "mKKNXzeIAJs", + "displayName": "Data Management Admin", + "access": "rw------" + } } - ] + } }, { "id": "KoIzyX81ZVL", "type": "PIVOT_TABLE", "name": "Award Number 12345 - Target vs Actual - People - Male Only - Pivot Table", "numberType": "VALUE", - "legendDisplayStyle": "FILL", "rowSubTotals": true, "showDimensionLabels": true, "showData": true, "aggregationType": "DEFAULT", - "legendDisplayStrategy": "FIXED", + "legend": { + "strategy": "FIXED", + "style": "FILL", + "showKey": false + }, "rowTotals": true, "digitGroupSeparator": "SPACE", "dataDimensionItems": [ @@ -7184,7 +7615,9 @@ "id": "pe" } ], - "columnDimensions": ["pe"], + "columnDimensions": [ + "pe" + ], "filters": [ { "id": "ou" @@ -7206,7 +7639,11 @@ ] } ], - "filterDimensions": ["ou", "Kyg1O6YEGa9", "uSMHdwhxFSV"], + "filterDimensions": [ + "ou", + "Kyg1O6YEGa9", + "uSMHdwhxFSV" + ], "rows": [ { "id": "dx" @@ -7227,7 +7664,10 @@ ] } ], - "rowDimensions": ["dx", "GIIHAr9BzzO"], + "rowDimensions": [ + "dx", + "GIIHAr9BzzO" + ], "categoryDimensions": [ { "category": { @@ -7263,39 +7703,44 @@ ] } ], - "publicAccess": "--------", - "externalAccess": false, - "userAccesses": [ - { - "id": "M5zQapPyTZI", - "displayName": "admin admin", - "access": "rw------" - } - ], - "userGroupAccesses": [ - { - "id": "ywuI2WspUUG", - "displayName": "System Admin", - "access": "rw------" + "sharing": { + "public": "--------", + "external": false, + "users": { + "M5zQapPyTZI": { + "id": "M5zQapPyTZI", + "displayName": "admin admin", + "access": "rw------" + } }, - { - "id": "mKKNXzeIAJs", - "displayName": "Data Management Admin", - "access": "rw------" + "userGroups": { + "ywuI2WspUUG": { + "id": "ywuI2WspUUG", + "displayName": "System Admin", + "access": "rw------" + }, + "mKKNXzeIAJs": { + "id": "mKKNXzeIAJs", + "displayName": "Data Management Admin", + "access": "rw------" + } } - ] + } }, { "id": "WikhmLU9agJ", "type": "COLUMN", "name": "Award Number 12345 - Target vs Actual - People - Male Only - Column Chart", "numberType": "VALUE", - "legendDisplayStyle": "FILL", "rowSubTotals": true, "showDimensionLabels": true, "showData": true, "aggregationType": "DEFAULT", - "legendDisplayStrategy": "FIXED", + "legend": { + "strategy": "FIXED", + "style": "FILL", + "showKey": false + }, "rowTotals": true, "digitGroupSeparator": "SPACE", "dataDimensionItems": [ @@ -7393,7 +7838,9 @@ "id": "pe" } ], - "columnDimensions": ["pe"], + "columnDimensions": [ + "pe" + ], "filters": [ { "id": "ou" @@ -7415,7 +7862,11 @@ ] } ], - "filterDimensions": ["ou", "Kyg1O6YEGa9", "uSMHdwhxFSV"], + "filterDimensions": [ + "ou", + "Kyg1O6YEGa9", + "uSMHdwhxFSV" + ], "rows": [ { "id": "dx" @@ -7436,7 +7887,10 @@ ] } ], - "rowDimensions": ["dx", "GIIHAr9BzzO"], + "rowDimensions": [ + "dx", + "GIIHAr9BzzO" + ], "categoryDimensions": [ { "category": { @@ -7472,39 +7926,44 @@ ] } ], - "publicAccess": "--------", - "externalAccess": false, - "userAccesses": [ - { - "id": "M5zQapPyTZI", - "displayName": "admin admin", - "access": "rw------" - } - ], - "userGroupAccesses": [ - { - "id": "ywuI2WspUUG", - "displayName": "System Admin", - "access": "rw------" + "sharing": { + "public": "--------", + "external": false, + "users": { + "M5zQapPyTZI": { + "id": "M5zQapPyTZI", + "displayName": "admin admin", + "access": "rw------" + } }, - { - "id": "mKKNXzeIAJs", - "displayName": "Data Management Admin", - "access": "rw------" + "userGroups": { + "ywuI2WspUUG": { + "id": "ywuI2WspUUG", + "displayName": "System Admin", + "access": "rw------" + }, + "mKKNXzeIAJs": { + "id": "mKKNXzeIAJs", + "displayName": "Data Management Admin", + "access": "rw------" + } } - ] + } }, { "id": "yamOXKh6Vok", "type": "PIVOT_TABLE", "name": "Award Number 12345 - Target vs Actual - People - Female Only - Pivot Table", "numberType": "VALUE", - "legendDisplayStyle": "FILL", "rowSubTotals": true, "showDimensionLabels": true, "showData": true, "aggregationType": "DEFAULT", - "legendDisplayStrategy": "FIXED", + "legend": { + "strategy": "FIXED", + "style": "FILL", + "showKey": false + }, "rowTotals": true, "digitGroupSeparator": "SPACE", "dataDimensionItems": [ @@ -7602,7 +8061,9 @@ "id": "pe" } ], - "columnDimensions": ["pe"], + "columnDimensions": [ + "pe" + ], "filters": [ { "id": "ou" @@ -7624,7 +8085,11 @@ ] } ], - "filterDimensions": ["ou", "Kyg1O6YEGa9", "uSMHdwhxFSV"], + "filterDimensions": [ + "ou", + "Kyg1O6YEGa9", + "uSMHdwhxFSV" + ], "rows": [ { "id": "dx" @@ -7645,7 +8110,10 @@ ] } ], - "rowDimensions": ["dx", "GIIHAr9BzzO"], + "rowDimensions": [ + "dx", + "GIIHAr9BzzO" + ], "categoryDimensions": [ { "category": { @@ -7681,39 +8149,44 @@ ] } ], - "publicAccess": "--------", - "externalAccess": false, - "userAccesses": [ - { - "id": "M5zQapPyTZI", - "displayName": "admin admin", - "access": "rw------" - } - ], - "userGroupAccesses": [ - { - "id": "ywuI2WspUUG", - "displayName": "System Admin", - "access": "rw------" + "sharing": { + "public": "--------", + "external": false, + "users": { + "M5zQapPyTZI": { + "id": "M5zQapPyTZI", + "displayName": "admin admin", + "access": "rw------" + } }, - { - "id": "mKKNXzeIAJs", - "displayName": "Data Management Admin", - "access": "rw------" + "userGroups": { + "ywuI2WspUUG": { + "id": "ywuI2WspUUG", + "displayName": "System Admin", + "access": "rw------" + }, + "mKKNXzeIAJs": { + "id": "mKKNXzeIAJs", + "displayName": "Data Management Admin", + "access": "rw------" + } } - ] + } }, { "id": "yaQ772dtmLb", "type": "COLUMN", "name": "Award Number 12345 - Target vs Actual - People - Female Only - Column Chart", "numberType": "VALUE", - "legendDisplayStyle": "FILL", "rowSubTotals": true, "showDimensionLabels": true, "showData": true, "aggregationType": "DEFAULT", - "legendDisplayStrategy": "FIXED", + "legend": { + "strategy": "FIXED", + "style": "FILL", + "showKey": false + }, "rowTotals": true, "digitGroupSeparator": "SPACE", "dataDimensionItems": [ @@ -7811,7 +8284,9 @@ "id": "pe" } ], - "columnDimensions": ["pe"], + "columnDimensions": [ + "pe" + ], "filters": [ { "id": "ou" @@ -7833,7 +8308,11 @@ ] } ], - "filterDimensions": ["ou", "Kyg1O6YEGa9", "uSMHdwhxFSV"], + "filterDimensions": [ + "ou", + "Kyg1O6YEGa9", + "uSMHdwhxFSV" + ], "rows": [ { "id": "dx" @@ -7854,7 +8333,10 @@ ] } ], - "rowDimensions": ["dx", "GIIHAr9BzzO"], + "rowDimensions": [ + "dx", + "GIIHAr9BzzO" + ], "categoryDimensions": [ { "category": { @@ -7890,27 +8372,29 @@ ] } ], - "publicAccess": "--------", - "externalAccess": false, - "userAccesses": [ - { - "id": "M5zQapPyTZI", - "displayName": "admin admin", - "access": "rw------" - } - ], - "userGroupAccesses": [ - { - "id": "ywuI2WspUUG", - "displayName": "System Admin", - "access": "rw------" + "sharing": { + "public": "--------", + "external": false, + "users": { + "M5zQapPyTZI": { + "id": "M5zQapPyTZI", + "displayName": "admin admin", + "access": "rw------" + } }, - { - "id": "mKKNXzeIAJs", - "displayName": "Data Management Admin", - "access": "rw------" + "userGroups": { + "ywuI2WspUUG": { + "id": "ywuI2WspUUG", + "displayName": "System Admin", + "access": "rw------" + }, + "mKKNXzeIAJs": { + "id": "mKKNXzeIAJs", + "displayName": "Data Management Admin", + "access": "rw------" + } } - ] + } } ] -} +} \ No newline at end of file diff --git a/src/models/__tests__/data/project-metadata.json b/src/models/__tests__/data/project-metadata.json index 5dea1c74..7db9aaf9 100644 --- a/src/models/__tests__/data/project-metadata.json +++ b/src/models/__tests__/data/project-metadata.json @@ -16,27 +16,6 @@ { "code": "WGC0DJ0YSis_ACTUAL", "id": "CwUxT9UIX3z", - "publicAccess": "--------", - "externalAccess": false, - "userAccesses": [ - { - "id": "M5zQapPyTZI", - "displayName": "admin admin", - "access": "rwrw----" - } - ], - "userGroupAccesses": [ - { - "id": "ywuI2WspUUG", - "displayName": "System Admin", - "access": "rwrw----" - }, - { - "id": "mKKNXzeIAJs", - "displayName": "Data Management Admin", - "access": "rwrw----" - } - ], "dataSetElements": [ { "dataElement": { @@ -293,7 +272,30 @@ "closingDate": "2019-03-10T00:00:00.000", "openingDate": "2018-10-01T00:00:00.000" } - ] + ], + "sharing": { + "public": "--------", + "external": false, + "users": { + "M5zQapPyTZI": { + "id": "M5zQapPyTZI", + "displayName": "admin admin", + "access": "rwrw----" + } + }, + "userGroups": { + "ywuI2WspUUG": { + "id": "ywuI2WspUUG", + "displayName": "System Admin", + "access": "rwrw----" + }, + "mKKNXzeIAJs": { + "id": "mKKNXzeIAJs", + "displayName": "Data Management Admin", + "access": "rwrw----" + } + } + } } ] } diff --git a/src/models/__tests__/mer-data.ts b/src/models/__tests__/mer-data.ts index d8746454..b791fe30 100644 --- a/src/models/__tests__/mer-data.ts +++ b/src/models/__tests__/mer-data.ts @@ -1,5 +1,7 @@ -import MockAdapter from "axios-mock-adapter"; import { logUnknownRequest } from "../../utils/tests"; +import { getMockApi } from "../../types/d2-api"; + +type MockAdapter = ReturnType["mock"]; function mockApiMerDataSets(mock: MockAdapter, orgUnitIds: string[]) { mock.onGet("/metadata", { diff --git a/src/types/d2-api.ts b/src/types/d2-api.ts index 4d2d89da..a4887c69 100644 --- a/src/types/d2-api.ts +++ b/src/types/d2-api.ts @@ -1,9 +1,8 @@ -import { D2Api, D2ModelSchemas, MetadataPayloadBase } from "@eyeseetea/d2-api/2.36"; -import MockAdapter from "axios-mock-adapter/types"; +import { D2Api, D2ModelSchemas, MetadataPayloadBase } from "@eyeseetea/d2-api/2.42"; -export * from "@eyeseetea/d2-api/2.36"; +export * from "@eyeseetea/d2-api/2.42"; -export function getMockApi(): { api: D2Api; mock: MockAdapter } { +export function getMockApi() { const api = new D2Api({ backend: "xhr" }); const mock = api.getMockAdapter(); return { api, mock }; diff --git a/src/utils/tests.ts b/src/utils/tests.ts index 7e6cd008..de526884 100644 --- a/src/utils/tests.ts +++ b/src/utils/tests.ts @@ -1,17 +1,18 @@ import fs from "fs"; import tmp from "tmp"; import _ from "lodash"; -import MockAdapter from "axios-mock-adapter"; -import { Method } from "axios"; +import { getMockApi } from "../types/d2-api"; -interface MockAdapterWithHandlers extends MockAdapter { - handlers: Record; -} +type MockAdapter = ReturnType["mock"]; type Url = string; type Data = object; type Handler = [Url, Data]; +interface MockAdapterWithHandlers extends MockAdapter { + handlers: Record; +} + export function logUnknownRequest(mockAdapter: MockAdapter) { const mock = mockAdapter as MockAdapterWithHandlers; diff --git a/yarn.lock b/yarn.lock index 07f7ce8d..367a6572 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1156,7 +1156,7 @@ dependencies: regenerator-runtime "^0.13.4" -"@babel/runtime@^7.1.2", "@babel/runtime@^7.10.2", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.0", "@babel/runtime@^7.12.1", "@babel/runtime@^7.2.0", "@babel/runtime@^7.3.1", "@babel/runtime@^7.4.4", "@babel/runtime@^7.5.4", "@babel/runtime@^7.5.5", "@babel/runtime@^7.6.0", "@babel/runtime@^7.7.2", "@babel/runtime@^7.8.3", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7", "@babel/runtime@^7.9.1": +"@babel/runtime@^7.1.2", "@babel/runtime@^7.10.2", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.0", "@babel/runtime@^7.12.1", "@babel/runtime@^7.2.0", "@babel/runtime@^7.3.1", "@babel/runtime@^7.4.4", "@babel/runtime@^7.5.5", "@babel/runtime@^7.6.0", "@babel/runtime@^7.7.2", "@babel/runtime@^7.8.3", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7", "@babel/runtime@^7.9.1": version "7.13.10" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.13.10.tgz#47d42a57b6095f4468da440388fdbad8bebf0d7d" integrity sha512-4QPkjJq6Ns3V/RgpEahRk+AGfL0eO6RHHtTWoNNr5mO49G6B5+X6d6THgWEAvTrznU5xYpbAlVKRYcsCgh/Akw== @@ -2890,7 +2890,7 @@ i18next "^10.3" moment "^2.24.0" -"@dhis2/d2-i18n@1.1.0", "@dhis2/d2-i18n@^1.0.5": +"@dhis2/d2-i18n@1.1.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@dhis2/d2-i18n/-/d2-i18n-1.1.0.tgz#ec777c5091f747e4c5aa4f9801c62ba4d1ef3d16" integrity sha512-x3u58goDQsMfBzy50koxNrJjofJTtjRZOfz6f6Py/wMMJfp/T6vZjWMQgcfWH0JrV6d04K1RTt6bI05wqsVQvg== @@ -3414,36 +3414,20 @@ minimatch "^3.0.4" strip-json-comments "^3.1.1" -"@eyeseetea/d2-api@1.16.0-beta.13": - version "1.16.0-beta.13" - resolved "https://registry.yarnpkg.com/@eyeseetea/d2-api/-/d2-api-1.16.0-beta.13.tgz#1b46c30c18f5f54339c7e801af18ad941ea028e7" - integrity sha512-HtQMSDgIKOaMuS1qqBV6BN5uy6AIVbsyqLsrrF3RrWPUcxZmsZyKqM955F1IYbOROLjEgxu5zJnI2B7n4YDKpA== +"@eyeseetea/d2-api@1.21.0-beta.5": + version "1.21.0-beta.5" + resolved "https://registry.yarnpkg.com/@eyeseetea/d2-api/-/d2-api-1.21.0-beta.5.tgz#c6e9590b56d9cf0184fc2c450c483e40a075734a" + integrity sha512-fbtpm/fban4/9x5Gjuz0OwuiFSQFKBqCHvSzvy06r8AzoMAieVup8vsQ8+ZwJ1WDtDs40gWvf6b5dhU6+x7XAA== dependencies: - "@babel/runtime" "^7.5.4" - "@dhis2/d2-i18n" "^1.0.5" - "@types/prettier" "^1.18.3" - "@types/qs" "^6.5.3" abort-controller "3.0.0" - argparse "^2.0.1" - axios "0.19.2" - axios-debug-log "^0.6.2" - axios-mock-adapter "1.18.2" + axios "1.6.4" + axios-mock-adapter "1.22.0" btoa "^1.2.1" - cronstrue "^1.81.0" - cryptr "^4.0.2" - d2 "^31.8.1" - dotenv "^8.0.0" - express "^4.17.1" + cross-fetch "^4.0.0" form-data "^4.0.0" iconv-lite "0.6.2" - isomorphic-fetch "3.0.0" - lodash "^4.17.15" - log4js "^4.5.1" - node-schedule "^1.3.2" - qs "^6.9.0" - react "^16.12.0" - side-channel "^1.0.4" - yargs "^14.0.0" + lodash "4.17.21" + qs "6.9.7" "@eyeseetea/d2-ui-components@2.7.0": version "2.7.0" @@ -4304,11 +4288,6 @@ resolved "https://registry.yarnpkg.com/@types/cryptr/-/cryptr-4.0.1.tgz#d4128be91d1064a2678e695a318b217912881083" integrity sha512-Nn8fvr+8XYWK5h422lj4xQACfOg6vdhKI+Rh9ERa5Mg0cZvPL9Vn3845vSY07dNZnEs5cqkSNVMdhmf70lAYkA== -"@types/debug@^4.0.0": - version "4.1.5" - resolved "https://registry.yarnpkg.com/@types/debug/-/debug-4.1.5.tgz#b14efa8852b7768d898906613c23f688713e02cd" - integrity sha512-Q1y515GcOdTHgagaVFhHnIFQ38ygs/kmxdNpvpou+raI9UO3YZcHDngBSYKQklcKlvA7iuQlmIKbzvmxcOE9CQ== - "@types/eslint@^7.2.6": version "7.2.7" resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-7.2.7.tgz#f7ef1cf0dceab0ae6f9a976a0a9af14ab1baca26" @@ -4444,11 +4423,6 @@ resolved "https://registry.yarnpkg.com/@types/parse-json/-/parse-json-4.0.0.tgz#2f8bb441434d163b35fb8ffdccd7138927ffb8c0" integrity sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA== -"@types/prettier@^1.18.3": - version "1.19.1" - resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-1.19.1.tgz#33509849f8e679e4add158959fdb086440e9553f" - integrity sha512-5qOlnZscTn4xxM5MeGXAMOsIOIKIbh9e85zJWfBRVPlRMEVawzoPhINYbRGkBZCI8LxvBe7tJCdWiarA99OZfQ== - "@types/prettier@^2.0.0": version "2.2.3" resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.2.3.tgz#ef65165aea2924c9359205bf748865b8881753c0" @@ -4464,11 +4438,6 @@ resolved "https://registry.yarnpkg.com/@types/q/-/q-1.5.4.tgz#15925414e0ad2cd765bfef58842f7e26a7accb24" integrity sha512-1HcDas8SEj4z1Wc696tH56G8OlRaH/sqZOynNNB+HF0WOeXPaxTtbYzJY2oEfiUxjSKjhCKr+MvR7dCHcEelug== -"@types/qs@^6.5.3": - version "6.9.6" - resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.9.6.tgz#df9c3c8b31a247ec315e6996566be3171df4b3b1" - integrity sha512-0/HnwIfW4ki2D8L8c9GVcG5I72s9jP5GSLVF0VIXDW00kmIpA6O33G7a8n59Tmh7Nz0WUC3rSb7PTY/sdW2JzA== - "@types/react-dom@17.0.0": version "17.0.0" resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-17.0.0.tgz#b3b691eb956c4b3401777ee67b900cb28415d95a" @@ -5355,11 +5324,6 @@ argparse@^1.0.10, argparse@^1.0.7: dependencies: sprintf-js "~1.0.2" -argparse@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" - integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== - aria-query@5.1.3: version "5.1.3" resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-5.1.3.tgz#19db27cd101152773631396f7a95a3b58c22c35e" @@ -5642,14 +5606,6 @@ axe-core@^4.0.2: resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.1.3.tgz#64a4c85509e0991f5168340edc4bedd1ceea6966" integrity sha512-vwPpH4Aj4122EW38mxO/fxhGKtwWTMLDIJfZ1He0Edbtjcfna/R3YB67yVhezUMzqc3Jr3+Ii50KRntlENL4xQ== -axios-debug-log@^0.6.2: - version "0.6.2" - resolved "https://registry.yarnpkg.com/axios-debug-log/-/axios-debug-log-0.6.2.tgz#c7761ced8f1990e6d48c556b517af8e00edcef31" - integrity sha512-aavexsFWw+T09e9JkbsNe/zLjdG4r2vwhnKUtCNC/0wpogI/i+bQWJ0jJIuXof734dQ43uiOiFPgbRu8EVa64Q== - dependencies: - "@types/debug" "^4.0.0" - debug "^4.0.0" - axios-mock-adapter@*: version "1.19.0" resolved "https://registry.yarnpkg.com/axios-mock-adapter/-/axios-mock-adapter-1.19.0.tgz#9d72e321a6c5418e1eff067aa99761a86c5188a4" @@ -5666,6 +5622,14 @@ axios-mock-adapter@1.18.2: fast-deep-equal "^3.1.1" is-buffer "^2.0.3" +axios-mock-adapter@1.22.0: + version "1.22.0" + resolved "https://registry.yarnpkg.com/axios-mock-adapter/-/axios-mock-adapter-1.22.0.tgz#0f3e6be0fc9b55baab06f2d49c0b71157e7c053d" + integrity sha512-dmI0KbkyAhntUR05YY96qg2H6gg0XMl2+qTW0xmYg6Up+BFBAJYRLROMXRdDEL06/Wqwa0TJThAYvFtSFdRCZw== + dependencies: + fast-deep-equal "^3.1.3" + is-buffer "^2.0.5" + axios-retry@^3.1.9: version "3.1.9" resolved "https://registry.yarnpkg.com/axios-retry/-/axios-retry-3.1.9.tgz#6c30fc9aeb4519aebaec758b90ef56fa03fe72e8" @@ -5673,13 +5637,6 @@ axios-retry@^3.1.9: dependencies: is-retry-allowed "^1.1.0" -axios@0.19.2: - version "0.19.2" - resolved "https://registry.yarnpkg.com/axios/-/axios-0.19.2.tgz#3ea36c5d8818d0d5f8a8a97a6d36b86cdc00cb27" - integrity sha512-fjgm5MvRHLhx+osE2xoekY70AhARk3a6hkN+3Io1jc00jtquGvxYlKlsFUhmUET0V5te6CcZI7lcv2Ym61mjHA== - dependencies: - follow-redirects "1.5.10" - axios@0.21.1, axios@^0.21.1: version "0.21.1" resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.1.tgz#22563481962f4d6bde9a76d516ef0e5d3c09b2b8" @@ -5687,6 +5644,15 @@ axios@0.21.1, axios@^0.21.1: dependencies: follow-redirects "^1.10.0" +axios@1.6.4: + version "1.6.4" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.4.tgz#184ee1f63d412caffcf30d2c50982253c3ee86e0" + integrity sha512-heJnIs6N4aa1eSthhN9M5ioILu8Wi8vmQW9iHQ9NUvfkJb0lEEDUiIdQNAuBtfUt3FxReaKdpQA5DbmMOqzF/A== + dependencies: + follow-redirects "^1.15.4" + form-data "^4.0.0" + proxy-from-env "^1.1.0" + axios@^0.27.2: version "0.27.2" resolved "https://registry.yarnpkg.com/axios/-/axios-0.27.2.tgz#207658cc8621606e586c85db4b41a750e756d972" @@ -7306,19 +7272,6 @@ create-require@^1.1.0: resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== -cron-parser@^2.18.0: - version "2.18.0" - resolved "https://registry.yarnpkg.com/cron-parser/-/cron-parser-2.18.0.tgz#de1bb0ad528c815548371993f81a54e5a089edcf" - integrity sha512-s4odpheTyydAbTBQepsqd2rNWGa2iV3cyo8g7zbI2QQYGLVsfbhmwukayS1XHppe02Oy1fg7mg6xoaraVJeEcg== - dependencies: - is-nan "^1.3.0" - moment-timezone "^0.5.31" - -cronstrue@^1.81.0: - version "1.110.0" - resolved "https://registry.yarnpkg.com/cronstrue/-/cronstrue-1.110.0.tgz#cffbef09855141e518341ed5a4b575a5a4811638" - integrity sha512-+ABuGZl/nqf/0TemAsPlMSGaB9xEobWhctfRGEqEvH3g6pB/2FGbsUHQPSL8Wt1W3nmOHe1w8GWjacN5k8d3hg== - cross-domain-safe-weakmap@^1, cross-domain-safe-weakmap@^1.0.1: version "1.0.29" resolved "https://registry.yarnpkg.com/cross-domain-safe-weakmap/-/cross-domain-safe-weakmap-1.0.29.tgz#0847975c27d9e1cc840f24c1745311958df98022" @@ -7333,6 +7286,13 @@ cross-domain-utils@^2, cross-domain-utils@^2.0.0: dependencies: zalgo-promise "^1.0.11" +cross-fetch@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-4.1.0.tgz#8f69355007ee182e47fa692ecbaa37a52e43c3d2" + integrity sha512-uKm5PU+MHTootlWEY+mZ4vvXoCn4fLQxT9dSc1sXVMSFkINTJVN8cAQROpwcKm8bJ/c7rgZVIBWzH5T78sNZZw== + dependencies: + node-fetch "^2.7.0" + cross-spawn@7.0.3, cross-spawn@^7.0.0, cross-spawn@^7.0.2: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" @@ -7375,11 +7335,6 @@ crypto-random-string@^1.0.0: resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-1.0.0.tgz#a230f64f568310e1498009940790ec99545bca7e" integrity sha1-ojD2T1aDEOFJgAmUB5DsmVRbyn4= -cryptr@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/cryptr/-/cryptr-4.0.2.tgz#8a93b5ca7667d1a6131e396bab23a134ff1f5dc6" - integrity sha512-gLTcYjmLGe0Kk1yyacvjNKvSdkWBNNgG2tDnbRQP7yE559x/RJLo/I3WAmwCXNXf/fzMHCNp9vDv3PCopZDpXw== - css-blank-pseudo@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/css-blank-pseudo/-/css-blank-pseudo-0.1.4.tgz#dfdefd3254bf8a82027993674ccf35483bfcb3c5" @@ -7735,13 +7690,6 @@ d2@31.9.0: dependencies: isomorphic-fetch "^2.2.1" -d2@^31.8.1: - version "31.9.1" - resolved "https://registry.yarnpkg.com/d2/-/d2-31.9.1.tgz#5b0b8a520dd04a01593698e63156779cbf7f5f88" - integrity sha512-dnaDo4reXNt0ySQ6RBUo3EbnixTPs8TrTObYG4HA4ghXF6Xvvru9whUtiR1cRsqD/qlKXxEaUe5CFLw6l+SvyQ== - dependencies: - isomorphic-fetch "^2.2.1" - d2@~31.1: version "31.1.1" resolved "https://registry.yarnpkg.com/d2/-/d2-31.1.1.tgz#8c551077c27031de8ad2d8df0b575242a3080917" @@ -7793,11 +7741,6 @@ date-fns@^1.27.2: resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.30.1.tgz#2e71bf0b119153dbb4cc4e88d9ea5acfb50dc05c" integrity sha512-hBSVCvSmWC+QypYObzwGOd9wqdDpOt+0wl0KbU+R+uuZBS1jN8VsD1ss3irQDknRj5NvxiTF6oj/nDRnN/UQNw== -date-format@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/date-format/-/date-format-2.1.0.tgz#31d5b5ea211cf5fd764cd38baf9d033df7e125cf" - integrity sha512-bYQuGLeFxhkxNOF3rcMtiZxvCBAquGzZm6oWA1oZ0g2THUzivaRhv8uOhdr19LmoobSOLoIAxeUK2RdbM8IFTA== - dayjs@^1.8.34: version "1.11.9" resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.11.9.tgz#9ca491933fadd0a60a2c19f6c237c03517d71d1a" @@ -7815,21 +7758,14 @@ debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.0, debug@^2.6.8, debug@^2.6. dependencies: ms "2.0.0" -debug@4, debug@^4.0.0, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1: +debug@4, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1: version "4.3.1" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.1.tgz#f0d229c505e0c6d8c49ac553d1b13dc183f6b2ee" integrity sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ== dependencies: ms "2.1.2" -debug@=3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" - integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== - dependencies: - ms "2.0.0" - -debug@^3.1.0, debug@^3.1.1, debug@^3.2.5, debug@^3.2.6: +debug@^3.1.0, debug@^3.1.1, debug@^3.2.5: version "3.2.7" resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a" integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ== @@ -8208,7 +8144,7 @@ dotenv-expand@5.1.0: resolved "https://registry.yarnpkg.com/dotenv-expand/-/dotenv-expand-5.1.0.tgz#3fbaf020bfd794884072ea26b1e9791d45a629f0" integrity sha512-YXQl1DSa4/PQyRfgrv6aoNjhasp/p4qs9FjJ4q4cQk+8m4r6k4ZSiEyytKG8f8W9gi8WsQtIObNmKd+tMzNTmA== -dotenv@8.2.0, dotenv@^8.0.0: +dotenv@8.2.0: version "8.2.0" resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.2.0.tgz#97e619259ada750eea3e4ea3e26bceea5424b16a" integrity sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw== @@ -9455,11 +9391,6 @@ flat-cache@^3.0.4: flatted "^3.1.0" rimraf "^3.0.2" -flatted@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.2.tgz#4575b21e2bcee7434aa9be662f4b7b5f9c2b5138" - integrity sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA== - flatted@^3.1.0: version "3.1.1" resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.1.1.tgz#c4b489e80096d9df1dfc97c79871aea7c617c469" @@ -9486,13 +9417,6 @@ fluture@^14.0.0: sanctuary-show "^2.0.0" sanctuary-type-identifiers "^3.0.0" -follow-redirects@1.5.10: - version "1.5.10" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.5.10.tgz#7b7a9f9aea2fdff36786a94ff643ed07f4ff5e2a" - integrity sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ== - dependencies: - debug "=3.1.0" - follow-redirects@^1.0.0, follow-redirects@^1.10.0: version "1.13.3" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.13.3.tgz#e5598ad50174c1bc4e872301e82ac2cd97f90267" @@ -9503,6 +9427,11 @@ follow-redirects@^1.14.9: resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== +follow-redirects@^1.15.4: + version "1.15.11" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.11.tgz#777d73d72a92f8ec4d2e410eb47352a56b8e8340" + integrity sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ== + font-awesome@^4.7.0: version "4.7.0" resolved "https://registry.yarnpkg.com/font-awesome/-/font-awesome-4.7.0.tgz#8fa8cf0411a1a31afd07b06d2902bb9fc815a133" @@ -9598,7 +9527,7 @@ fs-constants@^1.0.0: resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow== -fs-extra@^7.0.0, fs-extra@^7.0.1: +fs-extra@^7.0.0: version "7.0.1" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" integrity sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw== @@ -10762,7 +10691,7 @@ is-buffer@^1.1.5: resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== -is-buffer@^2.0.3: +is-buffer@^2.0.3, is-buffer@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.5.tgz#ebc252e400d22ff8d77fa09888821a24a658c191" integrity sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ== @@ -10962,14 +10891,6 @@ is-module@^1.0.0: resolved "https://registry.yarnpkg.com/is-module/-/is-module-1.0.0.tgz#3258fb69f78c14d5b815d664336b4cffb6441591" integrity sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE= -is-nan@^1.3.0: - version "1.3.2" - resolved "https://registry.yarnpkg.com/is-nan/-/is-nan-1.3.2.tgz#043a54adea31748b55b6cd4e09aadafa69bd9e1d" - integrity sha512-E+zBKpQ2t6MEo1VsonYmluk9NxGrbzpeeLC2xIViuO2EjU2xsXsBPwTr3Ykv9l08UYEVEdWeRZNouaZqF6RN0w== - dependencies: - call-bind "^1.0.0" - define-properties "^1.1.3" - is-negated-glob@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-negated-glob/-/is-negated-glob-1.0.0.tgz#6910bca5da8c95e784b5751b976cf5a10fee36d2" @@ -11278,14 +11199,6 @@ isobject@^3.0.0, isobject@^3.0.1: resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= -isomorphic-fetch@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-3.0.0.tgz#0267b005049046d2421207215d45d6a262b8b8b4" - integrity sha512-qvUtwJ3j6qwsF3jLxkZ72qCgjMysPzDfeV240JHiGZsANBYd+EEuu35v7dfrJ9Up0Ak07D7GGSkGhCHTqg/5wA== - dependencies: - node-fetch "^2.6.1" - whatwg-fetch "^3.4.1" - isomorphic-fetch@^2.1.1, isomorphic-fetch@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz#611ae1acf14f5e81f729507472819fe9733558a9" @@ -12520,27 +12433,11 @@ log-update@^2.3.0: cli-cursor "^2.0.0" wrap-ansi "^3.0.1" -log4js@^4.5.1: - version "4.5.1" - resolved "https://registry.yarnpkg.com/log4js/-/log4js-4.5.1.tgz#e543625e97d9e6f3e6e7c9fc196dd6ab2cae30b5" - integrity sha512-EEEgFcE9bLgaYUKuozyFfytQM2wDHtXn4tAN41pkaxpNjAykv11GVdeI4tHtmPWW4Xrgh9R/2d7XYghDVjbKKw== - dependencies: - date-format "^2.0.0" - debug "^4.1.1" - flatted "^2.0.0" - rfdc "^1.1.4" - streamroller "^1.0.6" - loglevel@^1.4.0, loglevel@^1.6.1, loglevel@^1.6.8: version "1.7.1" resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.7.1.tgz#005fde2f5e6e47068f935ff28573e125ef72f197" integrity sha512-Hesni4s5UkWkwCGJMQGAh71PaLUmKFM60dHvq0zi/vDhhrzuk+4GgNbTXJ12YYQJn6ZKBDNIjYcuQGKudvqrIw== -long-timeout@0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/long-timeout/-/long-timeout-0.1.1.tgz#9721d788b47e0bcb5a24c2e2bee1a0da55dab514" - integrity sha1-lyHXiLR+C8taJMLivuGg2lXatRQ= - loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.2.0, loose-envify@^1.3.1, loose-envify@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" @@ -12963,19 +12860,12 @@ mkdirp@^1.0.3, mkdirp@^1.0.4: resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== -moment-timezone@^0.5.31: - version "0.5.33" - resolved "https://registry.yarnpkg.com/moment-timezone/-/moment-timezone-0.5.33.tgz#b252fd6bb57f341c9b59a5ab61a8e51a73bbd22c" - integrity sha512-PTc2vcT8K9J5/9rDEPe5czSIKgLoGsH8UNpA4qZTVw0Vd/Uz19geE9abbIOQKaAQFcnQ3v5YEXrbSc5BpshH+w== - dependencies: - moment ">= 2.9.0" - moment@2.22.2: version "2.22.2" resolved "https://registry.yarnpkg.com/moment/-/moment-2.22.2.tgz#3c257f9839fc0e93ff53149632239eb90783ff66" integrity sha1-PCV/mDn8DpP/UxSWMiOeuQeD/2Y= -moment@2.29.1, "moment@>= 2.9.0", moment@^2.22.1, moment@^2.24.0, moment@^2.29.1: +moment@2.29.1, moment@^2.22.1, moment@^2.24.0, moment@^2.29.1: version "2.29.1" resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.1.tgz#b2be769fa31940be9eeea6469c075e35006fa3d3" integrity sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ== @@ -13137,10 +13027,12 @@ node-fetch@^1.0.1: encoding "^0.1.11" is-stream "^1.0.1" -node-fetch@^2.6.1: - version "2.6.1" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" - integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== +node-fetch@^2.7.0: + version "2.7.0" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" + integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== + dependencies: + whatwg-url "^5.0.0" node-forge@^0.10.0: version "0.10.0" @@ -13210,15 +13102,6 @@ node-releases@^1.1.61, node-releases@^1.1.70: resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.71.tgz#cb1334b179896b1c89ecfdd4b725fb7bbdfc7dbb" integrity sha512-zR6HoT6LrLCRBwukmrVbHv0EpEQjksO6GmFcZQQuCAy139BEsoVKPYnf3jongYW83fAa1torLGYwxxky/p28sg== -node-schedule@^1.3.2: - version "1.3.3" - resolved "https://registry.yarnpkg.com/node-schedule/-/node-schedule-1.3.3.tgz#f8e01c5fb9597f09ecf9c4c25d6938e5e7a06f48" - integrity sha512-uF9Ubn6luOPrcAYKfsXWimcJ1tPFtQ8I85wb4T3NgJQrXazEzojcFZVk46ZlLHby3eEJChgkV/0T689IsXh2Gw== - dependencies: - cron-parser "^2.18.0" - long-timeout "0.1.1" - sorted-array-functions "^1.3.0" - normalize-package-data@^2.3.2, normalize-package-data@^2.5.0: version "2.5.0" resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" @@ -14818,6 +14701,11 @@ proxy-addr@~2.0.5: forwarded "~0.1.2" ipaddr.js "1.9.1" +proxy-from-env@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" + integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== + prr@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476" @@ -14890,12 +14778,10 @@ qs@6.7.0: resolved "https://registry.yarnpkg.com/qs/-/qs-6.7.0.tgz#41dc1a015e3d581f1621776be31afb2876a9b1bc" integrity sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ== -qs@^6.9.0: - version "6.10.0" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.10.0.tgz#8b6519121ab291c316a3e4d49cecf6d13d8c7fe5" - integrity sha512-yjACOWijC6L/kmPZZAsVBNY2zfHSIbpdpL977quseu56/8BZ2LoF5axK2bGhbzhVKt7V9xgWTtpyLbxwIoER0Q== - dependencies: - side-channel "^1.0.4" +qs@6.9.7: + version "6.9.7" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.9.7.tgz#4610846871485e1e048f44ae3b94033f0e675afe" + integrity sha512-IhMFgUmuNpyRfxA90umL7ByLlgRXu6tIfKPpF5TmcfRLlLCckfP/g3IQmju6jjpu+Hh8rA+2p6A27ZSPOOHdKw== qs@^6.9.6: version "6.10.1" @@ -15289,15 +15175,6 @@ react@17.0.1: loose-envify "^1.1.0" object-assign "^4.1.1" -react@^16.12.0: - version "16.14.0" - resolved "https://registry.yarnpkg.com/react/-/react-16.14.0.tgz#94d776ddd0aaa37da3eda8fc5b6b18a4c9a3114d" - integrity sha512-0X2CImDkJGApiAlcf0ODKIneSwBPhqJawOa5wCtKbu7ZECrmS26NvtSILynQ66cgkT/RJ4LidJOc3bUESwmU8g== - dependencies: - loose-envify "^1.1.0" - object-assign "^4.1.1" - prop-types "^15.6.2" - read-pkg-up@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" @@ -15801,11 +15678,6 @@ rework@1.0.1: convert-source-map "^0.3.3" css "^2.0.0" -rfdc@^1.1.4: - version "1.3.0" - resolved "https://registry.yarnpkg.com/rfdc/-/rfdc-1.3.0.tgz#d0b7c441ab2720d05dc4cf26e01c89631d9da08b" - integrity sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA== - rgb-regex@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/rgb-regex/-/rgb-regex-1.0.1.tgz#c0e0d6882df0e23be254a475e8edd41915feaeb1" @@ -16369,11 +16241,6 @@ sort-keys@^1.0.0: dependencies: is-plain-obj "^1.0.0" -sorted-array-functions@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/sorted-array-functions/-/sorted-array-functions-1.3.0.tgz#8605695563294dffb2c9796d602bd8459f7a0dd5" - integrity sha512-2sqgzeFlid6N4Z2fUQ1cvFmTOLRi/sEDzSQ0OKYchqgoPmQBVyM3959qYx3fpS6Esef80KjmpgPeEr028dP3OA== - sortobject@^1.1.1: version "1.3.0" resolved "https://registry.yarnpkg.com/sortobject/-/sortobject-1.3.0.tgz#bc8ce57014c567bdbf78e89ae6c484e64d51e9dc" @@ -16631,17 +16498,6 @@ stream-shift@^1.0.0: resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.1.tgz#d7088281559ab2778424279b0877da3c392d5a3d" integrity sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ== -streamroller@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/streamroller/-/streamroller-1.0.6.tgz#8167d8496ed9f19f05ee4b158d9611321b8cacd9" - integrity sha512-3QC47Mhv3/aZNFpDDVO44qQb9gwB9QggMEE0sQmkTAwBVYdBRWISdsywlkfm5II1Q5y/pmrHflti/IgmIzdDBg== - dependencies: - async "^2.6.2" - date-format "^2.0.0" - debug "^3.2.6" - fs-extra "^7.0.1" - lodash "^4.17.14" - strict-uri-encode@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713" @@ -17300,6 +17156,11 @@ tr46@^2.0.2: dependencies: punycode "^2.1.1" +tr46@~0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" + integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== + "traverse@>=0.3.0 <0.4": version "0.3.9" resolved "https://registry.yarnpkg.com/traverse/-/traverse-0.3.9.tgz#717b8f220cc0bb7b44e40514c22b2e8bbc70d8b9" @@ -17935,6 +17796,11 @@ wbuf@^1.1.0, wbuf@^1.7.3: dependencies: minimalistic-assert "^1.0.0" +webidl-conversions@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" + integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== + webidl-conversions@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-5.0.0.tgz#ae59c8a00b121543a2acc65c0434f57b0fc11aff" @@ -18093,6 +17959,14 @@ whatwg-mimetype@^2.3.0: resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf" integrity sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g== +whatwg-url@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" + integrity sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw== + dependencies: + tr46 "~0.0.3" + webidl-conversions "^3.0.0" + whatwg-url@^8.0.0: version "8.4.0" resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-8.4.0.tgz#50fb9615b05469591d2b2bd6dfaed2942ed72837" @@ -18479,14 +18353,6 @@ yargs-parser@^13.1.2: camelcase "^5.0.0" decamelize "^1.2.0" -yargs-parser@^15.0.1: - version "15.0.1" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-15.0.1.tgz#54786af40b820dcb2fb8025b11b4d659d76323b3" - integrity sha512-0OAMV2mAZQrs3FkNpDQcBk1x5HXb8X4twADss4S0Iuk+2dGnLOE/fRHrsYm542GduMveyA77OF4wrNJuanRCWw== - dependencies: - camelcase "^5.0.0" - decamelize "^1.2.0" - yargs-parser@^18.1.2: version "18.1.3" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-18.1.3.tgz#be68c4975c6b2abf469236b0c870362fab09a7b0" @@ -18516,23 +18382,6 @@ yargs@^13.3.2: y18n "^4.0.0" yargs-parser "^13.1.2" -yargs@^14.0.0: - version "14.2.3" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-14.2.3.tgz#1a1c3edced1afb2a2fea33604bc6d1d8d688a414" - integrity sha512-ZbotRWhF+lkjijC/VhmOT9wSgyBQ7+zr13+YLkhfsSiTriYsMzkTUFP18pFhWwBeMa5gUc1MzbhrO6/VB7c9Xg== - dependencies: - cliui "^5.0.0" - decamelize "^1.2.0" - find-up "^3.0.0" - get-caller-file "^2.0.1" - require-directory "^2.1.1" - require-main-filename "^2.0.0" - set-blocking "^2.0.0" - string-width "^3.0.0" - which-module "^2.0.0" - y18n "^4.0.0" - yargs-parser "^15.0.1" - yargs@^15.4.1: version "15.4.1" resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.4.1.tgz#0d87a16de01aee9d8bec2bfbf74f67851730f4f8" From 36b21792edee7ca0e4b78bb63bbd795f9fa69973 Mon Sep 17 00:00:00 2001 From: Eduardo Peredo Date: Tue, 31 Mar 2026 18:35:05 -0500 Subject: [PATCH 2/6] fix lint errors --- src/models/ProjectDashboard.ts | 5 +- src/models/ProjectDb.ts | 6 +- src/models/ProjectSharing.ts | 9 +- src/models/ProjectsList.ts | 7 +- src/models/Sharing.ts | 5 +- .../__tests__/data/project-db-metadata.json | 526 ++++-------------- 6 files changed, 134 insertions(+), 424 deletions(-) diff --git a/src/models/ProjectDashboard.ts b/src/models/ProjectDashboard.ts index 327c72a1..277c4f32 100644 --- a/src/models/ProjectDashboard.ts +++ b/src/models/ProjectDashboard.ts @@ -125,7 +125,10 @@ export default class ProjectDashboard { id: getUid("dashboard", projectsListDashboard.id), name: projectsListDashboard.name, dashboardItems: positionItems(items, positionItemsOptions), - sharing: new ProjectSharing(config, projectsListDashboard).getSharingAttributesForDashboard(), + sharing: new ProjectSharing( + config, + projectsListDashboard + ).getSharingAttributesForDashboard(), }; return { dashboards: [dashboard], visualizations }; diff --git a/src/models/ProjectDb.ts b/src/models/ProjectDb.ts index fb67fbb9..44ab336b 100644 --- a/src/models/ProjectDb.ts +++ b/src/models/ProjectDb.ts @@ -469,7 +469,8 @@ export default class ProjectDb { const dataSetAttrs = { ...dbDataSet, ...attrs, id: dbDataSet.id }; const res = await this.api.models.dataSets.put(dataSetAttrs).getData(); - if (res.errorReports && res.errorReports.length > 0) throw new Error("Error saving data set"); + if (res.errorReports && res.errorReports.length > 0) + throw new Error("Error saving data set"); } } @@ -586,7 +587,8 @@ export default class ProjectDb { const res = await api.models.dataSets.put(dataSetUpdated).getData(); - if (res.errorReports && res.errorReports.length > 0) console.error("Error saving data set"); + if (res.errorReports && res.errorReports.length > 0) + console.error("Error saving data set"); } } diff --git a/src/models/ProjectSharing.ts b/src/models/ProjectSharing.ts index 635cd118..51675cd6 100644 --- a/src/models/ProjectSharing.ts +++ b/src/models/ProjectSharing.ts @@ -95,10 +95,7 @@ export default class ProjectSharing { public: "--------", external: false, users: getD2SharingMap(project.sharing.userAccesses, fullAccess), - userGroups: getD2SharingMap( - project.sharing.userGroupAccesses, - fullAccess - ), + userGroups: getD2SharingMap(project.sharing.userGroupAccesses, fullAccess), }, }, }; @@ -157,7 +154,9 @@ interface D2DataSetAccessFields { data?: { read: boolean; write: boolean }; } -export function hasCurrentUserFullAccessToDataSet(shareable: { access: D2DataSetAccessFields }): boolean { +export function hasCurrentUserFullAccessToDataSet(shareable: { + access: D2DataSetAccessFields; +}): boolean { const { access } = shareable; const metadataAccess = access.read && access.write; const dataAccess = access.data ? access.data.read && access.data.write : true; diff --git a/src/models/ProjectsList.ts b/src/models/ProjectsList.ts index 2d79c79d..ddb50e13 100644 --- a/src/models/ProjectsList.ts +++ b/src/models/ProjectsList.ts @@ -103,7 +103,12 @@ export default class ProjectsList { fields: { code: true, sections: { code: true }, - sharing: { public: true, external: true, users: true, userGroups: true }, + sharing: { + public: true, + external: true, + users: true, + userGroups: true, + }, access: { read: true, write: true, data: true }, attributeValues: { attribute: { id: true }, value: true }, }, diff --git a/src/models/Sharing.ts b/src/models/Sharing.ts index ae7a0a14..cdd00d36 100644 --- a/src/models/Sharing.ts +++ b/src/models/Sharing.ts @@ -51,10 +51,7 @@ export const emptySharing: Sharing = { userGroupAccesses: [], }; -export function getD2SharingMap( - entitySharings: EntityAccess[], - access: Access -): D2SharingMap { +export function getD2SharingMap(entitySharings: EntityAccess[], access: Access): D2SharingMap { const result: D2SharingMap = {}; entitySharings.forEach(entitySharing => { result[entitySharing.id] = { diff --git a/src/models/__tests__/data/project-db-metadata.json b/src/models/__tests__/data/project-db-metadata.json index 83ab3bb8..cd116dd3 100644 --- a/src/models/__tests__/data/project-db-metadata.json +++ b/src/models/__tests__/data/project-db-metadata.json @@ -1554,9 +1554,7 @@ ] } ], - "columnDimensions": [ - "GIIHAr9BzzO" - ], + "columnDimensions": ["GIIHAr9BzzO"], "filters": [ { "id": "dx" @@ -1565,18 +1563,13 @@ "id": "ou" } ], - "filterDimensions": [ - "dx", - "ou" - ], + "filterDimensions": ["dx", "ou"], "rows": [ { "id": "pe" } ], - "rowDimensions": [ - "pe" - ], + "rowDimensions": ["pe"], "categoryDimensions": [ { "category": { @@ -1694,9 +1687,7 @@ ] } ], - "columnDimensions": [ - "GIIHAr9BzzO" - ], + "columnDimensions": ["GIIHAr9BzzO"], "filters": [ { "id": "dx" @@ -1735,20 +1726,13 @@ ] } ], - "filterDimensions": [ - "dx", - "ou", - "Kyg1O6YEGa9", - "uSMHdwhxFSV" - ], + "filterDimensions": ["dx", "ou", "Kyg1O6YEGa9", "uSMHdwhxFSV"], "rows": [ { "id": "pe" } ], - "rowDimensions": [ - "pe" - ], + "rowDimensions": ["pe"], "categoryDimensions": [ { "category": { @@ -1880,25 +1864,19 @@ ] } ], - "columnDimensions": [ - "GIIHAr9BzzO" - ], + "columnDimensions": ["GIIHAr9BzzO"], "filters": [ { "id": "ou" } ], - "filterDimensions": [ - "ou" - ], + "filterDimensions": ["ou"], "rows": [ { "id": "pe" } ], - "rowDimensions": [ - "pe" - ], + "rowDimensions": ["pe"], "categoryDimensions": [ { "category": { @@ -2004,9 +1982,7 @@ ] } ], - "columnDimensions": [ - "GIIHAr9BzzO" - ], + "columnDimensions": ["GIIHAr9BzzO"], "filters": [ { "id": "dx" @@ -2045,20 +2021,13 @@ ] } ], - "filterDimensions": [ - "dx", - "ou", - "Kyg1O6YEGa9", - "uSMHdwhxFSV" - ], + "filterDimensions": ["dx", "ou", "Kyg1O6YEGa9", "uSMHdwhxFSV"], "rows": [ { "id": "pe" } ], - "rowDimensions": [ - "pe" - ], + "rowDimensions": ["pe"], "categoryDimensions": [ { "category": { @@ -2184,17 +2153,13 @@ "id": "pe" } ], - "columnDimensions": [ - "pe" - ], + "columnDimensions": ["pe"], "filters": [ { "id": "ou" } ], - "filterDimensions": [ - "ou" - ], + "filterDimensions": ["ou"], "rows": [ { "id": "dx" @@ -2215,10 +2180,7 @@ ] } ], - "rowDimensions": [ - "dx", - "GIIHAr9BzzO" - ], + "rowDimensions": ["dx", "GIIHAr9BzzO"], "categoryDimensions": [ { "category": { @@ -2339,18 +2301,13 @@ ] } ], - "columnDimensions": [ - "pe", - "Kyg1O6YEGa9" - ], + "columnDimensions": ["pe", "Kyg1O6YEGa9"], "filters": [ { "id": "ou" } ], - "filterDimensions": [ - "ou" - ], + "filterDimensions": ["ou"], "rows": [ { "id": "dx" @@ -2386,11 +2343,7 @@ ] } ], - "rowDimensions": [ - "dx", - "GIIHAr9BzzO", - "uSMHdwhxFSV" - ], + "rowDimensions": ["dx", "GIIHAr9BzzO", "uSMHdwhxFSV"], "categoryDimensions": [ { "category": { @@ -2516,17 +2469,13 @@ "id": "dx" } ], - "columnDimensions": [ - "dx" - ], + "columnDimensions": ["dx"], "filters": [ { "id": "ou" } ], - "filterDimensions": [ - "ou" - ], + "filterDimensions": ["ou"], "rows": [ { "id": "pe" @@ -2547,10 +2496,7 @@ ] } ], - "rowDimensions": [ - "pe", - "GIIHAr9BzzO" - ], + "rowDimensions": ["pe", "GIIHAr9BzzO"], "categoryDimensions": [ { "category": { @@ -2656,9 +2602,7 @@ "id": "dx" } ], - "columnDimensions": [ - "dx" - ], + "columnDimensions": ["dx"], "filters": [ { "id": "ou" @@ -2694,11 +2638,7 @@ ] } ], - "filterDimensions": [ - "ou", - "Kyg1O6YEGa9", - "uSMHdwhxFSV" - ], + "filterDimensions": ["ou", "Kyg1O6YEGa9", "uSMHdwhxFSV"], "rows": [ { "id": "pe" @@ -2719,10 +2659,7 @@ ] } ], - "rowDimensions": [ - "pe", - "GIIHAr9BzzO" - ], + "rowDimensions": ["pe", "GIIHAr9BzzO"], "categoryDimensions": [ { "category": { @@ -2860,17 +2797,13 @@ ] } ], - "columnDimensions": [ - "GIIHAr9BzzO" - ], + "columnDimensions": ["GIIHAr9BzzO"], "filters": [ { "id": "ou" } ], - "filterDimensions": [ - "ou" - ], + "filterDimensions": ["ou"], "rows": [ { "id": "dx" @@ -2879,10 +2812,7 @@ "id": "pe" } ], - "rowDimensions": [ - "dx", - "pe" - ], + "rowDimensions": ["dx", "pe"], "categoryDimensions": [ { "category": { @@ -3000,9 +2930,7 @@ ] } ], - "columnDimensions": [ - "GIIHAr9BzzO" - ], + "columnDimensions": ["GIIHAr9BzzO"], "filters": [ { "id": "ou" @@ -3038,11 +2966,7 @@ ] } ], - "filterDimensions": [ - "ou", - "Kyg1O6YEGa9", - "uSMHdwhxFSV" - ], + "filterDimensions": ["ou", "Kyg1O6YEGa9", "uSMHdwhxFSV"], "rows": [ { "id": "dx" @@ -3051,10 +2975,7 @@ "id": "pe" } ], - "rowDimensions": [ - "dx", - "pe" - ], + "rowDimensions": ["dx", "pe"], "categoryDimensions": [ { "category": { @@ -3198,9 +3119,7 @@ ] } ], - "columnDimensions": [ - "GIIHAr9BzzO" - ], + "columnDimensions": ["GIIHAr9BzzO"], "filters": [ { "id": "ou" @@ -3229,11 +3148,7 @@ ] } ], - "filterDimensions": [ - "ou", - "Kyg1O6YEGa9", - "uSMHdwhxFSV" - ], + "filterDimensions": ["ou", "Kyg1O6YEGa9", "uSMHdwhxFSV"], "rows": [ { "id": "dx" @@ -3242,10 +3157,7 @@ "id": "pe" } ], - "rowDimensions": [ - "dx", - "pe" - ], + "rowDimensions": ["dx", "pe"], "categoryDimensions": [ { "category": { @@ -3386,9 +3298,7 @@ ] } ], - "columnDimensions": [ - "GIIHAr9BzzO" - ], + "columnDimensions": ["GIIHAr9BzzO"], "filters": [ { "id": "ou" @@ -3417,11 +3327,7 @@ ] } ], - "filterDimensions": [ - "ou", - "Kyg1O6YEGa9", - "uSMHdwhxFSV" - ], + "filterDimensions": ["ou", "Kyg1O6YEGa9", "uSMHdwhxFSV"], "rows": [ { "id": "dx" @@ -3430,10 +3336,7 @@ "id": "pe" } ], - "rowDimensions": [ - "dx", - "pe" - ], + "rowDimensions": ["dx", "pe"], "categoryDimensions": [ { "category": { @@ -3574,9 +3477,7 @@ ] } ], - "columnDimensions": [ - "GIIHAr9BzzO" - ], + "columnDimensions": ["GIIHAr9BzzO"], "filters": [ { "id": "ou" @@ -3605,11 +3506,7 @@ ] } ], - "filterDimensions": [ - "ou", - "Kyg1O6YEGa9", - "uSMHdwhxFSV" - ], + "filterDimensions": ["ou", "Kyg1O6YEGa9", "uSMHdwhxFSV"], "rows": [ { "id": "dx" @@ -3618,10 +3515,7 @@ "id": "pe" } ], - "rowDimensions": [ - "dx", - "pe" - ], + "rowDimensions": ["dx", "pe"], "categoryDimensions": [ { "category": { @@ -3773,9 +3667,7 @@ ] } ], - "columnDimensions": [ - "GIIHAr9BzzO" - ], + "columnDimensions": ["GIIHAr9BzzO"], "filters": [ { "id": "ou" @@ -3804,11 +3696,7 @@ ] } ], - "filterDimensions": [ - "ou", - "Kyg1O6YEGa9", - "uSMHdwhxFSV" - ], + "filterDimensions": ["ou", "Kyg1O6YEGa9", "uSMHdwhxFSV"], "rows": [ { "id": "dx" @@ -3817,10 +3705,7 @@ "id": "pe" } ], - "rowDimensions": [ - "dx", - "pe" - ], + "rowDimensions": ["dx", "pe"], "categoryDimensions": [ { "category": { @@ -3955,25 +3840,19 @@ "id": "pe" } ], - "columnDimensions": [ - "pe" - ], + "columnDimensions": ["pe"], "filters": [ { "id": "ou" } ], - "filterDimensions": [ - "ou" - ], + "filterDimensions": ["ou"], "rows": [ { "id": "dx" } ], - "rowDimensions": [ - "dx" - ], + "rowDimensions": ["dx"], "categoryDimensions": [], "sharing": { "public": "--------", @@ -4066,25 +3945,19 @@ "id": "pe" } ], - "columnDimensions": [ - "pe" - ], + "columnDimensions": ["pe"], "filters": [ { "id": "ou" } ], - "filterDimensions": [ - "ou" - ], + "filterDimensions": ["ou"], "rows": [ { "id": "dx" } ], - "rowDimensions": [ - "dx" - ], + "rowDimensions": ["dx"], "categoryDimensions": [], "sharing": { "public": "--------", @@ -4170,25 +4043,19 @@ "id": "ou" } ], - "columnDimensions": [ - "ou" - ], + "columnDimensions": ["ou"], "filters": [ { "id": "pe" } ], - "filterDimensions": [ - "pe" - ], + "filterDimensions": ["pe"], "rows": [ { "id": "dx" } ], - "rowDimensions": [ - "dx" - ], + "rowDimensions": ["dx"], "categoryDimensions": [], "sharing": { "public": "--------", @@ -4280,9 +4147,7 @@ "id": "ou" } ], - "columnDimensions": [ - "ou" - ], + "columnDimensions": ["ou"], "filters": [ { "id": "pe" @@ -4296,18 +4161,13 @@ ] } ], - "filterDimensions": [ - "pe", - "uSMHdwhxFSV" - ], + "filterDimensions": ["pe", "uSMHdwhxFSV"], "rows": [ { "id": "dx" } ], - "rowDimensions": [ - "dx" - ], + "rowDimensions": ["dx"], "categoryDimensions": [ { "category": { @@ -4422,9 +4282,7 @@ ] } ], - "columnDimensions": [ - "Kyg1O6YEGa9" - ], + "columnDimensions": ["Kyg1O6YEGa9"], "filters": [ { "id": "ou" @@ -4441,19 +4299,13 @@ ] } ], - "filterDimensions": [ - "ou", - "pe", - "uSMHdwhxFSV" - ], + "filterDimensions": ["ou", "pe", "uSMHdwhxFSV"], "rows": [ { "id": "dx" } ], - "rowDimensions": [ - "dx" - ], + "rowDimensions": ["dx"], "categoryDimensions": [ { "category": { @@ -4557,25 +4409,19 @@ "id": "ou" } ], - "columnDimensions": [ - "ou" - ], + "columnDimensions": ["ou"], "filters": [ { "id": "pe" } ], - "filterDimensions": [ - "pe" - ], + "filterDimensions": ["pe"], "rows": [ { "id": "dx" } ], - "rowDimensions": [ - "dx" - ], + "rowDimensions": ["dx"], "categoryDimensions": [], "sharing": { "public": "--------", @@ -4705,9 +4551,7 @@ "id": "dx" } ], - "columnDimensions": [ - "dx" - ], + "columnDimensions": ["dx"], "filters": [ { "id": "pe" @@ -4729,19 +4573,13 @@ ] } ], - "filterDimensions": [ - "pe", - "uSMHdwhxFSV", - "GIIHAr9BzzO" - ], + "filterDimensions": ["pe", "uSMHdwhxFSV", "GIIHAr9BzzO"], "rows": [ { "id": "ou" } ], - "rowDimensions": [ - "ou" - ], + "rowDimensions": ["ou"], "categoryDimensions": [ { "category": { @@ -4854,9 +4692,7 @@ "id": "dx" } ], - "columnDimensions": [ - "dx" - ], + "columnDimensions": ["dx"], "filters": [ { "id": "pe" @@ -4870,18 +4706,13 @@ ] } ], - "filterDimensions": [ - "pe", - "GIIHAr9BzzO" - ], + "filterDimensions": ["pe", "GIIHAr9BzzO"], "rows": [ { "id": "ou" } ], - "rowDimensions": [ - "ou" - ], + "rowDimensions": ["ou"], "categoryDimensions": [ { "category": { @@ -4996,9 +4827,7 @@ "id": "dx" } ], - "columnDimensions": [ - "dx" - ], + "columnDimensions": ["dx"], "filters": [ { "id": "ou" @@ -5020,19 +4849,13 @@ ] } ], - "filterDimensions": [ - "ou", - "uSMHdwhxFSV", - "GIIHAr9BzzO" - ], + "filterDimensions": ["ou", "uSMHdwhxFSV", "GIIHAr9BzzO"], "rows": [ { "id": "pe" } ], - "rowDimensions": [ - "pe" - ], + "rowDimensions": ["pe"], "categoryDimensions": [ { "category": { @@ -5139,9 +4962,7 @@ "id": "dx" } ], - "columnDimensions": [ - "dx" - ], + "columnDimensions": ["dx"], "filters": [ { "id": "ou" @@ -5155,18 +4976,13 @@ ] } ], - "filterDimensions": [ - "ou", - "GIIHAr9BzzO" - ], + "filterDimensions": ["ou", "GIIHAr9BzzO"], "rows": [ { "id": "pe" } ], - "rowDimensions": [ - "pe" - ], + "rowDimensions": ["pe"], "categoryDimensions": [ { "category": { @@ -5294,17 +5110,13 @@ "id": "pe" } ], - "columnDimensions": [ - "pe" - ], + "columnDimensions": ["pe"], "filters": [ { "id": "ou" } ], - "filterDimensions": [ - "ou" - ], + "filterDimensions": ["ou"], "rows": [ { "id": "dx" @@ -5340,11 +5152,7 @@ ] } ], - "rowDimensions": [ - "dx", - "GIIHAr9BzzO", - "uSMHdwhxFSV" - ], + "rowDimensions": ["dx", "GIIHAr9BzzO", "uSMHdwhxFSV"], "categoryDimensions": [ { "category": { @@ -5508,9 +5316,7 @@ "id": "dx" } ], - "columnDimensions": [ - "dx" - ], + "columnDimensions": ["dx"], "filters": [ { "id": "ou" @@ -5546,11 +5352,7 @@ ] } ], - "filterDimensions": [ - "ou", - "Kyg1O6YEGa9", - "uSMHdwhxFSV" - ], + "filterDimensions": ["ou", "Kyg1O6YEGa9", "uSMHdwhxFSV"], "rows": [ { "code": "ACTUAL_TARGET", @@ -5571,10 +5373,7 @@ "id": "pe" } ], - "rowDimensions": [ - "GIIHAr9BzzO", - "pe" - ], + "rowDimensions": ["GIIHAr9BzzO", "pe"], "categoryDimensions": [ { "category": { @@ -5733,17 +5532,13 @@ "id": "pe" } ], - "columnDimensions": [ - "pe" - ], + "columnDimensions": ["pe"], "filters": [ { "id": "ou" } ], - "filterDimensions": [ - "ou" - ], + "filterDimensions": ["ou"], "rows": [ { "id": "dx" @@ -5764,10 +5559,7 @@ ] } ], - "rowDimensions": [ - "dx", - "GIIHAr9BzzO" - ], + "rowDimensions": ["dx", "GIIHAr9BzzO"], "categoryDimensions": [ { "category": { @@ -5900,17 +5692,13 @@ "id": "dx" } ], - "columnDimensions": [ - "dx" - ], + "columnDimensions": ["dx"], "filters": [ { "id": "ou" } ], - "filterDimensions": [ - "ou" - ], + "filterDimensions": ["ou"], "rows": [ { "code": "ACTUAL_TARGET", @@ -5931,10 +5719,7 @@ "id": "pe" } ], - "rowDimensions": [ - "GIIHAr9BzzO", - "pe" - ], + "rowDimensions": ["GIIHAr9BzzO", "pe"], "categoryDimensions": [ { "category": { @@ -6157,9 +5942,7 @@ ] } ], - "columnDimensions": [ - "uSMHdwhxFSV" - ], + "columnDimensions": ["uSMHdwhxFSV"], "filters": [ { "id": "ou" @@ -6168,18 +5951,13 @@ "id": "pe" } ], - "filterDimensions": [ - "ou", - "pe" - ], + "filterDimensions": ["ou", "pe"], "rows": [ { "id": "dx" } ], - "rowDimensions": [ - "dx" - ], + "rowDimensions": ["dx"], "categoryDimensions": [ { "category": { @@ -6376,25 +6154,19 @@ "id": "pe" } ], - "columnDimensions": [ - "pe" - ], + "columnDimensions": ["pe"], "filters": [ { "id": "ou" } ], - "filterDimensions": [ - "ou" - ], + "filterDimensions": ["ou"], "rows": [ { "id": "dx" } ], - "rowDimensions": [ - "dx" - ], + "rowDimensions": ["dx"], "categoryDimensions": [], "sharing": { "public": "--------", @@ -6612,18 +6384,13 @@ ] } ], - "columnDimensions": [ - "pe", - "Kyg1O6YEGa9" - ], + "columnDimensions": ["pe", "Kyg1O6YEGa9"], "filters": [ { "id": "ou" } ], - "filterDimensions": [ - "ou" - ], + "filterDimensions": ["ou"], "rows": [ { "id": "dx" @@ -6659,11 +6426,7 @@ ] } ], - "rowDimensions": [ - "dx", - "GIIHAr9BzzO", - "uSMHdwhxFSV" - ], + "rowDimensions": ["dx", "GIIHAr9BzzO", "uSMHdwhxFSV"], "categoryDimensions": [ { "category": { @@ -6888,17 +6651,13 @@ "id": "pe" } ], - "columnDimensions": [ - "pe" - ], + "columnDimensions": ["pe"], "filters": [ { "id": "ou" } ], - "filterDimensions": [ - "ou" - ], + "filterDimensions": ["ou"], "rows": [ { "id": "dx" @@ -6919,10 +6678,7 @@ ] } ], - "rowDimensions": [ - "dx", - "GIIHAr9BzzO" - ], + "rowDimensions": ["dx", "GIIHAr9BzzO"], "categoryDimensions": [ { "category": { @@ -7139,9 +6895,7 @@ "id": "pe" } ], - "columnDimensions": [ - "pe" - ], + "columnDimensions": ["pe"], "filters": [ { "id": "ou" @@ -7177,11 +6931,7 @@ ] } ], - "filterDimensions": [ - "ou", - "Kyg1O6YEGa9", - "uSMHdwhxFSV" - ], + "filterDimensions": ["ou", "Kyg1O6YEGa9", "uSMHdwhxFSV"], "rows": [ { "id": "dx" @@ -7202,10 +6952,7 @@ ] } ], - "rowDimensions": [ - "dx", - "GIIHAr9BzzO" - ], + "rowDimensions": ["dx", "GIIHAr9BzzO"], "categoryDimensions": [ { "category": { @@ -7430,17 +7177,13 @@ "id": "pe" } ], - "columnDimensions": [ - "pe" - ], + "columnDimensions": ["pe"], "filters": [ { "id": "ou" } ], - "filterDimensions": [ - "ou" - ], + "filterDimensions": ["ou"], "rows": [ { "id": "dx" @@ -7461,10 +7204,7 @@ ] } ], - "rowDimensions": [ - "dx", - "GIIHAr9BzzO" - ], + "rowDimensions": ["dx", "GIIHAr9BzzO"], "categoryDimensions": [ { "category": { @@ -7615,9 +7355,7 @@ "id": "pe" } ], - "columnDimensions": [ - "pe" - ], + "columnDimensions": ["pe"], "filters": [ { "id": "ou" @@ -7639,11 +7377,7 @@ ] } ], - "filterDimensions": [ - "ou", - "Kyg1O6YEGa9", - "uSMHdwhxFSV" - ], + "filterDimensions": ["ou", "Kyg1O6YEGa9", "uSMHdwhxFSV"], "rows": [ { "id": "dx" @@ -7664,10 +7398,7 @@ ] } ], - "rowDimensions": [ - "dx", - "GIIHAr9BzzO" - ], + "rowDimensions": ["dx", "GIIHAr9BzzO"], "categoryDimensions": [ { "category": { @@ -7838,9 +7569,7 @@ "id": "pe" } ], - "columnDimensions": [ - "pe" - ], + "columnDimensions": ["pe"], "filters": [ { "id": "ou" @@ -7862,11 +7591,7 @@ ] } ], - "filterDimensions": [ - "ou", - "Kyg1O6YEGa9", - "uSMHdwhxFSV" - ], + "filterDimensions": ["ou", "Kyg1O6YEGa9", "uSMHdwhxFSV"], "rows": [ { "id": "dx" @@ -7887,10 +7612,7 @@ ] } ], - "rowDimensions": [ - "dx", - "GIIHAr9BzzO" - ], + "rowDimensions": ["dx", "GIIHAr9BzzO"], "categoryDimensions": [ { "category": { @@ -8061,9 +7783,7 @@ "id": "pe" } ], - "columnDimensions": [ - "pe" - ], + "columnDimensions": ["pe"], "filters": [ { "id": "ou" @@ -8085,11 +7805,7 @@ ] } ], - "filterDimensions": [ - "ou", - "Kyg1O6YEGa9", - "uSMHdwhxFSV" - ], + "filterDimensions": ["ou", "Kyg1O6YEGa9", "uSMHdwhxFSV"], "rows": [ { "id": "dx" @@ -8110,10 +7826,7 @@ ] } ], - "rowDimensions": [ - "dx", - "GIIHAr9BzzO" - ], + "rowDimensions": ["dx", "GIIHAr9BzzO"], "categoryDimensions": [ { "category": { @@ -8284,9 +7997,7 @@ "id": "pe" } ], - "columnDimensions": [ - "pe" - ], + "columnDimensions": ["pe"], "filters": [ { "id": "ou" @@ -8308,11 +8019,7 @@ ] } ], - "filterDimensions": [ - "ou", - "Kyg1O6YEGa9", - "uSMHdwhxFSV" - ], + "filterDimensions": ["ou", "Kyg1O6YEGa9", "uSMHdwhxFSV"], "rows": [ { "id": "dx" @@ -8333,10 +8040,7 @@ ] } ], - "rowDimensions": [ - "dx", - "GIIHAr9BzzO" - ], + "rowDimensions": ["dx", "GIIHAr9BzzO"], "categoryDimensions": [ { "category": { @@ -8397,4 +8101,4 @@ } } ] -} \ No newline at end of file +} From b36bc7fe22f94b48b2a6921d198efcd1e9505a1f Mon Sep 17 00:00:00 2001 From: Eduardo Peredo Rivero Date: Sat, 4 Apr 2026 17:00:33 -0500 Subject: [PATCH 3/6] migrate to new data entry app for target/actual datavalues --- src/components/app/App.tsx | 10 +- src/components/dashboard/Dashboard.tsx | 33 +-- src/components/data-entry/DataEntry.tsx | 196 ++++++------------ src/components/data-entry/validation-hooks.ts | 4 +- src/components/steps/sharing/SharingStep.tsx | 11 +- src/models/ProjectSharing.ts | 3 +- 6 files changed, 95 insertions(+), 162 deletions(-) diff --git a/src/components/app/App.tsx b/src/components/app/App.tsx index f47a052e..4e8c99ae 100644 --- a/src/components/app/App.tsx +++ b/src/components/app/App.tsx @@ -113,6 +113,8 @@ const App: React.FC = props => { return
Cannot load app: {loadError}
; } + const shouldRenderHeaderBar = window.self === window.top; + if (error) { return (

@@ -147,9 +149,11 @@ const App: React.FC = props => { title={disableLogoNav?.title} description={disableLogoNav?.description} /> -
- -
+ {shouldRenderHeaderBar && ( +
+ +
+ )}
diff --git a/src/components/dashboard/Dashboard.tsx b/src/components/dashboard/Dashboard.tsx index e937d22f..55b2cde4 100644 --- a/src/components/dashboard/Dashboard.tsx +++ b/src/components/dashboard/Dashboard.tsx @@ -35,8 +35,8 @@ const Dashboard: React.FC = props => { const [state, setState] = React.useState({ type: "loading", height: 10000 }); const iframeRef: React.RefObject = React.createRef(); - const dashboardUrlBase = `${baseUrl}/dhis-web-dashboard`; - const dashboardUrl = dashboardUrlBase + `/#/${id}`; + const dashboardUrlBase = `${baseUrl}/apps/dashboard`; + const dashboardUrl = dashboardUrlBase + `#/${id}`; const translations = getTranslations(name); const appHistory = useAppHistory(backUrl); @@ -153,30 +153,11 @@ function waitforElementToLoad(iframeDocument: HTMLDocument, selector: string) { async function setDashboardStyling(iframe: HTMLIFrameElement) { if (!iframe.contentWindow) return; const iframeDocument = iframe.contentWindow.document; - - await waitforElementToLoad(iframeDocument, ".app-wrapper,.dashboard-scroll-container"); - const iFrameRoot = iframeDocument.querySelector("#root"); - const iFrameWrapper = iframeDocument.querySelector(".app-wrapper"); - const pageContainer = iframeDocument.querySelector(".page-container-top-margin"); - - if (iFrameWrapper?.children[0]) - (iFrameWrapper.children[0] as HTMLElement).style.display = "none"; - if (iFrameWrapper?.children[1]) - (iFrameWrapper.children[1] as HTMLElement).style.display = "none"; - - // 2.36 - iframeDocument.querySelectorAll("header").forEach(el => el.remove()); - iframeDocument.querySelectorAll("[data-test='dashboards-bar']").forEach(el => el.remove()); - - // Hide top bar actions - iframeDocument - .querySelectorAll( - ".dashboard-scroll-container > div > div[class*='ViewTitleBar_container']" - ) - .forEach(el => (el.style.display = "none")); - - if (pageContainer) pageContainer.style.marginTop = "0px"; - if (iFrameRoot) iFrameRoot.style.marginTop = "0px"; + await waitforElementToLoad(iframeDocument, "header"); + const iFrameHeader = iframeDocument.querySelector("header"); + if (iFrameHeader) { + iFrameHeader.style.display = "none"; + } } export default React.memo(Dashboard); diff --git a/src/components/data-entry/DataEntry.tsx b/src/components/data-entry/DataEntry.tsx index 3bacb64d..07042d08 100644 --- a/src/components/data-entry/DataEntry.tsx +++ b/src/components/data-entry/DataEntry.tsx @@ -28,132 +28,37 @@ interface DataEntryProps { export type ValidateFn = { execute: () => Promise }; -function autoResizeIframeByContent(iframe: HTMLIFrameElement) { - const resize = () => { - if (iframe.contentWindow) { - const height = iframe.contentWindow.document.body.scrollHeight; - if (height > 0) iframe.height = height.toString(); - } - }; - window.setInterval(resize, 1000); -} - -function on(document: Document, selector: string, action: (el: T) => void) { - const el = document.querySelector(selector) as T; - if (el) action(el); +const hideHeaderFooterCss = "header, footer { display: none !important; }"; + +function injectHideStyles(doc: Document) { + if (doc.querySelector("style[data-dm-hide]")) return; + const style = doc.createElement("style"); + style.setAttribute("data-dm-hide", "true"); + style.textContent = hideHeaderFooterCss; + doc.head.appendChild(style); } function setEntryStyling(iframe: HTMLIFrameElement) { - if (!iframe.contentWindow) return; - const iframeDocument = iframe.contentWindow.document; - autoResizeIframeByContent(iframe); - - if (showControls) return; - - on(iframeDocument, "#currentSelection", el => el.remove()); - on(iframeDocument, "#header", el => el.remove()); - on(iframeDocument, "html", html => (html.style["overflowY"] = "hidden")); - on(iframeDocument, "#leftBar", el => (el.style.display = "none")); - on(iframeDocument, "#selectionBox", el => (el.style.display = "none")); - on(iframeDocument, "body", el => (el.style.marginTop = "-55px")); - on(iframeDocument, "#mainPage", el => (el.style.margin = "65px 10px 10px 10px")); - on(iframeDocument, "#completenessDiv", el => el.remove()); - on(iframeDocument, "#moduleHeader", el => el.remove()); -} - -export function wait(timeSecs: number) { - console.debug(`[data-entry] Wait ${timeSecs} seconds`); - return new Promise(resolve => setTimeout(resolve, 1000 * timeSecs)); -} - -function waitForOption(el: HTMLSelectElement, predicate: (option: HTMLOptionElement) => boolean) { - return new Promise(resolve => { - const check = () => { - const option = _.find(el.options, predicate); - if (option) { - resolve(undefined); - } else { - setTimeout(check, 10); - } - }; - check(); - }); -} - -async function setDataset(iframe: HTMLIFrameElement, dataSet: DataSet, onDone: () => void) { - const contentWindow = iframe.contentWindow as (Window & DataEntryWindow) | null; - if (!contentWindow) return; - - const iframeDocument = contentWindow.document; - const dataSetSelector = iframeDocument.querySelector("#selectedDataSetId"); - if (!dataSetSelector) return; + if (!iframe.contentWindow || showControls) return; - // Avoid database errors - try { - await contentWindow.dhis2.de.storageManager.formExists(dataSet.id); - } catch (err) { - console.log("[data-entry] error", err); - setTimeout(() => setDataset(iframe, dataSet, onDone), 500); - } - - await waitForOption( - dataSetSelector, - // data-multiorg is set when the country org unit is still selected - option => option.value === dataSet.id && !option.getAttribute("data-multiorg") - ); - await wait(1); - selectOption(dataSetSelector, dataSet.id); + const applyAll = () => { + const outerDoc = iframe.contentWindow?.document; + if (!outerDoc) return; - onDone(); -} - -const getDataEntryForm = async ( - iframe: HTMLIFrameElement, - project: Project, - dataSet: DataSet, - orgUnitId: string, - onDone: () => void -) => { - const contentWindow = iframe.contentWindow as (Window & DataEntryWindow) | null; - const iframeDocument = iframe.contentDocument; - const { parentOrgUnit } = project; - const iframeSelection = contentWindow ? contentWindow.selection : null; - if (!contentWindow || !iframeDocument || !iframeSelection || !parentOrgUnit) return; - const parentSelector = `#orgUnit${parentOrgUnit.id} .toggle`; - const ouSelector = `#orgUnit${orgUnitId} a`; - - const selectDataSet = async () => { - console.debug("[data-entry] Select project orgunit", orgUnitId); - const ouLink = iframeDocument.querySelector(ouSelector); - if (!ouLink) { - console.debug("[data-entry] Project orgunit not found, retry"); - selectOrgUnitAndOptions(); - } else { - ouLink.click(); - console.debug("[data-entry] Select options"); - setDataset(iframe, dataSet, onDone); - } - }; + injectHideStyles(outerDoc); - const selectOrgUnitAndOptions = async () => { - const ouEl = iframeDocument.querySelector(ouSelector); - if (ouEl) { - setTimeout(selectDataSet, 100); - } else { - const parentEl = iframeDocument.querySelector(parentSelector); - if (parentEl) { - console.debug("[data-entry] Click country", parentSelector); - parentEl.click(); - setTimeout(selectOrgUnitAndOptions, 100); - } else { - console.debug("[data-entry] Country orgunit not found, wait"); - setTimeout(selectOrgUnitAndOptions, 100); + outerDoc.querySelectorAll("iframe").forEach(innerIframe => { + if (innerIframe.contentDocument) { + injectHideStyles(innerIframe.contentDocument); } - } + }); }; - selectOrgUnitAndOptions(); -}; + applyAll(); + const intervalId = window.setInterval(applyAll, 500); + + return intervalId; +} const DataEntry = (props: DataEntryProps) => { const { goBack, orgUnitId, dataSet, attributes, dataSetType, onValidateFnChange } = props; @@ -164,7 +69,12 @@ const DataEntry = (props: DataEntryProps) => { const [disableValidation, setDisableValidation] = React.useState(false); const { periodIds, currentPeriodId } = React.useMemo(() => getPeriodsData(dataSet), [dataSet]); const iframeRef = React.useRef(null); - const iFrameSrc = `${baseUrl}/dhis-web-dataentry/index.action`; + const categoryId = config.categories.targetActual.id; + + const categoryOptionId = + props.dataSetType === "actual" + ? config.categoryOptions.actual.id + : config.categoryOptions.target.id; const [state, setState] = useState({ loading: false, @@ -172,6 +82,9 @@ const DataEntry = (props: DataEntryProps) => { dropdownValue: currentPeriodId, }); + const queryParams = `?attributeOptionComboSelection=${categoryId}-${categoryOptionId}&dataSetId=${dataSet.id}&orgUnitId=${orgUnitId}&periodId=${state.dropdownValue}`; + const iFrameSrc = `${baseUrl}/apps/aggregate-data-entry#/${queryParams}`; + function reloadIframe() { setState(state => ({ ...state, loading: true })); setIframeKey(new Date()); @@ -180,25 +93,48 @@ const DataEntry = (props: DataEntryProps) => { useEffect(() => { if (state.dropdownValue) { - setDataSetOpen(setSelectPeriod(iframeRef.current, state.dropdownValue, attributes)); + setDataSetOpen(true); } }, [state, project, iframeKey, attributes]); useEffect(() => { const iframe = iframeRef.current; + if (!iframe) return; - if (iframe) { - if (!showControls) iframe.style.display = "none"; - setState(prevState => ({ ...prevState, loading: true })); - iframe.addEventListener("load", () => { - setEntryStyling(iframe); - getDataEntryForm(iframe, project, dataSet, orgUnitId, () => - setState(prevState => ({ ...prevState, dropdownHasValues: true })) - ); - }); - } + const controller = new AbortController(); + + if (!showControls) iframe.style.display = "none"; + setState(prevState => ({ ...prevState, loading: true })); + + iframe.addEventListener( + "load", + () => { + setState(prevState => ({ ...prevState, dropdownHasValues: true })); + }, + { signal: controller.signal } + ); + + return () => controller.abort(); }, [iframeKey, dataSet, orgUnitId, project]); + useEffect(() => { + const iframe = iframeRef.current; + if (!iframe || showControls) return; + + let intervalId: number | undefined; + + const onLoad = () => { + intervalId = setEntryStyling(iframe); + }; + + iframe.addEventListener("load", onLoad); + + return () => { + iframe.removeEventListener("load", onLoad); + window.clearInterval(intervalId); + }; + }, [iframeKey]); + const period = state.dropdownValue; const [dataSetInfo, setDataSetInfo] = React.useState(); @@ -324,7 +260,7 @@ const DataEntry = (props: DataEntryProps) => { }; const styles = { - iframe: { width: "100%", border: 0, overflow: "hidden" }, + iframe: { width: "100%", border: 0, overflow: "hidden", minHeight: "100vh" }, iframeHidden: { maxHeight: 0, border: 0 }, backgroundIframe: { backgroundColor: "white" }, selector: { padding: "35px 10px 10px 5px", backgroundColor: "white" }, diff --git a/src/components/data-entry/validation-hooks.ts b/src/components/data-entry/validation-hooks.ts index 04005b9c..a67e4d34 100644 --- a/src/components/data-entry/validation-hooks.ts +++ b/src/components/data-entry/validation-hooks.ts @@ -117,7 +117,9 @@ export function useValidation(hookOptions: { usePageExitConfirmation(showPromptFn, disableValidation); - useDhis2EntryEvents(iframeRef, onMessage, options, iframeKey); + // TODO: new data entry app does not expose any global event + // so we cannot apply this hook + // useDhis2EntryEvents(iframeRef, onMessage, options, iframeKey); return { result: validationResult, clear: clearResult, validate: validate }; } diff --git a/src/components/steps/sharing/SharingStep.tsx b/src/components/steps/sharing/SharingStep.tsx index d82d7c2c..18fd9b4e 100644 --- a/src/components/steps/sharing/SharingStep.tsx +++ b/src/components/steps/sharing/SharingStep.tsx @@ -65,7 +65,16 @@ const SharingStep: React.FC = props => { return (
Date: Wed, 15 Apr 2026 20:05:37 -0500 Subject: [PATCH 4/6] generate custom form for actual/target dataSet. add old dhis2 events for dataentry v42 --- i18n/en.pot | 7 +- src/components/data-entry/DataEntry.tsx | 159 +++++---- src/components/data-entry/data-entry-hooks.ts | 54 ++- src/components/data-entry/validation-hooks.ts | 8 +- src/data/DataSetCustomForm.ts | 319 ++++++++++++++++++ src/models/ProjectDb.ts | 21 +- src/pages/data-values/DataValues.tsx | 37 +- 7 files changed, 504 insertions(+), 101 deletions(-) create mode 100644 src/data/DataSetCustomForm.ts diff --git a/i18n/en.pot b/i18n/en.pot index ed20a6f7..5d9e2a69 100644 --- a/i18n/en.pot +++ b/i18n/en.pot @@ -5,8 +5,8 @@ msgstr "" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" -"POT-Creation-Date: 2026-03-27T15:30:46.362Z\n" -"PO-Revision-Date: 2026-03-27T15:30:46.362Z\n" +"POT-Creation-Date: 2026-04-15T02:18:47.807Z\n" +"PO-Revision-Date: 2026-04-15T02:18:47.807Z\n" msgid "Validating Project" msgstr "" @@ -1057,6 +1057,9 @@ msgstr "" msgid "Message" msgstr "" +msgid "Error generating custom form" +msgstr "" + msgid "Set Target Values for Project" msgstr "" diff --git a/src/components/data-entry/DataEntry.tsx b/src/components/data-entry/DataEntry.tsx index 07042d08..802919a2 100644 --- a/src/components/data-entry/DataEntry.tsx +++ b/src/components/data-entry/DataEntry.tsx @@ -1,6 +1,5 @@ import React, { useEffect, useState } from "react"; import moment from "moment"; -import _ from "lodash"; import Spinner from "../spinner/Spinner"; import Dropdown from "../../components/dropdown/Dropdown"; import Project, { DataSet, monthFormat, getPeriodsData, DataSetType } from "../../models/Project"; @@ -69,8 +68,91 @@ const DataEntry = (props: DataEntryProps) => { const [disableValidation, setDisableValidation] = React.useState(false); const { periodIds, currentPeriodId } = React.useMemo(() => getPeriodsData(dataSet), [dataSet]); const iframeRef = React.useRef(null); + const [pluginIframe, setPluginIframe] = React.useState(null); const categoryId = config.categories.targetActual.id; + React.useEffect(() => { + const outer = iframeRef.current; + if (!outer) return; + + const observers: MutationObserver[] = []; + const loadListeners: Array<{ el: HTMLIFrameElement; fn: () => void }> = []; + const tracked = new WeakSet(); + let cancelled = false; + let found: HTMLIFrameElement | null = null; + + const isLegacyCustomFormPlugin = (ifr: HTMLIFrameElement) => { + const doc = ifr.contentDocument; + if (!doc) return false; + return Boolean(doc.querySelector(".plugin-legacy-custom-forms-wrapper")); + }; + + const setFound = (ifr: HTMLIFrameElement) => { + if (found === ifr) return; + found = ifr; + console.debug("[data-entry] legacy custom form plugin iframe found:", ifr); + setPluginIframe(ifr); + }; + + const checkPluginCandidate = (ifr: HTMLIFrameElement) => { + if (found || cancelled) return; + if (!ifr.src.includes("plugin.html")) return; + if (isLegacyCustomFormPlugin(ifr)) setFound(ifr); + }; + + const trackIframe = (ifr: HTMLIFrameElement) => { + if (tracked.has(ifr)) return; + tracked.add(ifr); + + const onLoad = () => { + checkPluginCandidate(ifr); + + if (ifr.contentDocument) watch(ifr.contentDocument); + }; + + if (ifr.contentDocument && ifr.contentDocument.location.href !== "about:blank") { + onLoad(); + } + + ifr.addEventListener("load", onLoad); + loadListeners.push({ el: ifr, fn: onLoad }); + }; + + const watch = (doc: Document) => { + if (cancelled) return; + + doc.querySelectorAll("iframe").forEach(checkPluginCandidate); + + const obs = new MutationObserver(() => { + if (cancelled || found) return; + doc.querySelectorAll("iframe").forEach(ifr => { + checkPluginCandidate(ifr); + trackIframe(ifr); + }); + }); + obs.observe(doc, { childList: true, subtree: true }); + observers.push(obs); + + doc.querySelectorAll("iframe").forEach(trackIframe); + }; + + const start = () => { + const doc = outer.contentDocument; + if (doc) watch(doc); + }; + + outer.addEventListener("load", start); + start(); + + return () => { + cancelled = true; + observers.forEach(o => o.disconnect()); + loadListeners.forEach(({ el, fn }) => el.removeEventListener("load", fn)); + outer.removeEventListener("load", start); + setPluginIframe(null); + }; + }, [iframeKey]); + const categoryOptionId = props.dataSetType === "actual" ? config.categoryOptions.actual.id @@ -150,7 +232,7 @@ const DataEntry = (props: DataEntryProps) => { Boolean(isDataSetOpen) && state.dropdownHasValues && Boolean(dataSetInfo?.isOpen); const validation = useValidation({ - iframeRef, + iframe: pluginIframe, project, dataSetType, period, @@ -202,7 +284,6 @@ const DataEntry = (props: DataEntryProps) => { onClose={validation.clear} /> )} - setDisableValidation(true)} @@ -214,7 +295,6 @@ const DataEntry = (props: DataEntryProps) => { } }} /> -
{!state.dropdownHasValues && } @@ -245,7 +325,6 @@ const DataEntry = (props: DataEntryProps) => {
)}
-