mirror of
https://github.com/datahub-project/datahub.git
synced 2025-11-02 11:49:23 +00:00
Add dataset deprecation acknowledgement and wiki link
This commit is contained in:
parent
209a3fe535
commit
394a5f5ae4
@ -97,6 +97,8 @@ public class Application extends Controller {
|
||||
Play.application().configuration().getString("links.wiki.metadataHealth", "");
|
||||
private static final String WHZ_WIKI_LINKS__PURGE_KEY =
|
||||
Play.application().configuration().getString("links.wiki.purgeKey", "");
|
||||
private static final String WHZ_WIKI_LINKS__DATASET_DECOMMISSION =
|
||||
Play.application().configuration().getString("links.wiki.datasetDecommission");
|
||||
|
||||
private static final String WHZ_LINKS__JIT_ACL_CONTACT =
|
||||
Play.application().configuration().getString("links.jitAcl.contact", "");
|
||||
@ -272,6 +274,7 @@ public class Application extends Controller {
|
||||
wikiLinks.put("exportPolicy", WHZ_WIKI_LINKS__EXPORT_POLICY);
|
||||
wikiLinks.put("metadataHealth", WHZ_WIKI_LINKS__METADATA_HEALTH);
|
||||
wikiLinks.put("purgeKey", WHZ_WIKI_LINKS__PURGE_KEY);
|
||||
wikiLinks.put("datasetDecommission", WHZ_WIKI_LINKS__DATASET_DECOMMISSION);
|
||||
|
||||
return wikiLinks;
|
||||
}
|
||||
|
||||
@ -66,6 +66,14 @@ export default class DatasetDeprecation extends Component {
|
||||
*/
|
||||
deprecationNoteAlias: ComputedProperty<DatasetDeprecation['deprecationNote']> = oneWay('deprecationNote');
|
||||
|
||||
/**
|
||||
* Before a user can update the deprecation status to deprecated, they must acknowledge that even if the
|
||||
* dataset is deprecated they must still keep it compliant.
|
||||
* @memberof DatasetDeprecation
|
||||
* @type {boolean}
|
||||
*/
|
||||
isDeprecationNoticeAcknowledged: boolean = false;
|
||||
|
||||
/**
|
||||
* Checks the working / aliased copies of the deprecation properties diverge from the
|
||||
* saved versions i.e. deprecationNoteAlias and deprecationAlias
|
||||
@ -124,6 +132,15 @@ export default class DatasetDeprecation extends Component {
|
||||
set(this, 'decommissionTime', new Date(decommissionTime).getTime());
|
||||
}
|
||||
|
||||
/**
|
||||
* When a user clicks the checkbox to acknowledge or cancel acknowledgement of the notice for
|
||||
* deprecating a dataset
|
||||
*/
|
||||
@action
|
||||
onAcknowledgeDeprecationNotice(this: DatasetDeprecation) {
|
||||
this.toggleProperty('isDeprecationNoticeAcknowledged');
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the save action with the updated values for
|
||||
* deprecated decommissionTime, and deprecationNote
|
||||
|
||||
@ -58,3 +58,22 @@ input[type='checkbox'] {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
input[type='checkbox'] + label.checkbox-input__wrapper {
|
||||
$checkbox-width: 28px;
|
||||
$container-margin: item-spacing(4);
|
||||
display: flex;
|
||||
padding: item-spacing(2) $container-margin item-spacing(2) ($container-margin + $checkbox-width);
|
||||
box-sizing: content-box;
|
||||
margin: 0 (-1 * $container-margin);
|
||||
|
||||
&:hover {
|
||||
background-color: rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
&:before,
|
||||
&:after {
|
||||
left: $container-margin;
|
||||
top: item-spacing(2) - 1;
|
||||
}
|
||||
}
|
||||
|
||||
@ -29,22 +29,3 @@
|
||||
color: rgba(0, 0, 0, 0.6);
|
||||
}
|
||||
}
|
||||
|
||||
input[type='checkbox'] + label.search-facet__checkbox-wrapper {
|
||||
$checkbox-width: 28px;
|
||||
$container-margin: item-spacing(4);
|
||||
display: flex;
|
||||
padding: item-spacing(2) $container-margin item-spacing(2) ($container-margin + $checkbox-width);
|
||||
box-sizing: content-box;
|
||||
margin: 0 (-1 * $container-margin);
|
||||
|
||||
&:hover {
|
||||
background-color: rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
&:before,
|
||||
&:after {
|
||||
left: $container-margin;
|
||||
top: item-spacing(2) - 1;
|
||||
}
|
||||
}
|
||||
|
||||
@ -82,13 +82,33 @@
|
||||
</strong>
|
||||
</p>
|
||||
|
||||
<span>
|
||||
{{input
|
||||
type="checkbox"
|
||||
name="deprecated.acknowledge"
|
||||
id="acknowledge-deprecation"
|
||||
checked=(readonly isDeprecationAcknowledged)
|
||||
change=(action "onAcknowledgeDeprecationNotice")}}
|
||||
|
||||
<label for="acknowledge-deprecation">
|
||||
<p>By checking this box, you acknowledge that you must keep this dataset compliant even after it is deprecated.</p>
|
||||
<p>
|
||||
For more information on how to decommission your dataset, please follow this link:
|
||||
<a href={{wikiLinks.datasetDecommission}} target="_blank">
|
||||
Dataset Decommission
|
||||
</a>
|
||||
</p>
|
||||
</label>
|
||||
</span>
|
||||
|
||||
|
||||
{{/if}}
|
||||
|
||||
<div class="dataset-deprecation-toggle__actions">
|
||||
<button
|
||||
type="submit"
|
||||
class="nacho-button--large nacho-button--secondary"
|
||||
disabled={{and deprecatedAlias (not decommissionTime)}}>
|
||||
disabled={{and deprecatedAlias (or (not decommissionTime) (not isDeprecationNoticeAcknowledged))}}>
|
||||
Update Deprecation Status
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
deprecated=deprecated
|
||||
deprecationNote=deprecationNote
|
||||
decommissionTime=decommissionTime
|
||||
wikiLinks=wikiLinks
|
||||
onUpdateDeprecation=(action "updateDeprecation")
|
||||
}}
|
||||
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
checked=(readonly checked)
|
||||
change=(action onChange facet facetValue)
|
||||
}}
|
||||
<label for="{{facetValue.value}}" class="search-facet__checkbox-wrapper">
|
||||
<label for="{{facetValue.value}}" class="search-facet__checkbox-wrapper checkbox-input__wrapper">
|
||||
<span class="search-facet__label">{{facetValue.label}}</span>
|
||||
<span class="search-facet__count">{{readonly count}}</span>
|
||||
</label>
|
||||
|
||||
@ -125,6 +125,7 @@
|
||||
urn=encodedUrn
|
||||
deprecated=model.deprecated
|
||||
deprecationNote=model.deprecationNote
|
||||
wikiLinks=wikiLinks
|
||||
}}
|
||||
{{/tabs.tabpanel}}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user