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

Changed term 'control' to 'requirement' on the UI #488

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
47 changes: 22 additions & 25 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,31 @@
module.exports = {
env: {
browser: true,
es6: true
es6: true,
},
extends: ["plugin:vue/recommended", 'prettier', 'plugin:prettier/recommended' ],
extends: ["plugin:vue/recommended", "prettier", "plugin:prettier/recommended"],
rules: {
'max-len': 'off',
'no-console': 'warn',
'no-return-await': 'warn',
'no-throw-literal': 'warn',
'vue/require-default-prop': 'off',
'vue/prop-name-casing': 'off',
'object-curly-spacing': 'off',
'lines-between-class-members': [
'warn',
'always',
{exceptAfterSingleLine: true}
"max-len": "off",
"no-console": "warn",
"no-return-await": "warn",
"no-throw-literal": "warn",
"vue/require-default-prop": "off",
"vue/prop-name-casing": "off",
"vue/multi-word-component-names": "off",
"object-curly-spacing": "off",
"lines-between-class-members": ["warn", "always", { exceptAfterSingleLine: true }],
"padding-line-between-statements": [
"warn",
{ blankLine: "always", prev: "function", next: "*" },
{ blankLine: "always", prev: "import", next: ["class", "function"] },
],
'padding-line-between-statements': [
'warn',
{blankLine: 'always', prev: 'function', next: '*'},
{blankLine: 'always', prev: 'import', next: ['class', 'function']}
],
'vue/html-self-closing': [
'warn',
"vue/html-self-closing": [
"warn",
{
html: {
void: 'always'
}
}
]
}
void: "always",
},
},
],
},
};
4 changes: 2 additions & 2 deletions app/javascript/components/components/ComponentCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<i v-if="component.released" class="mdi mdi-stamper h5" aria-hidden="true" />
<!-- Rules count info -->
<span class="float-right h6">
{{ component.rules_count }} {{ component.component_id ? "Overlaid" : "" }} Controls
{{ component.rules_count }} {{ component.component_id ? "Overlaid" : "" }} Requirements
</span>
</b-card-title>
<b-card-sub-title class="mb-2">
Expand Down Expand Up @@ -131,7 +131,7 @@
v-b-tooltip.hover
class="mdi mdi-lock h5 clickable"
aria-hidden="true"
title="Lock component controls"
title="Lock component requirements"
/>
</template>
</LockControlsModal>
Expand Down
6 changes: 3 additions & 3 deletions app/javascript/components/components/LockControlsModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
<!-- Modal trigger button -->
<span @click="showModal()">
<slot name="opener">
<b-button class="px-2 m-2" variant="primary"> Lock Component Controls </b-button>
<b-button class="px-2 m-2" variant="primary"> Lock Component Requirements </b-button>
</slot>
</span>

