Skip to content

Commit

Permalink
Update button build fix
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianlinkflink committed Dec 9, 2024
1 parent 15747ca commit feca136
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 236 deletions.
28 changes: 2 additions & 26 deletions src/components/Misc/Settings/SettingsBuildingCodes.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,38 +64,14 @@ import type { dropdownItem } from '@/components/Misc/DropdownMenuItem.vue'
import { buildingCodes } from '@/models/buildingCode'
import Dropdown from '@/components/Misc/Dropdown.vue'
import UpdateButton from '@/components/Misc/Settings/UpdateButton.vue'
import { storeToRefs } from 'pinia'
export default defineComponent({
name: 'SettingsBuildingCodes',
components: {
Dropdown,
// Local update button
UpdateButton: defineComponent({
name: 'UpdateButton',
props: {
label: {
type: String,
default: 'Update',
},
},
setup(props, { emit }) {
const handleClick = () => {
emit('click')
}
return { handleClick }
},
template: `
<button
type="button"
class="font-semibold text-green-600 hover:text-green-500"
@click="handleClick"
>
{{ label }}
</button>
`,
}),
UpdateButton
},
setup() {
const settingsStore = useSettingsStore()
Expand Down
30 changes: 3 additions & 27 deletions src/components/Misc/Settings/SettingsCalculationCategory.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
v-model="currentSetting.name"
class="w-full border p-2 rounded-md"
/>
<SaveButton label="Save" @click="saveSettings" />
<UpdateButton label="Save" @click="saveSettings" />
</dd>
</div>
</dl>
Expand All @@ -38,38 +38,14 @@ import type { CalculationSettingsLog } from '@/models/firebase'
import type { dropdownItem } from '@/components/Misc/Dropdown.vue'
import Dropdown from '@/components/Misc/Dropdown.vue'
import UpdateButton from './UpdateButton.vue'
// TODO: Add general settings here!
export default defineComponent({
name: 'SettingsImpactCategory',
components: {
Dropdown,
// Local update button
SaveButton: defineComponent({
name: 'SaveButton',
props: {
label: {
type: String,
default: 'Update',
},
},
setup(props, { emit }) {
const handleClick = () => {
emit('click')
}
return { handleClick }
},
template: `
<button
type="button"
class="font-semibold text-green-600 hover:text-green-500"
@click="handleClick"
>
{{ label }}
</button>
`,
}),
UpdateButton
},
setup() {
const settingsStore = useSettingsStore()
Expand Down
28 changes: 2 additions & 26 deletions src/components/Misc/Settings/SettingsFirebase.vue
Original file line number Diff line number Diff line change
Expand Up @@ -95,36 +95,12 @@
<script lang="ts">
import { defineComponent, ref } from 'vue'
import { useSettingsStore } from '@/stores/settings'
import UpdateButton from '@/components/Misc/Settings/UpdateButton.vue'
export default defineComponent({
name: 'SettingsFirebase',
components: {
// Local update button
UpdateButton: defineComponent({
name: 'UpdateButton',
props: {
label: {
type: String,
default: 'Update',
},
},
setup(props, { emit }) {
const handleClick = () => {
emit('click')
}
return { handleClick }
},
template: `
<button
type="button"
class="font-semibold text-green-600 hover:text-green-500"
@click="handleClick"
>
{{ label }}
</button>
`,
}),
UpdateButton
},
setup() {
const settingsStore = useSettingsStore()
Expand Down
28 changes: 2 additions & 26 deletions src/components/Misc/Settings/SettingsGeneral.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,37 +45,13 @@
<script lang="ts">
import { defineComponent, ref } from 'vue'
import { useSettingsStore } from '@/stores/settings'
import UpdateButton from '@/components/Misc/Settings/UpdateButton.vue'
// TODO: Add general settings here!
export default defineComponent({
name: 'SettingsGeneral',
components: {
// Local update button
UpdateButton: defineComponent({
name: 'UpdateButton',
props: {
label: {
type: String,
default: 'Update',
},
},
setup(props, { emit }) {
const handleClick = () => {
emit('click')
}
return { handleClick }
},
template: `
<button
type="button"
class="font-semibold text-green-600 hover:text-green-500"
@click="handleClick"
>
{{ label }}
</button>
`,
}),
UpdateButton
},
setup() {
const settingsStore = useSettingsStore()
Expand Down
28 changes: 2 additions & 26 deletions src/components/Misc/Settings/SettingsGithub.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,36 +23,12 @@
<script lang="ts">
import { defineComponent, ref } from 'vue'
import { useSettingsStore } from '@/stores/settings'
import UpdateButton from '@/components/Misc/Settings/UpdateButton.vue'
export default defineComponent({
name: 'SettingsGithub',
components: {
// Local update button
UpdateButton: defineComponent({
name: 'UpdateButton',
props: {
label: {
type: String,
default: 'Update',
},
},
setup(props, { emit }) {
const handleClick = () => {
emit('click')
}
return { handleClick }
},
template: `
<button
type="button"
class="font-semibold text-green-600 hover:text-green-500"
@click="handleClick"
>
{{ label }}
</button>
`,
}),
UpdateButton
},
setup() {
const settingsStore = useSettingsStore()
Expand Down
28 changes: 2 additions & 26 deletions src/components/Misc/Settings/SettingsImpactCategory.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,39 +29,15 @@ import type { ExtendedImpactCategoryKey } from '@/models/material'
import type { dropdownItem } from '@/components/Misc/Dropdown.vue'
import Dropdown from '@/components/Misc/Dropdown.vue'
import UpdateButton from '@/components/Misc/Settings/UpdateButton.vue'
import { storeToRefs } from 'pinia'
// TODO: Add general settings here!
export default defineComponent({
name: 'SettingsImpactCategory',
components: {
Dropdown,
// Local update button
UpdateButton: defineComponent({
name: 'UpdateButton',
props: {
label: {
type: String,
default: 'Update',
},
},
setup(props, { emit }) {
const handleClick = () => {
emit('click')
}
return { handleClick }
},
template: `
<button
type="button"
class="font-semibold text-green-600 hover:text-green-500"
@click="handleClick"
>
{{ label }}
</button>
`,
}),
UpdateButton,
},
setup() {
const settingsStore = useSettingsStore()
Expand Down
30 changes: 3 additions & 27 deletions src/components/Misc/Settings/SettingsLifecycleStages.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,39 +40,15 @@
<script lang="ts">
import { defineComponent, ref, reactive, watch } from 'vue'
import { useSettingsStore } from '@/stores/settings'
import UpdateButton from '@/components/Misc/Settings/UpdateButton.vue'
import { LifeCycleStages } from '@/models/material'
import { storeToRefs } from 'pinia';
import { storeToRefs } from 'pinia'
export default defineComponent({
name: 'SettingsLifecycleStages',
components: {
// Local update button
UpdateButton: defineComponent({
name: 'UpdateButton',
props: {
label: {
type: String,
default: 'Update',
},
},
setup(props, { emit }) {
const handleClick = () => {
emit('click')
}
return { handleClick }
},
template: `
<button
type="button"
class="font-semibold text-green-600 hover:text-green-500"
@click="handleClick"
>
{{ label }}
</button>
`,
}),
UpdateButton
},
setup() {
const settingsStore = useSettingsStore()
Expand Down
28 changes: 2 additions & 26 deletions src/components/Misc/Settings/SettingsMaterials.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,36 +36,12 @@
<script lang="ts">
import { defineComponent, ref } from 'vue'
import { useSettingsStore } from '@/stores/settings'
import UpdateButton from '@/components/Misc/Settings/UpdateButton.vue'
export default defineComponent({
name: 'SettingsMaterials',
components: {
// Local update button
UpdateButton: defineComponent({
name: 'UpdateButton',
props: {
label: {
type: String,
default: 'Update',
},
},
setup(props, { emit }) {
const handleClick = () => {
emit('click')
}
return { handleClick }
},
template: `
<button
type="button"
class="font-semibold text-green-600 hover:text-green-500"
@click="handleClick"
>
{{ label }}
</button>
`,
}),
UpdateButton
},
setup() {
const settingsStore = useSettingsStore()
Expand Down
28 changes: 2 additions & 26 deletions src/components/Misc/Settings/SettingsSpeckle.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,36 +47,12 @@
<script lang="ts">
import { defineComponent, ref } from 'vue'
import { useSettingsStore } from '@/stores/settings'
import UpdateButton from '@/components/Misc/Settings/UpdateButton.vue'
export default defineComponent({
name: 'SettingsSpeckle',
components: {
// Local update button
UpdateButton: defineComponent({
name: 'UpdateButton',
props: {
label: {
type: String,
default: 'Update',
},
},
setup(props, { emit }) {
const handleClick = () => {
emit('click')
}
return { handleClick }
},
template: `
<button
type="button"
class="font-semibold text-green-600 hover:text-green-500"
@click="handleClick"
>
{{ label }}
</button>
`,
}),
UpdateButton
},
setup() {
const settingsStore = useSettingsStore()
Expand Down
Loading

0 comments on commit feca136

Please sign in to comment.