Barista: [Expandable Section] 'expanded' ์†์„ฑ์— ๋Œ€ํ•ด ๋ถ€์šธ ๊ฐ•์ œ ๋ณ€ํ™˜์ด ์ œ๋Œ€๋กœ ์ž‘๋™ํ•˜์ง€ ์•Š์Œ

์— ๋งŒ๋“  2020๋…„ 08์›” 10์ผ  ยท  13์ฝ”๋ฉ˜ํŠธ  ยท  ์ถœ์ฒ˜: dynatrace-oss/barista

๋ฒ„๊ทธ ์‹ ๊ณ 

์•ˆ๋…• ํŒ€! expanded ์†์„ฑ์ด ๊ฐ•์ œ๋กœ ์ž‘๋™ํ•˜์ง€ ์•Š๋Š” ๊ฒƒ ๊ฐ™์ง€๋งŒ [expanded]="true" ๋กœ ์„ค์ •ํ•˜๋ฉด ์˜ฌ๋ฐ”๋ฅด๊ฒŒ ์ž‘๋™ํ•ฉ๋‹ˆ๋‹ค. ์ด๊ฒƒ์€ ์˜ค๋žซ๋™์•ˆ ์ž˜ ์ž‘๋™ํ–ˆ์ง€๋งŒ ์ตœ๊ทผ์— ์ž‘๋™์„ ๋ฉˆ์ท„๊ณ  ๋‚ด ํ”„๋กœ๋•์…˜ ํŽ˜์ด์ง€ ์ค‘ ํ•˜๋‚˜๊ฐ€ ์˜ฌ๋ฐ”๋ฅด๊ฒŒ ๋ Œ๋”๋ง๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. https://ci360.dynatrace.com/account/environment/cloud/managed/298

์˜ˆ์ƒ๋˜๋Š” ๋™์ž‘

๋‹ค์Œ์ด ํ‰์†Œ์™€ ๊ฐ™์ด ์ž‘๋™ํ•  ๊ฒƒ์œผ๋กœ ์˜ˆ์ƒํ•ฉ๋‹ˆ๋‹ค.
<dt-expandable-section expanded>

ํ˜„์žฌ ํ–‰๋™

TypeError: Cannot set property 'expanded' of undefined
    at DtExpandableSection.set expanded [as expanded] (dynatrace-barista-components-expandable-section.js:79)
    at Object.ngOnChangesSetInput [as setInput] (core.js:26879)
    at setInputsFromAttrs (core.js:13039)
    at instantiateAllDirectives (core.js:12752)
    at createDirectivesInstances (core.js:11989)
    at Module.ษตษตelementStart (core.js:21043)
    at AppComponent_Template (app.component.html:1)
    at executeTemplate (core.js:11949)
    at renderView (core.js:11735)
    at renderComponent (core.js:13244)

๊ฐ€๋Šฅํ•œ ํ•ด๊ฒฐ์ฑ…

<dt-expandable-section [expanded]="true">

๋ฒˆ์‹ ๋‹จ๊ณ„

๋ณต์ œ: https://github.com/areknow/a-expandable-section-demo ๋ฐ ์‹คํ–‰

์‚ฌ์šฉ๋œ ๋ฒ„์ „:

  • @dynatrace/barista-components : 7.6.0

๋…ธ๊ณ ์— ์ง„์‹ฌ์œผ๋กœ ๊ฐ์‚ฌ๋“œ๋ฆฝ๋‹ˆ๋‹ค!

bug has-pr

๊ฐ€์žฅ ์œ ์šฉํ•œ ๋Œ“๊ธ€

@lukasholzer ๊ท€ํ•˜์˜ ๊ฒŒ์‹œ๋ฌผ์— ๋ช…์‹œ๋œ ๋ช…๋ น์— ๋”ฐ๋ผ ๋ฌธ์ œ ์—†์ด ํ”„๋กœ์ ํŠธ๋ฅผ ์‹คํ–‰ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค

๋ชจ๋“  13 ๋Œ“๊ธ€

