Skip to content

Commit

Permalink
Remove profile component, tidy fixtures/stories
Browse files Browse the repository at this point in the history
  • Loading branch information
ahosgood committed Oct 25, 2023
1 parent 49ebba2 commit 4a25c73
Show file tree
Hide file tree
Showing 19 changed files with 23 additions and 122 deletions.
2 changes: 0 additions & 2 deletions .github/actions/prototype-kit-test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ runs:
echo -e "{% from \"nationalarchives/components/pagination/macro.njk\" import tnaPagination %}\n$(cat prototype/app/views/index.html)" > prototype/app/views/index.html &&
echo -e "{% from \"nationalarchives/components/phase-banner/macro.njk\" import tnaPhaseBanner %}\n$(cat prototype/app/views/index.html)" > prototype/app/views/index.html &&
echo -e "{% from \"nationalarchives/components/picture/macro.njk\" import tnaPicture %}\n$(cat prototype/app/views/index.html)" > prototype/app/views/index.html &&
echo -e "{% from \"nationalarchives/components/profile/macro.njk\" import tnaProfile %}\n$(cat prototype/app/views/index.html)" > prototype/app/views/index.html &&
echo -e "{% from \"nationalarchives/components/sensitive-image/macro.njk\" import tnaSensitiveImage %}\n$(cat prototype/app/views/index.html)" > prototype/app/views/index.html &&
echo -e "{% from \"nationalarchives/components/skip-link/macro.njk\" import tnaSkipLink %}\n$(cat prototype/app/views/index.html)" > prototype/app/views/index.html &&
echo -e "{% from \"nationalarchives/components/tabs/macro.njk\" import tnaTabs %}\n$(cat prototype/app/views/index.html)" > prototype/app/views/index.html
Expand All @@ -73,7 +72,6 @@ runs:
echo "{{ tnaPagination({}) }}" >> prototype/app/views/index.html &&
echo "{{ tnaPhaseBanner({}) }}" >> prototype/app/views/index.html &&
echo "{{ tnaPicture({}) }}" >> prototype/app/views/index.html &&
echo "{{ tnaProfile({}) }}" >> prototype/app/views/index.html &&
echo "{{ tnaSensitiveImage({}) }}" >> prototype/app/views/index.html &&
echo "{{ tnaSkipLink({}) }}" >> prototype/app/views/index.html &&
echo "{{ tnaTabs({}) }}" >> prototype/app/views/index.html &&
Expand Down
1 change: 0 additions & 1 deletion src/nationalarchives/components/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
@use "pagination";
@use "phase-banner";
@use "picture";
@use "profile";
@use "sensitive-image";
@use "skip-link";
@use "tabs";
2 changes: 1 addition & 1 deletion src/nationalarchives/components/footer/template.njk
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
<ul class="tna-footer__navigation-block-items tna-ul tna-ul--plain">
{%- for item in group.items -%}
<li class="tna-footer__navigation-block-item">
<a href="{{ item.href }}" class="tna-footer__navigation-block-item-link"{%- if item.title or item.newTab %} title="{{ item.title if item.title else item.text }}{%- if item.newTab %} (opens in new tab){% endif %}"{% endif %}{%- if item.newTab %} target="_blank"{% endif %}>
<a href="{{ item.href }}" class="tna-footer__navigation-block-item-link"{%- if item.title or item.newTab %} title="{{ item.title if item.title else item.text }}{%- if item.newTab %} (opens in new tab){% endif %}"{% endif %}{%- if item.newTab %} target="_blank" rel="noreferrer noopener"{% endif %}>
{{ item.text }}
{%- if item.newTab -%}
<i class="fa-solid fa-arrow-up-right-from-square"></i>
Expand Down
10 changes: 4 additions & 6 deletions src/nationalarchives/components/header/header.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ const argTypes = {
logo: { control: "object" },
topNavigation: { control: "object" },
navigation: { control: "object" },
colour: {
control: "radio",
options: ["black", "yellow", "pink", "orange", "green", "blue"],
accent: {
control: "boolean",
},
exit: { control: "object" },
classes: { control: "text" },
Expand All @@ -35,7 +34,7 @@ const Template = ({
logo,
topNavigation,
navigation,
colour,
accent,
exit,
classes,
attributes,
Expand All @@ -45,7 +44,7 @@ const Template = ({
logo,
topNavigation,
navigation,
colour,
accent,
exit,
classes,
attributes,
Expand Down Expand Up @@ -89,7 +88,6 @@ Standard.args = {
href: "#/gamma",
},
],
colour: "yellow",
exit: {
text: "Go to the current National Archives website",
href: "#",
Expand Down
4 changes: 2 additions & 2 deletions src/nationalarchives/components/header/macro-options.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@
]
},
{
"name": "colour",
"type": "string",
"name": "accent",
"type": "boolean",
"required": false,
"description": ""
},
Expand Down
4 changes: 2 additions & 2 deletions src/nationalarchives/components/header/template.njk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{%- set containerClasses = [params.classes] if params.classes else [] -%}
{%- if params.colour -%}
{%- set containerClasses = containerClasses.concat('tna-header--' + params.colour) -%}
{%- if params.accent -%}
{%- set containerClasses = containerClasses.concat('tna-header--accent') -%}
{%- endif -%}
<header class="tna-header {{ containerClasses | join(' ') }}" data-module="tna-header" {%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %}>
{%- if params.exit -%}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
"required": true,
"description": ""
},
{
"name": "accent",
"type": "boolean",
"required": false,
"description": ""
},
{
"name": "classes",
"type": "string",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import macroOptions from "./macro-options.json";

const argTypes = {
phase: {
control: "radio",
options: ["discovery", "alpha", "beta", "live"],
control: "text",
},
message: { control: "text" },
accent: { control: "boolean" },
classes: { control: "text" },
attributes: { control: "object" },
};
Expand All @@ -32,32 +32,8 @@ const Template = ({ phase, message, classes, attributes }) =>
},
});

export const Discovery = Template.bind({});
Discovery.args = {
phase: "discovery",
message: `This is a new service – <a href="#">give us your feedback</a> to help improve it.`,
};

export const Alpha = Template.bind({});
Alpha.args = {
phase: "alpha",
message: `This is a new service – <a href="#">give us your feedback</a> to help improve it.`,
};

export const Beta = Template.bind({});
Beta.args = {
export const Standard = Template.bind({});
Standard.args = {
phase: "beta",
message: `This is a new service – <a href="#">give us your feedback</a> to help improve it.`,
};

export const Live = Template.bind({});
Live.args = {
phase: "live",
message: `This is a new service – <a href="#">give us your feedback</a> to help improve it.`,
};

export const Unknown = Template.bind({});
Unknown.args = {
phase: "unknown",
message: `This is a new service – <a href="#">give us your feedback</a> to help improve it.`,
};
4 changes: 3 additions & 1 deletion src/nationalarchives/components/phase-banner/template.njk
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{%- set containerClasses = [params.classes] if params.classes else [] -%}
{%- set containerClasses = containerClasses.concat('tna-phase-banner--' + params.phase | lower) -%}
{%- if params.accent -%}
{%- set containerClasses = containerClasses.concat('tna-phase-banner--accent') -%}
{%- endif -%}
<div class="tna-phase-banner {{ containerClasses | join(' ') }}" {%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %}>
<div class="tna-container">
<div class="tna-column tna-column--full-tiny">
Expand Down
1 change: 0 additions & 1 deletion src/nationalarchives/components/profile/_index.scss

This file was deleted.

4 changes: 0 additions & 4 deletions src/nationalarchives/components/profile/fixtures.json

This file was deleted.

14 changes: 0 additions & 14 deletions src/nationalarchives/components/profile/macro-options.json

This file was deleted.

3 changes: 0 additions & 3 deletions src/nationalarchives/components/profile/macro.njk

This file was deleted.

5 changes: 0 additions & 5 deletions src/nationalarchives/components/profile/profile.scss

This file was deleted.

31 changes: 0 additions & 31 deletions src/nationalarchives/components/profile/profile.stories.js

This file was deleted.

15 changes: 0 additions & 15 deletions src/nationalarchives/components/profile/template.njk

This file was deleted.

4 changes: 0 additions & 4 deletions src/nationalarchives/components/tabs/tabs.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ export class Tabs {
}

setSelectedToNextTab(targetItem) {
console.log("setSelectedToNextTab", targetItem);
const currentIndex = [...this.$tabListItemLinks].findIndex(
($tabListItemLink) =>
$tabListItemLink.getAttribute("id") === targetItem.getAttribute("id"),
Expand All @@ -161,14 +160,12 @@ export class Tabs {
} else {
newIndex = 0;
}
console.log(currentIndex, newIndex);
this.switchTab(
this.$tabListItemLinks[newIndex].getAttribute("aria-controls"),
);
}

setSelectedToPreviousTab(targetItem) {
console.log("setSelectedToPreviousTab", targetItem);
const currentIndex = [...this.$tabListItemLinks].findIndex(
($tabListItemLink) =>
$tabListItemLink.getAttribute("id") === targetItem.getAttribute("id"),
Expand All @@ -179,7 +176,6 @@ export class Tabs {
} else {
newIndex = this.$tabListItemLinks.length - 1;
}
console.log(currentIndex, newIndex);
this.switchTab(
this.$tabListItemLinks[newIndex].getAttribute("aria-controls"),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ const Template = ({ theme, accent }) => {
phase: "beta",
message:
'This is a new service - <a href="#">give us your feedback</a> to help improve it.',
classes: "tna-phase-banner--accent",
accent: true,
},
})}
${Header({
Expand Down
1 change: 0 additions & 1 deletion tasks/test-package.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ const checkExists = [
...componentFiles("pagination"),
...componentFiles("phase-banner"),
...componentFiles("picture", "Picture"),
...componentFiles("profile"),
...componentFiles("sensitive-image", "SensitiveImage"),
...componentFiles("skip-link", "SkipLink"),
...componentFiles("tabs", "Tabs"),
Expand Down

0 comments on commit 4a25c73

Please sign in to comment.