Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add archived: false to queries for users and orgs #790

Merged
merged 67 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
49db8d4
Add archived: false to queries for users and orgs
richford Sep 10, 2024
054ee7c
Add archived: false to queries for users and orgs
richford Sep 10, 2024
71199da
Update roar-admin firestore indexes
richford Sep 11, 2024
131727e
Add indexes for groups and families
richford Sep 11, 2024
b0f9fd7
WIP: query users by archived status
richford Sep 11, 2024
0ece276
Use assignment doc for administration info rather than seperate admin…
kellyel Sep 24, 2024
5086d03
Merge branch 'enh/archived-users-orgs' of https://github.com/yeatmanl…
kellyel Sep 24, 2024
44e300f
Add archived: false to queries for users and orgs
richford Sep 10, 2024
c12ff58
Update roar-admin firestore indexes
richford Sep 11, 2024
9aab32b
Add indexes for groups and families
richford Sep 11, 2024
454e7a6
WIP: query users by archived status
richford Sep 11, 2024
9262b2a
Change Clever signin back to redirect
richford Sep 23, 2024
62188c0
Use assignment doc for administration info rather than seperate admin…
kellyel Sep 24, 2024
45707fb
Remove data-cy from speed dial and use name in admin greeting
richford Sep 25, 2024
6134b81
Use firekit method to get administrations
richford Sep 25, 2024
59b3dc9
Merge branch 'enh/archived-users-orgs' of https://github.com/yeatmanl…
kellyel Sep 26, 2024
aa36111
Remove unused computed properties
kellyel Sep 26, 2024
c6a974e
Update firekit
richford Sep 26, 2024
0629442
npm run lint
richford Sep 26, 2024
c466ba2
Merge branch 'enh/archived-users-orgs' of https://github.com/yeatmanl…
kellyel Sep 26, 2024
ca7899f
Refactor administrations fetcher to use cloud function that grabs onl…
richford Sep 27, 2024
9a1a663
Remove console warning
richford Sep 27, 2024
abfa9bc
Merge branch 'enh/archived-users-orgs' of https://github.com/yeatmanl…
kellyel Sep 27, 2024
0479be1
Update firekit
richford Sep 27, 2024
b6f1796
Remove console.log statements
richford Sep 27, 2024
340a739
UpdateUserData should not use logged in user's ID
kellyel Sep 27, 2024
bfdb6d0
Merge branch 'enh/archived-users-orgs' of https://github.com/yeatmanl…
kellyel Sep 27, 2024
422a497
Update firestore rules
richford Sep 30, 2024
0eb9aa6
Merge branch 'enh/archived-users-orgs' of github.com:yeatmanlab/roar-…
richford Sep 30, 2024
1b1823c
Use roarUid instead of uid for fetchDocById with collection = users
richford Sep 30, 2024
5075232
Add archived: false to queries for users and orgs
richford Sep 10, 2024
7f3fe4a
Update roar-admin firestore indexes
richford Sep 11, 2024
e57b80f
Add indexes for groups and families
richford Sep 11, 2024
b062202
WIP: query users by archived status
richford Sep 11, 2024
c34939d
Change Clever signin back to redirect
richford Sep 23, 2024
1ed9dfb
Use assignment doc for administration info rather than seperate admin…
kellyel Sep 24, 2024
aca1c3f
Remove data-cy from speed dial and use name in admin greeting
richford Sep 25, 2024
9af9b9d
Use firekit method to get administrations
richford Sep 25, 2024
ebcfaa3
Update firekit
richford Sep 26, 2024
ee701b6
npm run lint
richford Sep 26, 2024
396882b
Refactor administrations fetcher to use cloud function that grabs onl…
richford Sep 27, 2024
d291f7b
Remove console warning
richford Sep 27, 2024
109e0d9
Update firekit
richford Sep 27, 2024
f1ee259
Remove console.log statements
richford Sep 27, 2024
f923b6d
Update firestore rules
richford Sep 30, 2024
93c5c27
WIP: query users by archived status
richford Sep 11, 2024
e67ccaf
UpdateUserData should not use logged in user's ID
kellyel Sep 27, 2024
73e1c40
Use roarUid instead of uid for fetchDocById with collection = users
richford Sep 30, 2024
153fd6b
Ensure fresh copy of assignment info
kellyel Sep 30, 2024
52765f9
Update firestore indexes for admin project
richford Sep 30, 2024
8db9e0d
Update firestore indexes
richford Sep 30, 2024
457c47a
Merge branch 'enh/archived-users-orgs' of https://github.com/yeatmanl…
Emily-ejag Sep 30, 2024
a615ecf
Fix administration query and ordering/filtering
richford Oct 1, 2024
d3a0587
Fix TOS race condition for administrators
richford Oct 1, 2024
0a4042c
Fix participant assent/consent
richford Oct 1, 2024
a5aa855
Remove default sort for score report
richford Oct 1, 2024
770b9e1
Add secondary sort for score report table
richford Oct 1, 2024
5fb1543
adding some minor error handling
Emily-ejag Oct 1, 2024
031ff17
fixing localeCompare on ScoreReport
Emily-ejag Oct 1, 2024
40706dd
Remove space between user display name and exclamation point
richford Oct 1, 2024
bd99c51
Merge branch 'enh/archived-users-orgs' of github.com:yeatmanlab/roar-…
richford Oct 1, 2024
3d53523
solving cypress test
Emily-ejag Oct 2, 2024
c2673a4
making signInWIthcleverRedirect default
Emily-ejag Oct 2, 2024
19480a9
Add 'direct report' classes under districts in tree table orgs
richford Oct 2, 2024
2ba723f
Resolve legalDocs.some error
richford Oct 3, 2024
f031fd4
Add direct report classes to a special 'direct report' school
richford Oct 3, 2024
f16ff3c
Add TODO comment
richford Oct 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 116 additions & 0 deletions firebase/admin/firestore.indexes.json
Original file line number Diff line number Diff line change
Expand Up @@ -2998,6 +2998,10 @@
"collectionGroup": "classes",
"queryScope": "COLLECTION",
"fields": [
{
"fieldPath": "archived",
"order": "ASCENDING"
},
{
"fieldPath": "schoolId",
"order": "ASCENDING"
Expand All @@ -3012,6 +3016,10 @@
"collectionGroup": "classes",
"queryScope": "COLLECTION",
"fields": [
{
"fieldPath": "archived",
"order": "ASCENDING"
},
{
"fieldPath": "schoolId",
"order": "ASCENDING"
Expand All @@ -3022,10 +3030,70 @@
}
]
},
{
"collectionGroup": "classes",
"queryScope": "COLLECTION",
"fields": [
{
"fieldPath": "districtId",
"order": "ASCENDING"
},
{
"fieldPath": "lastRoarSync",
"order": "ASCENDING"
}
]
},
{
"collectionGroup": "districts",
"queryScope": "COLLECTION",
"fields": [
{
"fieldPath": "archived",
"order": "ASCENDING"
},
{
"fieldPath": "name",
"order": "ASCENDING"
}
]
},
{
"collectionGroup": "families",
"queryScope": "COLLECTION",
"fields": [
{
"fieldPath": "archived",
"order": "ASCENDING"
},
{
"fieldPath": "name",
"order": "ASCENDING"
}
]
},
{
"collectionGroup": "groups",
"queryScope": "COLLECTION",
"fields": [
{
"fieldPath": "archived",
"order": "ASCENDING"
},
{
"fieldPath": "name",
"order": "ASCENDING"
}
]
},
{
"collectionGroup": "schools",
"queryScope": "COLLECTION",
"fields": [
{
"fieldPath": "archived",
"order": "ASCENDING"
},
{
"fieldPath": "districtId",
"order": "ASCENDING"
Expand All @@ -3040,6 +3108,10 @@
"collectionGroup": "schools",
"queryScope": "COLLECTION",
"fields": [
{
"fieldPath": "archived",
"order": "ASCENDING"
},
{
"fieldPath": "districtId",
"order": "ASCENDING"
Expand All @@ -3054,6 +3126,10 @@
"collectionGroup": "schools",
"queryScope": "COLLECTION",
"fields": [
{
"fieldPath": "archived",
"order": "ASCENDING"
},
{
"fieldPath": "districtId",
"order": "ASCENDING"
Expand All @@ -3068,6 +3144,10 @@
"collectionGroup": "schools",
"queryScope": "COLLECTION",
"fields": [
{
"fieldPath": "archived",
"order": "ASCENDING"
},
{
"fieldPath": "districtId",
"order": "ASCENDING"
Expand All @@ -3082,6 +3162,10 @@
"collectionGroup": "schools",
"queryScope": "COLLECTION",
"fields": [
{
"fieldPath": "archived",
"order": "ASCENDING"
},
{
"fieldPath": "districtId",
"order": "ASCENDING"
Expand All @@ -3096,6 +3180,10 @@
"collectionGroup": "schools",
"queryScope": "COLLECTION",
"fields": [
{
"fieldPath": "archived",
"order": "ASCENDING"
},
{
"fieldPath": "districtId",
"order": "ASCENDING"
Expand All @@ -3106,6 +3194,20 @@
}
]
},
{
"collectionGroup": "schools",
"queryScope": "COLLECTION",
"fields": [
{
"fieldPath": "districtId",
"order": "ASCENDING"
},
{
"fieldPath": "lastRoarSync",
"order": "ASCENDING"
}
]
},
{
"collectionGroup": "users",
"queryScope": "COLLECTION",
Expand Down Expand Up @@ -3352,6 +3454,20 @@
}
]
},
{
"collectionGroup": "users",
"queryScope": "COLLECTION",
"fields": [
{
"fieldPath": "districts.current",
"arrayConfig": "CONTAINS"
},
{
"fieldPath": "archived",
"order": "ASCENDING"
}
]
},
{
"collectionGroup": "users",
"queryScope": "COLLECTION",
Expand Down
6 changes: 6 additions & 0 deletions src/components/ListUsers.vue
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,12 @@ const columns = ref([
dataType: 'string',
sort: false,
},
{
field: 'archived',
header: 'Archived',
dataType: 'boolean',
sort: false,
},
{
header: 'Edit',
button: true,
Expand Down
84 changes: 0 additions & 84 deletions src/helpers/query/assignments.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,90 +173,6 @@ export const getAssignmentsRequestBody = ({
return requestBody;
};

export const getUsersByAssignmentIdRequestBody = ({
adminId,
orgType,
orgId,
filter,
aggregationQuery,
pageLimit,
page,
paginate = true,
select = userSelectFields,
}) => {
const requestBody = {
structuredQuery: {},
};

if (!aggregationQuery) {
if (paginate) {
requestBody.structuredQuery.limit = pageLimit;
requestBody.structuredQuery.offset = page * pageLimit;
}

if (select.length > 0) {
requestBody.structuredQuery.select = {
fields: select.map((field) => ({ fieldPath: field })),
};
}
}

requestBody.structuredQuery.from = [
{
collectionId: 'users',
allDescendants: false,
},
];

requestBody.structuredQuery.where = {
compositeFilter: {
op: 'AND',
filters: [
{
fieldFilter: {
field: { fieldPath: `${pluralizeFirestoreCollection(orgType)}.current` },
op: 'ARRAY_CONTAINS',
value: { stringValue: orgId },
},
},
{
fieldFilter: {
field: { fieldPath: `assignments.assigned` },
op: 'ARRAY_CONTAINS_ANY',
value: { arrayValue: { values: [{ stringValue: adminId }] } },
},
},
],
},
};

if (filter) {
requestBody.structuredQuery.where.compositeFilter.filters.push({
fieldFilter: {
field: { fieldPath: filter[0].field },
op: 'EQUAL',
value: { stringValue: filter[0].value },
},
});
}

if (aggregationQuery) {
return {
structuredAggregationQuery: {
...requestBody,
aggregations: [
{
alias: 'count',
count: {},
},
],
},
};
}

return requestBody;
};

export const getFilteredScoresRequestBody = ({
adminId,
orgId,
Expand Down
Loading
Loading