@areknow ์‹ ๊ณ ํ•ด ์ฃผ์…”์„œ ๋Œ€๋‹จํžˆ ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค. ํ•˜์ง€๋งŒ stackblitz์—์„œ๋Š” ์ด๋ฅผ ์žฌํ˜„ํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค.
https://stackblitz.com/edit/github-yp9pwy?file=src/expandable -section/expandable-section-default-example/expandable-section-default-example.html

๋˜ํ•œ ์ฝ”๋“œ๋ฅผ ๋ณด๋ฉด coerceBooleanProperty ๊ฐ€ ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค. ๐Ÿค”

๊ตฌ์„ฑ ์š”์†Œ๋ฅผ ์˜ฌ๋ฐ”๋ฅด๊ฒŒ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๊นŒ?

https://github.com/dynatrace-oss/barista/blob/master/libs/barista-components/expandable-section/src/expandable-section.ts#L76

  @Input()
  get expanded(): boolean {
    return this._panel.expanded;
  }
  set expanded(value: boolean) {
    this._panel.expanded = coerceBooleanProperty(value);
    this._changeDetectorRef.markForCheck();
  }

์•ˆ๋…•ํ•˜์„ธ์š” @lukasholzer์ž…๋‹ˆ๋‹ค! ์ €๋„ stackblitz๋กœ๋Š” ์žฌํ˜„์ด ์•ˆ๋˜์„œ ์ตœ์†Œํ•œ์˜ repo๋ฅผ ๋งŒ๋“ค์—ˆ์Šต๋‹ˆ๋‹ค. ์ด๋Š” ๋ทฐ ๋ Œ๋”๋Ÿฌ์—์„œ ๋ฐœ์ƒํ•˜์ง€ ์•Š๋Š” ์•„์ด๋น„ ๋ฌธ์ œ๋ฅผ ๋‚˜ํƒ€๋‚ผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋ฆฌํฌ์ง€ํ† ๋ฆฌ๋ฅผ ๋ณต์ œํ•˜๊ณ  ์ฝ˜์†” ์˜ค๋ฅ˜๋ฅผ ๋ณผ ์ˆ˜ ์žˆ์—ˆ์Šต๋‹ˆ๊นŒ?

์•ˆ๋…•ํ•˜์„ธ์š” @lukasholzer ,
์ง€์‹œ๋ฌธ์— ๋Œ€ํ•œ ์•ฝ์‹ ํ‘œ๊ธฐ๋ฒ•์„ ์‚ฌ์šฉํ•˜์—ฌ ๋ฌธ์ œ๋ฅผ ์žฌํ˜„ํ•  ์ˆ˜๋„ ์žˆ์Šต๋‹ˆ๋‹ค.

@areknow ์•ฑ์—์„œ ํ™•์žฅ ๊ฐ€๋Šฅํ•œ ์žฌ๋ฃŒ๋ฅผ ์‚ฌ์šฉํ•˜๊ณ  ๋™์ž‘์„ ๋น„๊ตํ•ด ๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๊นŒ? ์•„์ด๋น„ ํ˜ธํ™˜์„ฑ์— ์ปดํŒŒ์ผ ๋ฌธ์ œ๊ฐ€ ์žˆ๋Š”์ง€ ๊ถ๊ธˆํ•ฉ๋‹ˆ๋‹ค. ์ด๊ฒƒ์€ ์ตœ์†Œํ•œ์˜ ์„ค์ •์ด ๋  ๊ฒƒ์ž…๋‹ˆ๋‹ค https://stackblitz.com/edit/angular-rubmxc?file=src/app/expansion -steps-example.html

@areknow ๊ท€ํ•˜์˜ repo๋ฅผ ๋ณต์ œํ•˜์—ฌ npm ์„ค์น˜๋ฅผ ์ˆ˜ํ–‰ํ•˜๊ณ  ์ด์ œ ng ์„œ๋ธŒ๋ฅผ ์ˆ˜ํ–‰ํ–ˆ์Šต๋‹ˆ๋‹ค.

image

๊ทธ ์™ธ์— ์—…๋ฐ์ดํŠธํ•˜์‹ญ์‹œ์˜ค highcharts ๋ฒ„์ „๊ณผ ์ œ๊ฑฐ @types/highcharts

