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

Fixed: Plateform Icon And Text #4713

Merged
merged 1 commit into from
Mar 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 21 additions & 9 deletions src/components/Table/TableFormatters/PlatformFormatter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,28 @@ export default {
}
</script>

<style scoped>
<style scoped lang="scss">
.platform-td {
display: flex;
flex-wrap: nowrap;
align-items: center;
gap: 0.5rem;

.icon-zone {
display: inline-block;
width: 1.5em;
}
.icon-zone {
width: 1.5em;
height: 1.5em;

.asset-icon {
height: 100%;
width: 100%;
vertical-align: -0.2em;
fill: currentColor;
}
}

.asset-icon {
height: 1.5em;
vertical-align: -0.2em;
fill: currentColor;
.platform-name {
flex: 1;
}
}

</style>
Copy link
Member

Choose a reason for hiding this comment

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

The code seems to have no issues in terms of structure, syntax, or function flow as it stands currently. The main areas where potential improvements could be made relate to using CSS instead of plain HTML.

Optimizing:

  1. Move some common utility classes (e.g., platform-name) directly into the style block at the end, rather than creating them inline within an instance of .icon-zone. This will make stylesheets cleaner and more maintainable.
    css
    @import '~fontawesome/scss';
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.platform-td {
  transition: all 0.2s cubic-bezier(0.25, 0.35, 0.25, 1);

  /* add fade-in animation only when hovered */
  &:hover:not([data-disabled]),
  &[class*('_active_')],
  *[data-focus-visible] {
    transform: scale(1.1);
    color: #f7b28c;

    // Add this to apply the animation only on hover over certain elements
    &::after,
  &[data-disabled][&*~._focus-visible]:not([aria-label^='')] {
        content: "";
        position: absolute;
        z-index: 9;
        top: 1px;
        right: 1px;
        bottom: 1px;
        left: 1px;
        background-color: rgba(140,140,160,.2)

To sum up, if I were making changes for you based on these optimizations, the updated script might look something like this:

<script src="https://unpkg.com/@fortawesome/free-brands-js">...</script>

@@-158,15 +162,11 @@

<style scoped lang="scss" v-loading-prevention> body { margin-top: 0!important; } @media screen and (max-width: 1024px) { .content-table > :last-child:first-of-type { order-position: first !important ```

1 change: 1 addition & 0 deletions src/views/assets/Asset/AssetList/components/const.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ export function getDefaultConfig(vm) {
sortable: true
},
platform: {
width: '160px',
sortable: true,
formatter: PlatformFormatter
},
Copy link
Member

Choose a reason for hiding this comment

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

The main difference between the two lines of code is in the line with the curly braces {} instead of {width}, which changes the value of < "platform.width"`. To optimize the readability and maintainability of the code:

export function getDefaultConfig(vm) {

  // Here's the rest of your existing functionality...
}

This change might not have an impact on regular operations but could improve style slightly. It's generally advisable to ensure consistency in naming conventions (e.g., height, width) since it makes files easier to read and understand.

If you want further optimizations, let me know!

Expand Down