Skip to content

Commit

Permalink
Merge pull request #2740 from NationalSecurityAgency/t#2737/user_comm…
Browse files Browse the repository at this point in the history
…unity_axe_failures

T#2737/user community axe failures
  • Loading branch information
rmmayo authored Jul 29, 2024
2 parents 6b6a4d9 + b33348a commit 8990184
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 12 deletions.
17 changes: 7 additions & 10 deletions dashboard-prime/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,8 @@ const isDashboardFooter = computed(() => notSkillsClient.value && !isLoadingApp.

<template>
<div role="presentation"
:class="{
'skills-dark-theme': themeHelper.isDarkTheme,
'skills-light-theme': !themeHelper.isDarkTheme
}"
class="m-0 surface-ground skills-light-theme">
:class="{ 'st-dark-theme': themeHelper.isDarkTheme, 'st-light-theme': !themeHelper.isDarkTheme }"
class="m-0 surface-ground">
<VueAnnouncer class="sr-only" />

<customizable-header v-if="isCustomizableHeader" role="region" aria-label="dynamic customizable header"></customizable-header>
Expand All @@ -155,7 +152,7 @@ const isDashboardFooter = computed(() => notSkillsClient.value && !isLoadingApp.
<skills-spinner :is-loading="true" class="mt-8 text-center"/>
<h1 class="text-sm sr-only">Loading...</h1>
</div>
<div v-if="!isLoadingApp" class="m-0" :class="{ 'st-dark-theme': themeHelper.isDarkTheme, 'st-light-theme': !themeHelper.isDarkTheme }">
<div v-if="!isLoadingApp" class="m-0">
<pki-app-bootstrap v-if="inBootstrapMode" role="region"/>
<div v-if="!inBootstrapMode" :class="{ 'overall-container' : notSkillsClient, 'sd-theme-background-color': !notSkillsClient }">
<new-software-version />
Expand Down Expand Up @@ -188,19 +185,19 @@ body a, a:link, a:visited {
text-decoration: none !important;
}
body .skills-light-theme a, a:link {
body .st-light-theme a, a:link {
color: #2f64bd !important;
}
body .skills-light-theme a:visited {
body .st-light-theme a:visited {
color: #784f9f !important;
}
body .skills-dark-theme a, a:link {
body .st-dark-theme a, a:link {
color: #99befb !important;
}
body .skills-dark-theme a:visited {
body .st-dark-theme a:visited {
color: #d5aafb !important;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ const userCommunityRestrictedDescriptor = computed(() => {

<InputSwitch
data-cy="restrictCommunity"
:aria-label="`Restrict Access to ${userCommunityRestrictedDescriptor} Users Only`"
class="mr-2"
v-model="value" />
<label id="restrictMsg">Restrict <i class="fas fa-shield-alt text-red-500" aria-hidden="true" /> Access to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ limitations under the License.
<script setup>
import { useFocusState } from '@/stores/UseFocusState.js'
import SkillsSpinner from '@/components/utils/SkillsSpinner.vue'
import { useThemesHelper } from '@/components/header/UseThemesHelper.js'
const model = defineModel()
const props = defineProps({
Expand Down Expand Up @@ -69,6 +70,7 @@ const props = defineProps({
})
const emit = defineEmits(['on-ok', 'on-cancel'])
const focusState = useFocusState()
const themeHelper = useThemesHelper()
const onUpdateVisible = (newVal) => {
if (!newVal) {
emit('on-cancel', newVal)
Expand Down Expand Up @@ -109,7 +111,7 @@ defineExpose({
>
<skills-spinner :is-loading="loading" />

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

<div :class="`text-right ${footerClass}`">
Expand Down
2 changes: 1 addition & 1 deletion dashboard-prime/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ import '@toast-ui/editor/dist/toastui-editor.css'
import 'video.js/dist/video-js.css'


log.setLevel('trace')
log.setLevel('warn')

const pinia = createPinia()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,41 @@ describe('Dark Mode Accessibility Tests for Admin pages', () => {
cy.customA11y();
})

it('create restricted community project', () => {
cy.intercept('GET', '/public/config', (req) => {
req.reply((res) => {
const conf = res.body;
conf.userCommunityDocsLabel = 'User Community Docs';
conf.userCommunityDocsLink = 'https://somedocs.com';
res.send(conf);
});
})

const allDragonsUser = '[email protected]'
cy.fixture('vars.json').then((vars) => {
cy.logout();
cy.login(vars.rootUser, vars.defaultPass, true);
cy.request('POST', `/root/users/${vars.rootUser}/tags/dragons`, { tags: ['DivineDragon'] });
cy.request('POST', `/root/users/${vars.defaultUser}/tags/dragons`, { tags: ['DivineDragon'] });
cy.logout();

cy.register(allDragonsUser, vars.defaultPass);
cy.logout();

cy.login(vars.defaultUser, vars.defaultPass);
});

cy.visit('/administrator')
cy.get('[data-cy="inception-button"]').contains('Level');
cy.get('[data-cy="newProjectButton"]').click()
cy.injectAxe();
cy.get('[data-cy="projectName"]').type('one')
cy.get('[data-cy="saveDialogBtn"]').should('be.enabled')
cy.get('[data-cy="userCommunityDocsLink"] a').contains( 'User Community Docs')

cy.customLighthouse();
cy.customA11y()
});

})

37 changes: 37 additions & 0 deletions e2e-tests/cypress/e2e/accessibility/accessibility_project_specs.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,4 +267,41 @@ describe('Accessibility Tests', () => {
cy.customA11y()
});


it('create restricted community project', () => {
cy.intercept('GET', '/public/config', (req) => {
req.reply((res) => {
const conf = res.body;
conf.userCommunityDocsLabel = 'User Community Docs';
conf.userCommunityDocsLink = 'https://somedocs.com';
res.send(conf);
});
})

const allDragonsUser = '[email protected]'
cy.fixture('vars.json').then((vars) => {
cy.logout();
cy.login(vars.rootUser, vars.defaultPass, true);
cy.request('POST', `/root/users/${vars.rootUser}/tags/dragons`, { tags: ['DivineDragon'] });
cy.request('POST', `/root/users/${vars.defaultUser}/tags/dragons`, { tags: ['DivineDragon'] });
cy.logout();

cy.register(allDragonsUser, vars.defaultPass);
cy.logout();

cy.login(vars.defaultUser, vars.defaultPass);
});

cy.visit('/administrator')
cy.get('[data-cy="inception-button"]').contains('Level');
cy.get('[data-cy="newProjectButton"]').click()
cy.injectAxe();
cy.get('[data-cy="projectName"]').type('one')
cy.get('[data-cy="saveDialogBtn"]').should('be.enabled')
cy.get('[data-cy="userCommunityDocsLink"] a').contains( 'User Community Docs')

cy.customLighthouse();
cy.customA11y()
});

});

0 comments on commit 8990184

Please sign in to comment.