@ffriedl89 MatExpansionModule ๊ฐ€์ ธ ์˜ค๊ณ  ๊ตฌ์„ฑ ์š”์†Œ ๋งˆํฌ์—…์„ ํ”„๋กœ์ ํŠธ์— ์ถ”๊ฐ€
Screen Shot 2020-08-12 at 9 43 20 AM

@lukasholzer @types/highcharts ์ œ๊ฑฐํ•˜๊ณ  highcharts ๋ฅผ ์ตœ์‹  ๋ฒ„์ „์œผ๋กœ ์—…๋ฐ์ดํŠธํ–ˆ์Šต๋‹ˆ๋‹ค. ์—ฌ์ „ํžˆ ๋™์ผํ•œ ๋ฌธ์ œ:

core.js:6185 ERROR TypeError: Cannot set property 'expanded' of undefined
    at DtExpandableSection.set expanded [as expanded] (dynatrace-barista-components-expandable-section.js:79)
    at Object.ngOnChangesSetInput [as setInput] (core.js:26879)
    at setInputsFromAttrs (core.js:13039)
    at instantiateAllDirectives (core.js:12752)
    at createDirectivesInstances (core.js:11989)
    at Module.ษตษตelementStart (core.js:21043)
    at AppComponent_Template (app.component.html:1)
    at executeTemplate (core.js:11949)
    at renderView (core.js:11735)
    at renderComponent (core.js:13244)

@areknow ์•ฑ์„ ์ œ๊ณตํ•˜๋ ค๊ณ  ํ•  ๋•Œ ์œ„์˜ ์˜ค๋ฅ˜๊ฐ€ ํ‘œ์‹œ๋˜๋ฏ€๋กœ ์žฌํ˜„ํ•  ์ˆ˜ ์—†๋Š” ๋ ˆ์ด๋ธ”์„

๊ท€ํ•˜์˜ ๋ฆฌํฌ์ง€ํ† ๋ฆฌ๊ฐ€ ๋‚˜๋ฅผ ์œ„ํ•ด ์‹คํ–‰๋˜๋„๋ก ํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค.

๋‚ด๊ฐ€ ๋งŒ๋“  ๋‹จ๊ณ„:

  1. git clone ...
  2. npm install
  3. ng serve

@lukasholzer ์„ธ ๋Œ€์˜ ๊ฐœ๋ณ„ ์ปดํ“จํ„ฐ์—์„œ ์ €์žฅ์†Œ๋ฅผ ์‹คํ–‰ํ–ˆ์Šต๋‹ˆ๋‹ค. ๋ฌธ์ œ๊ฐ€ ๋ฌด์—‡์ธ์ง€ ์ž˜ ๋ชจ๋ฅด๊ฒ ์ง€๋งŒ ๋งค์šฐ ๊ธฐ๋ณธ์ ์ธ ํ”„๋กœ์ ํŠธ์ž…๋‹ˆ๋‹ค ๐Ÿค”
@josecolella @toddbaert ๋„ repo๋ฅผ ์‹คํ–‰ํ–ˆ์œผ๋ฉฐ ๋™์ผํ•œ ๋ฌธ์ œ๋ฅผ ๋ณด์•˜์Šต๋‹ˆ๋‹ค.

~/Desktop/test
โฏ git clone https://github.com/areknow/a-expandable-section-demo.git .
Cloning into '.'...
remote: Enumerating objects: 47, done.
remote: Counting objects: 100% (47/47), done.
remote: Compressing objects: 100% (37/37), done.
remote: Total 47 (delta 10), reused 45 (delta 8), pack-reused 0
Unpacking objects: 100% (47/47), done.

~/Desktop/test master
โฏ ls
README.md          angular.json       browserslist       e2e                karma.conf.js      package-lock.json  package.json       src                tsconfig.app.json  tsconfig.json      tsconfig.spec.json tslint.json

~/Desktop/test master
โฏ npm i

> [email protected] install /Users/arnaud.crowther/Desktop/test/node_modules/watchpack-chokidar2/node_modules/fsevents
> node install.js

No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.

No receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'.

No receipt for 'com.apple.pkg.DeveloperToolsCLI' found at '/'.

gyp: No Xcode or CLT version detected!
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/Users/arnaud.crowther/.nvm/versions/node/v12.16.1/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:311:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Darwin 19.5.0
gyp ERR! command "/Users/arnaud.crowther/.nvm/versions/node/v12.16.1/bin/node" "/Users/arnaud.crowther/.nvm/versions/node/v12.16.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/arnaud.crowther/Desktop/test/node_modules/watchpack-chokidar2/node_modules/fsevents
gyp ERR! node -v v12.16.1
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok

> [email protected] install /Users/arnaud.crowther/Desktop/test/node_modules/webpack-dev-server/node_modules/fsevents
> node install.js

No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.

No receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'.

No receipt for 'com.apple.pkg.DeveloperToolsCLI' found at '/'.

gyp: No Xcode or CLT version detected!
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/Users/arnaud.crowther/.nvm/versions/node/v12.16.1/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:311:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Darwin 19.5.0
gyp ERR! command "/Users/arnaud.crowther/.nvm/versions/node/v12.16.1/bin/node" "/Users/arnaud.crowther/.nvm/versions/node/v12.16.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/arnaud.crowther/Desktop/test/node_modules/webpack-dev-server/node_modules/fsevents
gyp ERR! node -v v12.16.1
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok

> [email protected] postinstall /Users/arnaud.crowther/Desktop/test/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"


> @angular/[email protected] postinstall /Users/arnaud.crowther/Desktop/test/node_modules/@angular/cli
> node ./bin/postinstall/script.js

added 1391 packages from 1132 contributors and audited 1393 packages in 20.393s

41 packages are looking for funding
  run `npm fund` for details

found 5 vulnerabilities (3 low, 2 high)
  run `npm audit fix` to fix them, or `npm audit` for details

~/Desktop/test master 22s
โฏ ng serve
0% compiling
Compiling @angular/core : es2015 as esm2015

Compiling @angular/common : es2015 as esm2015

Compiling @angular/platform-browser : es2015 as esm2015

Compiling @angular/platform-browser-dynamic : es2015 as esm2015

Compiling @angular/common/http : es2015 as esm2015

Compiling @angular/cdk/platform : es2015 as esm2015

Compiling @angular/cdk/bidi : es2015 as esm2015

Compiling @angular/cdk/collections : es2015 as esm2015

Compiling @angular/cdk/scrolling : es2015 as esm2015

Compiling @angular/cdk/keycodes : es2015 as esm2015

Compiling @angular/cdk/observers : es2015 as esm2015

Compiling @angular/cdk/a11y : es2015 as esm2015

Compiling @angular/cdk/tree : es2015 as esm2015

Compiling @angular/animations : es2015 as esm2015

Compiling @angular/forms : es2015 as esm2015

Compiling @angular/cdk/portal : es2015 as esm2015

Compiling @angular/cdk/overlay : es2015 as esm2015

Compiling @dynatrace/barista-components/core : es2015 as esm2015

Compiling @dynatrace/barista-components/icon : es2015 as esm2015

Compiling @angular/animations/browser : es2015 as esm2015

Compiling @angular/platform-browser/animations : es2015 as esm2015

Compiling @angular/cdk/table : es2015 as esm2015

Compiling @angular/cdk/drag-drop : es2015 as esm2015

Compiling @dynatrace/barista-components/button : es2015 as esm2015

Compiling @dynatrace/barista-components/indicator : es2015 as esm2015

Compiling @dynatrace/barista-components/empty-state : es2015 as esm2015

Compiling @dynatrace/barista-components/form-field : es2015 as esm2015

Compiling @dynatrace/barista-components/formatters : es2015 as esm2015

Compiling @angular/cdk/text-field : es2015 as esm2015

Compiling @dynatrace/barista-components/input : es2015 as esm2015

Compiling @dynatrace/barista-components/checkbox : es2015 as esm2015

Compiling @dynatrace/barista-components/pagination : es2015 as esm2015

Compiling @dynatrace/barista-components/table : es2015 as esm2015

Compiling @dynatrace/barista-components/expandable-panel : es2015 as esm2015

