Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Lhcfl committed Aug 20, 2024
1 parent 07b2a4b commit 0c7fc38
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import Component from "@glimmer/component";
import CategoryChooser from "select-kit/components/category-chooser";

export default class GroupListInput extends Component {
// CategoryChooser will try to modify the value of value,
// triggering a setting-on-hash error. So we have to do the dirty work.
get data() {
return {
value: this.args.field.value,
};
}

<template>
<@field.Custom id={{@field.id}} @_tmp={{this.valueChange}}>

Check failure on line 14 in assets/javascripts/discourse/components/param-input/category-id-input.gjs

View workflow job for this annotation

GitHub Actions / ci / linting

Capital argument names is not supported
<CategoryChooser
@value={{this.data.value}}
@onChange={{@field.set}}
name={{@info.identifier}}
/>
</@field.Custom>
</template>
}

This file was deleted.

6 changes: 3 additions & 3 deletions lib/discourse_data_explorer/parameter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module ::DiscourseDataExplorer
class Parameter
attr_accessor :identifier, :type, :default, :nullable

def initialize(identifier, type, default, nullable)
def initialize(identifier, type, default, nullable, check: true)
unless identifier
raise ValidationError.new("Parameter declaration error - identifier is missing")
end
Expand All @@ -25,7 +25,7 @@ def initialize(identifier, type, default, nullable)
@default = default
@nullable = nullable
begin
cast_to_ruby default if default.present?
cast_to_ruby default if default.present? && check
rescue ValidationError
raise ValidationError.new(
"Parameter declaration error - the default value is not a valid #{type}",
Expand Down Expand Up @@ -89,7 +89,7 @@ def self.create_from_sql(sql, opts = {})
type = type.strip

begin
ret_params << Parameter.new(ident, type, default, nullable)
ret_params << Parameter.new(ident, type, default, nullable, check: false)
rescue StandardError
raise if opts[:strict]
end
Expand Down

0 comments on commit 0c7fc38

Please sign in to comment.