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

Redirecting dialog and authentication message #68

Merged
merged 27 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
7fda693
add loading dialog and unauthenticated card component
uahmed-assecor Dec 6, 2024
f3adbc4
remove unnecessary code in Loading Dialog
uahmed-assecor Dec 9, 2024
78a9a22
change LoadingDialog.vue text
banxtv Dec 11, 2024
ccf67d0
feat: add package json information
cillies-finatix Dec 12, 2024
ce11e70
v1.0.0
cillies-finatix Dec 12, 2024
f64ac67
feat: add types to package json
cillies-finatix Dec 12, 2024
5fa343d
v1.0.1
cillies-finatix Dec 12, 2024
d3bc3aa
fix: use 1.0.1 in dependencies
cillies-finatix Dec 12, 2024
e7e275b
fix: order in github action fixed
cillies-finatix Dec 12, 2024
e060dc1
fix: order in dockerfile fixed
cillies-finatix Dec 12, 2024
4d8af1e
fix: ignore dist folder in docker
cillies-finatix Dec 12, 2024
536f1af
fix: cache dist folders
cillies-finatix Dec 12, 2024
b241e34
fix: ci clean up
cillies-finatix Dec 12, 2024
0e3dd66
Revert "fix: ci clean up"
cillies-finatix Dec 12, 2024
8036d4d
fix: fix ci caching
cillies-finatix Dec 12, 2024
cafba6f
fix: enhance ci.yml using variables
cillies-finatix Dec 12, 2024
ea5b3b5
Revert "fix: enhance ci.yml using variables"
cillies-finatix Dec 12, 2024
2ea4403
fix: chore in ci.yml
cillies-finatix Dec 12, 2024
e68fe13
Merge remote-tracking branch 'origin/npm-publish-preparation' into di…
uahmed-assecor Dec 12, 2024
2e6c15e
fix solid session path
uahmed-assecor Dec 12, 2024
8486c02
Fix test for auth app
uahmed-assecor Dec 12, 2024
346c741
Merge branch 'market' into dialog-box
uahmed-assecor Dec 12, 2024
be96b71
Merge branch 'market' into dialog-box
uahmed-assecor Dec 12, 2024
531af00
Fix padding issue in demand
uahmed-assecor Dec 12, 2024
f8b935b
Fix import for loading dialog
uahmed-assecor Dec 12, 2024
28fe03a
Merge branch 'market' into dialog-box
uahmed-assecor Dec 16, 2024
2097af3
Merge branch 'market' into dialog-box
uahmed-assecor Dec 17, 2024
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
8 changes: 2 additions & 6 deletions apps/auth/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,13 @@
<router-view />
</main>

<Card v-else style="width: 50%; margin-top: 2rem; display: block; margin-left: auto; margin-right: auto;">
<template #content>
<p style="text-align: center;">{{ $t("error.401-unauthenticated") }}</p>
</template>
</Card>
<UnauthenticatedCard v-else/>

<Toast position="bottom-right" :breakpoints="{ '420px': { width: '100%', right: '0', left: '0' } }" />
</template>

<script setup lang="ts">
import {AuthAppHeaderBar} from "@shared/components";
import {AuthAppHeaderBar, UnauthenticatedCard} from "@shared/components";
import {useSolidProfile, useSolidSession} from "@shared/composables";
import Card from "primevue/card";
import Toast from "primevue/toast";
Expand Down
13 changes: 4 additions & 9 deletions apps/lisa/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@
<div v-if="isLoggedIn && session.rdp !== ''">
<router-view />
</div>
<Card v-else style="width: 50%; margin-top: 2rem; display: block; margin-left: auto; margin-right: auto;height:100px" >
<template #content>
<p style="text-align: center;line-height:100px">401 Unauthenticated : Login using the button in the top-right corner!</p>
</template>
</Card>
<UnauthenticatedCard v-else/>

<Dialog
header="We updated the App!"
Expand All @@ -32,12 +28,11 @@
</template>

<script setup lang="ts">
import { computed, ref, watch } from "vue";
import {DacklHeaderBar, HeaderBar} from "@shared/components";
import { useServiceWorkerUpdate, useSolidProfile, useSolidSession } from "@shared/composables";
import {computed, ref, watch} from "vue";
import {DacklHeaderBar, UnauthenticatedCard} from "@shared/components";
import {useServiceWorkerUpdate, useSolidProfile, useSolidSession} from "@shared/composables";
import Toast from "primevue/toast";
import router from "./router";
import Card from "primevue/card";