Compiling @dynatrace/barista-components/expandable-section : es2015 as esm2015

Compiling @angular/cdk/accordion : es2015 as esm2015

Compiling @angular/material/expansion : es2015 as esm2015

chunk {main} main.js, main.js.map (main) 14 kB [initial] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 150 kB [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 6.15 kB [entry] [rendered]
chunk {styles} styles.js, styles.js.map (styles) 108 kB [initial] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 4.99 MB [initial] [rendered]
Date: 2020-08-12T15:43:23.068Z - Hash: 1ecde4c6e7201f777336 - Time: 57275ms
** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
: Compiled successfully.

Date: 2020-08-12T15:43:24.031Z - Hash: 1ecde4c6e7201f777336
5 unchanged chunks

Time: 537ms
: Compiled successfully.

@lukasholzer ๊ท€ํ•˜์˜ ๊ฒŒ์‹œ๋ฌผ์— ๋ช…์‹œ๋œ ๋ช…๋ น์— ๋”ฐ๋ผ ๋ฌธ์ œ ์—†์ด ํ”„๋กœ์ ํŠธ๋ฅผ ์‹คํ–‰ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค

@lukasholzer ๋‚˜ ์—ญ์‹œ ์„ฑ๊ณต์ ์ธ ์ปดํŒŒ์ผ ๋ฉ”์‹œ์ง€๋กœ ๋ฌธ์ œ๋ฅผ ์žฌํ˜„ํ•  ์ˆ˜ ์žˆ์—ˆ๋‹ค.

  1. ๋ณต์ œ๋œ ์ž์‹ ์ €์žฅ์†Œ
  2. npm ์„ค์น˜
  3. ์„œ๋ธŒ

๊ฒฐ๊ณผ:
Screen Shot 2020-08-12 at 12 03 13 PM
Screen Shot 2020-08-12 at 12 03 07 PM
Screen Shot 2020-08-12 at 12 02 47 PM
Screen Shot 2020-08-12 at 11 57 00 AM

@areknow Hey @thomaspink ์™€ ๋‚˜ ์ž์‹ ์ด ํ•ด๊ฒฐํ•  ๋ฌธ์ œ๋ฅผ ์ฐพ์•˜์Šต๋‹ˆ๋‹ค! :) viewChild ์ดํ›„์˜ Lifecycle์ธ setter ์— ์†์„ฑ์„ ์„ค์ •ํ•˜๋ ค๊ณ  ํ•  ๋•Œ VE์—์„œ๋„ ์ด๊ฒƒ์ด ์–ด๋–ป๊ฒŒ ์ž‘๋™ํ•˜๋Š”์ง€ ๊ถ๊ธˆํ•ฉ๋‹ˆ๋‹ค. ๐Ÿค”

์ด๊ฒƒ์ด ๊ธด๊ธ‰ ์ˆ˜์ •์ž…๋‹ˆ๊นŒ, ์•„๋‹ˆ๋ฉด 8.0.0์œผ๋กœ ๋ฐ›์•„๋„ ๊ดœ์ฐฎ์Šต๋‹ˆ๊นŒ? ๊ทธ๋ ‡์ง€ ์•Š์œผ๋ฉด ์ด ๋ฌธ์ œ์— ๋Œ€ํ•ด ๋ฐฑํฌํŠธ๋ฅผ ์ˆ˜ํ–‰ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

PR #1491์— ์˜ํ•ด ์ˆ˜์ •๋จ

@lukasholzer ์ข‹์€ ์†Œ์‹์ž…๋‹ˆ๋‹ค! ๋‚ด ์•ฑ์— ๋Œ€ํ•œ ํ•ซํ”ฝ์Šค๋ฅผ ์ˆ˜ํ–‰ํ–ˆ์œผ๋ฏ€๋กœ 8.0.0๊นŒ์ง€ ๊ธฐ๋‹ค๋ฆด ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๊ฐ์‚ฌ ํ•ด์š”!

์ด ํŽ˜์ด์ง€๊ฐ€ ๋„์›€์ด ๋˜์—ˆ๋‚˜์š”?
0 / 5 - 0 ๋“ฑ๊ธ‰