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

[web-components]Fix document capture hide attribution #370

Merged
merged 2 commits into from
Dec 11, 2024
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
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,23 @@ class DocumentCaptureScreens extends HTMLElement {
this.innerHTML = `
${styles(this.themeColor)}
<div>
<document-capture-instructions theme-color='${this.themeColor}' id='document-capture-instructions-front' ${this.title} ${this.documentCaptureModes} ${this.showNavigation} ${this.hideInstructions ? 'hidden' : ''}></document-capture-instructions>
<document-capture-instructions theme-color='${this.themeColor}' id='document-capture-instructions-front' ${this.title}
${this.documentCaptureModes} ${this.showNavigation} ${this.hideInstructions ? 'hidden' : ''}
${this.hideAttribution}
></document-capture-instructions>
<document-capture id='document-capture-front' side-of-id='Front'
${this.title} ${this.showNavigation} ${this.hideInstructions ? '' : 'hidden'}
${this.title} ${this.showNavigation} ${this.hideInstructions ? '' : 'hidden'} ${this.hideAttribution}
${this.documentCaptureModes} ${this.documentType} theme-color='${this.themeColor}'
></document-capture>
<document-capture-instructions id='document-capture-instructions-back' side-of-id='Back' title='Submit Back of ID'
${this.documentCaptureModes} ${this.showNavigation} theme-color='${this.themeColor}' hidden
${this.documentCaptureModes} ${this.showNavigation} theme-color='${this.themeColor}' ${this.hideAttribution} hidden
></document-capture-instructions>
<document-capture id='document-capture-back' side-of-id='Back' ${this.title} ${this.showNavigation}
${this.documentCaptureModes} theme-color='${this.themeColor}'
${this.documentCaptureModes} theme-color='${this.themeColor}' ${this.hideAttribution}
hidden
></document-capture>
<document-capture-review id='front-of-document-capture-review' theme-color='${this.themeColor}' hidden></document-capture-review>
<document-capture-review id='back-of-document-capture-review' theme-color='${this.themeColor}' hidden></document-capture-review>
<document-capture-review id='front-of-document-capture-review' theme-color='${this.themeColor}' ${this.hideAttribution} hidden></document-capture-review>
<document-capture-review id='back-of-document-capture-review' theme-color='${this.themeColor}' ${this.hideAttribution} hidden></document-capture-review>
</div>
`;

Expand Down Expand Up @@ -294,6 +297,10 @@ class DocumentCaptureScreens extends HTMLElement {
: '';
}

get hideAttribution() {
return this.hasAttribute('hide-attribution') ? 'hide-attribution' : '';
}

get themeColor() {
return this.getAttribute('theme-color') || '#001096';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ import './index';

const meta = {
args: {
'hide-attribution': false,
'theme-color': '#001096',
},
argTypes: {
'hide-attribution': { control: 'boolean' },
'theme-color': { control: 'color' },
},
component: 'document-capture-screens',
Expand All @@ -14,35 +16,35 @@ export default meta;

export const DocumentCapture = {
render: (args) => `
<document-capture-screens theme-color='${args['theme-color']}'>
<document-capture-screens theme-color='${args['theme-color']}' ${args['hide-attribution'] ? 'hide-attribution' : ''}>
</document-capture-screens>
`,
};

export const DocumentCaptureHiddenInstructions = {
render: (args) => `
<document-capture-screens hide-instructions theme-color='${args['theme-color']}'>
<document-capture-screens hide-instructions theme-color='${args['theme-color']}' ${args['hide-attribution'] ? 'hide-attribution' : ''}>
</document-capture-screens>
`,
};

export const DocumentCaptureHideBackOfId = {
render: (args) => `
<document-capture-screens hide-back-of-id theme-color='${args['theme-color']}'>
<document-capture-screens hide-back-of-id theme-color='${args['theme-color']}' ${args['hide-attribution'] ? 'hide-attribution' : ''}>
</document-capture-screens>
`,
};

export const DocumentCaptureAllowAttributes = {
render: (args) => `
<document-capture-screens document-capture-screens-modes='camera,upload' theme-color='${args['theme-color']}'>
<document-capture-screens document-capture-screens-modes='camera,upload' theme-color='${args['theme-color']}' ${args['hide-attribution'] ? 'hide-attribution' : ''}>
</document-capture-screens>
`,
};

export const DocumentCaptureHideInstructionNBackOfId = {
render: (args) => `
<document-capture-screens hide-back-of-id hide-instructions theme-color='${args['theme-color']}'>
<document-capture-screens hide-back-of-id hide-instructions theme-color='${args['theme-color']}' ${args['hide-attribution'] ? 'hide-attribution' : ''}>
</document-capture-screens>
`,
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import './SelfieCaptureScreens';

const meta = {
args: {
'hide-attribution': false,
'theme-color': '#001096',
},
argTypes: {
'hide-attribution': { control: 'boolean' },
'theme-color': { control: 'color' },
},
component: 'selfie-capture-screens',
Expand All @@ -10,21 +15,15 @@ const meta = {
export default meta;

export const SelfieCaptureFlow = {
args: {
'theme-color': '#001096',
},
render: (args) => `
<selfie-capture-screens theme-color='${args['theme-color']}'>
<selfie-capture-screens theme-color='${args['theme-color']}' ${args['hide-attribution'] ? 'hide-attribution' : ''}>
</selfie-capture-screens>
`,
};

export const SelfieCaptureFlowHiddenInstructions = {
args: {
'theme-color': '#001096',
},
render: (args) => `
<selfie-capture-screens hide-instructions theme-color='${args['theme-color']}'>
<selfie-capture-screens hide-instructions theme-color='${args['theme-color']}' ${args['hide-attribution'] ? 'hide-attribution' : ''}>
</selfie-capture-screens>
`,
};
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ import './SmartCameraWeb';

const meta = {
args: {
'hide-attribution': false,
'theme-color': '#001096',
},
argTypes: {
'hide-attribution': { control: 'boolean' },
'theme-color': { control: 'color' },
},
component: 'smart-camera-web',
Expand All @@ -14,35 +16,35 @@ export default meta;

export const SmartCameraWeb = {
render: (args) => `
<smart-camera-web theme-color='${args['theme-color']}' capture-id show-navigation>
<smart-camera-web theme-color='${args['theme-color']}' capture-id show-navigation ${args['hide-attribution'] ? 'hide-attribution' : ''}>
</smart-camera-web>
`,
};

export const SmartCameraWebWithOutInstructions = {
render: (args) => `
<smart-camera-web theme-color='${args['theme-color']}' capture-id hide-instructions>
<smart-camera-web theme-color='${args['theme-color']}' capture-id hide-instructions ${args['hide-attribution'] ? 'hide-attribution' : ''}>
</smart-camera-web>
`,
};

export const SmartCameraWebWithOutNavigation = {
render: (args) => `
<smart-camera-web theme-color='${args['theme-color']}' capture-id>
<smart-camera-web theme-color='${args['theme-color']}' capture-id ${args['hide-attribution'] ? 'hide-attribution' : ''}>
</smart-camera-web>
`,
};

export const SmartCameraWebWithOutBackToHost = {
render: (args) => `
<smart-camera-web theme-color='${args['theme-color']}' capture-id show-navigation hide-back-to-host>
<smart-camera-web theme-color='${args['theme-color']}' capture-id show-navigation hide-back-to-host ${args['hide-attribution'] ? 'hide-attribution' : ''}>
</smart-camera-web>
`,
};

export const SmartCameraWebWithOutBackId = {
render: (args) => `
<smart-camera-web theme-color='${args['theme-color']}' capture-id show-navigation hide-back-of-id>
<smart-camera-web theme-color='${args['theme-color']}' capture-id show-navigation hide-back-of-id ${args['hide-attribution'] ? 'hide-attribution' : ''}>
</smart-camera-web>
`,
};
Expand Down
Loading
Loading