Skip to content

Commit

Permalink
Feature: Add/Edit conversation labels (chatwoot#488)
Browse files Browse the repository at this point in the history
Co-authored-by: Pranav Raj S <[email protected]>
  • Loading branch information
nithindavid and pranavrajs authored Feb 16, 2020
1 parent 77473dc commit e61ba95
Show file tree
Hide file tree
Showing 31 changed files with 857 additions and 317 deletions.
274 changes: 274 additions & 0 deletions .scss-lint.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,281 @@
# Default application configuration that all configurations inherit from.

scss_files: '**/*.scss'
plugin_directories: ['.scss-linters']

# List of gem names to load custom linters from (make sure they are already
# installed)
plugin_gems: []

# Default severity of all linters.
severity: warning

linters:
BangFormat:
enabled: true
space_before_bang: true
space_after_bang: false

BemDepth:
enabled: false
max_elements: 1

BorderZero:
enabled: true
convention: zero # or `none`

ChainedClasses:
enabled: false

ColorKeyword:
enabled: true

ColorVariable:
enabled: true

Comment:
enabled: true
style: silent

DebugStatement:
enabled: true

DeclarationOrder:
enabled: true

DisableLinterReason:
enabled: false

DuplicateProperty:
enabled: true

ElsePlacement:
enabled: true
style: same_line # or 'new_line'

EmptyLineBetweenBlocks:
enabled: true
ignore_single_line_blocks: true

EmptyRule:
enabled: true

ExtendDirective:
enabled: false

FinalNewline:
enabled: true
present: true

HexLength:
enabled: true
style: short # or 'long'

HexNotation:
enabled: true
style: lowercase # or 'uppercase'

HexValidation:
enabled: true

IdSelector:
enabled: true

ImportantRule:
enabled: true

ImportPath:
enabled: true
leading_underscore: false
filename_extension: false

Indentation:
enabled: true
allow_non_nested_indentation: false
character: space # or 'tab'
width: 2

LeadingZero:
enabled: false

MergeableSelector:
enabled: true
force_nesting: true

NameFormat:
enabled: true
allow_leading_underscore: true
convention: hyphenated_lowercase # or 'camel_case', or 'snake_case', or a regex pattern

NestingDepth:
enabled: true
max_depth: 6
ignore_parent_selectors: false

PlaceholderInExtend:
enabled: true

PrivateNamingConvention:
enabled: false
prefix: _

PropertyCount:
enabled: false
include_nested: false
max_properties: 10

PropertySortOrder:
enabled: true
ignore_unspecified: false
min_properties: 2
separate_groups: false

PropertySpelling:
enabled: true
extra_properties: []
disabled_properties: []

PropertyUnits:
enabled: true
global: [
'ch',
'em',
'ex',
'rem', # Font-relative lengths
'cm',
'in',
'mm',
'pc',
'pt',
'px',
'q', # Absolute lengths
'vh',
'vw',
'vmin',
'vmax', # Viewport-percentage lengths
'fr', # Grid fractional lengths
'deg',
'grad',
'rad',
'turn', # Angle
'ms',
's', # Duration
'Hz',
'kHz', # Frequency
'dpi',
'dpcm',
'dppx', # Resolution
'%',
] # Other
properties: {}

PseudoElement:
enabled: true

QualifyingElement:
enabled: true
allow_element_with_attribute: false
allow_element_with_class: false
allow_element_with_id: false

SelectorDepth:
enabled: true
max_depth: 5

SelectorFormat:
enabled: false

Shorthand:
enabled: true
allowed_shorthands: [1, 2, 3, 4]

SingleLinePerProperty:
enabled: true
allow_single_line_rule_sets: true

SingleLinePerSelector:
enabled: true

SpaceAfterComma:
enabled: true
style: one_space # or 'no_space', or 'at_least_one_space'

SpaceAfterComment:
enabled: false
style: one_space # or 'no_space', or 'at_least_one_space'
allow_empty_comments: true

SpaceAfterPropertyColon:
enabled: true
style: one_space # or 'no_space', or 'at_least_one_space', or 'aligned'

SpaceAfterPropertyName:
enabled: true

SpaceAfterVariableColon:
enabled: false
style: one_space # or 'no_space', 'at_least_one_space' or 'one_space_or_newline'

SpaceAfterVariableName:
enabled: true

SpaceAroundOperator:
enabled: true
style: one_space # or 'at_least_one_space', or 'no_space'

SpaceBeforeBrace:
enabled: true
style: space # or 'new_line'
allow_single_line_padding: false

SpaceBetweenParens:
enabled: true
spaces: 0

StringQuotes:
enabled: true
style: single_quotes # or double_quotes

TrailingSemicolon:
enabled: true

TrailingWhitespace:
enabled: true

TrailingZero:
enabled: false

TransitionAll:
enabled: false

UnnecessaryMantissa:
enabled: true

UnnecessaryParentReference:
enabled: true

UrlFormat:
enabled: true

UrlQuotes:
enabled: true

VariableForProperty:
enabled: false
properties: []

VendorPrefix:
enabled: true
identifier_list: base
additional_identifiers: []
excluded_identifiers: []

ZeroUnit:
enabled: true

Compass::*:
enabled: false

exclude:
- 'app/javascript/widget/assets/scss/_reset.scss'
- 'app/javascript/widget/assets/scss/sdk.css'
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ group :development do
end

group :development, :test do
# locking until https://github.com/codeclimate/test-reporter/issues/418 is resolved
gem 'action-cable-testing'
gem 'bundle-audit', require: false
gem 'byebug', platform: :mri
Expand All @@ -100,9 +101,9 @@ group :development, :test do
gem 'rubocop-performance', require: false
gem 'rubocop-rails', require: false
gem 'rubocop-rspec', require: false
gem 'scss_lint', require: false
gem 'seed_dump'
gem 'shoulda-matchers'
# locking until https://github.com/codeclimate/test-reporter/issues/418 is resolved
gem 'simplecov', '0.17.1', require: false
gem 'spring'
gem 'spring-watcher-listen'
Expand Down
8 changes: 8 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -393,8 +393,15 @@ GEM
rubocop-rspec (1.37.1)
rubocop (>= 0.68.1)
ruby-progressbar (1.10.1)
sass (3.7.4)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
scout_apm (2.6.6)
parser
scss_lint (0.59.0)
sass (~> 3.5, >= 3.5.5)
seed_dump (3.3.1)
activerecord (>= 4)
activesupport (>= 4)
Expand Down Expand Up @@ -539,6 +546,7 @@ DEPENDENCIES
rubocop-rails
rubocop-rspec
scout_apm
scss_lint
seed_dump
sentry-raven
shoulda-matchers
Expand Down
4 changes: 2 additions & 2 deletions app/javascript/dashboard/api/conversations.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ class ConversationApi extends ApiClient {
return axios.get(`${this.url}/${conversationID}/labels`);
}

createLabels(conversationID) {
return axios.get(`${this.url}/${conversationID}/labels`);
updateLabels(conversationID, labels) {
return axios.post(`${this.url}/${conversationID}/labels`, { labels });
}
}

Expand Down
2 changes: 1 addition & 1 deletion app/javascript/dashboard/api/specs/conversations.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ describe('#ConversationApi', () => {
expect(conversations).toHaveProperty('update');
expect(conversations).toHaveProperty('delete');
expect(conversations).toHaveProperty('getLabels');
expect(conversations).toHaveProperty('createLabels');
expect(conversations).toHaveProperty('updateLabels');
});
});
Loading

0 comments on commit e61ba95

Please sign in to comment.