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

Remove clever sync orgs button #598

Merged
merged 1 commit into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 0 additions & 8 deletions src/components/CreateAdministration.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,6 @@
<i class="pi pi-sliders-h text-gray-400 rounded" style="font-size: 1.6rem" />
<div class="admin-page-header">{{ header }}</div>
</div>
<button
v-if="isSuperAdmin"
v-tooltip.top="'Sync Clever orgs'"
class="p-panel-header-icon mr-2"
@click="syncClever"
>
<span :class="cleverSyncIcon"></span>
</button>
</div>
<div class="text-md text-gray-500 ml-6">{{ description }}</div>
</div>
Expand Down
29 changes: 1 addition & 28 deletions src/components/ListOrgs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,6 @@
<i class="pi pi-folder-open text-gray-400 rounded" style="font-size: 1.6rem" />
<div class="admin-page-header">List Organizations</div>
</div>
<button
v-if="isSuperAdmin"
v-tooltip.top="'Sync Clever orgs'"
class="p-panel-header-icon mr-2"
@click="syncClever"
>
<span :class="cleverSyncIcon"></span>
</button>
</div>
<div class="text-md text-gray-500 ml-6">View organizations asssigned to your account.</div>
</div>
Expand Down Expand Up @@ -79,13 +71,11 @@ import { orgFetcher, orgFetchAll, orgPageFetcher } from '@/helpers/query/orgs';
import { orderByDefault, exportCsv, fetchDocById } from '@/helpers/query/utils';
import { ref, computed, onMounted, watch } from 'vue';
import { storeToRefs } from 'pinia';
import { useToast } from 'primevue/usetoast';
import { useQuery } from '@tanstack/vue-query';
import { useAuthStore } from '@/store/auth';
import _get from 'lodash/get';
import _head from 'lodash/head';

const toast = useToast();
const initialized = ref(false);
const orgsQueryKeyIndex = ref(0);

Expand All @@ -110,24 +100,6 @@ const schoolPlaceholder = computed(() => {
// Authstore and Sidebar
const authStore = useAuthStore();

const syncingClever = ref(false);
const cleverSyncIcon = computed(() => {
if (syncingClever.value) {
return 'pi pi-sync pi-spin';
} else {
return 'pi pi-cloud-download';
}
});

const syncClever = async () => {
toast.add({ severity: 'info', summary: 'Syncing', detail: 'Clever sync initiated', life: 3000 });
syncingClever.value = true;
await authStore.syncCleverOrgs();
syncingClever.value = false;
orgsQueryKeyIndex.value += 0;
toast.add({ severity: 'success', summary: 'Success', detail: 'Clever sync successful', life: 5000 });
};

const { isLoading: isLoadingClaims, data: userClaims } = useQuery({
queryKey: ['userClaims', authStore.uid, authStore.userQueryKeyIndex],
queryFn: () => fetchDocById('userClaims', authStore.uid),
Expand Down Expand Up @@ -247,6 +219,7 @@ const tableColumns = computed(() => {

if (['districts', 'schools', 'classes'].includes(activeOrgType.value)) {
columns.push({ field: 'clever', header: 'Clever', dataType: 'boolean', sort: false });
columns.push({ field: 'classlink', header: 'ClassLink', dataType: 'boolean', sort: false });
}

columns.push({
Expand Down
13 changes: 12 additions & 1 deletion src/helpers/query/orgs.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,18 @@ export const getOrgsRequestBody = ({
pageLimit,
page,
paginate = true,
select = ['abbreviation', 'address', 'clever', 'districtContact', 'id', 'mdrNumber', 'name', 'ncesId', 'tags'],
select = [
'abbreviation',
'address',
'clever',
'classlink',
'districtContact',
'id',
'mdrNumber',
'name',
'ncesId',
'tags',
],
}) => {
const requestBody = {
structuredQuery: {
Expand Down
5 changes: 0 additions & 5 deletions src/store/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,6 @@ export const useAuthStore = () => {
console.log('Cant log out while not logged in');
}
},
async syncCleverOrgs() {
return this.roarfirekit.syncCleverOrgs(false);
},
// TODO: rostering from ClassLink

async createNewFamily(careTakerEmail, careTakerPassword, careTakerData, students, isTestData = false) {
return this.roarfirekit.createNewFamily(careTakerEmail, careTakerPassword, careTakerData, students, isTestData);
},
Expand Down
Loading