Skip to content

Commit

Permalink
resolve merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
jatindersingh93 committed Oct 16, 2023
2 parents b211f6d + c9e6f35 commit 03fe583
Show file tree
Hide file tree
Showing 15 changed files with 102 additions and 76 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#
# Build the application
#
FROM registry.access.redhat.com/ubi9/nodejs-18:1-62.1692771036 as application
FROM registry.access.redhat.com/ubi9/nodejs-18:1-70.1695740477 as application

ENV NO_UPDATE_NOTIFIER=true

Expand All @@ -22,7 +22,7 @@ RUN npm ci --omit=dev
#
# Build the frontend
#
FROM registry.access.redhat.com/ubi9/nodejs-18:1-62.1692771036 as frontend
FROM registry.access.redhat.com/ubi9/nodejs-18-minimal:1-74.1695740475 as frontend

ENV NO_UPDATE_NOTIFIER=true

Expand Down
9 changes: 9 additions & 0 deletions frontend/src/assets/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,18 @@ td .wrap-block {
}
}

// ---------- datatables

.p-datatable {
.p-datatable-loading-overlay {
background: white;
opacity: 0.8;
}
}

.versions-table .p-datatable-table tbody tr:not(.selected-row) {
&:hover{
background-color: $bcbox-highlight-background !important;
cursor: pointer;
}
}
12 changes: 7 additions & 5 deletions frontend/src/assets/primevue.scss
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,6 @@
color: $bcbox-outline-on-primary !important;
}

&:hover {
border-color: $bcbox-primary !important;
color: $bcbox-outline-on-primary !important;
background-color: $bcbox-primary !important;
}
}
}

Expand Down Expand Up @@ -116,3 +111,10 @@
}
}
}

