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 missing information to object details screens #35

Merged
merged 3 commits into from
Feb 14, 2023

Conversation

kamorel
Copy link
Contributor

@kamorel kamorel commented Feb 10, 2023

Description

  • Adds bucket information to object properties screen
  • Adds action buttons to object properties screen
  • Sidebar object details no longer displays all the information
  • Adds back the 'Manage by' information

Types of changes

Bug fix (non-breaking change which fixes an issue)

Checklist

  • I have read the CONTRIBUTING doc
  • I have checked that unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

@kamorel kamorel changed the title Feature/obj properties updates Add missing information to object details screens Feb 10, 2023
@github-actions
Copy link

Coverage Report (Frontend)

Totals Coverage
Statements: 43.68% ( 38 / 87 )
Methods: 25% ( 6 / 24 )
Lines: 53.85% ( 28 / 52 )
Branches: 36.36% ( 4 / 11 )

@github-actions
Copy link

Coverage Report (Application)

Totals Coverage
Statements: 75% ( 51 / 68 )
Methods: 62.5% ( 5 / 8 )
Lines: 82.61% ( 38 / 46 )
Branches: 57.14% ( 8 / 14 )

Copy link
Member

@jujaga jujaga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking pretty good from what I can gather; mostly style fixes and a few minor tweaks needed. 👍

frontend/src/components/object/ObjectAccess.vue Outdated Show resolved Hide resolved
frontend/src/components/object/ObjectAccess.vue Outdated Show resolved Hide resolved
@@ -2,25 +2,42 @@
import { onMounted, ref } from 'vue';
import { useRoute } from 'vue-router';
import { storeToRefs } from 'pinia';
import Button from 'primevue/button';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style: We'll want to reorder the imports so that the pinia one comes before the vue one.

frontend/src/components/object/ObjectFileDetails.vue Outdated Show resolved Hide resolved
frontend/src/components/object/ObjectList.vue Outdated Show resolved Hide resolved
Comment on lines +2 to +6
import { onMounted, ref, watch } from 'vue';
import { storeToRefs } from 'pinia';
import { useBucketStore, useUserStore } from '@/store';
import GridRow from '@/components/form/GridRow.vue';
import { RouteNames } from '@/utils/constants';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style: Import ordering should be done based on library name. Newline between external and internal deps.

import { storeToRefs } from 'pinia';
import { onMounted, ref, watch } from 'vue';

import GridRow from '@/components/form/GridRow.vue';
import { useBucketStore, useUserStore } from '@/store';
import { RouteNames } from '@/utils/constants';

Comment on lines 48 to 51
watch( props, async () => {
await getBucketData();
await getUserData();
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Async/await: Is there an actual linear dependency where getUserData needs to wait on getBucketData to complete first? If not, we should let these both fire asynchronously. That means the following is sufficient:

watch(props, () => {
  getBucketData();
  getUserData();
});

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the need for the watches in these components. It's a load->loading->display pattern right? Or are there refreshes somewhere or subscriptions that would update that data?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the sidebar in the object list, the first time it is opened it gets mounted but if you click the info icon again on a different object it doesn't remount, it just receives new props.

// State
import { useObjectStore } from '@/store';
// Component

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style: We should try to reorder the primevue/* imports to come before the vue ones now that we're removing the comment groupings on them unless that causes a compilation behavior due to import ordering.

v-if="value && link"
class="col-9"
>
<router-link
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i like the way you made GriDRow re-usable.
you might be able to make this more compact:

<div v-if="value && label" class="grid-row">
  <div class="col-3">{{ label }}</div>
  <div class="col-9">
    <router-link v-if="link" :to="link">{{ value }}</router-link>
    <span v-else>{{value }}</span>
  </div>
</div>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with you here, but unfortunately nested div's break the formatting for some reason I wasn't able to figure out.

const permissionsObjectId = ref('');
const permissionsObjectName = ref('');

const getObjectInfo = (objId: string) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not suggesting we do it now, by personally i would find some code comments useful. or jsdoc or whatever.
// gets details, perms for a single object from objectList state in objectStore.
the toast summary on line 45 could be changed to 'unable to load object (singular)'

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

separate note. Does this component call the objectStore.listObjects(objId) method.. in case someone navigates straight to this page. Rather than just checking the existing objectList.value.
maybe Luke was going to take a look at this.. or it;s for another ticket

Copy link
Contributor

@loneil loneil Feb 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a fix for that almost to go, but this ticket will merge conflict the heck out of that
https://apps.nrs.gov.bc.ca/int/jira/browse/SHOWCASE-3049

So would leave this and once this is merged in I'll sort it for 3049

v-if="isInfoLoaded"
class="pl-2"
>
<ObjectProperties :object-properties="objectInfo" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you could rename these props to object-info="objectInfo" so that they are received in the child component as
objectInfo

@kamorel kamorel force-pushed the feature/obj-properties-updates branch from 9882833 to 2ed4bae Compare February 14, 2023 23:10
@TimCsaky TimCsaky merged commit 6ee4070 into master Feb 14, 2023
@kamorel kamorel deleted the feature/obj-properties-updates branch February 14, 2023 23:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants