Skip to content

Commit

Permalink
set disabled on pref
Browse files Browse the repository at this point in the history
  • Loading branch information
Severino committed Oct 25, 2023
1 parent 5181a77 commit abd310f
Show file tree
Hide file tree
Showing 13 changed files with 59 additions and 18 deletions.
11 changes: 8 additions & 3 deletions resources/js/components/BibliographyTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -461,8 +461,14 @@
</td>
<td>
<div class="dropdown">
<span id="dropdownMenuButton" class="clickable" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fas fa-fw fa-ellipsis-vertical"></i>
<span
id="dropdownMenuButton"
class="clickable"
data-bs-toggle="dropdown"
aria-haspopup="true"
aria-expanded="false"
>
<i class="fas fa-fw fa-ellipsis-vertical" />
</span>
<div
class="dropdown-menu overlay-all"
Expand Down Expand Up @@ -692,7 +698,6 @@
return false;
});
}
const size = Math.min(state.entriesLoaded, filteredEntries.length);
return _orderBy(filteredEntries, state.orderColumn, state.orderType).slice(0, size);
})
Expand Down
6 changes: 4 additions & 2 deletions resources/js/components/CommentList.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<template>
<!-- eslint-disable vue/no-v-html-->
<div :class="classes">
<div :class="listClasses">
<div v-show="!state.commentsHidden">
Expand Down Expand Up @@ -150,12 +151,13 @@
v-if="comment.content"
class="card-body px-3 py-2"
>
<!-- eslint-disable -->
<!-- TODO; Here we insert user input into the comment. This is bad!-->
<!-- eslint-disable vue/no-v-html -->
<p
class="card-text"
v-html="mentionify(comment.content)"
/>
<!-- eslint-enable -->
<!-- eslint-enable vue/no-v-html -->
</div>
</slot>
<slot
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/Roles.vue
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
<div
class="dropdown-menu"
:aria-labelledby="`role-options-dropdown-${role.id}`"
>
>
<a
v-if="roleDirty(role.id)"
class="dropdown-item"
Expand Down
30 changes: 19 additions & 11 deletions resources/js/components/UserPreferences.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,10 @@
<td>
<component
:is="preferencesBlock.component"
v-if="preferencesBlock.data === 'v-model'"
v-model="state.preferences[preferencesBlock.label]"
@changed="value => trackChanges(preferencesBlock.label, value)"
/>
<component
:is="preferencesBlock.component"
v-else
:data="state.preferences[preferencesBlock.label]"
:model-value="(preferencesBlock.data === 'v-model') ? state.preferences[preferencesBlock.label] : null"
:readonly="!state.overrides[preferencesBlock.label]"
:data="(preferencesBlock.data === undefined) ? state.preferences[preferencesBlock.label] : null"
@update:model-value="value => updateValue(preferencesBlock, value)"
@changed="e => trackChanges(preferencesBlock.label, e)"
/>
</td>
Expand Down Expand Up @@ -126,6 +122,13 @@
state.dirtyData[label].value = data;
}
};
const updateValue = (preferencesBlock, data) => {
if(preferencesBlock.data === 'v-model') {
state.preferences[preferencesBlock.label] = data;
}
};
const savePreferences = _ => {
if(!state.hasDirtyData) return;
Expand All @@ -145,9 +148,13 @@
*
* Otherwise there will be an 'array to text conversion' error -SO
*/
if(label == 'prefs.map-projection') {
dirtyData.value = JSON.stringify(dirtyData.value);
}
// if(label == 'prefs.map-projection') {
// dirtyData.value = JSON.stringify(dirtyData.value);
// }
// if(label == 'prefs.project-maintainer') {
// dirtyData.value = JSON.stringify(dirtyData.value);
// }
}
const data = {
changes: Object.values(state.dirtyData),
Expand Down Expand Up @@ -251,6 +258,7 @@
// LOCAL
trackChanges,
savePreferences,
updateValue,
// PROPS
// STATE
state,
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/preferences/Color.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
:filterResults="true"
:options="state.colorList"
:searchable="true"
:readonly="readonly"
:disabled="readonly"
:placeholder="t('global.select.placeholder')"
@change="onChange"
>
Expand Down
3 changes: 3 additions & 0 deletions resources/js/components/preferences/Columns.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
v-model="data.left"
class="form-control"
type="number"
:disabled="readonly"
min="0"
:max="state.maxLeft"
:readonly="readonly"
Expand All @@ -28,6 +29,7 @@
v-model="data.center"
class="form-control"
type="number"
:disabled="readonly"
min="0"
:max="state.maxCenter"
:readonly="readonly"
Expand All @@ -46,6 +48,7 @@
v-model="data.right"
class="form-control"
type="number"
:disabled="readonly"
min="0"
:max="state.maxRight"
:readonly="readonly"
Expand Down
1 change: 1 addition & 0 deletions resources/js/components/preferences/GuiLanguage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
:filterResults="true"
:options="state.languageList"
:searchable="true"
:disabled="readonly"
:readonly="readonly"
:placeholder="t('global.select.placeholder')"
@change="onChange"
Expand Down
1 change: 1 addition & 0 deletions resources/js/components/preferences/MapProjection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
min="0"
max="99999"
step="1"
:disabled="readonly"
:readonly="readonly"
@input="onChange"
>
Expand Down
3 changes: 3 additions & 0 deletions resources/js/components/preferences/ProjectMaintainer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<input
v-model="localData.name"
class="form-control"
:disabled="readonly"
type="text"
:readonly="readonly"
@input="onChange"
Expand All @@ -17,6 +18,7 @@
<input
v-model="localData.email"
class="form-control"
:disabled="readonly"
type="text"
:readonly="readonly"
@input="onChange"
Expand All @@ -29,6 +31,7 @@
<textarea
v-model="localData.description"
class="form-control"
:disabled="readonly"
rows="1"
:readonly="readonly"
@input="onChange"
Expand Down
1 change: 1 addition & 0 deletions resources/js/components/preferences/ProjectName.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
:value="modelValue"
class="form-control"
type="text"
:disabled="readonly"
:readonly="readonly"
@input="onInput"
>
Expand Down
1 change: 1 addition & 0 deletions resources/js/components/preferences/Tags.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
:value="data"
class="form-control"
type="text"
:disabled="readonly"
:readonly="readonly"
@input="onChange"
>
Expand Down
1 change: 1 addition & 0 deletions resources/js/components/preferences/ThesaurusLink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
class="form-control"
type="text"
:readonly="readonly"
:disabled="readonly"
@input="onChange"
>
</div>
Expand Down
15 changes: 15 additions & 0 deletions resources/sass/_variables-override-dark_unrounded.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ $brand-danger: $red;
// Corners
$enable-rounded: false;

// Inputs
$input-disabled-bg: $gray-200 !default;
$input-disabled-color: $gray-400 !default;


// Addons

Expand All @@ -49,11 +53,20 @@ $enable-rounded: false;
.multiselect {
--ms-bg: $gray-100;
color: $gray-600;

@if not $enable-rounded {
--ms-radius: 0px;
}
}

.multiselect.is-disabled {
--ms-bg-disabled: #{$input-disabled-bg};
--ms-color-disabled: #{$input-disabled-color};

color: var(--ms-color-disabled) !important;
border-color: #{$input-disabled-color} !important;
}

.multiselect-search {
--ms-placeholder-color: $gray-600;
}
Expand All @@ -63,6 +76,7 @@ $enable-rounded: false;
--ms-tag-color: #{$gray-600};
--ms-tag-bg-disabled: #{$gray-400};
--ms-tag-color-disabled: #{$gray-600};

@if not $enable-rounded {
--ms-tag-radius: 0px;
}
Expand All @@ -71,6 +85,7 @@ $enable-rounded: false;
.multiselect-dropdown {
--ms-dropdown-border-color: #{$gray-300};
--ms-dropdown-bg: #{$gray-100};

@if not $enable-rounded {
--ms-dropdown-radius: 0px;
}
Expand Down

0 comments on commit abd310f

Please sign in to comment.