<!-- Add component modal -->
<b-modal
ref="LockControlsModal"
title="Lock Component Controls"
title="Lock Component Requirements"
size="lg"
:ok-title="loading ? 'Loading...' : 'Lock Controls'"
:ok-title="loading ? 'Loading...' : 'Lock Requirements'"
:ok-disabled="loading"
@ok="lockControls"
>
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/components/components/NewComponentModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
<b-form-group
v-else
label="STIG ID Prefix"
description="STIG IDs for each control will be automatically generated based on this prefix value"
description="STIG IDs for each requirement will be automatically generated based on this prefix value"
>
<b-form-input
v-model="prefix"
Expand Down
4 changes: 2 additions & 2 deletions app/javascript/components/components/ProjectComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@
<!-- Tab view for project information -->
<b-tabs v-model="componentTabIndex" content-class="mt-3" justified>
<!-- Component rules -->
<b-tab :title="`Controls (${component.rules.length})`">
<b-tab :title="`Requirements (${component.rules.length})`">
<b-button
v-if="role_gte_to(effective_permissions, 'author')"
class="m-2"
variant="primary"
:href="`/components/${component.id}/controls`"
>
Edit Component Controls
Edit Component Requirements
</b-button>
<span v-b-tooltip.hover :title="releaseComponentTooltip">
<b-button
Expand Down
6 changes: 3 additions & 3 deletions app/javascript/components/memberships/NewMembership.vue
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,9 @@ export default {
selectedRole: null,
roleDescriptions: [
"Read only access to the Project or Component",
"Edit, comment, and mark Controls as requiring review. Cannot sign-off or approve changes to a Control. Great for individual contributors.",
"Author and approve changes to a Control.",
"Full control of a Project or Component. Lock Controls, revert controls, and manage members.",
"Edit, comment, and mark Requirements as requiring review. Cannot sign-off or approve changes to a Requirement. Great for individual contributors.",
"Author and approve changes to a Requirement.",
"Full control of a Project or Component. Lock Requirements, revert requirements, and manage members.",
],
userSearchStyles: {
vueSimpleSuggest: "userSearchVueSimpleSuggest",
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/components/rules/FindAndReplace.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
>
<CommentModal
title="Replace All"
message="Provide a comment that summarizes your changes to these controls."
message="Provide a comment that summarizes your changes to these requirements."
:require-non-empty="false"
button-text="Replace All"
button-variant="primary"
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/components/rules/FindAndReplaceResult.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<b-col lg="2" class="text-right">
<CommentModal
title="Replace"
message="Provide a comment that summarizes your changes to this control."
message="Provide a comment that summarizes your changes to this requirement."
:require-non-empty="false"
button-text="Replace"
button-variant="secondary"
Expand Down
88 changes: 44 additions & 44 deletions app/javascript/components/rules/RuleEditorHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
</h2>

<p v-if="!readOnly && rule.locked" class="text-danger font-weight-bold">
This control is locked and must first be unlocked if changes or deletion are required.
This requirement is locked and must first be unlocked if changes or deletion are required.
</p>
<p v-if="!readOnly && rule.review_requestor_id" class="text-danger font-weight-bold">
This control is under review and cannot be edited at this time.
This requirement is under review and cannot be edited at this time.
</p>

<div v-if="!readOnly">
Expand All @@ -28,14 +28,14 @@
<!-- Action Buttons -->
<!-- Clone rule modal -->
<NewRuleModalForm
:title="'Clone Control'"
:title="'Clone Requirement'"
:id-prefix="'duplicate'"
:for-duplicate="true"
:selected-rule-id="rule.id"
:selected-rule-text="`${projectPrefix}-${rule.rule_id}`"
@ruleSelected="$emit('ruleSelected', $event.id)"
/>
<b-button v-b-modal.duplicate-rule-modal variant="info">Clone Control</b-button>
<b-button v-b-modal.duplicate-rule-modal variant="info">Clone Requirement</b-button>
<!-- Mark/Unmark as duplicate modal -->
<span
v-if="
Expand All @@ -45,7 +45,7 @@
rule.satisfies.length > 0
"
v-b-tooltip.hover
title="This control cannot be marked as duplicate because it satisfies other controls"
title="This requirement cannot be marked as duplicate because it satisfies other requirements"
>
<b-button v-b-modal.mark-as-duplicate-modal disabled variant="orange"
>Mark as Duplicate</b-button
Expand Down Expand Up @@ -78,16 +78,16 @@
v-if="effectivePermissions == 'admin'"
v-b-tooltip.hover
class="d-inline-block"
title="Cannot delete a control that is locked or under review"
title="Cannot delete a requirement that is locked or under review"
>
<b-button variant="danger" disabled>Delete Control</b-button>
<b-button variant="danger" disabled>Delete Requirement</b-button>
</span>
<span
v-b-tooltip.hover
class="d-inline-block"
title="Cannot save a control that is locked or under review."
title="Cannot save a requirement that is locked or under review."
>
<b-button variant="success" disabled>Save Control</b-button>
<b-button variant="success" disabled>Save Requirement</b-button>
</span>
</template>
<template v-else>
Expand All @@ -97,15 +97,15 @@
v-b-modal.delete-rule-modal
variant="danger"
>
Delete Control
Delete Requirement
</b-button>

<!-- Save rule -->
<CommentModal
title="Save Control"
message="Provide a comment that summarizes your changes to this control."
title="Save Requirement"
message="Provide a comment that summarizes your changes to this requirement."
:require-non-empty="true"
button-text="Save Control"
button-text="Save Requirement"
button-variant="success"
:button-disabled="false"
wrapper-class="d-inline-block"
Expand All @@ -116,7 +116,7 @@
<!-- Comment -->
<CommentModal
title="Comment"
message="Submit general feedback on the control"
message="Submit general feedback on the requirement"
:require-non-empty="true"
button-text="Comment"
button-variant="secondary"
Expand Down Expand Up @@ -199,18 +199,18 @@

<b-modal
id="delete-rule-modal"
title="Delete Control"
title="Delete Requirement"
centered
@ok="$root.$emit('delete:rule', rule.id)"
>
<p class="my-2">
Are you sure you want to delete this control?<br />This cannot be undone.
Are you sure you want to delete this requirement?<br />This cannot be undone.
</p>

<template #modal-footer="{ cancel, ok }">
<!-- Emulate built in modal footer ok and cancel button actions -->
<b-button @click="cancel()"> Cancel </b-button>
<b-button variant="danger" @click="ok()"> Permanently Delete Control </b-button>
<b-button variant="danger" @click="ok()"> Permanently Delete Requirement </b-button>
</template>
</b-modal>
<b-modal
Expand All @@ -219,7 +219,7 @@
centered
@ok="$root.$emit('markDuplicate:rule', rule.id, satisfied_by_rule_id)"
>
<p>Mark control as duplicate of:</p>
<p>Mark requirement as duplicate of:</p>
<b-form-select
v-model="satisfied_by_rule_id"
:options="
Expand All @@ -244,7 +244,7 @@
centered
@ok="$root.$emit('unmarkDuplicate:rule', rule.id, satisfied_by_rule_id)"
>
<p>Unmark control as duplicate of:</p>
<p>Unmark requirement as duplicate of:</p>
<b-form-select
v-model="satisfied_by_rule_id"
:options="
Expand Down Expand Up @@ -330,11 +330,11 @@ export default {
{
value: "request_review",
name: "Request Review",
description: "control will not be editable during the review process",
description: "requirement will not be editable during the review process",
disabledTooltip: isUnderReview
? "Control is already under review"
? "Requirement is already under review"
: this.rule.locked
? "Control is currently locked"
? "Requirement is currently locked"
: null,
},

Expand All @@ -344,70 +344,70 @@ export default {
{
value: "revoke_review_request",
name: "Revoke Review Request",
description: "revoke your request for review - control will be editable again",
description: "revoke your request for review - requirement will be editable again",
disabledTooltip: !(isAdmin || isRequestor)
? "Only an admin or the review requestor can revoke the current review request"
: !isUnderReview
? "Control is not currently under review"
? "Requirement is not currently under review"
: null,
},

// should only be able to request changes if
// - current user is a reviewer or admin
// - control is currently under review
// - requirement is currently under review
{
value: "request_changes",
name: "Request Changes",
description: "request changes on the control - control will be editable again",
description: "request changes on the requirement - requirement will be editable again",
disabledTooltip: !(isAdmin || isReviewer)
? "Only an admin or reviewer can request changes"
: !isUnderReview
? "Control is not currently under review"
? "Requirement is not currently under review"
: null,
},

// should only be able to approve if
// - current user is a reviewer or admin
// - control is currently under review
// - requirement is currently under review
{
value: "approve",
name: "Approve",
description: "approve the control - control will become locked",
description: "approve the requirement - requirement will become locked",
disabledTooltip: !(isAdmin || isReviewer)
? "Only an admin or reviewer can approve"
: !isUnderReview
? "Control is not currently under review"
? "Requirement is not currently under review"
: null,
},

// should only be able to lock control if
// should only be able to lock requirement if
// - current user is admin
// - control is not under review
// - control is not locked
// - requirement is not under review
// - requirement is not locked
{
value: "lock_control",
name: "Lock Control",
description: "skip the review process - control will be immediately locked",
name: "Lock Requirement",
description: "skip the review process - requirement will be immediately locked",
disabledTooltip: !isAdmin
? "Only an admin can directly lock a control"
? "Only an admin can directly lock a requirement"
: isUnderReview
? "Cannot lock a control that is currently under review"
? "Cannot lock a requirement that is currently under review"
: this.rule.locked
? "Cannot lock a control that is already locked"
? "Cannot lock a requirement that is already locked"
: null,
},

// should only be able to unlock a control if
// should only be able to unlock a requirement if
// - current user is admin
// - control is locked
// - requirement is locked
{
value: "unlock_control",
name: "Unlock Control",
description: "unlock the control - control will be editable again",
name: "Unlock Requirement",
description: "unlock the requirement - requirement will be editable again",
disabledTooltip: !isAdmin
? "Only an admin can unlock a control"
? "Only an admin can unlock a requirement"
: !this.rule.locked
? "Cannot unlock a control that is not locked"
? "Cannot unlock a requirement that is not locked"
: null,
},
];
Expand Down
Loading