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

BC-820 - Design improvements school admin page #2845

Merged
merged 24 commits into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
004e740
fix slots in dialogs
davwas Oct 4, 2023
ef50c8c
fix types in tests
davwas Oct 4, 2023
2e9a787
import missing icon
davwas Oct 4, 2023
0e8b932
rewrite and redesign new settings page
davwas Oct 4, 2023
5c1f115
fix new settings page tests
davwas Oct 4, 2023
5c04b32
add missing translations
davwas Oct 4, 2023
c2426d8
change method to computed ref
davwas Oct 4, 2023
1569874
add missing translations
davwas Oct 5, 2023
86df8c5
redesign admin page components
davwas Oct 5, 2023
3944dad
fix tests
davwas Oct 5, 2023
b3f3e4d
fix another tests
davwas Oct 5, 2023
4cc3d30
Merge branch 'main' into BC-820-design-improvement-admin-page
davwas Oct 6, 2023
dd27f86
Merge branch 'main' into BC-820-design-improvement-admin-page
davwas Oct 11, 2023
0f09e5a
set german as default input selection and remove hint
davwas Oct 11, 2023
17c5dee
hide external tools table if no data
davwas Oct 11, 2023
2cf817d
add an option to open panels by default when redirecting
davwas Oct 11, 2023
5c35fef
fix failing tests
davwas Oct 11, 2023
8629af3
Merge branch 'main' into BC-820-design-improvement-admin-page
davwas Oct 18, 2023
303f654
Merge branch 'main' into BC-820-design-improvement-admin-page
davwas Oct 18, 2023
92af3a9
Merge branch 'main' into BC-820-design-improvement-admin-page
davwas Oct 19, 2023
6edb4a2
fix closing tags
davwas Oct 19, 2023
6e428e8
Merge branch 'main' into BC-820-design-improvement-admin-page
davwas Oct 20, 2023
71c8638
Merge branch 'main' into BC-820-design-improvement-admin-page
davwas Oct 23, 2023
cedce1b
Merge branch 'main' into BC-820-design-improvement-admin-page
davwas Oct 23, 2023
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
56 changes: 32 additions & 24 deletions src/components/administration/AdminMigrationSection.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<template>
<div>
<h2 class="text-h4 mb-10">
{{ t("components.administration.adminMigrationSection.headers") }}
</h2>
<div v-if="!isGracePeriodExpired" data-testId="migration-control-section">
<RenderHTML
data-testid="text-description"
Expand All @@ -14,32 +11,36 @@
component="p"
/>
<div v-if="isStartButtonVisible">
<v-alert light prominent text type="info">
<RenderHTML
data-testid="migration-info-text"
:html="
t('components.administration.adminMigrationSection.infoText')
"
component="span"
/>
<v-alert light text type="info">
<div class="alert-text">
<RenderHTML
data-testid="migration-info-text"
:html="
t('components.administration.adminMigrationSection.infoText')
"
component="span"
/>
</div>
</v-alert>
</div>
<div v-else-if="isMigrationActive">
<v-alert light prominent text type="info">
<RenderHTML
data-testid="migration-active-status"
:html="
t(
'components.administration.adminMigrationSection.migrationActive'
)
"
component="span"
/>
<v-alert light text type="info">
<div class="alert-text">
<RenderHTML
data-testid="migration-active-status"
:html="
t(
'components.administration.adminMigrationSection.migrationActive'
)
"
component="span"
/>
</div>
</v-alert>
</div>
<v-btn
v-if="isStartButtonVisible"
class="my-5 button-start"
class="my-4 button-start"
color="primary"
depressed
:disabled="!officialSchoolNumber"
Expand All @@ -54,7 +55,7 @@
</v-btn>
<v-btn
v-if="isEndButtonVisible"
class="my-5 button-end"
class="my-4 button-end"
color="primary"
depressed
:disabled="!oauthMigration.startedAt"
Expand Down Expand Up @@ -161,7 +162,7 @@

<script lang="ts">
import { MigrationBody } from "@/serverApi/v3";
import { OauthMigration, School } from "@/store/types/schools";
import { School } from "@/store/types/schools";
import {
ENV_CONFIG_MODULE_KEY,
injectStrict,
Expand Down Expand Up @@ -364,3 +365,10 @@ export default defineComponent({
},
});
</script>

<style lang="scss" scoped>
.alert-text {
color: var(--v-black-base) !important;
line-height: var(--line-height-lg) !important;
}
</style>
40 changes: 19 additions & 21 deletions src/components/administration/ExternalToolSection.unit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,26 +82,6 @@ describe("ExternalToolSection", () => {
});
});

describe("headers is called", () => {
describe("when table is rendered", () => {
it("should display dataTableHeaders in v-data-table", () => {
const { wrapper } = setup();

const vueWrapperArray = wrapper
.find(".v-data-table-header")
.findAll("th");

expect(vueWrapperArray.at(0).find("span").text()).toEqual(
"common.labels.name"
);
expect(vueWrapperArray.at(1).find("span").text()).toEqual(
"components.administration.externalToolsSection.table.header.status"
);
expect(vueWrapperArray.at(2).find("span").text()).toEqual("");
});
});
});

describe("items is called", () => {
const setupItems = () => {
const firstToolName = "Test";
Expand Down Expand Up @@ -136,6 +116,24 @@ describe("ExternalToolSection", () => {
};
};

describe("when table is rendered", () => {
it("should display dataTableHeaders in v-data-table", () => {
const { wrapper } = setupItems();

const vueWrapperArray = wrapper
.find(".v-data-table-header")
.findAll("th");

expect(vueWrapperArray.at(0).find("span").text()).toEqual(
"common.labels.name"
);
expect(vueWrapperArray.at(1).find("span").text()).toEqual(
"components.administration.externalToolsSection.table.header.status"
);
expect(vueWrapperArray.at(2).find("span").text()).toEqual("");
});
});

describe("when external tools were loaded", () => {
it("names should be rendered in the datatable", () => {
const { wrapper, firstToolName, secondToolName } = setupItems();
Expand Down Expand Up @@ -209,7 +207,7 @@ describe("ExternalToolSection", () => {

await deleteButton.trigger("click");

expect(wrapper.find("p").text()).toContain(firstToolName);
expect(wrapper.findAll("p").at(1).text()).toContain(firstToolName);
});
});

Expand Down
9 changes: 5 additions & 4 deletions src/components/administration/ExternalToolSection.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<template>
<div>
<h2 class="text-h4 mb-10">
{{ t("components.administration.externalToolsSection.header") }}
</h2>
<p class="mb-6">
{{ t("components.administration.externalToolsSection.info") }}
</p>
<v-data-table
v-if="items.length"
:disable-pagination="true"
:hide-default-footer="true"
:items="items"
Expand Down Expand Up @@ -36,7 +37,7 @@
</template>
</v-data-table>
<v-btn
class="my-5 button-save"
class="mt-8 mb-4 button-save float-right"
color="primary"
depressed
:to="{ name: 'administration-tool-config-overview' }"
Expand Down
11 changes: 4 additions & 7 deletions src/components/organisms/administration/AuthSystems.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<template>
<section>
<h2 class="text-h4 mb-10">
{{ $t("pages.administration.school.index.authSystems.title") }}
</h2>
<div>
<v-text-field
v-if="customLoginLinkEnabled && !hasSystems"
id="school-login-link-0"
Expand Down Expand Up @@ -111,7 +108,7 @@
<v-btn
v-if="hasSystemCreatePermission"
color="primary"
class="my-8 add-ldap"
class="mt-8 mb-4 add-ldap float-right"
depressed
to="/administration/ldap/config"
>
Expand All @@ -129,7 +126,7 @@
$t("pages.administration.school.index.authSystems.deleteAuthSystem")
}}
</h2>
<template slot="content">
<template #content>
<p class="text-md mt-2">
{{
$t(
Expand All @@ -139,7 +136,7 @@
</p>
</template>
</v-custom-dialog>
</section>
</div>
</template>

<script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,11 @@ describe("GeneralSettings", () => {
const ele = wrapper.find(searchStrings.languagesSelect);
expect(ele.vm.$props.items).toHaveLength(3);
expect(ele.vm.$props.items[0].name).toStrictEqual("Deutsch");
expect(ele.vm.$props.items[0].abbreveation).toStrictEqual("de");
expect(ele.vm.$props.items[0].abbreviation).toStrictEqual("de");
expect(ele.vm.$props.items[1].name).toStrictEqual("Englisch");
expect(ele.vm.$props.items[1].abbreveation).toStrictEqual("en");
expect(ele.vm.$props.items[1].abbreviation).toStrictEqual("en");
expect(ele.vm.$props.items[2].name).toStrictEqual("Spanisch");
expect(ele.vm.$props.items[2].abbreveation).toStrictEqual("es");
expect(ele.vm.$props.items[2].abbreviation).toStrictEqual("es");
});
});

Expand Down
Loading
Loading