Skip to content

Commit

Permalink
[5.x] Hide "Localizable" button on non-localizable blueprints (statam…
Browse files Browse the repository at this point in the history
  • Loading branch information
duncanmcclean authored Nov 11, 2024
1 parent f13a997 commit d479f05
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 1 deletion.
4 changes: 3 additions & 1 deletion resources/js/components/blueprints/Builder.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
:single-tab="!useTabs"
:initial-tabs="tabs"
:errors="errors.tabs"
:can-define-localizable="canDefineLocalizable"
@updated="tabsUpdated"
/>

Expand All @@ -53,10 +54,11 @@
<script>
import SuggestsConditionalFields from './SuggestsConditionalFields';
import Tabs from './Tabs.vue';
import CanDefineLocalizable from "../fields/CanDefineLocalizable";
export default {
mixins: [SuggestsConditionalFields],
mixins: [SuggestsConditionalFields, CanDefineLocalizable],
components: {
Tabs,
Expand Down
4 changes: 4 additions & 0 deletions resources/js/components/blueprints/TabContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,20 @@
:edit-section-text="editSectionText"
:show-section-handle-field="showSectionHandleField"
:show-section-hide-field="showSectionHideField"
:can-define-localizable="canDefineLocalizable"
@updated="sectionsUpdated($event)"
/>
</div>
</template>

<script>
import Sections from './Sections.vue';
import CanDefineLocalizable from "../fields/CanDefineLocalizable";
export default {
mixins: [CanDefineLocalizable],
components: {
Sections,
},
Expand Down
4 changes: 4 additions & 0 deletions resources/js/components/blueprints/Tabs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
:new-section-text="newSectionText"
:edit-section-text="editSectionText"
:add-section-text="addSectionText"
:can-define-localizable="canDefineLocalizable"
@updated="updateTab(tab._id, $event)"
/>
</div>
Expand All @@ -47,9 +48,12 @@ import {Sortable, Plugins} from '@shopify/draggable';
import uniqid from 'uniqid';
import Tab from './Tab.vue';
import TabContent from './TabContent.vue';
import CanDefineLocalizable from "../fields/CanDefineLocalizable";
export default {
mixins: [CanDefineLocalizable],
components: {
Tab,
TabContent,
Expand Down
1 change: 1 addition & 0 deletions resources/views/forms/blueprints/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
:initial-blueprint="{{ json_encode($blueprintVueObject) }}"
:use-tabs="false"
:is-form-blueprint="true"
:can-define-localizable="false"
></blueprint-builder>

@include('statamic::partials.docs-callout', [
Expand Down
1 change: 1 addition & 0 deletions resources/views/usergroups/blueprints/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<blueprint-builder
action="{{ cp_route('user-groups.blueprint.update') }}"
:initial-blueprint="{{ json_encode($blueprintVueObject) }}"
:can-define-localizable="false"
></blueprint-builder>

@include('statamic::partials.docs-callout', [
Expand Down
1 change: 1 addition & 0 deletions resources/views/users/blueprints/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<blueprint-builder
action="{{ cp_route('users.blueprint.update') }}"
:initial-blueprint="{{ json_encode($blueprintVueObject) }}"
:can-define-localizable="false"
></blueprint-builder>

@include('statamic::partials.docs-callout', [
Expand Down

0 comments on commit d479f05

Please sign in to comment.