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

Sprint 15 #50

Merged
merged 5 commits into from
Oct 25, 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
5,767 changes: 5,172 additions & 595 deletions src/goapp/public/css/output.css

Large diffs are not rendered by default.

14 changes: 12 additions & 2 deletions src/goapp/routes/pages/approvals/myapprovals.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,15 @@ func MyApprovalsHandler(w http.ResponseWriter, r *http.Request) {
}
}

exportUrls, err := db.ExecuteStoredProcedureWithResult("PR_ApplicationModules_SelectExport_ById", nil)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
} else {
for _, v := range exportUrls {
homeData.ExportUrls = append(homeData.ExportUrls, v["ExportUrl"].(string))
}
}

b, err := json.Marshal(homeData)
if err != nil {
fmt.Println(err)
Expand Down Expand Up @@ -152,8 +161,9 @@ func itemMapper(item map[string]interface{}, isApproved bool) TypItem {
}

type TypHomeData struct {
Approved []TypItem
Pending []TypItem
Approved []TypItem
Pending []TypItem
ExportUrls []string
}

type TypItem struct {
Expand Down
1,817 changes: 1,813 additions & 4 deletions src/goapp/tailwind/package-lock.json

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions src/goapp/tailwind/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"devDependencies": {
"@tailwindcss/aspect-ratio": "^0.4.2",
"@tailwindcss/forms": "^0.5.3",
"@tailwindcss/typography": "^0.5.7",
"tailwindcss": "^3.2.7"
}
}
19 changes: 8 additions & 11 deletions src/goapp/tailwind/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@

module.exports = {
content: ["../**/*.{html,js}"],
theme: {extend: {},

content: ["../**/*.{html,js}"],
theme: {
extend: {},
},

plugins: [
require('@tailwindcss/forms'),
require('@tailwindcss/typography'),
require('@tailwindcss/aspect-ratio'),

require('@tailwindcss/forms'),
require('@tailwindcss/typography'),
require('@tailwindcss/aspect-ratio')
],

}
mode:'jit'
}
18 changes: 14 additions & 4 deletions src/goapp/templates/myapprovals.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@
<div id="pageTitle">Approval Requests Assigned To You</div>

<div class="px-4" x-data="initHome()">
<div class="relative w-full">
<div class="absolute inline-block text-left right-0">
<button
class="bg-[#FF5800] hover:bg-[#FF4300] text-white font-bold py-2 px-4 rounded"
x-on:click="exportMyApprovals(profile.username, data.ExportUrls)">
Export Project Approvals
</button>
</div>
</div>
<nav class="flex space-x-4 mb-3" aria-label="Tabs">
<div class="px-3 py-2 font-medium text-sm rounded-md cursor-pointer" x-bind:class="activeTab == tabs[0] ? 'bg-[#fff2eb] text-[#FF5800]':'text-gray-500 hover:text-gray-700'" x-on:click="onChangeTabs(0)"> Pending Request</div>
<div class="px-3 py-2 font-medium text-sm rounded-md cursor-pointer" x-bind:class="activeTab == tabs[1] ? 'bg-[#fff2eb] text-[#FF5800]':'text-gray-500 hover:text-gray-700'" x-on:click="onChangeTabs(1)"> Closed Request</div>
Expand Down Expand Up @@ -34,16 +43,20 @@ <h2 class="text-lg p-3 text-red-800 border-b">Rejected Requests</h2>

<script src="/public/components/list.js"></script>
<script type="text/javascript">
const initHome = () => {
const initHome = () => {
return {
tabs : ['pending', 'closed'],
activeTab : '',
currentSelected: -1,
data: JSON.parse('{{ . }}'),
async init(){
this.activeTab = this.tabs[0];
},
onChangeTabs(tab){
this.activeTab = this.tabs[tab];
},
exportMyApprovals(username, exportUrls){
window.open(exportUrls[0].replace('{username}', username), '_blank')
}
}
}
Expand Down Expand Up @@ -194,10 +207,7 @@ <h2 class="text-lg p-3 text-red-800 border-b">Rejected Requests</h2>

const res = await fetch(`/api/items/type/${type}/status/${status}?filter=${option.filter}&offset=${offset}&search=${search}`)
const data = await res.json()
console.log(data)
return data
}


</script>
{{ end }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
CREATE PROCEDURE PR_ApplicationModules_SelectExport_ById
AS
BEGIN
SELECT
ExportUrl
FROM
ApplicationModules
WHERE
ExportUrl IS NOT NULL
END
4 changes: 2 additions & 2 deletions src/sqldb/ApprovalSystemDb/Tables/ApplicationModules.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ CREATE TABLE [dbo].[ApplicationModules] (
[IsActive] BIT CONSTRAINT [DF_ApplicationModules_IsActive] DEFAULT ((1)) NOT NULL,
[CallbackUrl] VARCHAR (100) NULL,
[ReassignCallbackUrl] [varchar](100) NULL,
[ExportUrl] VARCHAR (255) NULL,
[RequireRemarks] BIT CONSTRAINT [DF_ApplicationModules_RequireRemarks] DEFAULT ((1)) NOT NULL,
[ApprovalTypeId] INT NOT NULL DEFAULT 1,
[AllowReassign] [bit] NULL,
Expand All @@ -16,5 +17,4 @@ CREATE TABLE [dbo].[ApplicationModules] (
CONSTRAINT [PK_ApplicationModules] PRIMARY KEY CLUSTERED ([Id] ASC),
CONSTRAINT [FK_ApplicationModules_Applications] FOREIGN KEY ([ApplicationId]) REFERENCES [dbo].[Applications] ([Id]),
CONSTRAINT [FK_ApplicationModules_ApprovalTypes] FOREIGN KEY ([ApprovalTypeId]) REFERENCES [dbo].[ApprovalTypes] ([Id])
);

);
Loading