Skip to content

Commit 281abb5

Browse files
uahmed-assecorbanxtvcillies-finatix
authored
Redirecting dialog and authentication message (#68)
* add loading dialog and unauthenticated card component add loading dialog and unauthenticated card component integrate with tom, lisa, auth and max app * remove unnecessary code in Loading Dialog remove unnecessary code in Loading Dialog * change LoadingDialog.vue text * feat: add package json information * v1.0.0 * feat: add types to package json improved docker environment * v1.0.1 * fix: use 1.0.1 in dependencies * fix: order in github action fixed Need build BEFORE test because we need to have all dist folders. * fix: order in dockerfile fixed Need build BEFORE test because we need to have all dist folders. * fix: ignore dist folder in docker * fix: cache dist folders * fix: ci clean up * Revert "fix: ci clean up" This reverts commit b241e34. * fix: fix ci caching * fix: enhance ci.yml using variables * Revert "fix: enhance ci.yml using variables" This reverts commit cafba6f. * fix: chore in ci.yml * fix solid session path fix solid session path * Fix test for auth app Fix test for auth app * Fix padding issue in demand Fix padding issue in demand * Fix import for loading dialog Fix import for loading dialog --------- Co-authored-by: banxtv <[email protected]> Co-authored-by: Christian Illies (FINATIX) <[email protected]>
1 parent 49ade36 commit 281abb5

File tree

12 files changed

+126
-86
lines changed

12 files changed

+126
-86
lines changed

apps/auth/src/App.vue

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,7 @@
99
<router-view />
1010
</main>
1111

12-
<Card
13-
v-else
14-
style="
15-
width: 50%;
16-
margin-top: 2rem;
17-
display: block;
18-
margin-left: auto;
19-
margin-right: auto;
20-
"
21-
>
22-
<template #content>
23-
<p style="text-align: center">{{ $t("error.401-unauthenticated") }}</p>
24-
</template>
25-
</Card>
12+
<UnauthenticatedCard v-else />
2613

2714
<Toast
2815
position="bottom-right"
@@ -32,12 +19,14 @@
3219

3320
<script setup lang="ts">
3421
import appLogo from "@/assets/logo.svg";
35-
import { AuthAppHeaderBar } from "@datev-research/mandat-shared-components";
22+
import {
23+
AuthAppHeaderBar,
24+
UnauthenticatedCard,
25+
} from "@datev-research/mandat-shared-components";
3626
import {
3727
useSolidProfile,
3828
useSolidSession,
3929
} from "@datev-research/mandat-shared-composables";
40-
import Card from "primevue/card";
4130
import Toast from "primevue/toast";
4231
import { computed } from "vue";
4332
import router from "./router";

apps/auth/tests/unit/App.spec.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@ import ToastService from "primevue/toastservice";
77

88
jest.mock("@datev-research/mandat-shared-components", () => ({}));
99

10-
test("App should render 401 by default", async () => {
10+
test("App should render", async () => {
1111
const wrapper = mount(App, {
1212
global: {
1313
plugins: [PrimeVue, ToastService, ConfirmationService, router],
14+
1415
mocks: {
1516
$t: (key: string): string => key,
1617
},
1718
},
1819
});
19-
expect(wrapper.text()).toMatch(`error.401-unauthenticated`);
20+
expect(wrapper.exists()).toBe(true);
2021
});

apps/lisa/src/App.vue

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@
55
<div v-if="isLoggedIn && session.rdp !== ''">
66
<router-view />
77
</div>
8-
<Card v-else style="width: 50%; margin-top: 2rem; display: block; margin-left: auto; margin-right: auto;height:100px" >
9-
<template #content>
10-
<p style="text-align: center;line-height:100px">401 Unauthenticated : Login using the button in the top-right corner!</p>
11-
</template>
12-
</Card>
8+
<UnauthenticatedCard v-else/>
139

1410
<Dialog
1511
header="We updated the App!"
@@ -33,11 +29,10 @@
3329

3430
<script setup lang="ts">
3531
import { computed, ref, watch } from "vue";
36-
import {DacklHeaderBar} from "@datev-research/mandat-shared-components";
32+
import {DacklHeaderBar, UnauthenticatedCard} from "@datev-research/mandat-shared-components";
3733
import { useServiceWorkerUpdate, useSolidProfile, useSolidSession } from "@datev-research/mandat-shared-composables";
3834
import Toast from "primevue/toast";
3935
import router from "./router";
40-
import Card from "primevue/card";
4136
4237
const appLogo = require('@/assets/logo.svg');
4338
const { hasUpdatedAvailable, refreshApp } = useServiceWorkerUpdate();

apps/lisa/src/components/BusinessDataPanel.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ if (props.store) {
3434

3535
<style scoped>
3636
.success-message{
37-
padding:1rem;
37+
padding:0 1rem 0 1rem;
3838
margin-top:1rem;
3939
border:2px solid rgba(32, 151, 12, 1);
4040
background-color:rgba(230, 252, 197, 1);

apps/lisa/src/components/DemandProcessor.vue

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<template>
2-
<div v-show="tabState === currentDemandState" v-if="currentState!== STATES.NoOperation">
2+
<div v-show="tabState === currentDemandState" v-if="currentState!== STATES.NoOperation" class="pb-4">
33
<Card :data-demand-id="demandUri">
44
<template #content>
5+
<div class="card-container">
56
<div class="grid">
67
<div class="col-12" v-if ="currentState === STATES.Terminated" >
78
<StatusChip :status="STATES.Terminated"></StatusChip>
@@ -68,6 +69,7 @@
6869
</Button>
6970
<Button v-else-if="currentState !== STATES.Terminated" class="step-button" :disabled="isCreateOfferBtnDisabled"
7071
@click="createOfferResource(props.demandUri, accessRequestUri!)">Create Offer and grant Access</Button>
72+
</div>
7173
</template>
7274
</Card>
7375
</div>
@@ -92,6 +94,7 @@
9294
</div>
9395
</div>
9496
</Dialog>
97+
<LoadingDialog :isVisible="isLoadingDialogVisible"></LoadingDialog>
9598
</template>
9699

97100
<script setup lang="ts">
@@ -113,7 +116,7 @@ import {
113116
getDataBody,
114117
getDocumentCreationDemandBody
115118
} from "@/utils/request-access";
116-
import {DacklTextInput} from "@datev-research/mandat-shared-components";
119+
import {DacklTextInput, LoadingDialog} from "@datev-research/mandat-shared-components";
117120
import {useCache, useSolidProfile, useSolidSession} from "@datev-research/mandat-shared-composables";
118121
import {
119122
createResourceInAnyRegistrationOfShape,
@@ -149,6 +152,7 @@ let businessDataFetched = ref(false);
149152
const enteredAnnualPercentageRate = ref(1.08);
150153
const selectedLoanTerm = ref({label: "60 months", value: "5"});
151154
const isDialogVisible = ref(false);
155+
const isLoadingDialogVisible = ref(false);
152156
const loanTerms = [
153157
{label: "6 months", value: "0.5"},
154158
{label: "12 months", value: "1"},
@@ -625,6 +629,7 @@ async function patchOfferInDemand(demandURI: string, offerURI: string): Promise<
625629
}
626630
627631
async function createOfferResource(demand: string, dataAccessRequest: string) {
632+
isLoadingDialogVisible.value =true;
628633
const businessAssessmentRegistrations = await getDataRegistrationContainers(demanderUri!.value!, selectedShapeTree.value.value, session);
629634
const derivedFromData = businessAssessmentRegistrations.map(r => "<" + r + ">").join(", ");
630635
const body = getCreateOfferResourceBody(
@@ -640,6 +645,7 @@ async function createOfferResource(demand: string, dataAccessRequest: string) {
640645
);
641646
const offerLocation = await createResourceInAnyRegistrationOfShape(memberOf.value!, offerShapeTreeUri, body, session)
642647
.catch((err) => {
648+
isLoadingDialogVisible.value = false;
643649
toast.add({
644650
severity: "error",
645651
summary: "Error on create offer!",
@@ -684,6 +690,7 @@ async function requestAccessBeingSet(resource: string, forAgent: string) {
684690
}
685691
686692
function handleAuthorizationRequest(inspectedAccessRequestURI: string) {
693+
isLoadingDialogVisible.value =false;
687694
window.open(
688695
`${authAgent.value}?uri=${encodeURIComponent(
689696
inspectedAccessRequestURI
@@ -747,16 +754,13 @@ setTimeout(()=>{
747754
},1000);
748755
</script>
749756

750-
<style>
751-
.p-card {
752-
.p-card-content {
753-
padding: 0;
754-
}
755-
.p-card-body {
756-
padding-top:0px;
757-
}
757+
<style scoped>
758+
.p-component :deep(.p-card-body){
759+
padding-top:0px
760+
}
761+
.p-component :deep(.p-card-content ){
762+
padding-top:0px
758763
}
759-
760764
761765
762766
.p-disabled{

apps/lisa/src/components/StatusChip.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ watch(()=> props.status,()=> {
1818
}, {immediate:true});
1919
</script>
2020

21-
<style>
21+
<style scoped>
2222
.offer-accepted{
2323
background-color:rgba(32, 151, 12, 1);
2424
color:white;

apps/lisa/src/views/Home.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<h1 v-else >{{activeTab}} <Button v-if="session.webId" icon="pi pi-refresh" class="p-button-text p-button-rounded p-button-icon-only"
88
@click="fetchDemandUris(memberOf)" /></h1>
99

10-
<div class="col-12 flex flex-column gap-4" style="background-color:white">
10+
<div class="col-12 flex flex-column" style="background-color:white">
1111
<ProgressBar v-if="isLoading" mode="indeterminate" style="height: 2px" />
1212
<template v-for="(demandUri, index) in demandUris" :key="demandUri">
1313
<div class="w-full" v-if="index === 0"></div>

apps/max/src/App.vue

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,7 @@
77
<router-view />
88
</div>
99

10-
<Card v-else style="width: 50%; margin-top: 2rem; display: block; margin-left: auto; margin-right: auto;" >
11-
<template #content>
12-
<p style="text-align: center;">401 Unauthenticated : Login using the button in the top-right corner!</p>
13-
</template>
14-
</Card>
15-
10+
<UnauthenticatedCard v-else/>
1611
<Dialog header="We updated the App!" v-model:visible="isOpen" position="bottomright">
1712
<div>Please save your progress.</div>
1813
<div>Use the latest version.</div>
@@ -30,9 +25,8 @@
3025
import { computed, ref, watch } from "vue";
3126
import Toast from "primevue/toast";
3227
import { useServiceWorkerUpdate, useSolidProfile, useSolidSession } from "@datev-research/mandat-shared-composables";
33-
import {DacklHeaderBar, HeaderBar} from "@datev-research/mandat-shared-components";
28+
import {DacklHeaderBar, UnauthenticatedCard} from "@datev-research/mandat-shared-components";
3429
import router from "./router";
35-
import Card from "primevue/card";
3630
3731
const appLogo = require('@/assets/logo.png');
3832
const { hasUpdatedAvailable, refreshApp } = useServiceWorkerUpdate();

apps/tom/src/App.vue

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,7 @@
88
<div v-if="isLoggedIn && session.rdp" class="m-1 lg:m-5">
99
<router-view />
1010
</div>
11-
<Card v-else class="w-6 mt-5 block mx-auto">
12-
<template #content>
13-
<p class="text-center">401 Unauthenticated:<br/>Login using the button in the top-right corner!</p>
14-
</template>
15-
</Card>
16-
11+
<UnauthenticatedCard v-else />
1712
<!-- This div is a buffer area for the bottom navigation tool (speeddial or other) -->
1813
<div style="height: 75px" />
1914

@@ -39,10 +34,9 @@
3934
</template>
4035

4136
<script lang="ts" setup>
42-
import {DacklHeaderBar, TabItemType, TabList} from "@datev-research/mandat-shared-components";
37+
import {DacklHeaderBar, TabItemType, TabList, UnauthenticatedCard} from "@datev-research/mandat-shared-components";
4338
import {useIsLoggedIn, useServiceWorkerUpdate, useSolidProfile, useSolidSession} from "@datev-research/mandat-shared-composables";
4439
import Button from "primevue/button";
45-
import Card from "primevue/card";
4640
import Toast from "primevue/toast";
4741
import {computed, ref, watch} from "vue";
4842
import {useRoute} from "vue-router";

libs/components/index.ts

Lines changed: 35 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,43 @@
1-
import AccessRequestCallback from "./src/AccessRequestCallback.vue";
2-
import AuthAppHeaderBar from "./src/AuthAppHeaderBar.vue";
3-
import CheckMarkSvg from "./src/CheckMarkSvg.vue";
4-
import DateFormatted from "./src/DateFormatted.vue";
5-
import HeaderBar from "./src/HeaderBar.vue";
6-
import DacklHeaderBar from "./src/DacklHeaderBar.vue";
1+
import AccessRequestCallback from './src/AccessRequestCallback.vue';
2+
import AuthAppHeaderBar from './src/AuthAppHeaderBar.vue';
3+
import CheckMarkSvg from './src/CheckMarkSvg.vue';
4+
import DateFormatted from './src/DateFormatted.vue';
5+
import HeaderBar from './src/HeaderBar.vue';
6+
import DacklHeaderBar from './src/DacklHeaderBar.vue';
77
import HorizontalLine from "./src/HorizontalLine.vue";
8-
import LDN from "./src/LDN.vue";
9-
import LDNs from "./src/LDNs.vue";
10-
import LoginButton from "./src/LoginButton.vue";
11-
import LogoutButton from "./src/LogoutButton.vue";
8+
import LDN from './src/LDN.vue';
9+
import LDNs from './src/LDNs.vue';
10+
import LoginButton from './src/LoginButton.vue';
11+
import LogoutButton from './src/LogoutButton.vue';
1212
import PageHeadline from "./src/PageHeadline.vue";
13-
import SignUpButton from "./src/SignUpButton.vue";
13+
import SignUpButton from './src/SignUpButton.vue';
1414
import SmeCard from "./src/SmeCard.vue";
1515
import SmeCardHeadline from "./src/SmeCardHeadline.vue";
16-
import TabList from "./src/tabs/TabList.vue";
17-
import DacklTextInput from "./src/DacklTextInput.vue";
16+
import TabList from './src/tabs/TabList.vue';
17+
import DacklTextInput from './src/DacklTextInput.vue';
18+
import UnauthenticatedCard from "./src/UnauthenticatedCard.vue";
19+
import LoadingDialog from "./src/LoadingDialog.vue";
1820

19-
export * from "./src/tabs/TabItemType";
21+
export * from './src/tabs/TabItemType';
2022

2123
export {
22-
HeaderBar,
23-
DacklHeaderBar,
24-
AuthAppHeaderBar,
25-
LoginButton,
26-
LogoutButton,
27-
SignUpButton,
28-
DateFormatted,
29-
LDN,
30-
LDNs,
31-
AccessRequestCallback,
32-
CheckMarkSvg,
33-
TabList,
34-
HorizontalLine,
35-
SmeCard,
36-
PageHeadline,
37-
SmeCardHeadline,
38-
DacklTextInput,
24+
HeaderBar,
25+
DacklHeaderBar,
26+
AuthAppHeaderBar,
27+
LoginButton,
28+
LogoutButton,
29+
SignUpButton,
30+
DateFormatted,
31+
LDN,
32+
LDNs,
33+
AccessRequestCallback,
34+
CheckMarkSvg,
35+
TabList,
36+
HorizontalLine,
37+
SmeCard,
38+
PageHeadline,
39+
SmeCardHeadline,
40+
DacklTextInput,
41+
UnauthenticatedCard,
42+
LoadingDialog
3943
};

0 commit comments

Comments
 (0)