Skip to content

Commit

Permalink
wip with basic looks in place
Browse files Browse the repository at this point in the history
  • Loading branch information
SeriousHorncat committed Oct 20, 2023
1 parent f77eb52 commit 29856f7
Showing 1 changed file with 64 additions and 34 deletions.
98 changes: 64 additions & 34 deletions frontend/src/components/AnalysisView/SupportingEvidence.vue
Original file line number Diff line number Diff line change
@@ -1,25 +1,36 @@
<template>
<div class="section-row">
<label
class="section-field"
v-bind:style="[
value.length === 0 && !this.editable
? 'color: var(--rosalution-grey-300);'
: 'color: var(--rosalution-black);',
]"
>
<label class="section-field" v-bind:style="[
value.length === 0 && !this.editable
? 'color: var(--rosalution-grey-300);'
: 'color: var(--rosalution-black);',
]">
{{ field }}
</label>
<span class="section-content">
<span v-if="this.editable && " role="textbox" class="editable-section-content-values"
data-test="editable-value" @input="onContentChanged($event)"
>
Attach
</span>
<span :data-test="supporting-evidence{field}">
{{ content }}
</span>
</span>
<div class="section-content" :data-test="`supporting-evidence-${field}`">
<div class="supporting-evidence-content">
<span v-if="isDataUnavailable && this.editable" role="textbox" @input="onContentChanged($event)">
Attach
</span>
<span class="status-icon attachment-logo">
<font-awesome-icon :icon="typeIcon" size="lg" />
</span>
<div v-if="content.type == 'file'" @click="$emit('download', content)" target="_blank" rel="noreferrer noopener" class="attachment-data attachment-name">

Check failure on line 18 in frontend/src/components/AnalysisView/SupportingEvidence.vue

View workflow job for this annotation

GitHub Actions / nodejs-ci (20.8)

This line has a length of 161. Maximum allowed is 120
{{ content.name }}
</div>
<a v-if="content.type == 'link'" :href="content.data" target="_blank" rel="noreferrer noopener" class="attachment-data attachment-name">

Check failure on line 21 in frontend/src/components/AnalysisView/SupportingEvidence.vue

View workflow job for this annotation

GitHub Actions / nodejs-ci (20.8)

This line has a length of 144. Maximum allowed is 120
{{ content.name }}
</a>
</div>
<div class="action-items">
<button @click="$emit('edit', content)" data-test="edit-button">
<font-awesome-icon icon="pencil" size="xl" />
</button>
<button v-if="writePermissions" @click="$emit('delete', content)" data-test="delete-button">
<font-awesome-icon icon="xmark" size="xl" />
</button>
</div>
</div>
</div>
</template>

Expand All @@ -41,15 +52,22 @@ export default {
},
},
computed: {
isDataUnavailable: function() {
isDataUnavailable: function () {

Check failure on line 55 in frontend/src/components/AnalysisView/SupportingEvidence.vue

View workflow job for this annotation

GitHub Actions / nodejs-ci (20.8)

Unexpected space before function parentheses
return this.value == '.' || this.value == 'null' || this.value == null || this.value.length == 0;
},
dataAvailabilityColour: function() {
dataAvailabilityColour: function () {

Check failure on line 58 in frontend/src/components/AnalysisView/SupportingEvidence.vue

View workflow job for this annotation

GitHub Actions / nodejs-ci (20.8)

Unexpected space before function parentheses
return this.isDataUnavailable ? 'var(--rosalution-grey-300)' : 'var(--rosalution-black)';
},
content: function() {
console.log(this.value);
typeIcon: function () {

Check failure on line 61 in frontend/src/components/AnalysisView/SupportingEvidence.vue

View workflow job for this annotation

GitHub Actions / nodejs-ci (20.8)

Unexpected space before function parentheses
if (this.isDataUnavailable) {
return undefined;
} else if (this.content.type === 'file') {
return ['far', 'file'];
}
return 'link';
},
content: function () {

Check failure on line 70 in frontend/src/components/AnalysisView/SupportingEvidence.vue

View workflow job for this annotation

GitHub Actions / nodejs-ci (20.8)

Unexpected space before function parentheses
if (this.isDataUnavailable) {
return {};
}
Expand Down Expand Up @@ -84,22 +102,34 @@ export default {
.section-content {
display: flex;
flex-direction: column;
flex-direction: row;
flex: 1 0 0;
justify-content: space-between;
align-items: center;
background-color: var(--rosalution-grey-50);
border-radius: var(--content-border-radius);
padding: var(--p-10);
}
.editable-section-content-values {
overflow: hidden;
resize: both;
border-top: none;
border-right: none;
border-left: none;
border-bottom: 2px solid var(--rosalution-purple-200);
.attachment-name {
color: var(--rosalution-purple-300);
font-weight: bold;
cursor: pointer;
}
span:focus {
color: var(--rosalution-purple-300);
outline: none;
box-shadow: 0px 5px 5px var(--rosalution-grey-200);
.supporting-evidence-content {
display: flex;
align-items: center;
gap: var(--p-10);
}
.action-items svg{
color: var(--rosalution-black);
}
.action-items > button {
border: none;
background: none;
}
</style>

0 comments on commit 29856f7

Please sign in to comment.