const appLogo = require('@/assets/logo.svg');
const { hasUpdatedAvailable, refreshApp } = useServiceWorkerUpdate();
Expand Down
2 changes: 1 addition & 1 deletion apps/lisa/src/components/BusinessDataPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ if (props.store) {

<style scoped>
.success-message{
padding:1rem;
padding:0 1rem 0 1rem;
margin-top:1rem;
border:2px solid rgba(32, 151, 12, 1);
background-color:rgba(230, 252, 197, 1);
Expand Down
24 changes: 14 additions & 10 deletions apps/lisa/src/components/DemandProcessor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<div v-show="tabState === currentDemandState" v-if="currentState!== STATES.NoOperation">
<Card>
<template #content>
<div class="card-container">
<div class="grid">
<div class="col-12" v-if ="currentState === STATES.Terminated" >
<StatusChip :status="STATES.Terminated"></StatusChip>
Expand Down Expand Up @@ -68,6 +69,7 @@
</Button>
<Button v-else-if="currentState !== STATES.Terminated" class="step-button" :disabled="isCreateOfferBtnDisabled"
@click="createOfferResource(props.demandUri, accessRequestUri!)">Create Offer and grant Access</Button>
</div>
</template>
</Card>
</div>
Expand All @@ -92,6 +94,7 @@
</div>
</div>
</Dialog>
<LoadingDialog :isVisible="isLoadingDialogVisible"></LoadingDialog>
</template>

<script setup lang="ts">
Expand All @@ -118,7 +121,7 @@ import {Literal, NamedNode, Store, Writer} from 'n3';
import {useToast} from 'primevue/usetoast';
import {computed, reactive, Ref, ref, watch} from 'vue';
import Card from "primevue/card";
import {DacklTextInput} from "@shared/components";
import {DacklTextInput, LoadingDialog} from "@shared/components";
import {STATES} from "@/enums/states";
import {TAB_STATE} from "@/enums/tabsState";
import {
Expand Down Expand Up @@ -148,6 +151,7 @@ let businessDataFetched = ref(false);
const enteredAnnualPercentageRate = ref(1.08);
const selectedLoanTerm = ref({label: "60 months", value: "5"});
const isDialogVisible = ref(false);
const isLoadingDialogVisible = ref(false);
const loanTerms = [
{label: "6 months", value: "0.5"},
{label: "12 months", value: "1"},
Expand Down Expand Up @@ -515,6 +519,7 @@ async function patchOfferInDemand(demandURI: string, offerURI: string): Promise<
}

async function createOfferResource(demand: string, dataAccessRequest: string) {
isLoadingDialogVisible.value =true;
const businessAssessmentRegistrations = await getDataRegistrationContainers(demanderUri!.value!, selectedShapeTree.value.value, session);
const derivedFromData = businessAssessmentRegistrations.map(r => "<" + r + ">").join(", ");
const body = getCreateOfferResourceBody(
Expand All @@ -530,6 +535,7 @@ async function createOfferResource(demand: string, dataAccessRequest: string) {
);
const offerLocation = await createResourceInAnyRegistrationOfShape(memberOf.value!, offerShapeTreeUri, body, session)
.catch((err) => {
isLoadingDialogVisible.value = false;
toast.add({
severity: "error",
summary: "Error on create offer!",
Expand Down Expand Up @@ -574,6 +580,7 @@ async function requestAccessBeingSet(resource: string, forAgent: string) {
}

function handleAuthorizationRequest(inspectedAccessRequestURI: string) {
isLoadingDialogVisible.value =false;
window.open(
`${authAgent.value}?uri=${encodeURIComponent(
inspectedAccessRequestURI
Expand Down Expand Up @@ -637,16 +644,13 @@ setTimeout(()=>{
},1000);
</script>

<style>
.p-card {
.p-card-content {
padding: 0;
}
.p-card-body {
padding-top:0px;
}
<style scoped>
.p-component :deep(.p-card-body){
padding-top:0px
}
.p-component :deep(.p-card-content ){
padding-top:0px
}



.p-disabled{
Expand Down
2 changes: 1 addition & 1 deletion apps/lisa/src/components/StatusChip.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ watch(()=> props.status,()=> {
}, {immediate:true});
</script>

<style>
<style scoped>
.offer-accepted{
background-color:rgba(32, 151, 12, 1);
color:white;
Expand Down
10 changes: 2 additions & 8 deletions apps/max/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,7 @@
<router-view />
</div>

<Card v-else style="width: 50%; margin-top: 2rem; display: block; margin-left: auto; margin-right: auto;" >
<template #content>
<p style="text-align: center;">401 Unauthenticated : Login using the button in the top-right corner!</p>
</template>
</Card>

<UnauthenticatedCard v-else/>
<Dialog header="We updated the App!" v-model:visible="isOpen" position="bottomright">
<div>Please save your progress.</div>
<div>Use the latest version.</div>
Expand All @@ -30,9 +25,8 @@
import { computed, ref, watch } from "vue";
import Toast from "primevue/toast";
import { useServiceWorkerUpdate, useSolidProfile, useSolidSession } from "@shared/composables";
import {DacklHeaderBar, HeaderBar} from "@shared/components";
import {DacklHeaderBar, UnauthenticatedCard} from "@shared/components";
import router from "./router";
import Card from "primevue/card";

const appLogo = require('@/assets/logo.png');
const { hasUpdatedAvailable, refreshApp } = useServiceWorkerUpdate();
Expand Down
10 changes: 2 additions & 8 deletions apps/tom/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,7 @@
<div v-if="isLoggedIn && session.rdp" class="m-1 lg:m-5">
<router-view />
</div>
<Card v-else class="w-6 mt-5 block mx-auto">
<template #content>
<p class="text-center">401 Unauthenticated:<br/>Login using the button in the top-right corner!</p>
</template>
</Card>

<UnauthenticatedCard v-else />
<!-- This div is a buffer area for the bottom navigation tool (speeddial or other) -->
<div style="height: 75px" />

Expand All @@ -39,10 +34,9 @@
</template>

<script lang="ts" setup>
import {DacklHeaderBar, TabItemType, TabList} from "@shared/components";
import {DacklHeaderBar, TabItemType, TabList, UnauthenticatedCard} from "@shared/components";
import {useIsLoggedIn, useServiceWorkerUpdate, useSolidProfile, useSolidSession} from "@shared/composables";
import Button from "primevue/button";
import Card from "primevue/card";
import Toast from "primevue/toast";
import {computed, ref, watch} from "vue";
import {useRoute} from "vue-router";
Expand Down
4 changes: 4 additions & 0 deletions libs/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import SmeCard from "./src/SmeCard.vue";
import SmeCardHeadline from "./src/SmeCardHeadline.vue";
import TabList from './src/tabs/TabList.vue';
import DacklTextInput from './src/DacklTextInput.vue';
import UnauthenticatedCard from "./src/UnauthenticatedCard.vue";
import LoadingDialog from "./src/LoadingDialog.vue";

export * from './src/tabs/TabItemType';

Expand All @@ -36,4 +38,6 @@ export {
PageHeadline,
SmeCardHeadline,
DacklTextInput,
UnauthenticatedCard,
LoadingDialog
};
23 changes: 23 additions & 0 deletions libs/components/src/LoadingDialog.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<template>
<Dialog v-model:visible="isVisible" modal header="Redirecting to the AuthApp" center style="width: 50%; margin-top: 2rem; display: block; margin-left: auto; margin-right: auto">
uahmed-assecor marked this conversation as resolved.
Show resolved Hide resolved
<p style="margin-bottom: 2rem">Please wait. You will be redirecting to the AuthApp...</p>
</Dialog>
</template>
<style scoped>
.p-dialog-title {
text-align: center;
width: 100%;
}
</style>
<script setup lang="ts">

import {ref, watch} from "vue";

const isVisible = ref(false);

const props = defineProps<{ isVisible: boolean }>();

watch(()=> props.isVisible,()=> {
isVisible.value = props.isVisible;
uahmed-assecor marked this conversation as resolved.
Show resolved Hide resolved
}, {immediate:true});
</script>
24 changes: 24 additions & 0 deletions libs/components/src/UnauthenticatedCard.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<template>
<Card class="mt-6" style="width: 50%; margin-top: 2rem; display: block; margin-left: auto; margin-right: auto;" >
<template #content>
<p style="text-align: center;">401 Unauthenticated : Click <span class="redirect" @click="redirectToLogin()">here</span> to login or use the button in the top-right corner!</p>
</template>
</Card>
</template>
<style scoped>
.redirect{
color: #007577;
cursor: pointer;
font-style:italic;
}
</style>
<script setup lang="ts">
import {useSolidSession} from "@shared/composables";
const {session} = useSolidSession();
const redirect_uri = window.location.href;

function redirectToLogin(){
const idp = 'https://solid.aifb.kit.edu';
session.login(idp, redirect_uri);
}
</script>