.p-tag{
background-color: $bcbox-primary;
font-size: 1rem;
padding: .25rem .75rem;
font-weight: normal;
}
2 changes: 1 addition & 1 deletion frontend/src/components/bucket/BucketConfigForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ const onCancel = () => {
name="bucket"
label="Bucket *"
placeholder="bucket0123456789"
help-text="The name of the bucket given to you, e.g. yxwgj"
:help-text="'The name of the bucket given to you. For example: \'yxwgj\'.'"
/>
<TextInput
name="endpoint"
Expand Down
9 changes: 5 additions & 4 deletions frontend/src/components/common/SyncButton.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { ref, onMounted } from 'vue';
import { ref } from 'vue';
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
import { Button, Dialog, useToast } from '@/lib/primevue';
Expand Down Expand Up @@ -42,13 +42,14 @@ const onSubmit = () => {
displaySyncDialog.value = false;
};
onMounted( () => {
const onClick = () => {
displaySyncDialog.value = true;
if (props.bucketId) {
name.value = bucketStore.findBucketById(props.bucketId)?.bucketName ?? '';
} else if (props.objectId) {
name.value = objectStore.findObjectById(props.objectId)?.name ?? '';
}
});
};
</script>

<template>
Expand Down Expand Up @@ -110,7 +111,7 @@ onMounted( () => {
<Button
class="p-button-lg p-button-text"
aria-label="Synchronize File"
@click="displaySyncDialog = true"
@click="onClick"
>
<font-awesome-icon icon="fa-solid fa-sync" />
</Button>
Expand Down
15 changes: 9 additions & 6 deletions frontend/src/components/object/ObjectAccess.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,29 @@ async function load() {
await permissionStore.fetchObjectPermissions({ objectId: props.objectId });
const uniqueIds = [...new Set(getObjectPermissions.value
.filter( (x: COMSObjectPermission) => x.objectId === props.objectId && x.permCode === Permissions.MANAGE )
.map( (x: COMSObjectPermission) => x.userId) )];
.filter((x: COMSObjectPermission) => x.objectId === props.objectId && x.permCode === Permissions.MANAGE)
.map((x: COMSObjectPermission) => x.userId))];
if( uniqueIds.length ) {
if (uniqueIds.length) {
await userStore.fetchUsers({ userId: uniqueIds });
managedBy.value = userStore.findUsersById(uniqueIds).map( x => x.fullName ).join(', ');
managedBy.value = userStore.findUsersById(uniqueIds).map(x => x.fullName).join(', ');
}
}
onMounted(() => {
load();
});
watch( props, () => {
watch(props, () => {
load();
});
</script>

<template>
<div class="grid details-grid grid-nogutter mb-2">
<div
v-if="managedBy"
class="grid details-grid grid-nogutter mb-2"
>
<div class="col-12">
<h2 class="font-bold">
Access
Expand Down
8 changes: 1 addition & 7 deletions frontend/src/components/object/ObjectFileDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import {
} from '@/store';
import { Permissions, RouteNames } from '@/utils/constants';
import { ButtonMode } from '@/utils/enums';
import { formatDateLong } from '@/utils/formatters';
import type { Ref } from 'vue';
import type { COMSObject, Version } from '@/types';
Expand Down Expand Up @@ -140,11 +139,7 @@ watch( [props, getObjects], async () => {
<h1
class="pl-1 font-bold heading"
>
<span v-if="latestVersionId !== props.versionId">
Previous version:
{{ formatDateLong(version?.createdAt as string) }}
</span>
<span v-else>
<span>
File details
</span>
</h1>
Expand Down Expand Up @@ -227,7 +222,6 @@ watch( [props, getObjects], async () => {
:version-id="props.versionId"
/>
<ObjectTag
:editable="props.versionId === latestVersionId"
:object-id="props.objectId"
:version-id="props.versionId"
@on-file-uploaded="onFileUploaded"
Expand Down
9 changes: 7 additions & 2 deletions frontend/src/components/object/ObjectMetadata.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const emit = defineEmits(['on-file-uploaded']);
// Store
const metadataStore = useMetadataStore();
const versionStore = useVersionStore();
const objectStore = useObjectStore();
const permissionStore = usePermissionStore();
const { getUserId } = storeToRefs(useAuthStore());
const { getMetadata: tsGetMetadata } = storeToRefs(metadataStore);
Expand All @@ -42,6 +43,10 @@ const formData: Ref<ObjectMetadataTagFormType> = ref({
});
const objectMetadata: Ref<Metadata | undefined> = ref(undefined);
// Object
const obj = objectStore.findObjectById(props.objectId);
// Actions
const confirm = useConfirm();
Expand All @@ -56,7 +61,7 @@ const confirmUpdate = (values: ObjectMetadataTagFormType) => {
};
const showModal = () => {
formData.value.filename = useObjectStore().findObjectById(props.objectId)?.name ?? '';
formData.value.filename = obj?.name ?? '';
formData.value.metadata = objectMetadata.value?.metadata;
editing.value = true;
Expand Down Expand Up @@ -107,7 +112,7 @@ watch([props, tsGetMetadata,vsGetMetadata] , () => {
</div>
<div
v-if="editable &&
permissionStore.isObjectActionAllowed(props.objectId, getUserId, Permissions.UPDATE, props.objectId)"
permissionStore.isObjectActionAllowed(props.objectId, getUserId, Permissions.UPDATE, obj?.bucketId)"
>
<Button
outlined
Expand Down
25 changes: 6 additions & 19 deletions frontend/src/components/object/ObjectProperties.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import { storeToRefs } from 'pinia';
import { onMounted, ref, watch } from 'vue';
import GridRow from '@/components/form/GridRow.vue';
import { useBucketStore, useMetadataStore, useObjectStore, useUserStore, useVersionStore } from '@/store';
import { useBucketStore, useMetadataStore, useObjectStore, useUserStore } from '@/store';
import { RouteNames } from '@/utils/constants';
import { formatDateLong } from '@/utils/formatters';
import type { Ref } from 'vue';
import type { Bucket, COMSObject, Metadata, Version } from '@/types';
import type { Bucket, COMSObject, Metadata } from '@/types';
// Props
type Props = {
Expand All @@ -26,7 +26,6 @@ const bucketStore = useBucketStore();
const metadataStore = useMetadataStore();
const objectStore = useObjectStore();
const userStore = useUserStore();
const versionStore = useVersionStore();
const { getUserSearch } = storeToRefs(userStore);
// State
Expand All @@ -35,7 +34,6 @@ const createdBy: Ref<string | undefined> = ref(undefined);
const object: Ref<COMSObject | undefined> = ref(undefined);
const objectMetadata: Ref<Metadata | undefined> = ref(undefined);
const updatedBy: Ref<string | undefined> = ref(undefined);
const version: Ref<Version | undefined> = ref(undefined);
// Actions
async function load() {
Expand All @@ -44,21 +42,10 @@ async function load() {
bucket.value = bucketStore.findBucketById(object.value?.bucketId as string);
if( props.fullView ) {
if( props.versionId ) {
version.value = versionStore.findVersionById(props.versionId);
objectMetadata.value = versionStore.findMetadataByVersionId(props.versionId);
await userStore.fetchUsers({userId:[version.value?.createdBy, version.value?.updatedBy]});
createdBy.value = getUserSearch.value.find( x => x.userId === version.value?.createdBy )?.fullName;
updatedBy.value = getUserSearch.value.find( x => x.userId === version.value?.updatedBy )?.fullName;
}
else {
objectMetadata.value = metadataStore.findMetadataByObjectId(object.value?.id as string);
await userStore.fetchUsers({userId:[object.value?.createdBy, object.value?.updatedBy]});
createdBy.value = getUserSearch.value.find( x => x.userId === object.value?.createdBy )?.fullName;
updatedBy.value = getUserSearch.value.find( x => x.userId === object.value?.updatedBy )?.fullName;
}
objectMetadata.value = metadataStore.findMetadataByObjectId(object.value?.id as string);
await userStore.fetchUsers({userId:[object.value?.createdBy, object.value?.updatedBy]});
createdBy.value = getUserSearch.value.find( x => x.userId === object.value?.createdBy )?.fullName;
updatedBy.value = getUserSearch.value.find( x => x.userId === object.value?.updatedBy )?.fullName;
}
}
Expand Down
6 changes: 5 additions & 1 deletion frontend/src/components/object/ObjectSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ const closeObjectInfo = async () => {
emit('close-object-info');
};
const obj = objectStore.findObjectById(props.objectId);
const bucketId = obj?.bucketId;
watch( props, () => {
const obj = objectStore.findObjectById(props.objectId);
if( obj &&
(obj.public || permissionStore.isObjectActionAllowed(obj.id, getUserId.value, Permissions.READ, obj.bucketId)))
{
Expand Down Expand Up @@ -68,10 +70,12 @@ watch( props, () => {
:full-view="false"
/>
<ObjectMetadata
:bucket-id="bucketId"
:editable="false"
:object-id="props.objectId"
/>
<ObjectTag
:bucket-id="bucketId"
:editable="false"
:object-id="props.objectId"
/>
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/object/ObjectTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ const filters = ref({
paginator-template="RowsPerPageDropdown CurrentPageReport PrevPageLink NextPageLink "
current-page-report-template="{first}-{last} of {totalRecords}"
:rows-per-page-options="[10, 20, 50]"
sort-field="name"
:sort-order="1"
sort-field="lastUpdatedDate"
:sort-order="-1"
:global-filter-fields="['name']"
>
<template #header>
Expand Down
26 changes: 16 additions & 10 deletions frontend/src/components/object/ObjectTag.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { storeToRefs } from 'pinia';
import { onMounted, ref, watch } from 'vue';
import { ObjectMetadataTagForm } from '@/components/object';
import { Button, Dialog } from '@/lib/primevue';
import { Button, Dialog, Tag } from '@/lib/primevue';
import { useAuthStore, useObjectStore, usePermissionStore, useTagStore, useVersionStore } from '@/store';
import { Permissions } from '@/utils/constants';
Expand All @@ -27,6 +27,7 @@ const props = withDefaults(defineProps<Props>(), {
const emit = defineEmits(['on-file-uploaded']);
// Store
const objectStore = useObjectStore();
const tagStore = useTagStore();
const versionStore = useVersionStore();
const permissionStore = usePermissionStore();
Expand All @@ -41,9 +42,12 @@ const formData: Ref<ObjectMetadataTagFormType> = ref({
});
const objectTagging: Ref<Tagging | undefined> = ref(undefined);
// Object
const obj = objectStore.findObjectById(props.objectId);
// Actions
const showModal = () => {
formData.value.filename = useObjectStore().findObjectById(props.objectId)?.name ?? '';
formData.value.filename = obj?.name ?? '';
formData.value.tagset = objectTagging.value?.tagset;
editing.value = true;
Expand Down Expand Up @@ -98,19 +102,21 @@ watch( [props, tsGetTagging, vsGetTagging], () => {
v-for="tag in objectTagging?.tagset"
:key="tag.key + tag.value"
>
<div class="col">
<Button
label="Primary"
class="p-button-raised p-button-rounded"
>
{{ tag.key + "=" + tag.value }}
</Button>
<div class="grid">
<div class="col mr-2">
<Tag
value="Primary"
rounded
>
{{ tag.key + "=" + tag.value }}
</Tag>
</div>
</div>
</div>
</div>
<div
v-if="editable &&
permissionStore.isObjectActionAllowed(props.objectId, getUserId, Permissions.UPDATE, props.objectId)"
permissionStore.isObjectActionAllowed(props.objectId, getUserId, Permissions.UPDATE, obj?.bucketId)"
>
<Button
outlined
Expand Down
Loading

0 comments on commit 03fe583

Please sign in to comment.