Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Admin settings config #282

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

kamtschatka
Copy link
Collaborator

just showing the wireframe

kamtschatka added a commit to kamtschatka/hoarder-app that referenced this pull request Jul 7, 2024
created the basic structure
@kamtschatka kamtschatka force-pushed the admin-settings-config branch from 89aa1ae to 4cdc455 Compare July 7, 2024 20:16
kamtschatka added a commit to kamtschatka/hoarder-app that referenced this pull request Jul 7, 2024
created the basic structure
@kamtschatka kamtschatka force-pushed the admin-settings-config branch from 4cdc455 to 83098e2 Compare July 7, 2024 20:26
packages/db/config/configUtils.ts Outdated Show resolved Hide resolved
packages/db/config/configUtils.ts Outdated Show resolved Hide resolved
packages/db/config/configUtils.ts Outdated Show resolved Hide resolved
packages/db/config/configUtils.ts Outdated Show resolved Hide resolved
packages/db/config/config.ts Outdated Show resolved Hide resolved
packages/db/config/configValue.ts Outdated Show resolved Hide resolved
validator: ConfigValidatorMap[T];
}

export class ConfigValue<T extends ConfigType> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not ConfigValue extends ConfigProperties<T extends ConfigType> to remove the duplicate properties?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure I understand. ConfigProperties is an interface, so i can't use extends if I want a class from it.
I can use implements, but that is not shorter:

export class ConfigValue<T extends ConfigType> implements ConfigProperties<T> {
  key: string;
  name: string;
  type: T;
  defaultValue: ConfigTypeMap[T];
  validator: ConfigValidatorMap[T];
  value: ConfigTypeMap[T] | undefined;

  constructor(props: ConfigProperties<T>) {
    this.key = props.key;
    this.name = props.name;
    this.type = props.type;
    this.defaultValue = props.defaultValue;
    this.validator = props.validator;
  }

  setValue(value: ConfigTypeMap[T]): void {
    this.value = value;
  }
}

packages/db/config/configUtils.ts Outdated Show resolved Hide resolved
kamtschatka added a commit to kamtschatka/hoarder-app that referenced this pull request Jul 8, 2024
Incorporated PR feedback
kamtschatka added a commit to kamtschatka/hoarder-app that referenced this pull request Jul 12, 2024
Added dynamic generation of the UI
Added the possibility to validate the schema
Added database functions to load/store the config
kamtschatka added a commit to kamtschatka/hoarder-app that referenced this pull request Jul 12, 2024
fixed the issue with the flickering of the UI and properly resetting the state of the config after saving to get rid of any previous changes in hidden elements
kamtschatka added a commit to kamtschatka/hoarder-app that referenced this pull request Oct 1, 2024
created the basic structure
kamtschatka added a commit to kamtschatka/hoarder-app that referenced this pull request Oct 1, 2024
Incorporated PR feedback
kamtschatka added a commit to kamtschatka/hoarder-app that referenced this pull request Oct 1, 2024
Added dynamic generation of the UI
Added the possibility to validate the schema
Added database functions to load/store the config
kamtschatka added a commit to kamtschatka/hoarder-app that referenced this pull request Oct 1, 2024
fixed the issue with the flickering of the UI and properly resetting the state of the config after saving to get rid of any previous changes in hidden elements
@kamtschatka kamtschatka force-pushed the admin-settings-config branch from d368e30 to cf594c6 Compare October 1, 2024 17:31
created the basic structure
Incorporated PR feedback
Added dynamic generation of the UI
Added the possibility to validate the schema
Added database functions to load/store the config
fixed the issue with the flickering of the UI and properly resetting the state of the config after saving to get rid of any previous changes in hidden elements
@kamtschatka kamtschatka force-pushed the admin-settings-config branch from cf594c6 to bd23681 Compare October 11, 2024 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants