3939 <NcContextResource :resources.sync =" resources" :receivers.sync =" receivers" />
4040 </div >
4141 <div class =" row space-T" >
42- <div >
43- {{ t('tables', 'Navigation bar display') }}
44- </div >
45- <NcCheckboxRadioSwitch :checked.sync =" displayMode" value =" NAV_ENTRY_MODE_HIDDEN"
46- name =" NAV_ENTRY_MODE_HIDDEN" type =" radio" >
47- Hide navigation entry for everybody
48- </NcCheckboxRadioSwitch >
49- <NcCheckboxRadioSwitch :checked.sync =" displayMode" value =" NAV_ENTRY_MODE_RECIPIENTS"
50- name =" NAV_ENTRY_MODE_RECIPIENTS" type =" radio" >
51- Show navigation entry for everybody, except me
52- </NcCheckboxRadioSwitch >
53- <NcCheckboxRadioSwitch :checked.sync =" displayMode" value =" NAV_ENTRY_MODE_ALL" name =" NAV_ENTRY_MODE_ALL"
54- type =" radio" >
55- Show navigation entry for everybody
56- </NcCheckboxRadioSwitch >
57- <br >
42+ <NcActions >
43+ <NcActionCheckbox :checked =" showInNavigationDefault" @change =" updateDisplayMode" >
44+ Show in app list
45+ </NcActionCheckbox >
46+ </NcActions >
47+ <p class =" nav-display-subtext" >
48+ This can be overridden by a per-account preference
49+ </p >
5850 </div >
5951 <div class =" row space-T" >
6052 <div class =" fix-col-4 space-T justify-between" >
7971</template >
8072
8173<script >
82- import { NcDialog , NcButton , NcIconSvgWrapper , NcCheckboxRadioSwitch } from ' @nextcloud/vue'
74+ import { NcDialog , NcButton , NcIconSvgWrapper , NcActionCheckbox } from ' @nextcloud/vue'
8375import { showError , showSuccess } from ' @nextcloud/dialogs'
8476import { getCurrentUser } from ' @nextcloud/auth'
8577import ' @nextcloud/dialogs/style.css'
@@ -100,7 +92,7 @@ export default {
10092 NcIconPicker,
10193 NcIconSvgWrapper,
10294 NcContextResource,
103- NcCheckboxRadioSwitch ,
95+ NcActionCheckbox ,
10496 },
10597 mixins: [svgHelper, permissionBitmask, permissionsMixin],
10698 props: {
@@ -129,7 +121,7 @@ export default {
129121 PERMISSION_UPDATE ,
130122 PERMISSION_DELETE ,
131123 prepareDeleteContext: false ,
132- displayMode : ' NAV_ENTRY_MODE_HIDDEN ' , // TODO: get the actual saved display mode
124+ showInNavigationDefault : false ,
133125 }
134126 },
135127 computed: {
@@ -154,6 +146,7 @@ export default {
154146 this .description = context .description
155147 this .resources = context ? this .getContextResources (context) : []
156148 this .receivers = context ? this .getContextReceivers (context) : []
149+ this .showInNavigationDefault = this .getNavDisplay (context)
157150 }
158151 },
159152 },
@@ -194,7 +187,8 @@ export default {
194187 isUser: true ,
195188 key: ' user-' + getCurrentUser ().uid ,
196189 })
197- const res = await this .$store .dispatch (' updateContext' , { id: this .contextId , data, previousReceivers: Object .values (context .sharing ), receivers: this .receivers })
190+ const displayMode = this .showInNavigation ? ' NAV_ENTRY_MODE_ALL' : ' NAV_ENTRY_MODE_HIDDEN'
191+ const res = await this .$store .dispatch (' updateContext' , { id: this .contextId , data, previousReceivers: Object .values (context .sharing ), receivers: this .receivers , displayMode: NAV_ENTRY_MODE [displayMode] })
198192 if (res) {
199193 showSuccess (t (' tables' , ' Updated application "{contextTitle}".' , { contextTitle: this .title }))
200194 this .actionCancel ()
@@ -210,15 +204,15 @@ export default {
210204 this .resources = context ? this .getContextResources (context) : []
211205 this .receivers = context ? this .getContextReceivers (context) : []
212206 this .prepareDeleteContext = false
207+ this .showInNavigationDefault = this .getNavDisplay (context)
213208 },
214- getDisplayMode (context ) {
209+ getNavDisplay (context ) {
215210 const shares = Object .keys (context .sharing || {})
216211 if (shares .length ) {
217- print (' vals' , context .sharing [shares[0 ]])
218212 const displayMode = context .sharing [shares[0 ]].display_mode_default
219- return Object . keys ( NAV_ENTRY_MODE ). find ( key => NAV_ENTRY_MODE [key] === displayMode)
213+ return displayMode !== 0
220214 }
221- return ' NAV_ENTRY_MODE_HIDDEN '
215+ return false
222216 },
223217 getContextReceivers (context ) {
224218 let sharing = Object .values (context .sharing )
@@ -276,6 +270,9 @@ export default {
276270 }
277271
278272 },
273+ updateDisplayMode () {
274+ this .showInNavigation = ! this .showInNavigation
275+ },
279276 actionTransfer () {
280277 emit (' tables:context:edit' , null )
281278 emit (' tables:context:transfer' , this .localContext )
@@ -296,4 +293,12 @@ export default {
296293 padding-inline : 0 !important ;
297294 max-width : 100% ;
298295}
296+
297+ .nav-display-subtext {
298+ color : var (--color-text-maxcontrast )
299+ }
300+
301+ li {
302+ list-style : none ;
303+ }
299304 </style >
0 commit comments