Skip to content

Commit 8990184

Browse files
authored
Merge pull request #2740 from NationalSecurityAgency/t#2737/user_community_axe_failures
T#2737/user community axe failures
2 parents 6b6a4d9 + b33348a commit 8990184

File tree

6 files changed

+85
-12
lines changed

6 files changed

+85
-12
lines changed

dashboard-prime/src/App.vue

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,8 @@ const isDashboardFooter = computed(() => notSkillsClient.value && !isLoadingApp.
142142

143143
<template>
144144
<div role="presentation"
145-
:class="{
146-
'skills-dark-theme': themeHelper.isDarkTheme,
147-
'skills-light-theme': !themeHelper.isDarkTheme
148-
}"
149-
class="m-0 surface-ground skills-light-theme">
145+
:class="{ 'st-dark-theme': themeHelper.isDarkTheme, 'st-light-theme': !themeHelper.isDarkTheme }"
146+
class="m-0 surface-ground">
150147
<VueAnnouncer class="sr-only" />
151148

152149
<customizable-header v-if="isCustomizableHeader" role="region" aria-label="dynamic customizable header"></customizable-header>
@@ -155,7 +152,7 @@ const isDashboardFooter = computed(() => notSkillsClient.value && !isLoadingApp.
155152
<skills-spinner :is-loading="true" class="mt-8 text-center"/>
156153
<h1 class="text-sm sr-only">Loading...</h1>
157154
</div>
158-
<div v-if="!isLoadingApp" class="m-0" :class="{ 'st-dark-theme': themeHelper.isDarkTheme, 'st-light-theme': !themeHelper.isDarkTheme }">
155+
<div v-if="!isLoadingApp" class="m-0">
159156
<pki-app-bootstrap v-if="inBootstrapMode" role="region"/>
160157
<div v-if="!inBootstrapMode" :class="{ 'overall-container' : notSkillsClient, 'sd-theme-background-color': !notSkillsClient }">
161158
<new-software-version />
@@ -188,19 +185,19 @@ body a, a:link, a:visited {
188185
text-decoration: none !important;
189186
}
190187
191-
body .skills-light-theme a, a:link {
188+
body .st-light-theme a, a:link {
192189
color: #2f64bd !important;
193190
}
194191
195-
body .skills-light-theme a:visited {
192+
body .st-light-theme a:visited {
196193
color: #784f9f !important;
197194
}
198195
199-
body .skills-dark-theme a, a:link {
196+
body .st-dark-theme a, a:link {
200197
color: #99befb !important;
201198
}
202199
203-
body .skills-dark-theme a:visited {
200+
body .st-dark-theme a:visited {
204201
color: #d5aafb !important;
205202
}
206203

dashboard-prime/src/components/projects/CommunityProtectionControls.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ const userCommunityRestrictedDescriptor = computed(() => {
9292

9393
<InputSwitch
9494
data-cy="restrictCommunity"
95+
:aria-label="`Restrict Access to ${userCommunityRestrictedDescriptor} Users Only`"
9596
class="mr-2"
9697
v-model="value" />
9798
<label id="restrictMsg">Restrict <i class="fas fa-shield-alt text-red-500" aria-hidden="true" /> Access to

dashboard-prime/src/components/utils/inputForm/SkillsDialog.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ limitations under the License.
1616
<script setup>
1717
import { useFocusState } from '@/stores/UseFocusState.js'
1818
import SkillsSpinner from '@/components/utils/SkillsSpinner.vue'
19+
import { useThemesHelper } from '@/components/header/UseThemesHelper.js'
1920
2021
const model = defineModel()
2122
const props = defineProps({
@@ -69,6 +70,7 @@ const props = defineProps({
6970
})
7071
const emit = defineEmits(['on-ok', 'on-cancel'])
7172
const focusState = useFocusState()
73+
const themeHelper = useThemesHelper()
7274
const onUpdateVisible = (newVal) => {
7375
if (!newVal) {
7476
emit('on-cancel', newVal)
@@ -109,7 +111,7 @@ defineExpose({
109111
>
110112
<skills-spinner :is-loading="loading" />
111113

112-
<div v-if="!loading" v-focustrap>
114+
<div v-if="!loading" v-focustrap :class="{ 'st-dark-theme': themeHelper.isDarkTheme, 'st-light-theme': !themeHelper.isDarkTheme }">
113115
<slot></slot>
114116

115117
<div :class="`text-right ${footerClass}`">

dashboard-prime/src/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ import '@toast-ui/editor/dist/toastui-editor.css'
8989
import 'video.js/dist/video-js.css'
9090

9191

92-
log.setLevel('trace')
92+
log.setLevel('warn')
9393

9494
const pinia = createPinia()
9595

e2e-tests/cypress/e2e/accessibility/accessibility_dark-mode-admin-pages.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,41 @@ describe('Dark Mode Accessibility Tests for Admin pages', () => {
4545
cy.customA11y();
4646
})
4747

48+
it('create restricted community project', () => {
49+
cy.intercept('GET', '/public/config', (req) => {
50+
req.reply((res) => {
51+
const conf = res.body;
52+
conf.userCommunityDocsLabel = 'User Community Docs';
53+
conf.userCommunityDocsLink = 'https://somedocs.com';
54+
res.send(conf);
55+
});
56+
})
57+
58+
const allDragonsUser = '[email protected]'
59+
cy.fixture('vars.json').then((vars) => {
60+
cy.logout();
61+
cy.login(vars.rootUser, vars.defaultPass, true);
62+
cy.request('POST', `/root/users/${vars.rootUser}/tags/dragons`, { tags: ['DivineDragon'] });
63+
cy.request('POST', `/root/users/${vars.defaultUser}/tags/dragons`, { tags: ['DivineDragon'] });
64+
cy.logout();
65+
66+
cy.register(allDragonsUser, vars.defaultPass);
67+
cy.logout();
68+
69+
cy.login(vars.defaultUser, vars.defaultPass);
70+
});
71+
72+
cy.visit('/administrator')
73+
cy.get('[data-cy="inception-button"]').contains('Level');
74+
cy.get('[data-cy="newProjectButton"]').click()
75+
cy.injectAxe();
76+
cy.get('[data-cy="projectName"]').type('one')
77+
cy.get('[data-cy="saveDialogBtn"]').should('be.enabled')
78+
cy.get('[data-cy="userCommunityDocsLink"] a').contains( 'User Community Docs')
79+
80+
cy.customLighthouse();
81+
cy.customA11y()
82+
});
83+
4884
})
4985

e2e-tests/cypress/e2e/accessibility/accessibility_project_specs.js

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,4 +267,41 @@ describe('Accessibility Tests', () => {
267267
cy.customA11y()
268268
});
269269

270+
271+
it('create restricted community project', () => {
272+
cy.intercept('GET', '/public/config', (req) => {
273+
req.reply((res) => {
274+
const conf = res.body;
275+
conf.userCommunityDocsLabel = 'User Community Docs';
276+
conf.userCommunityDocsLink = 'https://somedocs.com';
277+
res.send(conf);
278+
});
279+
})
280+
281+
const allDragonsUser = '[email protected]'
282+
cy.fixture('vars.json').then((vars) => {
283+
cy.logout();
284+
cy.login(vars.rootUser, vars.defaultPass, true);
285+
cy.request('POST', `/root/users/${vars.rootUser}/tags/dragons`, { tags: ['DivineDragon'] });
286+
cy.request('POST', `/root/users/${vars.defaultUser}/tags/dragons`, { tags: ['DivineDragon'] });
287+
cy.logout();
288+
289+
cy.register(allDragonsUser, vars.defaultPass);
290+
cy.logout();
291+
292+
cy.login(vars.defaultUser, vars.defaultPass);
293+
});
294+
295+
cy.visit('/administrator')
296+
cy.get('[data-cy="inception-button"]').contains('Level');
297+
cy.get('[data-cy="newProjectButton"]').click()
298+
cy.injectAxe();
299+
cy.get('[data-cy="projectName"]').type('one')
300+
cy.get('[data-cy="saveDialogBtn"]').should('be.enabled')
301+
cy.get('[data-cy="userCommunityDocsLink"] a').contains( 'User Community Docs')
302+
303+
cy.customLighthouse();
304+
cy.customA11y()
305+
});
306+
270307
});

0 commit comments

Comments
 (0)