Skip to content

Commit

Permalink
feat: custom home tags
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismclarke committed Aug 10, 2024
1 parent 08ae189 commit 4cef03d
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
<h2 class="step-title">{{ step.title | translate }}</h2>
<div class="tags-container">
@for(tag of step.tags; track tag){
<span class="tag step-tag">{{ tag.label | translate }}</span>
<span class="tag" [attr.data-color]="tag.color">{{ tag.label | translate }}</span>
} @for(tool of step.tools; track tool){
<span class="tag tool-tag">{{ tool.label | translate }}</span>
<span class="tag">{{ tool.label | translate }}</span>
}
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,10 @@ button.mat-mdc-icon-button.nav-button {
background: var(--tag-background, black);
padding: 8px;
color: white;
.step-tag {
}
}
.tag.tool-tag {
.tag {
--tag-background: var(--color-primary);
}
.tag.step-tag {
.tag[data-color='secondary'] {
--tag-background: var(--color-secondary);
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ export class ResourceItemFileComponent implements OnInit, OnDestroy {

async ngOnDestroy() {
// ensure any created file attachment uris disposed of
this.service.revokeFileAttachmentURIs([this.dbDoc.filename]);
if (this.dbDoc) {
this.service.revokeFileAttachmentURIs([this.dbDoc.filename]);
}
}

/** When attachment state changed attempt to get URI to downloaded file resource */
Expand Down
2 changes: 1 addition & 1 deletion libs/data/farmer_content/data/content/0_intro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const content: Omit<IFarmerContent, 'id' | 'icon_path'> = {
slug: 'intro',
title: translateMarker('What is PICSA?'),
tools: [],
tags: [{ label: translateMarker('Tutorials') }],
tags: [{ label: translateMarker('Tutorials'), color: 'secondary' }],
steps,
};
export default content;
2 changes: 1 addition & 1 deletion libs/data/farmer_content/data/content/1_what_you_do.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const content: Omit<IFarmerContent, 'id' | 'icon_path'> = {
slug: 'what-do-you-currently-do',
title: translateMarker('What do you currently do?'),
tools: [seasonal_calendar],
tags: [],
tags: [{ label: translateMarker('Resource Allocation Map') }],
steps,
showReviewSection: true,
};
Expand Down
1 change: 0 additions & 1 deletion libs/data/farmer_content/data/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ const TOOLS_BASE = {
href: 'crop-probability',
tabLabel: translateMarker('Tool'),
},
// resource_allocation_map: { label: translateMarker('Resource Allocation Map'), tabLabel: translateMarker('RAM Tool') },
seasonal_calendar: {
label: translateMarker('Seasonal Calendar'),
href: 'seasonal-calendar',
Expand Down
2 changes: 1 addition & 1 deletion libs/data/farmer_content/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export interface IFarmerContent {
icon_path: string;
title: string;
tools: IToolData[];
tags: { label: string }[];
tags: { label: string; color?: 'primary' | 'secondary' }[];
steps: IFarmerContentStep[];
disabled?: boolean;
/** Include a photo-input section as part of review */
Expand Down

0 comments on commit 4cef03d

Please sign in to comment.