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

Vue 3x - Update for titleId and maskId prop #455

Merged
merged 6 commits into from
Nov 1, 2023

Conversation

jasonlundien
Copy link
Member

@jasonlundien jasonlundien commented Apr 25, 2023

This PR addresses this bug report: title property breaks snapshots#181

Currently we cannot add and set a title property without a random generated string being attached to the aria-labelledby and the title id.

image

This PR will allow us to set a title and titleId so that there would NOT be a random generated string if set, and snapshot tests will now pass.

image

@robmadole --- can you review code for accuracy?

},
titleId: {
type: String,
default: null,
Copy link
Member Author

Choose a reason for hiding this comment

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

added titleId

},
maskId: {
type: String,
default: null,
Copy link
Member Author

Choose a reason for hiding this comment

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

added maskId

@jasonlundien
Copy link
Member Author

jasonlundien commented Apr 25, 2023

Prettier has taken over these files as well @robmadole. I left comments where I changed the code (6 total).

  • index.es.js and index.js were updated automatically with npm run dist
  • I did have to manually update index.d.ts, which is 1 of the 6 comments.

@jasonlundien jasonlundien force-pushed the vue-3x-update-title-id-and-mask-id-prop branch from a22cfc4 to 3072263 Compare April 27, 2023 02:36
@robmadole
Copy link
Member

@jasonlundien the changes look good. But the stuff prettier did is a little annoying. Were you surprised by them? I almost wonder if something is misconfigured in VSCode.

@jasonlundien
Copy link
Member Author

jasonlundien commented Jul 10, 2023

@robmadole ---

@jasonlundien the changes look good. But the stuff prettier did is a little annoying. Were you surprised by them? I almost wonder if something is misconfigured in VSCode.

I went back and adjusted my prettier settings to reflect those of Font Awesome. The prettier changes are now fewer than they were but you will still see some the changes --- for consistency. The exception is the index.es.js file which prettier did quite a number on... this file was auto updated when I ran the npm run dist.

I am fine with these prettier changes and being consistent going forward if you are ?!

@jasonlundien jasonlundien force-pushed the vue-3x-update-title-id-and-mask-id-prop branch 2 times, most recently from d458f1f to 251746c Compare July 10, 2023 19:27
@jasonlundien jasonlundien force-pushed the vue-3x-update-title-id-and-mask-id-prop branch from 7626f9a to 444dbfa Compare July 10, 2023 19:44
@jasonlundien jasonlundien reopened this Jul 10, 2023
@jasonlundien jasonlundien force-pushed the vue-3x-update-title-id-and-mask-id-prop branch 2 times, most recently from 91d7b79 to 56462a1 Compare July 10, 2023 20:25
const wrapper = mountFromProps({ icon: faCoffee, size: size })
;['2xs', 'xs', 'sm', 'lg', 'xl', '2xl', '1x', '2x', '3x', '4x', '5x', '6x', '7x', '8x', '9x', '10x'].forEach(
(size) => {
const wrapper = mountFromProps({ icon: faCoffee, size: size })
Copy link
Member Author

Choose a reason for hiding this comment

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

prettier

}
},
{ immediate: true }
)
Copy link
Member Author

Choose a reason for hiding this comment

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

prettier


const vnode = computed(() => renderedIcon.value ? convert(renderedIcon.value.abstract[0], {}, attrs) : null)
const vnode = computed(() => (renderedIcon.value ? convert(renderedIcon.value.abstract[0], {}, attrs) : null))
Copy link
Member Author

Choose a reason for hiding this comment

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

prettier

title: props.title,
titleId: props.titleId,
maskId: props.maskId
})
Copy link
Member Author

Choose a reason for hiding this comment

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

prettier + added titleId: props.titleId, and maskId: props.maskId

? faParse.transform(props.transform)
: props.transform
))
const transform = computed(() => objectWithKey('transform', typeof props.transform === 'string' ? faParse.transform(props.transform) : props.transform))
Copy link
Member Author

Choose a reason for hiding this comment

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

prettier

},

setup (props, { attrs }) {
setup(props, { attrs }) {
Copy link
Member Author

Choose a reason for hiding this comment

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

prettier

@@ -133,35 +141,38 @@ export default defineComponent({
spinReverse: {
type: Boolean,
default: false
},
}
Copy link
Member Author

Choose a reason for hiding this comment

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

prettier

@@ -4,7 +4,7 @@ import convert from '../converter'
import log from '../logger'
import { objectWithKey, classList } from '../utils'

function normalizeIconArgs (icon) {
function normalizeIconArgs(icon) {
Copy link
Member Author

Choose a reason for hiding this comment

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

prettier

@jasonlundien jasonlundien force-pushed the vue-3x-update-title-id-and-mask-id-prop branch from bab2321 to b5e467a Compare July 10, 2023 21:03
@jasonlundien jasonlundien force-pushed the vue-3x-update-title-id-and-mask-id-prop branch 3 times, most recently from 3b3741b to 3c6538d Compare November 1, 2023 20:12
@jasonlundien jasonlundien force-pushed the vue-3x-update-title-id-and-mask-id-prop branch from 3c6538d to 30929b9 Compare November 1, 2023 20:13
@jasonlundien jasonlundien force-pushed the vue-3x-update-title-id-and-mask-id-prop branch from c95cac7 to 15852d3 Compare November 1, 2023 20:32
@jasonlundien jasonlundien merged commit 90cad31 into 3.x Nov 1, 2023
48 checks passed
@jasonlundien jasonlundien deleted the vue-3x-update-title-id-and-mask-id-prop branch November 1, 2023 20:48
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.

None yet

2 participants