Skip to content

Commit

Permalink
Merge pull request #190 from lcnetdev/bfp-300-admin-metadata
Browse files Browse the repository at this point in the history
[BFP-300] Admin Metadata
  • Loading branch information
f-osorio authored Jan 24, 2025
2 parents 7f3ac8d + db7d8df commit 35cc4a2
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 3 deletions.
12 changes: 11 additions & 1 deletion src/components/panels/edit/EditPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@

<template v-if="((preferenceStore.returnValue('--b-edit-main-splitpane-edit-switch-between-resource-button') === false) || (preferenceStore.returnValue('--b-edit-main-splitpane-edit-switch-between-resource-button') === true && profileName == activeResourceName ))">

<template v-if="!activeProfile.rt[profileName].pt[profileCompoent].deleted">
<template v-if="!activeProfile.rt[profileName].pt[profileCompoent].deleted && !hideAdminField(activeProfile.rt[profileName].pt[profileCompoent], profileName)">
<!-- if createLatoutMode is active, and there is an active layout, show everything -->
<div v-if="(!preferenceStore.returnValue('--c-general-ad-hoc') || (createLayoutMode && !layoutActive)) || (layoutActive || (preferenceStore.returnValue('--c-general-ad-hoc') && !profileStore.emptyComponents[profileName].includes(profileCompoent)))" :class="{ 'inline-mode' : (preferenceStore.returnValue('--b-edit-main-splitpane-edit-inline-mode')), 'edit-panel-scroll-x-child': preferenceStore.returnValue('--b-edit-main-splitpane-edit-scroll-x'), 'read-only': isReadOnly(activeProfile.rt[profileName].pt[profileCompoent])}">
<!-- =={{ layoutActiveFilter['properties'][profileName].includes(activeProfile.rt[profileName].pt[profileCompoent].id) }} -->
Expand Down Expand Up @@ -244,6 +244,16 @@
},
//We only want the editable admin field under instances to show up
// Don't show READONLY ADMIN fields in the instance, Don't show any admin fields in the work
hideAdminField: function(component, profileName){
let readOnly = this.isReadOnly(component)
let isWork = profileName.includes(':Work')
let isAdminField = component.propertyURI.includes('adminMetadata')
return (readOnly) || (isWork && isAdminField )
},
inlineRowButtonMouseEnter: function(event){
console.log(event)
Expand Down
18 changes: 17 additions & 1 deletion src/components/panels/sidebar_property/Properties.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import { mapStores, mapState, mapWritableState } from 'pinia'
import { isReadonly } from 'vue';
export default {
data() {
Expand Down Expand Up @@ -295,6 +296,21 @@
this.activeComponent = this.activeProfile.rt[profileName].pt[elementName]
}
},
isReadOnlyField: function(component){
if (component.adminMetadataType && component.adminMetadataType == 'secondary'){
return true
}
return false
},
hideAdminField: function(component, profileName){
let readOnly = this.isReadOnlyField(component)
let isWork = profileName.includes(':Work')
let isAdminField = component.propertyURI.includes('adminMetadata')
return (readOnly) || (isWork && isAdminField )
},
},
}
Expand Down Expand Up @@ -347,7 +363,7 @@
@change="change"
item-key="id">
<template #item="{element}">
<template v-if="!activeProfile.rt[profileName].pt[element].deleted && !hideProps.includes(activeProfile.rt[profileName].pt[element].propertyURI) && ( (layoutActive && layoutActiveFilter['properties'][profileName] && layoutActiveFilter['properties'][profileName].includes(activeProfile.rt[profileName].pt[element].id)) || !layoutActive || (createLayoutMode && layoutActive))">
<template v-if="!hideAdminField(activeProfile.rt[profileName].pt[element], profileName) && !activeProfile.rt[profileName].pt[element].deleted && !hideProps.includes(activeProfile.rt[profileName].pt[element].propertyURI) && ( (layoutActive && layoutActiveFilter['properties'][profileName] && layoutActiveFilter['properties'][profileName].includes(activeProfile.rt[profileName].pt[element].id)) || !layoutActive || (createLayoutMode && layoutActive))">
<li @click.stop="jumpToElement(profileName, element)" :class="['sidebar-property-li sidebar-property-li-empty', {'user-populated': (hasData(activeProfile.rt[profileName].pt[element]) == 'user')} , {'system-populated': (hasData(activeProfile.rt[profileName].pt[element])) == 'system'} , {'not-populated-hide': (preferenceStore.returnValue('--c-general-ad-hoc') && emptyComponents[profileName] && emptyComponents[profileName].includes(element) && !layoutActive )}]">
<a href="#" @click.stop="jumpToElement(profileName, element)" class="sidebar-property-ul-alink">
<template v-if="preferenceStore.returnValue('--b-edit-main-splitpane-properties-number-labels')">{{activeProfile.rt[profileName].ptOrder.indexOf(element)}}</template>
Expand Down
2 changes: 1 addition & 1 deletion src/stores/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const useConfigStore = defineStore('config', {

versionMajor: 0,
versionMinor: 17,
versionPatch: 25,
versionPatch: 26,

regionUrls: {

Expand Down

0 comments on commit 35cc4a2

Please sign in to comment.