Skip to content

Commit

Permalink
default new samba share to read only = false
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuaboud committed Jun 14, 2024
1 parent 9e1a1d8 commit b37befb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion file-sharing/src/tabs/samba/data-types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { type KeyValueData } from "@45drives/houston-common-lib";
import { readonly } from 'vue';

export type SambaGlobalConfig = {
logLevel: number;
Expand All @@ -23,7 +24,7 @@ export type SambaConfig = {
shares: SambaShareConfig[];
};

export const defaultSambaShareConfig = (name: string = "") => ({
export const defaultSambaShareConfig = (name: string = ""): SambaShareConfig => ({
name,
description: "",
path: "",
Expand All @@ -34,6 +35,11 @@ export const defaultSambaShareConfig = (name: string = "") => ({
advancedOptions: {},
});

export const newSambaShareConfig = (): SambaShareConfig => ({
...defaultSambaShareConfig(""),
readOnly: false,
})

export const defaultSambaGlobalConfig = () => ({
serverString: "Samba %v",
logLevel: 0,
Expand Down
4 changes: 2 additions & 2 deletions file-sharing/src/tabs/samba/ui/ShareEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
validationError,
ValidationResultView,
} from "@45drives/houston-common-ui";
import { type SambaShareConfig, defaultSambaShareConfig } from "@/tabs/samba/data-types";
import { type SambaShareConfig, newSambaShareConfig } from "@/tabs/samba/data-types";
import { KeyValueSyntax } from "@45drives/houston-common-lib";
import { BooleanKeyValueSuite } from "@/tabs/samba/ui/BooleanKeyValueSuite"; // TODO: move to common-ui
import ShareDirectoryInputAndOptions from "@/common/ui/ShareDirectoryInputAndOptions.vue";
Expand Down Expand Up @@ -44,7 +44,7 @@ const emit = defineEmits<{
const globalProcessingState = useGlobalProcessingState();
const shareConf = computed<SambaShareConfig>(() =>
props.newShare ? defaultSambaShareConfig() : props.share
props.newShare ? newSambaShareConfig() : props.share
);
const { tempObject: tempShareConfig, modified, resetChanges } = useTempObjectStaging(shareConf);
Expand Down

0 comments on commit b37befb

Please sign in to comment.