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

#1866 - Remove props any from the vue application #1916

Merged
merged 7 commits into from
May 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default defineComponent({
required: true,
},
},
setup(props: any) {
setup(props) {
const precedingOffering = ref({} as PrecedingOfferingSummaryAPIOutDTO);
const bannerText = computed(() => {
if (precedingOffering.value?.applicationsCount > 1) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
</template>

<script lang="ts">
import { onMounted, ref, SetupContext, defineComponent } from "vue";
import { onMounted, ref, defineComponent } from "vue";
import { EducationProgramOfferingService } from "@/services/EducationProgramOfferingService";
import { OfferingStatus, OfferingRelationType } from "@/types";
import { EducationProgramOfferingAPIOutDTO } from "@/services/http/dto";
Expand Down Expand Up @@ -34,7 +34,7 @@ export default defineComponent({
//TODO: This emit needs to be removed when the program and offering header component
//TODO: is enhanced to load header values with it's own API call.
emits: ["getHeaderDetails"],
setup(props: any, context: SetupContext) {
setup(props, context) {
const initialData = ref({} as EducationProgramOfferingAPIOutDTO);

onMounted(async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</template>

<script lang="ts">
import { ref, reactive, computed, defineComponent } from "vue";
import { ref, reactive, computed, defineComponent, PropType } from "vue";
import ModalDialogBase from "@/components/generic/ModalDialogBase.vue";
import { useModalDialog, useRules } from "@/composables";
import ErrorSummary from "@/components/generic/ErrorSummary.vue";
Expand All @@ -43,7 +43,7 @@ export default defineComponent({
components: { ModalDialogBase, CheckPermissionRole, ErrorSummary },
props: {
offeringStatus: {
type: String,
type: String as PropType<OfferingStatus>,
required: true,
},
processing: {
Expand All @@ -52,7 +52,7 @@ export default defineComponent({
default: false,
},
},
setup(props: any) {
setup(props) {
const { checkNotesLengthRule } = useRules();
const { showDialog, showModal, resolvePromise } = useModalDialog<
OfferingAssessmentAPIInDTO | boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</template>
<script lang="ts">
import { AESTRoutesConst } from "@/constants/routes/RouteConstants";
import { SetupContext, defineComponent } from "vue";
import { defineComponent } from "vue";
import { useFormioUtils } from "@/composables";
import { StudentAppealRequest } from "@/types";

Expand All @@ -35,7 +35,7 @@ export default defineComponent({
default: false,
},
},
setup(_props: any, context: SetupContext) {
setup(_props, context) {
const { checkFormioValidity } = useFormioUtils();
const appealForms: any[] = [];
const appealFormLoaded = (form: any) => {
Expand Down
13 changes: 10 additions & 3 deletions sources/packages/web/src/components/common/IdleTimeChecker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,14 @@
</template>

<script lang="ts">
import { onMounted, ref, computed, watch, defineComponent } from "vue";
import {
onMounted,
ref,
computed,
watch,
defineComponent,
PropType,
} from "vue";
import { ClientIdType } from "@/types";
import {
ModalDialog,
Expand All @@ -36,12 +43,12 @@ export default defineComponent({
components: { ConfirmExtendTime },
props: {
clientIdType: {
type: String,
type: String as PropType<ClientIdType>,
required: true,
default: "" as ClientIdType,
},
},
setup(props: any) {
setup(props) {
const interval = ref();
const extendTimeModal = ref({} as ModalDialog<boolean>);
const { isAuthenticated } = useInstitutionAuth();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ export default defineComponent({
default: false,
},
},
setup(props: any) {
setup(props) {
const snackBar = useSnackBar();
const { institutionUserRoleToDisplay } = useFormatters();
const usersListAndCount = ref({} as InstitutionUserSummary);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export default defineComponent({
required: false,
},
},
setup(props: any) {
setup(props) {
const formatter = useFormatters();
const router = useRouter();
const clientType = computed(() => AuthService.shared.authClientType);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export default defineComponent({
required: true,
},
},
setup(props: any) {
setup(props) {
const router = useRouter();
const loading = ref(false);
const searchBox = ref("");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export default defineComponent({
default: {} as EducationProgramAPIOutDTO,
},
},
setup(props: any) {
setup(props) {
const router = useRouter();
const clientType = computed(() => AuthService.shared.authClientType);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export default defineComponent({
default: {} as ProgramOfferingHeader,
},
},
setup(props: any) {
setup(props) {
const router = useRouter();
const { dateOnlyLongString } = useFormatters();
const showApprovalDetails = computed(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</template>

<script lang="ts">
import { ref, SetupContext, watch, defineComponent } from "vue";
import { ref, watch, defineComponent, PropType } from "vue";
import {
ActiveApplicationDataAPIOutDTO,
ScholasticStandingSubmittedDetailsAPIOutDTO,
Expand All @@ -24,17 +24,17 @@ import { FormIOForm } from "@/types";

interface ScholasticStanding
extends ScholasticStandingSubmittedDetailsAPIOutDTO {
readonly: boolean;
readOnly: boolean;
}
interface ScholasticStandingBeforeSubmission
extends ActiveApplicationDataAPIOutDTO {
readonly: boolean;
readOnly: boolean;
}
export default defineComponent({
emits: ["submit", "cancel"],
props: {
initialData: {
type: Object,
type: Object as PropType<ScholasticStandingSubmittedDetailsAPIOutDTO>,
required: true,
},
readOnly: {
Expand All @@ -48,7 +48,7 @@ export default defineComponent({
default: false,
},
},
setup(props: any, context: SetupContext) {
setup(props, context) {
const data = ref(
{} as ScholasticStanding | ScholasticStandingBeforeSubmission,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<formio :formName="formName" @loaded="formLoaded"></formio>
</template>
<script lang="ts">
import { SetupContext, defineComponent } from "vue";
import { defineComponent } from "vue";

export default defineComponent({
emits: ["appealFormLoaded"],
Expand All @@ -12,7 +12,7 @@ export default defineComponent({
required: true,
},
},
setup(props: any, context: SetupContext) {
setup(_props, context) {
const formLoaded = (form: any) => {
context.emit("appealFormLoaded", form);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {
FormIOCustomEvent,
FormIOForm,
} from "@/types";
import { ref, SetupContext, watch, defineComponent } from "vue";
import { ref, watch, defineComponent } from "vue";
import {
useFormioComponentLoader,
useFormioDropdownLoader,
Expand Down Expand Up @@ -65,7 +65,7 @@ export default defineComponent({
required: false,
},
},
setup(props: any, context: SetupContext) {
setup(props, context) {
// Component's names on Form.IO definition that will be manipulated.
const LOCATIONS_DROPDOWN_KEY = "selectedLocation";
const PROGRAMS_DROPDOWN_KEY = "selectedProgram";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default defineComponent({
default: false,
},
},
setup(props: any) {
setup(props) {
const initialData = ref({} as StudentProfileFormModel);

const saveLabel = computed(() =>
Expand Down
2 changes: 1 addition & 1 deletion sources/packages/web/src/components/common/notes/Notes.vue
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export default defineComponent({
},
},
emits: ["submitData"],
setup(props: any, context: any) {
setup(_props, context) {
const { dateOnlyLongString, timeOnlyInHoursAndMinutes } = useFormatters();
const showModal = ref(false);
const createNotesModal = ref({} as ModalDialog<NoteAPIInDTO | boolean>);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export default defineComponent({
required: true,
},
},
setup(props: any) {
setup(props) {
const { checkNotesLengthRule } = useRules();
const restrictionCategories = ref([] as SelectItemType[]);
const restrictionReasons = ref([] as SelectItemType[]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export default defineComponent({
required: true,
},
},
setup(props: any) {
setup(props) {
const NOTES_MAX_CHARACTERS = 500;
const { checkMaxCharacters } = useValidators();
const { showDialog, showModal, resolvePromise } = useModalDialog<
Expand Down
4 changes: 2 additions & 2 deletions sources/packages/web/src/components/generic/BCLogo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<script lang="ts">
import { useAuth } from "@/composables";
import { SetupContext, defineComponent } from "vue";
import { defineComponent } from "vue";
export default defineComponent({
props: {
subtitle: {
Expand All @@ -30,7 +30,7 @@ export default defineComponent({
},
},
emits: ["click"],
setup(_props: any, context: SetupContext) {
setup(_props, context) {
const { executeLogout } = useAuth();
const logoClick = () => {
context.emit("click");
Expand Down
2 changes: 1 addition & 1 deletion sources/packages/web/src/components/generic/Banner.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default defineComponent({
type: String,
},
},
setup(props: any) {
setup(props) {
const bannerIcon = computed(() => {
switch (props.type) {
case BannerTypes.Success:
Expand Down
2 changes: 1 addition & 1 deletion sources/packages/web/src/components/generic/BodyHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default defineComponent({
required: false,
},
},
setup(props: any) {
setup(props) {
const fullTitleMessage = computed(() => {
if (props.recordsCount) {
return `${props.title} (${props.recordsCount})`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default defineComponent({
required: true,
},
},
setup(props: any) {
setup(props) {
const { hasRole } = useAuth();

const notAllowed = computed(() => {
Expand Down
2 changes: 1 addition & 1 deletion sources/packages/web/src/components/generic/ChipLabel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default defineComponent({
required: false,
},
},
setup(props: any) {
setup(props) {
const chipColor = computed(() => {
switch (props.status) {
case StatusChipTypes.Success:
Expand Down
2 changes: 1 addition & 1 deletion sources/packages/web/src/components/generic/ChipStatus.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default defineComponent({
required: false,
},
},
setup(props: any) {
setup(props) {
const chipColor = computed(() => {
switch (props.status) {
case StatusChipTypes.Success:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import ModalDialogBase from "@/components/generic/ModalDialogBase.vue";
import { useFormioUtils, useModalDialog } from "@/composables";
import { FormIOForm } from "@/types";
import formio from "@/components/generic/formio.vue";
import { SetupContext, defineComponent } from "vue";
import { defineComponent } from "vue";

export default defineComponent({
components: {
Expand All @@ -38,7 +38,7 @@ export default defineComponent({
maxWidth: { type: Number, required: false },
},
emits: ["loaded"],
setup(_props: any, context: SetupContext) {
setup(_props, context) {
const { checkFormioValidity } = useFormioUtils();
const { showDialog, resolvePromise, showModal } = useModalDialog<
FormIOForm | boolean
Expand Down
12 changes: 7 additions & 5 deletions sources/packages/web/src/components/generic/HeaderNavigator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
</v-row>
</template>
<script lang="ts">
import { defineComponent } from "vue";
import { useRouter } from "vue-router";
import { defineComponent, PropType } from "vue";
import { RouteLocationRaw, useRouter } from "vue-router";

export default defineComponent({
props: {
Expand All @@ -43,15 +43,17 @@ export default defineComponent({
type: String,
},
routeLocation: {
type: Object,
type: Object as PropType<RouteLocationRaw>,
},
},

setup(props: any) {
setup(props) {
const router = useRouter();

const goBack = () => {
router.push(props.routeLocation);
if (props.routeLocation) {
router.push(props.routeLocation);
}
};
return { goBack };
},
Expand Down
9 changes: 3 additions & 6 deletions sources/packages/web/src/components/generic/SnackBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,18 @@
</v-snackbar>
</template>
<script lang="ts">
import { computed, reactive, watch, defineComponent } from "vue";
import { computed, reactive, watch, defineComponent, PropType } from "vue";
import { SnackBarOptions, SnackBarType } from "@/types";
import { useSnackBar } from "@/composables";

export default defineComponent({
props: {
snackBarOptions: {
type: Object,
type: Object as PropType<SnackBarOptions>,
required: true,
default() {
return {} as SnackBarOptions;
},
},
},
setup(props: any) {
setup(props) {
const snackBar = useSnackBar();
const snackBarChoices = reactive(
(props.snackBarOptions as SnackBarOptions) ??
Expand Down
Loading