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

Support newly proposed Auro Logos endpoint #111

Open
blackfalcon opened this issue Mar 10, 2024 · 0 comments
Open

Support newly proposed Auro Logos endpoint #111

blackfalcon opened this issue Mar 10, 2024 · 0 comments

Comments

@blackfalcon
Copy link
Member

Is your feature request related to a problem? Please describe.

Auro Icons is proposing a breaking up of services to maintain a proper single responsibility per repo. AlaskaAirlines/Icons#106

The <auro-icon> element must be updated to support either endpoint.

Describe the solution you'd like

The default this.uri could be updated to support both a logo and an icon default URI.

if (category === 'logos' && this.uri === undefined) {
    this.uri = 'https://cdn.jsdelivr.net/npm/@aurodesignsystem/logos@latest/dist/logos';
} else if (category !== 'logos' && this.uri === undefined) {
    this.uri = 'https://cdn.jsdelivr.net/npm/@alaskaairux/icons@latest/dist/icons';
}

The fetchIcon() method would be updated accordingly:

  async fetchIcon(category, name) {
    let iconHTML = '';

    if (category === 'logos') {
      iconHTML = await cacheFetch(`${this.uri}/${name}.svg`);
    } else {
      iconHTML = await cacheFetch(`${this.uri}/${category}/${name}.svg`);
    }

    const dom = new DOMParser().parseFromString(iconHTML, 'text/html');

    return dom.body.querySelector('svg');
  }

The update in logic sets the default based in input from the user. If the this.uri return truthy then the users input value would be used as the base URL for the fetch.

This would be a feature update that should have no impact because of the separating of the libraries on the backend.

Describe alternatives you've considered

n/a

Additional context

This issue will be considered complete once the feature is clearly demonstrating the ability to pull from one endpoint versus another based on user selection.

This issue has a dependency on the following issue being completed.

@blackfalcon blackfalcon added Type: Feature New Feature auro-icon not-reviewed Issue has not been reviewed by Auro team members labels Mar 10, 2024
@Patrick-Daly-AA Patrick-Daly-AA removed their assignment Mar 12, 2024
@Patrick-Daly-AA Patrick-Daly-AA removed the not-reviewed Issue has not been reviewed by Auro team members label Mar 12, 2024
@jason-capsule42 jason-capsule42 removed the Type: Feature New Feature label Oct 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants