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

Show results of bulk invite and add/remove in table #215

Merged
merged 2 commits into from
Jun 18, 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
2 changes: 2 additions & 0 deletions frontend/src/assets/variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ $bcbox-primary: #036;
$bcbox-link-text: #1a5a96;
$bcbox-link-text-hover: #2378c7;
$bcbox-outline-on-primary: #fff;
$bcbox-success: #2e8540;
$bcbox-error: #d8292f;
$bcbox-noaction: #606060;

// highlighted sections, table rows
$bcbox-highlight-background: #d9e1e8;
Expand Down
81 changes: 78 additions & 3 deletions frontend/src/components/common/BulkPermissionResults.vue
Original file line number Diff line number Diff line change
@@ -1,21 +1,96 @@
<script setup lang="ts">
import { Dialog } from '@/lib/primevue';
import { ref } from 'vue';
import { Column, DataTable, Dialog } from '@/lib/primevue';
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';

// Props
type Props = {
results: Array<Object>;
resource: any;
resourceType: string;
};
const props = withDefaults(defineProps<Props>(), {});

const props = withDefaults(defineProps<Props>(), {
results: undefined
});

const modelValue = defineModel<boolean>({ default: false });

// Exports DataTable results
const batchResults = ref();

const exportCSV = (event: any) => {

Check warning on line 22 in frontend/src/components/common/BulkPermissionResults.vue

View workflow job for this annotation

GitHub Actions / Unit Tests (Frontend) (16.x)

'event' is defined but never used

Check warning on line 22 in frontend/src/components/common/BulkPermissionResults.vue

View workflow job for this annotation

GitHub Actions / Unit Tests (Frontend) (16.x)

'event' is defined but never used

Check warning on line 22 in frontend/src/components/common/BulkPermissionResults.vue

View workflow job for this annotation

GitHub Actions / Unit Tests (Frontend) (18.x)

'event' is defined but never used

Check warning on line 22 in frontend/src/components/common/BulkPermissionResults.vue

View workflow job for this annotation

GitHub Actions / Unit Tests (Frontend) (20.x)

'event' is defined but never used

Check warning on line 22 in frontend/src/components/common/BulkPermissionResults.vue

View workflow job for this annotation

GitHub Actions / Unit Tests (Frontend) (18.x)

'event' is defined but never used

Check warning on line 22 in frontend/src/components/common/BulkPermissionResults.vue

View workflow job for this annotation

GitHub Actions / Unit Tests (Frontend) (20.x)

'event' is defined but never used
norrisng-bc marked this conversation as resolved.
Show resolved Hide resolved
batchResults.value.exportCSV();
};
</script>
<template>
<Dialog
v-model:visible="modelValue"
header="Results"
:modal="true"
>
<pre>{{ props.results }}</pre>
<DataTable
ref="batchResults"
:export-filename="`${resourceType === 'object' ? resource.name.replace(/\.[^/.]+$/, '') : resource.bucketName}_bulk_results`"

Check warning on line 34 in frontend/src/components/common/BulkPermissionResults.vue

View workflow job for this annotation

GitHub Actions / Unit Tests (Frontend) (16.x)

This line has a length of 131. Maximum allowed is 120

Check warning on line 34 in frontend/src/components/common/BulkPermissionResults.vue

View workflow job for this annotation

GitHub Actions / Unit Tests (Frontend) (16.x)

This line has a length of 131. Maximum allowed is 120

Check warning on line 34 in frontend/src/components/common/BulkPermissionResults.vue

View workflow job for this annotation

GitHub Actions / Unit Tests (Frontend) (18.x)

This line has a length of 131. Maximum allowed is 120

Check warning on line 34 in frontend/src/components/common/BulkPermissionResults.vue

View workflow job for this annotation

GitHub Actions / Unit Tests (Frontend) (20.x)

This line has a length of 131. Maximum allowed is 120

Check warning on line 34 in frontend/src/components/common/BulkPermissionResults.vue

View workflow job for this annotation

GitHub Actions / Unit Tests (Frontend) (18.x)

This line has a length of 131. Maximum allowed is 120

Check warning on line 34 in frontend/src/components/common/BulkPermissionResults.vue

View workflow job for this annotation

GitHub Actions / Unit Tests (Frontend) (20.x)

This line has a length of 131. Maximum allowed is 120
:value="props.results"
class="p-datatable-striped"
>
<div class="action-buttons">
<Button
v-tooltip.bottom="'Save results'"
aria-label="Save results"
class="p-button"
@click="exportCSV($event)"
>
<font-awesome-icon
icon="fa-download"
class="pl-1 pr-1 pt-1 pb-1"
/>
</Button>
</div>
<Column
field="email"
header="Email"
/>
<Column
field="description"
header="Result"
>
<template #body="{ data }">
<span>
<span class="m-1">
<font-awesome-icon
v-if="data.status === 1"
icon="fa-circle-check"
class="icon-success"
/>
<font-awesome-icon
v-else-if="data.status === 0"
icon="fa-circle-minus"
class="icon-noaction"
/>
<font-awesome-icon
v-else
icon="fa-circle-xmark"
class="icon-error"
/>
</span>
{{ data.description }}
</span>
</template>
</Column>
</DataTable>
</Dialog>
</template>

<style scoped lang="scss">
.icon-success {
color: $bcbox-success;
}
.icon-error {
color: $bcbox-error;
}
.icon-noaction {
color: $bcbox-noaction;
}
</style>
Loading